]> git.sur5r.net Git - u-boot/commitdiff
Merge branch 'master' of /home/wd/git/u-boot/work
authorWolfgang Denk <wd@denx.de>
Fri, 2 Nov 2007 14:09:22 +0000 (15:09 +0100)
committerWolfgang Denk <wd@denx.de>
Fri, 2 Nov 2007 14:09:22 +0000 (15:09 +0100)
39 files changed:
Makefile
board/cds/common/ft_board.c
board/dbau1x00/u-boot.lds
board/freescale/m54455evb/config.mk
board/gth2/u-boot.lds
board/incaip/u-boot.lds
board/m5282evb/m5282evb.c
board/pb1x00/u-boot.lds
board/purple/u-boot.lds
board/tb0229/u-boot.lds
cpu/mcf52x2/start.S
cpu/mcf532x/start.S
cpu/mips/config.mk
cpu/mips/start.S
cpu/mpc85xx/cpu.c
cpu/mpc85xx/start.S
drivers/Makefile
drivers/serial/Makefile
drivers/serial/serial_pl010.c [new file with mode: 0644]
drivers/serial/serial_pl011.c [new file with mode: 0644]
drivers/serial/serial_pl011.h [new file with mode: 0644]
drivers/serial_pl010.c [deleted file]
drivers/serial_pl011.c [deleted file]
drivers/serial_pl011.h [deleted file]
drivers/tsec.c
examples/mips.lds
include/asm-mips/addrspace.h
include/configs/M5253EVBE.h
include/configs/M5282EVB.h
include/configs/M5329EVB.h
include/configs/M54455EVB.h
include/configs/MPC8541CDS.h
include/configs/MPC8548CDS.h
include/configs/MPC8555CDS.h
include/configs/MPC8568MDS.h
include/configs/atstk1002.h
lib_m68k/m68k_linux.c
mips_config.mk
net/bootp.c

index 5643aa912136d96599a8a0fd347f169a58862bcc..c0821d87aac28b326c0e2cafe854d865ff55cf78 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1733,9 +1733,13 @@ M54455EVB_i66_config :   unconfig
        >include/config.h ; \
        if [ "$${FLASH}" == "INTEL" ] ; then \
                echo "#undef CFG_ATMEL_BOOT" >> $(obj)include/config.h ; \
+               echo "TEXT_BASE = 0x00000000" > $(obj)board/freescale/m54455evb/config.tmp ; \
+               cp $(obj)board/freescale/m54455evb/u-boot.int $(obj)board/freescale/m54455evb/u-boot.lds ; \
                echo "... with INTEL boot..." ; \
        else \
                echo "#define CFG_ATMEL_BOOT"   >> $(obj)include/config.h ; \
+               echo "TEXT_BASE = 0x04000000" > $(obj)board/freescale/m54455evb/config.tmp ; \
+               cp $(obj)board/freescale/m54455evb/u-boot.atm $(obj)board/freescale/m54455evb/u-boot.lds ; \
                echo "... with ATMEL boot..." ; \
        fi; \
        echo "#define CFG_INPUT_CLKSRC $${FREQ}" >> $(obj)include/config.h ; \
index 9d97905ca9b13b1a6bc2466ac4b075a55cf79e03..3eda1009efd140ec3b88a6d5acb2edb1d677a469 100644 (file)
@@ -37,17 +37,24 @@ static void cds_pci_fixup(void *blob)
 
        map = ft_get_prop(blob, "/" OF_SOC "/pci@8000/interrupt-map", &len);
 
-       len /= sizeof(u32);
+       if (!map)
+               map = ft_get_prop(blob, "/" OF_PCI "/interrupt-map", &len);
 
-       slot = get_pci_slot();
+       if (map) {
+               len /= sizeof(u32);
 
-       for (i=0;i<len;i+=7) {
-               /* We rotate the interrupt pins so that the mapping
-                * changes depending on the slot the carrier card is in.
-                */
-               map[3] = ((map[3] + slot - 2) % 4) + 1;
+               slot = get_pci_slot();
 
-               map+=7;
+               for (i=0;i<len;i+=7) {
+                       /* We rotate the interrupt pins so that the mapping
+                        * changes depending on the slot the carrier card is in.
+                        */
+                       map[3] = ((map[3] + slot - 2) % 4) + 1;
+
+                       map+=7;
+               }
+       } else {
+               printf("*** Warning - No PCI node found\n");
        }
 }
 #endif
index 10c99179864c752ad1309610c23eaab28cc03620..9639b81acc62fea49eeab2190ab6141a323f13fa 100644 (file)
@@ -43,14 +43,14 @@ SECTIONS
        . = ALIGN(4);
        .data  : { *(.data) }
 
-       . = ALIGN(4);
-       .sdata  : { *(.sdata) }
-
-       _gp = ALIGN(16);
+       . = .;
+       _gp = ALIGN(16) + 0x7ff0;
 
-       __got_start = .;
-       .got  : { *(.got) }
-       __got_end = .;
+       .got : {
+         __got_start = .;
+         *(.got)
+         __got_end = .;
+       }
 
        .sdata  : { *(.sdata) }
 
index ce014edca8fdd71563af610c37708b5317ac24f2..b42fcc94ce7de4d7b8d5c2a02ed4692c504c4e5a 100644 (file)
@@ -22,4 +22,6 @@
 # MA 02111-1307 USA
 #
 
-TEXT_BASE = 0
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)
index 8ba0b6d4c12906fe8865f50f6119fc7f6ffab054..90432cb8887519ca0e542987e343bc567396a82d 100644 (file)
@@ -43,14 +43,14 @@ SECTIONS
        . = ALIGN(4);
        .data  : { *(.data) }
 
-       . = ALIGN(4);
-       .sdata  : { *(.sdata) }
+       . = .;
+       _gp = ALIGN(16) + 0x7ff0;
 
-       _gp = ALIGN(16);
-
-       __got_start = .;
-       .got  : { *(.got) }
-       __got_end = .;
+       .got : {
+         __got_start = .;
+         *(.got)
+         __got_end = .;
+       }
 
        .sdata  : { *(.sdata) }
 
index 10c99179864c752ad1309610c23eaab28cc03620..9639b81acc62fea49eeab2190ab6141a323f13fa 100644 (file)
@@ -43,14 +43,14 @@ SECTIONS
        . = ALIGN(4);
        .data  : { *(.data) }
 
-       . = ALIGN(4);
-       .sdata  : { *(.sdata) }
-
-       _gp = ALIGN(16);
+       . = .;
+       _gp = ALIGN(16) + 0x7ff0;
 
-       __got_start = .;
-       .got  : { *(.got) }
-       __got_end = .;
+       .got : {
+         __got_start = .;
+         *(.got)
+         __got_end = .;
+       }
 
        .sdata  : { *(.sdata) }
 
index 243d6a4d83e9219a44646c65158fc0b83c833276..7d6d1d6231a1b1daa6be1ed33bf93c5587d4168a 100644 (file)
@@ -89,4 +89,5 @@ long int initdram (int board_type)
                /* Write to the SDRAM Mode Register */
                *(u32 *)(CFG_SDRAM_BASE + 0x400) = 0xA5A59696;
        }
+       return dramsize;
 }
index a2d19a84c9eae9195799605bbd7b2f0338555b2f..363d974c48f527f84f96124af7b2175a04046d4c 100644 (file)
@@ -43,14 +43,14 @@ SECTIONS
        . = ALIGN(4);
        .data  : { *(.data) }
 
-       . = ALIGN(4);
-       .sdata  : { *(.sdata) }
+       . = .;
+       _gp = ALIGN(16) + 0x7ff0;
 
-       _gp = ALIGN(16);
-
-       __got_start = .;
-       .got  : { *(.got) }
-       __got_end = .;
+       .got : {
+         __got_start = .;
+         *(.got)
+         __got_end = .;
+       }
 
        .sdata  : { *(.sdata) }
 
index 1bdac1f4a6faa64c02bdf17d00f973a24675ea8a..e7ec012c3be5eb688dd6e3b47280ff6b3889f233 100644 (file)
@@ -53,14 +53,14 @@ SECTIONS
        . = ALIGN(4);
        .data  : { *(.data) }
 
-       . = ALIGN(4);
-       .sdata  : { *(.sdata) }
-
-       _gp = ALIGN(16);
+       . = .;
+       _gp = ALIGN(16) + 0x7ff0;
 
-       __got_start = .;
-       .got  : { *(.got) }
-       __got_end = .;
+       .got : {
+         __got_start = .;
+         *(.got)
+         __got_end = .;
+       }
 
        .sdata  : { *(.sdata) }
 
index 30a2bc57eac50d9b3504b211ba2c96f362902e97..b2fa9f22dc9c7df0b46fc02f76ebeac9d4a72ce2 100644 (file)
@@ -43,14 +43,14 @@ SECTIONS
        . = ALIGN(4);
        .data  : { *(.data) }
 
-       . = ALIGN(4);
-       .sdata  : { *(.sdata) }
-
-       _gp = ALIGN(16);
+       . = .;
+       _gp = ALIGN(16) + 0x7ff0;
 
-       __got_start = .;
-       .got  : { *(.got) }
-       __got_end = .;
+       .got : {
+         __got_start = .;
+         *(.got)
+         __got_end = .;
+       }
 
        .sdata  : { *(.sdata) }
 
index 686e2a533302af0e69feae9603c7d835625f4932..260a09abf76ffdcdd1c1a8ff4451993f9b9556bc 100644 (file)
@@ -58,7 +58,7 @@ _vectors:
 .long  0x00000000              /* Flash offset is 0 until we setup CS0 */
 #if defined(CONFIG_R5200)
 .long  0x400
-#elif defined(CONFIG_M5282)
+#elif defined(CONFIG_M5282) && (TEXT_BASE == CFG_INT_FLASH_BASE)
 .long  _start - TEXT_BASE
 #else
 .long  _START
@@ -177,7 +177,11 @@ _after_flashbar_copy:
         * therefore no VBR to set
         */
 #if !defined(CONFIG_MONITOR_IS_IN_RAM)
+#if defined(CONFIG_M5282) && (TEXT_BASE == CFG_INT_FLASH_BASE)
+       move.l  #CFG_INT_FLASH_BASE, %d0
+#else
        move.l  #CFG_FLASH_BASE, %d0
+#endif
        movec   %d0, %VBR
 #endif
 
index 5cc1c87cdd0bd5e6e9dbef41c3e31b9cffc3356c..61be2eac695b122d81782849e198bc8fc8cd1d37 100644 (file)
@@ -131,7 +131,7 @@ _start:
        movec   %d0, %VBR
 
        move.l  #(CFG_INIT_RAM_ADDR + CFG_INIT_RAM_CTRL), %d0
-       movec   %d0, %RAMBAR0
+       movec   %d0, %RAMBAR1
 
        /* invalidate and disable cache */
        move.l  #0x01000000, %d0                /* Invalidate cache cmd */
@@ -268,7 +268,7 @@ _int_handler:
 icache_enable:
        move.l  #0x01000000, %d0                /* Invalidate cache cmd */
        movec   %d0, %CACR                      /* Invalidate cache */
-       move.l  #(CFG_SDRAM_BASE + 0xc000 + ((CFG_SDRAM_SIZE & 0x1fe0) << 11)), %d0
+       move.l  #(CFG_SDRAM_BASE + 0x1c000), %d0
        movec   %d0, %ACR0                      /* Enable cache */
 
        move.l  #0x80000200, %d0                /* Setup cache mask */
index b29986e26b7bac08bb20653a0ac7fc8a2a58577f..487c4eb5d64368ee41bbe300b73e1e9529669271 100644 (file)
@@ -35,6 +35,6 @@ else
 ENDIANNESS = -EB
 endif
 
-MIPSFLAGS += $(ENDIANNESS) -mabicalls
+MIPSFLAGS += $(ENDIANNESS)
 
 PLATFORM_CPPFLAGS += $(MIPSFLAGS)
index e91e2137d704f7eb8c0fe7ab6b1907673c1f2716..074d01d2dde203e88f0a07e54040f39b0c2324ba 100644 (file)
@@ -234,11 +234,11 @@ reset:
        li      t0, CONF_CM_UNCACHED
        mtc0    t0, CP0_CONFIG
 
-       /* Initialize GOT pointer.
+       /* Initialize $gp.
        */
        bal     1f
        nop
-       .word   _GLOBAL_OFFSET_TABLE_
+       .word   _gp
        1:
        move    gp, ra
        lw      t1, 0(ra)
@@ -306,9 +306,9 @@ relocate_code:
        move    t1, a2
 
        /*
-        * Fix GOT pointer:
+        * Fix $gp:
         *
-        * New GOT-PTR = (old GOT-PTR - CFG_MONITOR_BASE) + Destination Address
+        * New $gp = (Old $gp - CFG_MONITOR_BASE) + Destination Address
         */
        move    t6, gp
        sub     gp, CFG_MONITOR_BASE
@@ -341,15 +341,22 @@ relocate_code:
        j       t0
        nop
 
+       .gpword _GLOBAL_OFFSET_TABLE_   /* _GLOBAL_OFFSET_TABLE_ - _gp  */
        .word   uboot_end_data
        .word   uboot_end
        .word   num_got_entries
 
 in_ram:
-       /* Now we want to update GOT.
+       /*
+        * Now we want to update GOT.
+        *
+        * GOT[0] is reserved. GOT[1] is also reserved for the dynamic object
+        * generated by GNU ld. Skip these reserved entries from relocation.
         */
        lw      t3, -4(t0)      /* t3 <-- num_got_entries       */
-       addi    t4, gp, 8       /* Skipping first two entries.  */
+       lw      t4, -16(t0)     /* t4 <-- (_GLOBAL_OFFSET_TABLE_ - _gp) */
+       add     t4, t4, gp      /* t4 now holds _GLOBAL_OFFSET_TABLE_   */
+       addi    t4, t4, 8       /* Skipping first two entries.  */
        li      t2, 2
 1:
        lw      t1, 0(t4)
index 08e04685f593efbc4a9ee9abc247356ff3449271..bbc54448daa6951728b02938a22d8195721f1e4d 100644 (file)
@@ -163,7 +163,12 @@ int do_reset (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
         * Initiate hard reset in debug control register DBCR0
         * Make sure MSR[DE] = 1
         */
-               unsigned long val;
+               unsigned long val, msr;
+
+               msr = mfmsr ();
+               msr |= MSR_DE;
+               mtmsr (msr);
+
                val = mfspr(DBCR0);
                val |= 0x70000000;
                mtspr(DBCR0,val);
index 2c98c2ad8a0cbfa0d9e473fec8daa73d2b950c67..ada6ea505fbf12f297023bae71772bf448aab0fe 100644 (file)
@@ -218,6 +218,8 @@ _start_e500:
        bdnz    0b
 
        /* Clear and set up some registers. */
+       li      r0,0
+       mtmsr   r0
        li      r0,0x0000
        lis     r1,0xffff
        mtspr   DEC,r0                  /* prevent dec exceptions */
@@ -266,18 +268,17 @@ _start_e500:
         */
        lis     r3,CFG_INIT_RAM_ADDR@h
        ori     r3,r3,CFG_INIT_RAM_ADDR@l
-       li      r2,512 /* 512*32=16K */
+       li      r2,(CFG_DCACHE_SIZE / (2 * CFG_CACHELINE_SIZE)) 
        mtctr   r2
        li      r0,0
 1:
        dcbz    r0,r3
        dcbtls  0,r0,r3
-       addi    r3,r3,32
+       addi    r3,r3,CFG_CACHELINE_SIZE
        bdnz    1b
 
        /* Jump out the last 4K page and continue to 'normal' start */
 #ifdef CFG_RAMBOOT
-       bl      3f
        b       _start_cont
 #else
        /* Calculate absolute address in FLASH and jump there           */
@@ -286,15 +287,9 @@ _start_e500:
        ori     r3,r3,CFG_MONITOR_BASE@l
        addi    r3,r3,_start_cont - _start + _START_OFFSET
        mtlr    r3
+       blr
 #endif
 
-3:     li      r0,0
-       mtspr   SRR1,r0         /* Keep things disabled for now */
-       mflr    r1
-       mtspr   SRR0,r1
-       rfi
-       isync
-
        .text
        .globl  _start
 _start:
@@ -701,6 +696,7 @@ in8:
        .globl  out8
 out8:
        stb     r4,0x0000(r3)
+       sync
        blr
 
 /*------------------------------------------------------------------------------- */
@@ -710,6 +706,7 @@ out8:
        .globl  out16
 out16:
        sth     r4,0x0000(r3)
+       sync
        blr
 
 /*------------------------------------------------------------------------------- */
@@ -719,6 +716,7 @@ out16:
        .globl  out16r
 out16r:
        sthbrx  r4,r0,r3
+       sync
        blr
 
 /*------------------------------------------------------------------------------- */
@@ -728,6 +726,7 @@ out16r:
        .globl  out32
 out32:
        stw     r4,0x0000(r3)
+       sync
        blr
 
 /*------------------------------------------------------------------------------- */
@@ -737,6 +736,7 @@ out32:
        .globl  out32r
 out32r:
        stwbrx  r4,r0,r3
+       sync
        blr
 
 /*------------------------------------------------------------------------------- */
@@ -1061,11 +1061,11 @@ unlock_ram_in_cache:
        /* invalidate the INIT_RAM section */
        lis     r3,(CFG_INIT_RAM_ADDR & ~31)@h
        ori     r3,r3,(CFG_INIT_RAM_ADDR & ~31)@l
-       li      r4,512
+       li      r4,(CFG_DCACHE_SIZE / (2 * CFG_CACHELINE_SIZE)) 
        mtctr   r4
 1:     icbi    r0,r3
        dcbi    r0,r3
-       addi    r3,r3,32
+       addi    r3,r3,CFG_CACHELINE_SIZE
        bdnz    1b
        sync                    /* Wait for all icbi to complete on bus */
        isync
index 00978d82853ecee1e74ec903d168450a80538643..d19588f3af4c389ace46a4ab4f0b007bc492f464 100755 (executable)
@@ -45,7 +45,7 @@ COBJS = 3c589.o 5701rls.o ali512x.o at45.o ata_piix.o \
          s3c4510b_eth.o s3c4510b_uart.o \
          sed13806.o sed156x.o \
          serial.o serial_max3100.o \
-         serial_pl010.o serial_pl011.o serial_xuartlite.o \
+         serial_xuartlite.o \
          sil680.o sl811_usb.o sm501.o smc91111.o smiLynxEM.o \
          status_led.o sym53c8xx.o systemace.o ahci.o \
          ti_pci1410a.o tigon3.o tqm8xx_pcmcia.o tsec.o \
index 93c68dd2e08e7e9f5a12198d841b107f035da128..40f3d672ec9e9361a56af944e02fd6b276df3346 100644 (file)
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    := $(obj)libserial.a
 
-COBJS  := mcfuart.o
+COBJS  := mcfuart.o serial_pl010.o serial_pl011.o
 
 SRCS   := $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
diff --git a/drivers/serial/serial_pl010.c b/drivers/serial/serial_pl010.c
new file mode 100644 (file)
index 0000000..417b6ae
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * (C) Copyright 2000
+ * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
+ *
+ * (C) Copyright 2004
+ * ARM Ltd.
+ * Philippe Robin, <philippe.robin@arm.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+/* Simple U-Boot driver for the PrimeCell PL011 UARTs on the IntegratorCP */
+/* Should be fairly simple to make it work with the PL010 as well */
+
+#include <common.h>
+
+#ifdef CFG_PL010_SERIAL
+
+#include "serial_pl011.h"
+
+#define IO_WRITE(addr, val) (*(volatile unsigned int *)(addr) = (val))
+#define IO_READ(addr) (*(volatile unsigned int *)(addr))
+
+/* Integrator AP has two UARTs, we use the first one, at 38400-8-N-1 */
+#define CONSOLE_PORT CONFIG_CONS_INDEX
+#define baudRate CONFIG_BAUDRATE
+static volatile unsigned char *const port[] = CONFIG_PL01x_PORTS;
+#define NUM_PORTS (sizeof(port)/sizeof(port[0]))
+
+
+static void pl010_putc (int portnum, char c);
+static int pl010_getc (int portnum);
+static int pl010_tstc (int portnum);
+
+
+int serial_init (void)
+{
+       unsigned int divisor;
+
+       /*
+        ** First, disable everything.
+        */
+       IO_WRITE (port[CONSOLE_PORT] + UART_PL010_CR, 0x0);
+
+       /*
+        ** Set baud rate
+        **
+        */
+       switch (baudRate) {
+       case 9600:
+               divisor = UART_PL010_BAUD_9600;
+               break;
+
+       case 19200:
+               divisor = UART_PL010_BAUD_9600;
+               break;
+
+       case 38400:
+               divisor = UART_PL010_BAUD_38400;
+               break;
+
+       case 57600:
+               divisor = UART_PL010_BAUD_57600;
+               break;
+
+       case 115200:
+               divisor = UART_PL010_BAUD_115200;
+               break;
+
+       default:
+               divisor = UART_PL010_BAUD_38400;
+       }
+
+       IO_WRITE (port[CONSOLE_PORT] + UART_PL010_LCRM,
+                 ((divisor & 0xf00) >> 8));
+       IO_WRITE (port[CONSOLE_PORT] + UART_PL010_LCRL, (divisor & 0xff));
+
+       /*
+        ** Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled.
+        */
+       IO_WRITE (port[CONSOLE_PORT] + UART_PL010_LCRH,
+                 (UART_PL010_LCRH_WLEN_8 | UART_PL010_LCRH_FEN));
+
+       /*
+        ** Finally, enable the UART
+        */
+       IO_WRITE (port[CONSOLE_PORT] + UART_PL010_CR, (UART_PL010_CR_UARTEN));
+
+       return (0);
+}
+
+void serial_putc (const char c)
+{
+       if (c == '\n')
+               pl010_putc (CONSOLE_PORT, '\r');
+
+       pl010_putc (CONSOLE_PORT, c);
+}
+
+void serial_puts (const char *s)
+{
+       while (*s) {
+               serial_putc (*s++);
+       }
+}
+
+int serial_getc (void)
+{
+       return pl010_getc (CONSOLE_PORT);
+}
+
+int serial_tstc (void)
+{
+       return pl010_tstc (CONSOLE_PORT);
+}
+
+void serial_setbrg (void)
+{
+}
+
+static void pl010_putc (int portnum, char c)
+{
+       /* Wait until there is space in the FIFO */
+       while (IO_READ (port[portnum] + UART_PL01x_FR) & UART_PL01x_FR_TXFF);
+
+       /* Send the character */
+       IO_WRITE (port[portnum] + UART_PL01x_DR, c);
+}
+
+static int pl010_getc (int portnum)
+{
+       unsigned int data;
+
+       /* Wait until there is data in the FIFO */
+       while (IO_READ (port[portnum] + UART_PL01x_FR) & UART_PL01x_FR_RXFE);
+
+       data = IO_READ (port[portnum] + UART_PL01x_DR);
+
+       /* Check for an error flag */
+       if (data & 0xFFFFFF00) {
+               /* Clear the error */
+               IO_WRITE (port[portnum] + UART_PL01x_ECR, 0xFFFFFFFF);
+               return -1;
+       }
+
+       return (int) data;
+}
+
+static int pl010_tstc (int portnum)
+{
+       return !(IO_READ (port[portnum] + UART_PL01x_FR) &
+                UART_PL01x_FR_RXFE);
+}
+
+#endif
diff --git a/drivers/serial/serial_pl011.c b/drivers/serial/serial_pl011.c
new file mode 100644 (file)
index 0000000..4d35fe5
--- /dev/null
@@ -0,0 +1,161 @@
+/*
+ * (C) Copyright 2000
+ * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
+ *
+ * (C) Copyright 2004
+ * ARM Ltd.
+ * Philippe Robin, <philippe.robin@arm.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+/* Simple U-Boot driver for the PrimeCell PL011 UARTs on the IntegratorCP */
+/* Should be fairly simple to make it work with the PL010 as well */
+
+#include <common.h>
+
+#ifdef CFG_PL011_SERIAL
+
+#include "serial_pl011.h"
+
+#define IO_WRITE(addr, val) (*(volatile unsigned int *)(addr) = (val))
+#define IO_READ(addr) (*(volatile unsigned int *)(addr))
+
+/*
+ * IntegratorCP has two UARTs, use the first one, at 38400-8-N-1
+ * Versatile PB has four UARTs.
+ */
+
+#define CONSOLE_PORT CONFIG_CONS_INDEX
+#define baudRate CONFIG_BAUDRATE
+static volatile unsigned char *const port[] = CONFIG_PL01x_PORTS;
+#define NUM_PORTS (sizeof(port)/sizeof(port[0]))
+
+static void pl011_putc (int portnum, char c);
+static int pl011_getc (int portnum);
+static int pl011_tstc (int portnum);
+
+
+int serial_init (void)
+{
+       unsigned int temp;
+       unsigned int divider;
+       unsigned int remainder;
+       unsigned int fraction;
+
+       /*
+        ** First, disable everything.
+        */
+       IO_WRITE (port[CONSOLE_PORT] + UART_PL011_CR, 0x0);
+
+       /*
+        ** Set baud rate
+        **
+        ** IBRD = UART_CLK / (16 * BAUD_RATE)
+        ** FBRD = ROUND((64 * MOD(UART_CLK,(16 * BAUD_RATE))) / (16 * BAUD_RATE))
+        */
+       temp = 16 * baudRate;
+       divider = CONFIG_PL011_CLOCK / temp;
+       remainder = CONFIG_PL011_CLOCK % temp;
+       temp = (8 * remainder) / baudRate;
+       fraction = (temp >> 1) + (temp & 1);
+
+       IO_WRITE (port[CONSOLE_PORT] + UART_PL011_IBRD, divider);
+       IO_WRITE (port[CONSOLE_PORT] + UART_PL011_FBRD, fraction);
+
+       /*
+        ** Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled.
+        */
+       IO_WRITE (port[CONSOLE_PORT] + UART_PL011_LCRH,
+                 (UART_PL011_LCRH_WLEN_8 | UART_PL011_LCRH_FEN));
+
+       /*
+        ** Finally, enable the UART
+        */
+       IO_WRITE (port[CONSOLE_PORT] + UART_PL011_CR,
+                 (UART_PL011_CR_UARTEN | UART_PL011_CR_TXE |
+                  UART_PL011_CR_RXE));
+
+       return 0;
+}
+
+void serial_putc (const char c)
+{
+       if (c == '\n')
+               pl011_putc (CONSOLE_PORT, '\r');
+
+       pl011_putc (CONSOLE_PORT, c);
+}
+
+void serial_puts (const char *s)
+{
+       while (*s) {
+               serial_putc (*s++);
+       }
+}
+
+int serial_getc (void)
+{
+       return pl011_getc (CONSOLE_PORT);
+}
+
+int serial_tstc (void)
+{
+       return pl011_tstc (CONSOLE_PORT);
+}
+
+void serial_setbrg (void)
+{
+}
+
+static void pl011_putc (int portnum, char c)
+{
+       /* Wait until there is space in the FIFO */
+       while (IO_READ (port[portnum] + UART_PL01x_FR) & UART_PL01x_FR_TXFF);
+
+       /* Send the character */
+       IO_WRITE (port[portnum] + UART_PL01x_DR, c);
+}
+
+static int pl011_getc (int portnum)
+{
+       unsigned int data;
+
+       /* Wait until there is data in the FIFO */
+       while (IO_READ (port[portnum] + UART_PL01x_FR) & UART_PL01x_FR_RXFE);
+
+       data = IO_READ (port[portnum] + UART_PL01x_DR);
+
+       /* Check for an error flag */
+       if (data & 0xFFFFFF00) {
+               /* Clear the error */
+               IO_WRITE (port[portnum] + UART_PL01x_ECR, 0xFFFFFFFF);
+               return -1;
+       }
+
+       return (int) data;
+}
+
+static int pl011_tstc (int portnum)
+{
+       return !(IO_READ (port[portnum] + UART_PL01x_FR) &
+                UART_PL01x_FR_RXFE);
+}
+
+#endif
diff --git a/drivers/serial/serial_pl011.h b/drivers/serial/serial_pl011.h
new file mode 100644 (file)
index 0000000..5f20fdd
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * (C) Copyright 2003, 2004
+ * ARM Ltd.
+ * Philippe Robin, <philippe.robin@arm.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+/*
+ * ARM PrimeCell UART's (PL010 & PL011)
+ * ------------------------------------
+ *
+ *  Definitions common to both PL010 & PL011
+ *
+ */
+#define UART_PL01x_DR                   0x00    /*  Data read or written from the interface. */
+#define UART_PL01x_RSR                  0x04    /*  Receive status register (Read). */
+#define UART_PL01x_ECR                  0x04    /*  Error clear register (Write). */
+#define UART_PL01x_FR                   0x18    /*  Flag register (Read only). */
+
+#define UART_PL01x_RSR_OE               0x08
+#define UART_PL01x_RSR_BE               0x04
+#define UART_PL01x_RSR_PE               0x02
+#define UART_PL01x_RSR_FE               0x01
+
+#define UART_PL01x_FR_TXFE              0x80
+#define UART_PL01x_FR_RXFF              0x40
+#define UART_PL01x_FR_TXFF              0x20
+#define UART_PL01x_FR_RXFE              0x10
+#define UART_PL01x_FR_BUSY              0x08
+#define UART_PL01x_FR_TMSK              (UART_PL01x_FR_TXFF + UART_PL01x_FR_BUSY)
+
+/*
+ *  PL010 definitions
+ *
+ */
+#define UART_PL010_LCRH                 0x08    /*  Line control register, high byte. */
+#define UART_PL010_LCRM                 0x0C    /*  Line control register, middle byte. */
+#define UART_PL010_LCRL                 0x10    /*  Line control register, low byte. */
+#define UART_PL010_CR                   0x14    /*  Control register. */
+#define UART_PL010_IIR                  0x1C    /*  Interrupt indentification register (Read). */
+#define UART_PL010_ICR                  0x1C    /*  Interrupt clear register (Write). */
+#define UART_PL010_ILPR                 0x20    /*  IrDA low power counter register. */
+
+#define UART_PL010_CR_LPE               (1 << 7)
+#define UART_PL010_CR_RTIE              (1 << 6)
+#define UART_PL010_CR_TIE               (1 << 5)
+#define UART_PL010_CR_RIE               (1 << 4)
+#define UART_PL010_CR_MSIE              (1 << 3)
+#define UART_PL010_CR_IIRLP             (1 << 2)
+#define UART_PL010_CR_SIREN             (1 << 1)
+#define UART_PL010_CR_UARTEN            (1 << 0)
+
+#define UART_PL010_LCRH_WLEN_8          (3 << 5)
+#define UART_PL010_LCRH_WLEN_7          (2 << 5)
+#define UART_PL010_LCRH_WLEN_6          (1 << 5)
+#define UART_PL010_LCRH_WLEN_5          (0 << 5)
+#define UART_PL010_LCRH_FEN             (1 << 4)
+#define UART_PL010_LCRH_STP2            (1 << 3)
+#define UART_PL010_LCRH_EPS             (1 << 2)
+#define UART_PL010_LCRH_PEN             (1 << 1)
+#define UART_PL010_LCRH_BRK             (1 << 0)
+
+
+#define UART_PL010_BAUD_460800            1
+#define UART_PL010_BAUD_230400            3
+#define UART_PL010_BAUD_115200            7
+#define UART_PL010_BAUD_57600             15
+#define UART_PL010_BAUD_38400             23
+#define UART_PL010_BAUD_19200             47
+#define UART_PL010_BAUD_14400             63
+#define UART_PL010_BAUD_9600              95
+#define UART_PL010_BAUD_4800              191
+#define UART_PL010_BAUD_2400              383
+#define UART_PL010_BAUD_1200              767
+/*
+ *  PL011 definitions
+ *
+ */
+#define UART_PL011_IBRD                 0x24
+#define UART_PL011_FBRD                 0x28
+#define UART_PL011_LCRH                 0x2C
+#define UART_PL011_CR                   0x30
+#define UART_PL011_IMSC                 0x38
+#define UART_PL011_PERIPH_ID0           0xFE0
+
+#define UART_PL011_LCRH_SPS             (1 << 7)
+#define UART_PL011_LCRH_WLEN_8          (3 << 5)
+#define UART_PL011_LCRH_WLEN_7          (2 << 5)
+#define UART_PL011_LCRH_WLEN_6          (1 << 5)
+#define UART_PL011_LCRH_WLEN_5          (0 << 5)
+#define UART_PL011_LCRH_FEN             (1 << 4)
+#define UART_PL011_LCRH_STP2            (1 << 3)
+#define UART_PL011_LCRH_EPS             (1 << 2)
+#define UART_PL011_LCRH_PEN             (1 << 1)
+#define UART_PL011_LCRH_BRK             (1 << 0)
+
+#define UART_PL011_CR_CTSEN             (1 << 15)
+#define UART_PL011_CR_RTSEN             (1 << 14)
+#define UART_PL011_CR_OUT2              (1 << 13)
+#define UART_PL011_CR_OUT1              (1 << 12)
+#define UART_PL011_CR_RTS               (1 << 11)
+#define UART_PL011_CR_DTR               (1 << 10)
+#define UART_PL011_CR_RXE               (1 << 9)
+#define UART_PL011_CR_TXE               (1 << 8)
+#define UART_PL011_CR_LPE               (1 << 7)
+#define UART_PL011_CR_IIRLP             (1 << 2)
+#define UART_PL011_CR_SIREN             (1 << 1)
+#define UART_PL011_CR_UARTEN            (1 << 0)
+
+#define UART_PL011_IMSC_OEIM            (1 << 10)
+#define UART_PL011_IMSC_BEIM            (1 << 9)
+#define UART_PL011_IMSC_PEIM            (1 << 8)
+#define UART_PL011_IMSC_FEIM            (1 << 7)
+#define UART_PL011_IMSC_RTIM            (1 << 6)
+#define UART_PL011_IMSC_TXIM            (1 << 5)
+#define UART_PL011_IMSC_RXIM            (1 << 4)
+#define UART_PL011_IMSC_DSRMIM          (1 << 3)
+#define UART_PL011_IMSC_DCDMIM          (1 << 2)
+#define UART_PL011_IMSC_CTSMIM          (1 << 1)
+#define UART_PL011_IMSC_RIMIM           (1 << 0)
diff --git a/drivers/serial_pl010.c b/drivers/serial_pl010.c
deleted file mode 100644 (file)
index 417b6ae..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * (C) Copyright 2000
- * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
- *
- * (C) Copyright 2004
- * ARM Ltd.
- * Philippe Robin, <philippe.robin@arm.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-/* Simple U-Boot driver for the PrimeCell PL011 UARTs on the IntegratorCP */
-/* Should be fairly simple to make it work with the PL010 as well */
-
-#include <common.h>
-
-#ifdef CFG_PL010_SERIAL
-
-#include "serial_pl011.h"
-
-#define IO_WRITE(addr, val) (*(volatile unsigned int *)(addr) = (val))
-#define IO_READ(addr) (*(volatile unsigned int *)(addr))
-
-/* Integrator AP has two UARTs, we use the first one, at 38400-8-N-1 */
-#define CONSOLE_PORT CONFIG_CONS_INDEX
-#define baudRate CONFIG_BAUDRATE
-static volatile unsigned char *const port[] = CONFIG_PL01x_PORTS;
-#define NUM_PORTS (sizeof(port)/sizeof(port[0]))
-
-
-static void pl010_putc (int portnum, char c);
-static int pl010_getc (int portnum);
-static int pl010_tstc (int portnum);
-
-
-int serial_init (void)
-{
-       unsigned int divisor;
-
-       /*
-        ** First, disable everything.
-        */
-       IO_WRITE (port[CONSOLE_PORT] + UART_PL010_CR, 0x0);
-
-       /*
-        ** Set baud rate
-        **
-        */
-       switch (baudRate) {
-       case 9600:
-               divisor = UART_PL010_BAUD_9600;
-               break;
-
-       case 19200:
-               divisor = UART_PL010_BAUD_9600;
-               break;
-
-       case 38400:
-               divisor = UART_PL010_BAUD_38400;
-               break;
-
-       case 57600:
-               divisor = UART_PL010_BAUD_57600;
-               break;
-
-       case 115200:
-               divisor = UART_PL010_BAUD_115200;
-               break;
-
-       default:
-               divisor = UART_PL010_BAUD_38400;
-       }
-
-       IO_WRITE (port[CONSOLE_PORT] + UART_PL010_LCRM,
-                 ((divisor & 0xf00) >> 8));
-       IO_WRITE (port[CONSOLE_PORT] + UART_PL010_LCRL, (divisor & 0xff));
-
-       /*
-        ** Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled.
-        */
-       IO_WRITE (port[CONSOLE_PORT] + UART_PL010_LCRH,
-                 (UART_PL010_LCRH_WLEN_8 | UART_PL010_LCRH_FEN));
-
-       /*
-        ** Finally, enable the UART
-        */
-       IO_WRITE (port[CONSOLE_PORT] + UART_PL010_CR, (UART_PL010_CR_UARTEN));
-
-       return (0);
-}
-
-void serial_putc (const char c)
-{
-       if (c == '\n')
-               pl010_putc (CONSOLE_PORT, '\r');
-
-       pl010_putc (CONSOLE_PORT, c);
-}
-
-void serial_puts (const char *s)
-{
-       while (*s) {
-               serial_putc (*s++);
-       }
-}
-
-int serial_getc (void)
-{
-       return pl010_getc (CONSOLE_PORT);
-}
-
-int serial_tstc (void)
-{
-       return pl010_tstc (CONSOLE_PORT);
-}
-
-void serial_setbrg (void)
-{
-}
-
-static void pl010_putc (int portnum, char c)
-{
-       /* Wait until there is space in the FIFO */
-       while (IO_READ (port[portnum] + UART_PL01x_FR) & UART_PL01x_FR_TXFF);
-
-       /* Send the character */
-       IO_WRITE (port[portnum] + UART_PL01x_DR, c);
-}
-
-static int pl010_getc (int portnum)
-{
-       unsigned int data;
-
-       /* Wait until there is data in the FIFO */
-       while (IO_READ (port[portnum] + UART_PL01x_FR) & UART_PL01x_FR_RXFE);
-
-       data = IO_READ (port[portnum] + UART_PL01x_DR);
-
-       /* Check for an error flag */
-       if (data & 0xFFFFFF00) {
-               /* Clear the error */
-               IO_WRITE (port[portnum] + UART_PL01x_ECR, 0xFFFFFFFF);
-               return -1;
-       }
-
-       return (int) data;
-}
-
-static int pl010_tstc (int portnum)
-{
-       return !(IO_READ (port[portnum] + UART_PL01x_FR) &
-                UART_PL01x_FR_RXFE);
-}
-
-#endif
diff --git a/drivers/serial_pl011.c b/drivers/serial_pl011.c
deleted file mode 100644 (file)
index 4d35fe5..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * (C) Copyright 2000
- * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
- *
- * (C) Copyright 2004
- * ARM Ltd.
- * Philippe Robin, <philippe.robin@arm.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-/* Simple U-Boot driver for the PrimeCell PL011 UARTs on the IntegratorCP */
-/* Should be fairly simple to make it work with the PL010 as well */
-
-#include <common.h>
-
-#ifdef CFG_PL011_SERIAL
-
-#include "serial_pl011.h"
-
-#define IO_WRITE(addr, val) (*(volatile unsigned int *)(addr) = (val))
-#define IO_READ(addr) (*(volatile unsigned int *)(addr))
-
-/*
- * IntegratorCP has two UARTs, use the first one, at 38400-8-N-1
- * Versatile PB has four UARTs.
- */
-
-#define CONSOLE_PORT CONFIG_CONS_INDEX
-#define baudRate CONFIG_BAUDRATE
-static volatile unsigned char *const port[] = CONFIG_PL01x_PORTS;
-#define NUM_PORTS (sizeof(port)/sizeof(port[0]))
-
-static void pl011_putc (int portnum, char c);
-static int pl011_getc (int portnum);
-static int pl011_tstc (int portnum);
-
-
-int serial_init (void)
-{
-       unsigned int temp;
-       unsigned int divider;
-       unsigned int remainder;
-       unsigned int fraction;
-
-       /*
-        ** First, disable everything.
-        */
-       IO_WRITE (port[CONSOLE_PORT] + UART_PL011_CR, 0x0);
-
-       /*
-        ** Set baud rate
-        **
-        ** IBRD = UART_CLK / (16 * BAUD_RATE)
-        ** FBRD = ROUND((64 * MOD(UART_CLK,(16 * BAUD_RATE))) / (16 * BAUD_RATE))
-        */
-       temp = 16 * baudRate;
-       divider = CONFIG_PL011_CLOCK / temp;
-       remainder = CONFIG_PL011_CLOCK % temp;
-       temp = (8 * remainder) / baudRate;
-       fraction = (temp >> 1) + (temp & 1);
-
-       IO_WRITE (port[CONSOLE_PORT] + UART_PL011_IBRD, divider);
-       IO_WRITE (port[CONSOLE_PORT] + UART_PL011_FBRD, fraction);
-
-       /*
-        ** Set the UART to be 8 bits, 1 stop bit, no parity, fifo enabled.
-        */
-       IO_WRITE (port[CONSOLE_PORT] + UART_PL011_LCRH,
-                 (UART_PL011_LCRH_WLEN_8 | UART_PL011_LCRH_FEN));
-
-       /*
-        ** Finally, enable the UART
-        */
-       IO_WRITE (port[CONSOLE_PORT] + UART_PL011_CR,
-                 (UART_PL011_CR_UARTEN | UART_PL011_CR_TXE |
-                  UART_PL011_CR_RXE));
-
-       return 0;
-}
-
-void serial_putc (const char c)
-{
-       if (c == '\n')
-               pl011_putc (CONSOLE_PORT, '\r');
-
-       pl011_putc (CONSOLE_PORT, c);
-}
-
-void serial_puts (const char *s)
-{
-       while (*s) {
-               serial_putc (*s++);
-       }
-}
-
-int serial_getc (void)
-{
-       return pl011_getc (CONSOLE_PORT);
-}
-
-int serial_tstc (void)
-{
-       return pl011_tstc (CONSOLE_PORT);
-}
-
-void serial_setbrg (void)
-{
-}
-
-static void pl011_putc (int portnum, char c)
-{
-       /* Wait until there is space in the FIFO */
-       while (IO_READ (port[portnum] + UART_PL01x_FR) & UART_PL01x_FR_TXFF);
-
-       /* Send the character */
-       IO_WRITE (port[portnum] + UART_PL01x_DR, c);
-}
-
-static int pl011_getc (int portnum)
-{
-       unsigned int data;
-
-       /* Wait until there is data in the FIFO */
-       while (IO_READ (port[portnum] + UART_PL01x_FR) & UART_PL01x_FR_RXFE);
-
-       data = IO_READ (port[portnum] + UART_PL01x_DR);
-
-       /* Check for an error flag */
-       if (data & 0xFFFFFF00) {
-               /* Clear the error */
-               IO_WRITE (port[portnum] + UART_PL01x_ECR, 0xFFFFFFFF);
-               return -1;
-       }
-
-       return (int) data;
-}
-
-static int pl011_tstc (int portnum)
-{
-       return !(IO_READ (port[portnum] + UART_PL01x_FR) &
-                UART_PL01x_FR_RXFE);
-}
-
-#endif
diff --git a/drivers/serial_pl011.h b/drivers/serial_pl011.h
deleted file mode 100644 (file)
index 5f20fdd..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * (C) Copyright 2003, 2004
- * ARM Ltd.
- * Philippe Robin, <philippe.robin@arm.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-/*
- * ARM PrimeCell UART's (PL010 & PL011)
- * ------------------------------------
- *
- *  Definitions common to both PL010 & PL011
- *
- */
-#define UART_PL01x_DR                   0x00    /*  Data read or written from the interface. */
-#define UART_PL01x_RSR                  0x04    /*  Receive status register (Read). */
-#define UART_PL01x_ECR                  0x04    /*  Error clear register (Write). */
-#define UART_PL01x_FR                   0x18    /*  Flag register (Read only). */
-
-#define UART_PL01x_RSR_OE               0x08
-#define UART_PL01x_RSR_BE               0x04
-#define UART_PL01x_RSR_PE               0x02
-#define UART_PL01x_RSR_FE               0x01
-
-#define UART_PL01x_FR_TXFE              0x80
-#define UART_PL01x_FR_RXFF              0x40
-#define UART_PL01x_FR_TXFF              0x20
-#define UART_PL01x_FR_RXFE              0x10
-#define UART_PL01x_FR_BUSY              0x08
-#define UART_PL01x_FR_TMSK              (UART_PL01x_FR_TXFF + UART_PL01x_FR_BUSY)
-
-/*
- *  PL010 definitions
- *
- */
-#define UART_PL010_LCRH                 0x08    /*  Line control register, high byte. */
-#define UART_PL010_LCRM                 0x0C    /*  Line control register, middle byte. */
-#define UART_PL010_LCRL                 0x10    /*  Line control register, low byte. */
-#define UART_PL010_CR                   0x14    /*  Control register. */
-#define UART_PL010_IIR                  0x1C    /*  Interrupt indentification register (Read). */
-#define UART_PL010_ICR                  0x1C    /*  Interrupt clear register (Write). */
-#define UART_PL010_ILPR                 0x20    /*  IrDA low power counter register. */
-
-#define UART_PL010_CR_LPE               (1 << 7)
-#define UART_PL010_CR_RTIE              (1 << 6)
-#define UART_PL010_CR_TIE               (1 << 5)
-#define UART_PL010_CR_RIE               (1 << 4)
-#define UART_PL010_CR_MSIE              (1 << 3)
-#define UART_PL010_CR_IIRLP             (1 << 2)
-#define UART_PL010_CR_SIREN             (1 << 1)
-#define UART_PL010_CR_UARTEN            (1 << 0)
-
-#define UART_PL010_LCRH_WLEN_8          (3 << 5)
-#define UART_PL010_LCRH_WLEN_7          (2 << 5)
-#define UART_PL010_LCRH_WLEN_6          (1 << 5)
-#define UART_PL010_LCRH_WLEN_5          (0 << 5)
-#define UART_PL010_LCRH_FEN             (1 << 4)
-#define UART_PL010_LCRH_STP2            (1 << 3)
-#define UART_PL010_LCRH_EPS             (1 << 2)
-#define UART_PL010_LCRH_PEN             (1 << 1)
-#define UART_PL010_LCRH_BRK             (1 << 0)
-
-
-#define UART_PL010_BAUD_460800            1
-#define UART_PL010_BAUD_230400            3
-#define UART_PL010_BAUD_115200            7
-#define UART_PL010_BAUD_57600             15
-#define UART_PL010_BAUD_38400             23
-#define UART_PL010_BAUD_19200             47
-#define UART_PL010_BAUD_14400             63
-#define UART_PL010_BAUD_9600              95
-#define UART_PL010_BAUD_4800              191
-#define UART_PL010_BAUD_2400              383
-#define UART_PL010_BAUD_1200              767
-/*
- *  PL011 definitions
- *
- */
-#define UART_PL011_IBRD                 0x24
-#define UART_PL011_FBRD                 0x28
-#define UART_PL011_LCRH                 0x2C
-#define UART_PL011_CR                   0x30
-#define UART_PL011_IMSC                 0x38
-#define UART_PL011_PERIPH_ID0           0xFE0
-
-#define UART_PL011_LCRH_SPS             (1 << 7)
-#define UART_PL011_LCRH_WLEN_8          (3 << 5)
-#define UART_PL011_LCRH_WLEN_7          (2 << 5)
-#define UART_PL011_LCRH_WLEN_6          (1 << 5)
-#define UART_PL011_LCRH_WLEN_5          (0 << 5)
-#define UART_PL011_LCRH_FEN             (1 << 4)
-#define UART_PL011_LCRH_STP2            (1 << 3)
-#define UART_PL011_LCRH_EPS             (1 << 2)
-#define UART_PL011_LCRH_PEN             (1 << 1)
-#define UART_PL011_LCRH_BRK             (1 << 0)
-
-#define UART_PL011_CR_CTSEN             (1 << 15)
-#define UART_PL011_CR_RTSEN             (1 << 14)
-#define UART_PL011_CR_OUT2              (1 << 13)
-#define UART_PL011_CR_OUT1              (1 << 12)
-#define UART_PL011_CR_RTS               (1 << 11)
-#define UART_PL011_CR_DTR               (1 << 10)
-#define UART_PL011_CR_RXE               (1 << 9)
-#define UART_PL011_CR_TXE               (1 << 8)
-#define UART_PL011_CR_LPE               (1 << 7)
-#define UART_PL011_CR_IIRLP             (1 << 2)
-#define UART_PL011_CR_SIREN             (1 << 1)
-#define UART_PL011_CR_UARTEN            (1 << 0)
-
-#define UART_PL011_IMSC_OEIM            (1 << 10)
-#define UART_PL011_IMSC_BEIM            (1 << 9)
-#define UART_PL011_IMSC_PEIM            (1 << 8)
-#define UART_PL011_IMSC_FEIM            (1 << 7)
-#define UART_PL011_IMSC_RTIM            (1 << 6)
-#define UART_PL011_IMSC_TXIM            (1 << 5)
-#define UART_PL011_IMSC_RXIM            (1 << 4)
-#define UART_PL011_IMSC_DSRMIM          (1 << 3)
-#define UART_PL011_IMSC_DCDMIM          (1 << 2)
-#define UART_PL011_IMSC_CTSMIM          (1 << 1)
-#define UART_PL011_IMSC_RIMIM           (1 << 0)
index 4ff3339c7de40d64955b9937470e923f2f939daa..7ba8f0cace90eeeb61d40eb26f0860bc844cc4f1 100644 (file)
@@ -803,6 +803,7 @@ static void startup_tsec(struct eth_device *dev)
        /* Tell the DMA it is clear to go */
        regs->dmactrl |= DMACTRL_INIT_SETTINGS;
        regs->tstat = TSTAT_CLEAR_THALT;
+       regs->rstat = RSTAT_CLEAR_RHALT;
        regs->dmactrl &= ~(DMACTRL_GRS | DMACTRL_GTS);
 }
 
index 9d9849bf5c2deede742a3693ee1ca626415e041c..a7707287a2412f130643aae165dab7fc2a07011b 100644 (file)
@@ -39,14 +39,14 @@ SECTIONS
        . = ALIGN(4);
        .data  : { *(.data) }
 
-       . = ALIGN(4);
-       .sdata  : { *(.sdata) }
+       . = .;
+       _gp = ALIGN(16) + 0x7ff0;
 
-       _gp = ALIGN(16);
-
-       __got_start = .;
-       .got  : { *(.got) }
-       __got_end = .;
+       .got : {
+         __got_start = .;
+         *(.got)
+         __got_end = .;
+       }
 
        .sdata  : { *(.sdata) }
 
index b8214b1c8595cdf82d862d1e5fd8cb60ca1037c3..0e6abd7d0faa914c495dcc50a354c6ca730515db 100644 (file)
@@ -49,7 +49,7 @@
    cannot access physical memory directly from core */
 #define UNCACHED_SDRAM(a) (((unsigned long)(a)) | 0x20000000)
 #else  /* !CONFIG_AU1X00 */
-#define UNCACHED_SDRAM(a) PHYSADDR(a)
+#define UNCACHED_SDRAM(a) KSEG1ADDR(a)
 #endif /* CONFIG_AU1X00 */
 #endif /* __ASSEMBLY__ */
 /*
index 48170e7a35a7965c2f8e1c4fa92085e249fe1b81..f5e1b646ca2e52000e1f8dd5b175e92c75869028 100644 (file)
  * Please note that CFG_SDRAM_BASE _must_ start at 0
  */
 #define CFG_SDRAM_BASE         0x00000000
-#define CFG_SDRAM_SIZE         16      /* SDRAM size in MB */
+#define CFG_SDRAM_SIZE               /* SDRAM size in MB */
 
 #ifdef CONFIG_MONITOR_IS_IN_RAM
 #define CFG_MONITOR_BASE       0x20000
index 3c17c1ea1465c32a6ba6db6397de4a0f99a95684..7bb9f60f7650058ff24dc1967da773a036cfc903 100644 (file)
  * Please note that CFG_SDRAM_BASE _must_ start at 0
  */
 #define CFG_SDRAM_BASE         0x00000000
-#define        CFG_SDRAM_SIZE                /* SDRAM size in MB */
+#define        CFG_SDRAM_SIZE          16      /* SDRAM size in MB */
 #define CFG_FLASH_BASE         0xffe00000
 #define        CFG_INT_FLASH_BASE      0xf0000000
 #define CFG_INT_FLASH_ENABLE   0x21
index d3b160505be3c766638b42e5fd5e2b0e8e81674f..47d74a3c37a3179ce75a8505121207f76a39d6e9 100644 (file)
  * Please note that CFG_SDRAM_BASE _must_ start at 0
  */
 #define CFG_SDRAM_BASE         0x40000000
-#define CFG_SDRAM_SIZE         16      /* SDRAM size in MB */
+#define CFG_SDRAM_SIZE         32      /* SDRAM size in MB */
 #define CFG_SDRAM_CFG1         0x53722730
 #define CFG_SDRAM_CFG2         0x56670000
 #define CFG_SDRAM_CTRL         0xE1092000
index 6f4859c238037a1e9d8d713574d92a4b82955cc2..ba050cb7e466110c712daa22def30e308876dbb5 100644 (file)
@@ -27,8 +27,8 @@
  * board/config.h - configuration options, board specific
  */
 
-#ifndef _JAMICA54455_H
-#define _JAMICA54455_H
+#ifndef _M54455EVB_H
+#define _M54455EVB_H
 
 /*
  * High Level Configuration Options
@@ -75,7 +75,7 @@
 #define CONFIG_CMD_MISC
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_NET
-#define CONFIG_CMD_PCI
+#undef CONFIG_CMD_PCI
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_REGINFO
 
        "u-boot=u-boot.bin\0"                   \
        "load=tftp ${loadaddr) ${u-boot}\0"     \
        "upd=run load; run prog\0"              \
-       "prog=prot off 2ffff;"                \
-       "era 2ffff;"                          \
+       "prog=prot off 4000000 402ffff;"                \
+       "era 4000000 402ffff;"                          \
        "cp.b ${loadaddr} 0 ${filesize};"       \
        "save\0"                                \
        ""
 #define CFG_IMMR               CFG_MBAR
 
 /* PCI */
+#ifdef CONFIG_CMD_PCI
 #define CONFIG_PCI             1
 
 #define CFG_PCI_MEM_BUS                0xA0000000
 #define CFG_PCI_CFG_BUS                0xB0000000
 #define CFG_PCI_CFG_PHYS       CFG_PCI_CFG_BUS
 #define CFG_PCI_CFG_SIZE       0x01000000
+#endif
 
 /* FPGA - Spartan 2 */
 /* experiment
 /* Configuration for environment
  * Environment is embedded in u-boot in the second sector of the flash
  */
-#define CFG_ENV_OFFSET         0x4000
-#define CFG_ENV_SECT_SIZE      0x2000
 #define CFG_ENV_IS_IN_FLASH    1
 #define CONFIG_ENV_OVERWRITE   1
 #undef CFG_ENV_IS_EMBEDDED
  * FLASH organization
  */
 #ifdef CFG_ATMEL_BOOT
-#      define CFG_FLASH_BASE           0
+#      define CFG_FLASH_BASE           CFG_CS0_BASE    
 #      define CFG_FLASH0_BASE          CFG_CS0_BASE
 #      define CFG_FLASH1_BASE          CFG_CS1_BASE
+#      define CFG_ENV_ADDR             (CFG_FLASH_BASE + 0x4000)
+#      define CFG_ENV_SECT_SIZE        0x2000
 #else
 #      define CFG_FLASH_BASE           CFG_FLASH0_BASE
 #      define CFG_FLASH0_BASE          CFG_CS1_BASE
 #      define CFG_FLASH1_BASE          CFG_CS0_BASE
+#      define CFG_ENV_ADDR             (CFG_FLASH_BASE + 0x60000)
+#      define CFG_ENV_SECT_SIZE        0x20000
 #endif
 
 /* M54455EVB has one non CFI flash, defined CFG_FLASH_CFI will cause the system
  * NOTE: Enable CONFIG_CMD_JFFS2 for JFFS2 support.
  */
 #ifdef CFG_ATMEL_BOOT
-#      define CONFIG_JFFS2_DEV         "nor0"
+#      define CONFIG_JFFS2_DEV         "nor1"
 #      define CONFIG_JFFS2_PART_SIZE   0x01000000
-#      define CONFIG_JFFS2_PART_OFFSET CFG_FLASH1_BASE
+#      define CONFIG_JFFS2_PART_OFFSET (CFG_FLASH1_BASE + 0x500000)
 #else
 #      define CONFIG_JFFS2_DEV         "nor0"
 #      define CONFIG_JFFS2_PART_SIZE   (0x01000000 - 0x500000)
 
 #ifdef CFG_ATMEL_BOOT
  /* Atmel Flash */
-#define CFG_CS0_BASE           0
+#define CFG_CS0_BASE           0x04000000
 #define CFG_CS0_MASK           0x00070001
 #define CFG_CS0_CTRL           0x00001140
 /* Intel Flash */
-#define CFG_CS1_BASE           0x04000000
+#define CFG_CS1_BASE           0x00000000
 #define CFG_CS1_MASK           0x01FF0001
-#define CFG_CS1_CTRL           0x003F3D60
+#define CFG_CS1_CTRL           0x00000D60
 
 #define CFG_ATMEL_BASE         CFG_CS0_BASE
 #else
 /* Intel Flash */
-#define CFG_CS0_BASE           0
+#define CFG_CS0_BASE           0x00000000
 #define CFG_CS0_MASK           0x01FF0001
-#define CFG_CS0_CTRL           0x003F3D60
+#define CFG_CS0_CTRL           0x00000D60
  /* Atmel Flash */
 #define CFG_CS1_BASE           0x04000000
 #define CFG_CS1_MASK           0x00070001
 #define CFG_CS3_MASK           0x00070001
 #define CFG_CS3_CTRL           0x00000020
 
-#endif                         /* _JAMICA54455_H */
+#endif                         /* _M54455EVB_H */
index 4e061bd9ff25147758eee27591ad2b346bf7492b..8dda6651efc2e6c5938eb5c06e49757b10020421 100644 (file)
@@ -316,6 +316,7 @@ extern unsigned long get_clock_freq(void);
 #define OF_SOC                 "soc8541@e0000000"
 #define OF_TBCLK               (bd->bi_busfreq / 8)
 #define OF_STDOUT_PATH         "/soc8541@e0000000/serial@4600"
+#define OF_PCI                 "pci@e0008000"
 
 /*
  * I2C
index 608371518939a81876da9e4696183cf51f468604..4edc7fd2b6a5bdcacf395db9b61324c6000f3ed4 100644 (file)
@@ -340,6 +340,7 @@ extern unsigned long get_clock_freq(void);
 #define OF_SOC                 "soc8548@e0000000"
 #define OF_TBCLK               (bd->bi_busfreq / 8)
 #define OF_STDOUT_PATH         "/soc8548@e0000000/serial@4600"
+#define OF_PCI                 "pci@e0008000"
 
 /*
  * I2C
index 1d1b7c907957c153763c92e02732d0499fc9fc99..c414bf033e48aefa27acbbdf42c023783568cbea 100644 (file)
@@ -316,6 +316,7 @@ extern unsigned long get_clock_freq(void);
 #define OF_SOC                 "soc8555@e0000000"
 #define OF_TBCLK               (bd->bi_busfreq / 8)
 #define OF_STDOUT_PATH         "/soc8555@e0000000/serial@4600"
+#define OF_PCI                 "pci@e0008000"
 
 /*
  * I2C
index ba744e99f8d3d0e6437a100570bef7d763c87df9..548e1582a8f5878e9b28bbc64dc9a988132ad087 100644 (file)
@@ -297,7 +297,7 @@ extern unsigned long get_clock_freq(void);
 #define OF_SOC                 "soc8568@e0000000"
 #define OF_QE                  "qe@e0080000"
 #define OF_TBCLK               (bd->bi_busfreq / 8)
-#define OF_STDOUT_PATH         "/soc8568@e0000000/serial@4600"
+#define OF_STDOUT_PATH         "/soc8568@e0000000/serial@4500"
 
 /*
  * I2C
index 1809fc5d86401c21ee4281df7aa9ea57ae000a55..b33e26fe011727d7fbc9ff38c8d913565223bf8f 100644 (file)
 #define CONFIG_AUTOBOOT_STOP_STR       " "
 
 /*
- * These are "locally administered ethernet addresses" generated by
- * ./tools/gen_eth_addr
- *
- * After booting the board for the first time, new addresses should be
- * generated and assigned to the environment variables "ethaddr" and
- * "eth1addr".
+ * After booting the board for the first time, new ethernet addresses
+ * should be generated and assigned to the environment variables
+ * "ethaddr" and "eth1addr". This is normally done during production.
  */
-#define CONFIG_ETHADDR                 6a:87:71:14:cd:cb
-#define CONFIG_ETH1ADDR                        ca:f8:15:e6:3e:e6
 #define CONFIG_OVERWRITE_ETHADDR_ONCE  1
 #define CONFIG_NET_MULTI               1
 
index bea97441b14570293dcdafbbe6fa0acbc65fa816..cc974c2d60d7dfb4f5f8aa28f47a54b01ff50e9e 100644 (file)
@@ -26,6 +26,7 @@
 #include <image.h>
 #include <zlib.h>
 #include <bzlib.h>
+#include <watchdog.h>
 #include <environment.h>
 #include <asm/byteorder.h>
 
@@ -36,6 +37,8 @@ DECLARE_GLOBAL_DATA_PTR;
 #define LINUX_MAX_ENVS         256
 #define LINUX_MAX_ARGS         256
 
+#define CHUNKSZ                        (64 * 1024)
+
 #ifdef CONFIG_SHOW_BOOT_PROGRESS
 # include <status_led.h>
 # define SHOW_BOOT_PROGRESS(arg)       show_boot_progress(arg)
index d8aa5fa777b59ab547f4d24635fbfa5d187b0e54..67fb67d291dd8bbcbc6f82a3e98f9d496223a9c2 100644 (file)
 #
 
 PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
+
+#
+# From Linux arch/mips/Makefile
+#
+# GCC uses -G 0 -mabicalls -fpic as default.  We don't want PIC in the kernel
+# code since it only slows down the whole thing.  At some point we might make
+# use of global pointer optimizations but their use of $28 conflicts with
+# the current pointer optimization.
+#
+# The DECStation requires an ECOFF kernel for remote booting, other MIPS
+# machines may also.  Since BFD is incredibly buggy with respect to
+# crossformat linking we rely on the elf2ecoff tool for format conversion.
+#
+# cflags-y                     += -G 0 -mno-abicalls -fno-pic -pipe
+# cflags-y                     += -msoft-float
+# LDFLAGS_vmlinux              += -G 0 -static -n -nostdlib
+# MODFLAGS                     += -mlong-calls
+#
+
+#
+# Meanwhile, U-Boot rely on PIC. We add proper switches explicitly.
+#
+PLATFORM_CPPFLAGS              += -G 0 -mabicalls -fpic -pipe
+PLATFORM_CPPFLAGS              += -msoft-float
+PLATFORM_LDFLAGS               += -G 0 -static -n -nostdlib
index 749d3e5e0c24ce08fb3ea7f9ccc8726b56445ed8..cfe6f8dd6b9276ce8f73e1542b43a02e89f6a218 100644 (file)
@@ -850,9 +850,9 @@ static void DhcpSendRequestPkt(Bootp_t *bp_offer)
        bp->bp_hlen = HWL_ETHER;
        bp->bp_hops = 0;
        bp->bp_secs = htons(get_timer(0) / CFG_HZ);
-       NetCopyIP(&bp->bp_ciaddr, &bp_offer->bp_ciaddr); /* both in network byte order */
-       NetCopyIP(&bp->bp_yiaddr, &bp_offer->bp_yiaddr);
-       NetCopyIP(&bp->bp_siaddr, &bp_offer->bp_siaddr);
+       /* Do not set the client IP, your IP, or server IP yet, since it hasn't been ACK'ed by
+        * the server yet */
+
        /*
         * RFC3046 requires Relay Agents to discard packets with
         * nonzero and offered giaddr
@@ -870,7 +870,9 @@ static void DhcpSendRequestPkt(Bootp_t *bp_offer)
        /*
         * Copy options from OFFER packet if present
         */
-       NetCopyIP(&OfferedIP, &bp->bp_yiaddr);
+
+       /* Copy offered IP into the parameters request list */
+       NetCopyIP(&OfferedIP, &bp_offer->bp_yiaddr);
        extlen = DhcpExtended((u8 *)bp->bp_vend, DHCP_REQUEST, NetDHCPServerIP, OfferedIP);
 
        pktlen = BOOTP_SIZE - sizeof(bp->bp_vend) + extlen;
@@ -980,3 +982,4 @@ void DhcpRequest(void)
 #endif
 
 #endif
+