]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
ARMBoot merge
authorwdenk <wdenk>
Sun, 8 Sep 2002 22:44:00 +0000 (22:44 +0000)
committerwdenk <wdenk>
Sun, 8 Sep 2002 22:44:00 +0000 (22:44 +0000)
67 files changed:
MAKEALL
Makefile
board/cpu86/flash.c
board/dnp1110/dnp1110.c
board/dnp1110/env.c
board/dnp1110/ppcboot.lds [moved from board/dnp1110/armboot.lds with 100% similarity]
board/eltec/bab750/flash.c
board/ep7312/env.c
board/ep7312/ep7312.c
board/ep7312/flash.c
board/ep7312/ppcboot.lds [moved from board/ep7312/armboot.lds with 100% similarity]
board/evb64260/flash.c
board/impa7/env.c
board/impa7/impa7.c
board/impa7/ppcboot.lds [moved from board/impa7/armboot.lds with 100% similarity]
board/lart/env.c
board/lart/lart.c
board/lart/ppcboot.lds [moved from board/lart/armboot.lds with 100% similarity]
board/shannon/env.c
board/shannon/ppcboot.lds [moved from board/shannon/armboot.lds with 100% similarity]
board/shannon/shannon.c
board/smdk2400/ppcboot.lds [moved from board/smdk2400/armboot.lds with 100% similarity]
board/smdk2410/env.c
board/smdk2410/flash.c
board/smdk2410/ppcboot.lds [moved from board/smdk2410/armboot.lds with 100% similarity]
board/smdk2410/smdk2410.c
common/cmd_boot.c
common/cmd_bootm.c
common/cmd_ide.c
common/cmd_nvedit.c
common/console.c
cpu/arm720t/cpu.c
cpu/arm720t/interrupts.c
cpu/arm720t/serial.c
cpu/arm920t/serial.c
cpu/sa1100/interrupts.c
cpu/sa1100/serial.c
cpu/xscale/serial.c
drivers/3c589.c
drivers/Makefile
drivers/cs8900.c
drivers/cs8900.h
drivers/smc91111.c
drivers/smc91111.h
examples/syscall.S
include/asm-arm/global_data.h
include/asm-arm/io.h
include/asm-arm/ppcboot-arm.h
include/asm-ppc/io.h
include/common.h
include/configs/dnp1110.h
include/configs/ep7312.h
include/configs/impa7.h
include/configs/shannon.h
include/configs/smdk2410.h
include/flash.h
include/net.h
lib_arm/Makefile
lib_arm/_udivsi3.S [new file with mode: 0644]
lib_arm/_umodsi3.S [new file with mode: 0644]
lib_arm/board.c
lib_arm/cache.c [new file with mode: 0644]
lib_arm/div0.c [new file with mode: 0644]
lib_generic/display_options.c
lib_generic/string.c
lib_ppc/board.c
net/tftp.c

diff --git a/MAKEALL b/MAKEALL
index 290a7ef2f44e4fb0c3e7daf972a577d93a3c1236..3a4918526f7c2e1603c084c22f0a8144588c4a1c 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -96,7 +96,7 @@ LIST_ARM7="impa7 ep7312"
 ## ARM9 Systems
 #########################################################################
 
-LIST_ARM9="cmdk2400 smdk2410"
+LIST_ARM9="smdk2400 smdk2410"
 
 LIST_arm="${LIST_SA} ${LIST_ARM7} ${LIST_ARM9}"
 
@@ -121,7 +121,7 @@ build_target() {
 for arg in $@
 do
        case "$arg" in
-       8xx|824x|8260|4xx|7xx|74xx)
+       8xx|824x|8260|4xx|7xx|74xx|SA|ARM7|ARM9)
                        for target in `eval echo '$LIST_'${arg}`
                        do
                                build_target ${target}
index 0fc0303e96327557ed5645455f2a401a75c5e0e6..c8956f9c10ceb41254dc38d3cc4522cd856a8964 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -109,12 +109,12 @@ endif
 LIBS  =        board/$(BOARDDIR)/lib$(BOARD).a
 LIBS += cpu/$(CPU)/lib$(CPU).a
 LIBS += lib_$(ARCH)/lib$(ARCH).a
-LIBS += drivers/libdrivers.a
 LIBS += fs/jffs2/libjffs2.a
 LIBS += net/libnet.a
 LIBS += disk/libdisk.a
 LIBS += rtc/librtc.a
 LIBS += dtt/libdtt.a
+LIBS += drivers/libdrivers.a
 LIBS += common/libcommon.a
 LIBS += lib_generic/libgeneric.a
 
index 5fac05edc175e0778d2935ff795a8b62074f09a8..f4fbc2df7a8ccfe06f5d25841a6a8c4737c8be63 100644 (file)
@@ -193,15 +193,15 @@ unsigned long flash_init (void)
 
                printf("(");
 
-               if (size_b0 > 0)
-                       printf("Bank#1 - %ld MB", size_b0 >> 20);
-
-               if (size_b1 > 0)
-                       printf("%sBank#2 - %ld kB", 
-                              (size_b0 > 0) ? ", " : "", 
-                              size_b1 >> 10);
+               if (size_b0 > 0) {
+                       puts ("Bank#1 - ");
+                       print_size (size_b0, (size_b1 > 0) ? ", " : ") ");
+               }
 
-               printf(") ");
+               if (size_b1 > 0) {
+                       puts ("Bank#2 - ");
+                       print_size (size_b1, ") ");
+               }
        }
        else {
                printf ("## No FLASH found.\n");
index 6e93a3909617012f58bdcdc956dd42075430f064..80e707e891c8043e9088a972f4ac9748c6e553f8 100644 (file)
 
 int board_init (void)
 {
+       DECLARE_GLOBAL_DATA_PTR;
+
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
 
        /* arch number of DNP1110-Board */
-       bd->bi_arch_number = 255;
+       gd->bd->bi_arch_number = 255;
 
        /* adress of boot parameters */
-       bd->bi_boot_params = 0xc0000100;
+       gd->bd->bi_boot_params = 0xc0000100;
 
        return 0;
 }
 
 int dram_init (void)
 {
-       bd->bi_dram[0].start = PHYS_SDRAM_1;
-       bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+       DECLARE_GLOBAL_DATA_PTR;
+
+       gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+       gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
        return PHYS_SDRAM_1_SIZE;
 }
index ff11dc0310581805774a77191190bbbc8601ad75..9eef7f2cac400b072c8df8084b746d321907bbd2 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 
 static int check_crc(bd_t *bd)
 {
index 69522faa8d888f16033dbe281ccdce9bedcdc3c0..3264d6a5b4aaeaa43f2bc95e16cb092521c4f6fa 100644 (file)
@@ -129,11 +129,9 @@ void flash_print_info  (flash_info_t *info)
         break;
     }
 
-    if (info->size >= (1 << 20)) {
-           printf ("  Size: %ld MB in %d Sectors\n", info->size >> 20, info->sector_count);
-       } else {
-           printf ("  Size: %ld kB in %d Sectors\n", info->size >> 10, info->sector_count);
-       }
+    puts ("  Size: ");
+    print_size (info->size, "");
+    printf (" in %d Sectors\n", info->sector_count);
 
     printf ("  Sector Start Addresses:");
     for (i=0; i<info->sector_count; ++i) {
index ff11dc0310581805774a77191190bbbc8601ad75..9eef7f2cac400b072c8df8084b746d321907bbd2 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 
 static int check_crc(bd_t *bd)
 {
index ddad6579e290c6e93a74c9da0dd8d44b20a843b6..8191b1242ea69fb5f722426e83037c0cac9cb608 100644 (file)
 
 int board_init (void)
 {
+       DECLARE_GLOBAL_DATA_PTR;
+
        /* Activate LED flasher */
        IO_LEDFLSH = 0x40;
 
        /* arch number MACH_TYPE_EDB7312 */
-       bd->bi_arch_number = 131;
+       gd->bd->bi_arch_number = 131;
 
        /* location of boot parameters */
-       bd->bi_boot_params = 0xc0020100;
+       gd->bd->bi_boot_params = 0xc0020100;
 
        return 0;
 }
 
 int dram_init (void)
 {
-       bd->bi_dram[0].start = PHYS_SDRAM_1;
-       bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+       DECLARE_GLOBAL_DATA_PTR;
+
+       gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+       gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
        return PHYS_SDRAM_1_SIZE;
 }
index 1e69c2632fbdc11a615854ce6fb5d52065785e7c..aec16372bfe149ca65c3980ee9ad1683aa0f3ff1 100644 (file)
@@ -33,316 +33,309 @@ flash_info_t    flash_info[CFG_MAX_FLASH_BANKS];
 /*-----------------------------------------------------------------------
  */
 
-ulong flash_init(void)
+ulong flash_init (void)
 {
-    int i, j;
-    ulong size = 0;
-   
-    for (i = 0; i < CFG_MAX_FLASH_BANKS; i++)
-    {
-       ulong flashbase = 0;
-       flash_info[i].flash_id = 
-         (INTEL_MANUFACT & FLASH_VENDMASK) | 
-         (INTEL_ID_28F128J3 & FLASH_TYPEMASK);
-       flash_info[i].size = FLASH_BANK_SIZE;
-       flash_info[i].sector_count = CFG_MAX_FLASH_SECT;
-       memset(flash_info[i].protect, 0, CFG_MAX_FLASH_SECT);
-       if (i == 0)
-         flashbase = PHYS_FLASH_1;
-       else
-         panic("configured to many flash banks!\n");
-       for (j = 0; j < flash_info[i].sector_count; j++)
-       {
-           flash_info[i].start[j] = flashbase + j*MAIN_SECT_SIZE;
+       int i, j;
+       ulong size = 0;
+
+       for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
+               ulong flashbase = 0;
+
+               flash_info[i].flash_id =
+                               (INTEL_MANUFACT & FLASH_VENDMASK) |
+                               (INTEL_ID_28F128J3 & FLASH_TYPEMASK);
+               flash_info[i].size = FLASH_BANK_SIZE;
+               flash_info[i].sector_count = CFG_MAX_FLASH_SECT;
+               memset (flash_info[i].protect, 0, CFG_MAX_FLASH_SECT);
+               if (i == 0)
+                       flashbase = PHYS_FLASH_1;
+               else
+                       panic ("configured to many flash banks!\n");
+               for (j = 0; j < flash_info[i].sector_count; j++) {
+                       flash_info[i].start[j] = flashbase + j * MAIN_SECT_SIZE;
+               }
+               size += flash_info[i].size;
        }
-       size += flash_info[i].size;
-    }
-    
-    /* Protect monitor and environment sectors
-     */
-    flash_protect(FLAG_PROTECT_SET,
-                 CFG_FLASH_BASE,
-                 CFG_FLASH_BASE + _armboot_end - _armboot_start,
-                 &flash_info[0]);
-    
-    flash_protect(FLAG_PROTECT_SET,
-                 CFG_ENV_ADDR,
-                 CFG_ENV_ADDR + CFG_ENV_SIZE - 1,
-                 &flash_info[0]);
-
-    return size;
+
+       /* Protect monitor and environment sectors
+        */
+       flash_protect (FLAG_PROTECT_SET,
+                                  CFG_FLASH_BASE,
+                                  CFG_FLASH_BASE + _armboot_end - _armboot_start,
+                                  &flash_info[0]);
+
+       flash_protect (FLAG_PROTECT_SET,
+                                  CFG_ENV_ADDR,
+                                  CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[0]);
+
+       return size;
 }
 
 /*-----------------------------------------------------------------------
  */
-void flash_print_info  (flash_info_t *info)
+void flash_print_info (flash_info_t * info)
 {
-    int i;
-
-    switch (info->flash_id & FLASH_VENDMASK)
-    {
-    case (INTEL_MANUFACT & FLASH_VENDMASK):
-       printf("Intel: ");
-       break;
-    default:
-       printf("Unknown Vendor ");
-       break;
-    }
-    
-    switch (info->flash_id & FLASH_TYPEMASK)
-    {
-    case (INTEL_ID_28F128J3 & FLASH_TYPEMASK):
-       printf("28F128J3 (128Mbit)\n");
-       break;
-    default:
-       printf("Unknown Chip Type\n");
-       goto Done;
-       break;
-    }
-    
-    printf("  Size: %ld MB in %d Sectors\n",
-          info->size >> 20, info->sector_count);
-    
-    printf("  Sector Start Addresses:");
-    for (i = 0; i < info->sector_count; i++)
-    {
-       if ((i % 5) == 0)
-       {
-           printf ("\n   ");
+       int i;
+
+       switch (info->flash_id & FLASH_VENDMASK) {
+       case (INTEL_MANUFACT & FLASH_VENDMASK):
+               printf ("Intel: ");
+               break;
+       default:
+               printf ("Unknown Vendor ");
+               break;
        }
-       printf (" %08lX%s", info->start[i],
-               info->protect[i] ? " (RO)" : "     ");
-    }
-    printf ("\n");
-    
-Done:
+
+       switch (info->flash_id & FLASH_TYPEMASK) {
+       case (INTEL_ID_28F128J3 & FLASH_TYPEMASK):
+               printf ("28F128J3 (128Mbit)\n");
+               break;
+       default:
+               printf ("Unknown Chip Type\n");
+               goto Done;
+               break;
+       }
+
+       printf ("  Size: %ld MB in %d Sectors\n",
+                       info->size >> 20, info->sector_count);
+
+       printf ("  Sector Start Addresses:");
+       for (i = 0; i < info->sector_count; i++) {
+               if ((i % 5) == 0) {
+                       printf ("\n   ");
+               }
+               printf (" %08lX%s", info->start[i],
+                               info->protect[i] ? " (RO)" : "     ");
+       }
+       printf ("\n");
+
+  Done:
 }
 
 /*-----------------------------------------------------------------------
  */
 
-int    flash_erase (flash_info_t *info, int s_first, int s_last)
+int flash_erase (flash_info_t * info, int s_first, int s_last)
 {
-    int flag, prot, sect;
-    int rc = ERR_OK;
-   
-    if (info->flash_id == FLASH_UNKNOWN)
-       return ERR_UNKNOWN_FLASH_TYPE;
-
-    if ((s_first < 0) || (s_first > s_last)) {
-       return ERR_INVAL;
-    }
-
-    if ((info->flash_id & FLASH_VENDMASK) !=
-       (INTEL_MANUFACT & FLASH_VENDMASK)) {
-       return ERR_UNKNOWN_FLASH_VENDOR;
-    }
-
-    prot = 0;
-    for (sect=s_first; sect<=s_last; ++sect) {
-       if (info->protect[sect]) {
-           prot++;
-       }
-    }
-    if (prot)
-       return ERR_PROTECTED;
+       int flag, prot, sect;
+       int rc = ERR_OK;
 
-    /* 
-     * Disable interrupts which might cause a timeout
-     * here. Remember that our exception vectors are
-     * at address 0 in the flash, and we don't want a
-     * (ticker) exception to happen while the flash
-     * chip is in programming mode.
-     */
-    flag = disable_interrupts();
+       if (info->flash_id == FLASH_UNKNOWN)
+               return ERR_UNKNOWN_FLASH_TYPE;
 
-    /* Start erase on unprotected sectors */
-    for (sect = s_first; sect<=s_last && !ctrlc(); sect++) {
+       if ((s_first < 0) || (s_first > s_last)) {
+               return ERR_INVAL;
+       }
 
-       printf("Erasing sector %2d ... ", sect);
+       if ((info->flash_id & FLASH_VENDMASK) !=
+               (INTEL_MANUFACT & FLASH_VENDMASK)) {
+               return ERR_UNKNOWN_FLASH_VENDOR;
+       }
 
-       /* arm simple, non interrupt dependent timer */
-       reset_timer_masked();
-       
-       if (info->protect[sect] == 0) { /* not protected */
-           vushort *addr = (vushort *)(info->start[sect]);
-           
-           *addr = 0x20;       /* erase setup */
-           *addr = 0xD0;       /* erase confirm */
-
-           while ((*addr & 0x80) != 0x80) {
-               if (get_timer_masked() > CFG_FLASH_ERASE_TOUT) {
-                   *addr = 0xB0; /* suspend erase */
-                   *addr = 0xFF;       /* reset to read mode */
-                   rc = ERR_TIMOUT;
-                   goto outahere;
+       prot = 0;
+       for (sect = s_first; sect <= s_last; ++sect) {
+               if (info->protect[sect]) {
+                       prot++;
+               }
+       }
+       if (prot)
+               return ERR_PROTECTED;
+
+       /* 
+        * Disable interrupts which might cause a timeout
+        * here. Remember that our exception vectors are
+        * at address 0 in the flash, and we don't want a
+        * (ticker) exception to happen while the flash
+        * chip is in programming mode.
+        */
+       flag = disable_interrupts ();
+
+       /* Start erase on unprotected sectors */
+       for (sect = s_first; sect <= s_last && !ctrlc (); sect++) {
+
+               printf ("Erasing sector %2d ... ", sect);
+
+               /* arm simple, non interrupt dependent timer */
+               reset_timer_masked ();
+
+               if (info->protect[sect] == 0) { /* not protected */
+                       vu_short *addr = (vu_short *) (info->start[sect]);
+
+                       *addr = 0x20;           /* erase setup */
+                       *addr = 0xD0;           /* erase confirm */
+
+                       while ((*addr & 0x80) != 0x80) {
+                               if (get_timer_masked () > CFG_FLASH_ERASE_TOUT) {
+                                       *addr = 0xB0;   /* suspend erase */
+                                       *addr = 0xFF;   /* reset to read mode */
+                                       rc = ERR_TIMOUT;
+                                       goto outahere;
+                               }
+                       }
+
+                       /* clear status register command */
+                       *addr = 0x50;
+                       /* reset to read mode */
+                       *addr = 0xFF;
                }
-           }
-    
-           /* clear status register command */
-           *addr = 0x50;
-           /* reset to read mode */
-           *addr = 0xFF;
+               printf ("ok.\n");
        }
-       printf("ok.\n");
-    }
-    if (ctrlc())
-      printf("User Interrupt!\n");
-
-outahere:
-   
-    /* allow flash to settle - wait 10 ms */
-    udelay_masked(10000);
-   
-    if (flag)
-      enable_interrupts();
-   
-    return rc;
+       if (ctrlc ())
+               printf ("User Interrupt!\n");
+
+  outahere:
+
+       /* allow flash to settle - wait 10 ms */
+       udelay_masked (10000);
+
+       if (flag)
+               enable_interrupts ();
+
+       return rc;
 }
 
 /*-----------------------------------------------------------------------
  * Copy memory to flash
  */
 
-static int write_word (flash_info_t *info, ulong dest, ushort data)
+static int write_word (flash_info_t * info, ulong dest, ushort data)
 {
-    vushort *addr = (vushort *)dest, val;
-    int rc = ERR_OK;
-    int flag;
-
-    /* Check if Flash is (sufficiently) erased
-     */
-    if ((*addr & data) != data)
-        return ERR_NOT_ERASED;
-    
-    /* 
-     * Disable interrupts which might cause a timeout
-     * here. Remember that our exception vectors are
-     * at address 0 in the flash, and we don't want a
-     * (ticker) exception to happen while the flash
-     * chip is in programming mode.
-     */
-    flag = disable_interrupts();
-
-    /* clear status register command */
-    *addr = 0x50;
-    
-    /* program set-up command */
-    *addr = 0x40;
-
-    /* latch address/data */
-    *addr = data;
-
-    /* arm simple, non interrupt dependent timer */
-    reset_timer_masked();
-
-    /* wait while polling the status register */
-    while(((val = *addr) & 0x80) != 0x80)
-    {
-       if (get_timer_masked() > CFG_FLASH_WRITE_TOUT) {
-           rc = ERR_TIMOUT;
-           /* suspend program command */
-           *addr = 0xB0;
-           goto outahere;
+       vu_short *addr = (vu_short *) dest, val;
+       int rc = ERR_OK;
+       int flag;
+
+       /* Check if Flash is (sufficiently) erased
+        */
+       if ((*addr & data) != data)
+               return ERR_NOT_ERASED;
+
+       /* 
+        * Disable interrupts which might cause a timeout
+        * here. Remember that our exception vectors are
+        * at address 0 in the flash, and we don't want a
+        * (ticker) exception to happen while the flash
+        * chip is in programming mode.
+        */
+       flag = disable_interrupts ();
+
+       /* clear status register command */
+       *addr = 0x50;
+
+       /* program set-up command */
+       *addr = 0x40;
+
+       /* latch address/data */
+       *addr = data;
+
+       /* arm simple, non interrupt dependent timer */
+       reset_timer_masked ();
+
+       /* wait while polling the status register */
+       while (((val = *addr) & 0x80) != 0x80) {
+               if (get_timer_masked () > CFG_FLASH_WRITE_TOUT) {
+                       rc = ERR_TIMOUT;
+                       /* suspend program command */
+                       *addr = 0xB0;
+                       goto outahere;
+               }
+       }
+
+       if (val & 0x1A) {                       /* check for error */
+               printf ("\nFlash write error %02x at address %08lx\n",
+                               (int) val, (unsigned long) dest);
+               if (val & (1 << 3)) {
+                       printf ("Voltage range error.\n");
+                       rc = ERR_PROG_ERROR;
+                       goto outahere;
+               }
+               if (val & (1 << 1)) {
+                       printf ("Device protect error.\n");
+                       rc = ERR_PROTECTED;
+                       goto outahere;
+               }
+               if (val & (1 << 4)) {
+                       printf ("Programming error.\n");
+                       rc = ERR_PROG_ERROR;
+                       goto outahere;
+               }
+               rc = ERR_PROG_ERROR;
+               goto outahere;
        }
-    }
-   
-    if(val & 0x1A) {   /* check for error */
-        printf("\nFlash write error %02x at address %08lx\n",
-          (int)val, (unsigned long)dest);
-        if(val & (1<<3)) {
-           printf("Voltage range error.\n");
-           rc = ERR_PROG_ERROR;
-           goto outahere;
-        }
-        if(val & (1<<1)) {
-           printf("Device protect error.\n");
-           rc = ERR_PROTECTED;
-           goto outahere;
-        }
-        if(val & (1<<4)) {
-           printf("Programming error.\n");
-           rc = ERR_PROG_ERROR;
-           goto outahere;
-        }
-        rc = ERR_PROG_ERROR;
-        goto outahere;
-    }
-   
-outahere:
-    /* read array command */
-    *addr = 0xFF;
-
-    if (flag)
-      enable_interrupts();
-
-    return rc;
+
+  outahere:
+       /* read array command */
+       *addr = 0xFF;
+
+       if (flag)
+               enable_interrupts ();
+
+       return rc;
 }
 
 /*-----------------------------------------------------------------------
  * Copy memory to flash.
  */
 
-int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
+int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
 {
-    ulong cp, wp;
-    ushort data;
-    int l;
-    int i, rc;
-
-    wp = (addr & ~1);  /* get lower word aligned address */
+       ulong cp, wp;
+       ushort data;
+       int l;
+       int i, rc;
+
+       wp = (addr & ~1);                       /* get lower word aligned address */
+
+       /*
+        * handle unaligned start bytes
+        */
+       if ((l = addr - wp) != 0) {
+               data = 0;
+               for (i = 0, cp = wp; i < l; ++i, ++cp) {
+                       data = (data >> 8) | (*(uchar *) cp << 8);
+               }
+               for (; i < 2 && cnt > 0; ++i) {
+                       data = (data >> 8) | (*src++ << 8);
+                       --cnt;
+                       ++cp;
+               }
+               for (; cnt == 0 && i < 2; ++i, ++cp) {
+                       data = (data >> 8) | (*(uchar *) cp << 8);
+               }
 
-    /*
-     * handle unaligned start bytes
-     */
-    if ((l = addr - wp) != 0) {
-       data = 0;
-       for (i=0, cp=wp; i<l; ++i, ++cp) {
-           data = (data >> 8) | (*(uchar *)cp << 8);
+               if ((rc = write_word (info, wp, data)) != 0) {
+                       return (rc);
+               }
+               wp += 2;
        }
-       for (; i<2 && cnt>0; ++i) {
-           data = (data >> 8) | (*src++ << 8);
-           --cnt;
-           ++cp;
+
+       /*
+        * handle word aligned part
+        */
+       while (cnt >= 2) {
+               data = *((vu_short *) src);
+               if ((rc = write_word (info, wp, data)) != 0) {
+                       return (rc);
+               }
+               src += 2;
+               wp += 2;
+               cnt -= 2;
        }
-       for (; cnt==0 && i<2; ++i, ++cp) {
-           data = (data >> 8) | (*(uchar *)cp << 8);
+
+       if (cnt == 0) {
+               return ERR_OK;
        }
-       
-       if ((rc = write_word(info, wp, data)) != 0) {
-           return (rc);
+
+       /*
+        * handle unaligned tail bytes
+        */
+       data = 0;
+       for (i = 0, cp = wp; i < 2 && cnt > 0; ++i, ++cp) {
+               data = (data >> 8) | (*src++ << 8);
+               --cnt;
        }
-       wp += 2;
-    }
-
-    /*
-     * handle word aligned part
-     */
-    while (cnt >= 2) {
-       data = *((vushort*)src);
-       if ((rc = write_word(info, wp, data)) != 0) {
-           return (rc);
+       for (; i < 2; ++i, ++cp) {
+               data = (data >> 8) | (*(uchar *) cp << 8);
        }
-       src += 2;
-       wp  += 2;
-       cnt -= 2;
-    }
-    
-    if (cnt == 0) {
-       return ERR_OK;
-    }
-
-    /*
-     * handle unaligned tail bytes
-     */
-    data = 0;
-    for (i=0, cp=wp; i<2 && cnt>0; ++i, ++cp) {
-       data = (data >> 8) | (*src++ << 8);
-       --cnt;
-    }
-    for (; i<2; ++i, ++cp) {
-       data = (data >> 8) | (*(uchar *)cp << 8);
-    }
-
-    return write_word(info, wp, data);
+
+       return write_word (info, wp, data);
 }
index 936b2edf44dce67a62074c07e7a3f441add4335a..1b4147494834aa1464556a0d4cf4525707d58d3c 100644 (file)
@@ -210,13 +210,9 @@ flash_print_info  (flash_info_t *info)
                break;
        }
 
-       if((info->size >> 20) > 0 ) {
-           printf ("  Size: %ld MB in %d Sectors\n",
-                   info->size >> 20, info->sector_count);
-       } else {
-           printf ("  Size: %ld kB in %d Sectors\n",
-                   info->size >> 10, info->sector_count);
-       }
+       puts ("  Size: ");
+       print_size (info->size, "");
+       printf (" in %d Sectors\n", info->sector_count);
 
        printf ("  Sector Start Addresses:");
        for (i=0; i<info->sector_count; ++i) {
index ff11dc0310581805774a77191190bbbc8601ad75..9eef7f2cac400b072c8df8084b746d321907bbd2 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 
 static int check_crc(bd_t *bd)
 {
index b2a6273667170110b3ad9f5c0dce15080571b253..b95e9109ad0a425a245bec49f4a69013c517f5c6 100644 (file)
 
 int board_init (void)
 {
+       DECLARE_GLOBAL_DATA_PTR;
+
        /* Activate LED flasher */
        IO_LEDFLSH = 0x40;
 
        /* arch number of EP7111 */
-       bd->bi_arch_number = 50;
+       gd->bd->bi_arch_number = 50;
 
        /* location of boot parameters for EP7111 */
-       bd->bi_boot_params = 0xc0020100;
+       gd->bd->bi_boot_params = 0xc0020100;
 
        return 0;
 }
 
 int dram_init (void)
 {
-       bd->bi_dram[0].start = PHYS_SDRAM_1;
-       bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
-       bd->bi_dram[1].start = PHYS_SDRAM_2;
-       bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
+       DECLARE_GLOBAL_DATA_PTR;
+
+       gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+       gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+       gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
+       gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
 
        return PHYS_SDRAM_1_SIZE + PHYS_SDRAM_2_SIZE;
 }
index ff11dc0310581805774a77191190bbbc8601ad75..9eef7f2cac400b072c8df8084b746d321907bbd2 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 
 static int check_crc(bd_t *bd)
 {
index 93f8b768cd8cfcf598e80d2b23dda950d083939a..a50aa7027a5b7abea92186790c5dc519a0d3a703 100644 (file)
 
 int board_init (void)
 {
+       DECLARE_GLOBAL_DATA_PTR;
+
        /* memory and cpu-speed are setup before relocation */
        /* so we do _nothing_ here */
 
        /* arch number of LART-Board */
-       bd->bi_arch_number = 27;
+       gd->bd->bi_arch_number = 27;
 
        /* adress of boot parameters */
-       bd->bi_boot_params = 0xc0000100;
+       gd->bd->bi_boot_params = 0xc0000100;
 
        return 0;
 }
 
 int dram_init (void)
 {
+       DECLARE_GLOBAL_DATA_PTR;
+       bd_t *bd = gd->bd;
+
        bd->bi_dram[0].start = PHYS_SDRAM_1;
        bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
        bd->bi_dram[1].start = PHYS_SDRAM_2;
index b219fc8d6111c32489a407b46bb8f09a1a2daf3f..046b4d59edfa1a73c232f6ccb9c7328765acca68 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 
 static int check_crc(bd_t *bd)
 {
index 7ffc4b346ced8ed39de8a1782890c3f10725e88f..2dd708f3d6e17fb5620ceb2fbbeb12f81dd6c5ae 100644 (file)
@@ -33,6 +33,8 @@
 
 int board_init (void)
 {
+       DECLARE_GLOBAL_DATA_PTR;
+
        /* memory and cpu-speed are setup before relocation */
        /* but if we use InfernoLoader, we must do some inits here */
 
@@ -61,16 +63,22 @@ int board_init (void)
 #endif /* CONFIG_INIT_CRITICAL */
 
        /* arch number for shannon */
-       bd->bi_arch_number = 97;
+       gd->bd->bi_arch_number = 97;
 
        /* adress of boot parameters */
-       bd->bi_boot_params = 0xc0000100;
+       gd->bd->bi_boot_params = 0xc0000100;
 
        return 0;
 }
 
 int dram_init (void)
 {
+#if defined(PHYS_SDRAM_1) || defined(PHYS_SDRAM_2) || \
+    defined(PHYS_SDRAM_3) || defined(PHYS_SDRAM_4)
+       DECLARE_GLOBAL_DATA_PTR;
+       bd_t *bd = gd->bd;
+#endif
+
 #ifdef PHYS_SDRAM_1
        bd->bi_dram[0].start = PHYS_SDRAM_1;
        bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
@@ -91,10 +99,17 @@ int dram_init (void)
        bd->bi_dram[3].size = PHYS_SDRAM_4_SIZE;
 #endif
 
-       return (  PHYS_SDRAM_1_SIZE
+       return (  0
+#ifdef PHYS_SDRAM_1
+               + PHYS_SDRAM_1_SIZE
+#endif
+#ifdef PHYS_SDRAM_2
                + PHYS_SDRAM_2_SIZE
-#ifdef PHYS_SDRAM_4
+#endif
+#ifdef PHYS_SDRAM_3
                + PHYS_SDRAM_3_SIZE
+#endif
+#ifdef PHYS_SDRAM_4
                + PHYS_SDRAM_4_SIZE
 #endif
                );
index d22c529793ae6b87a0c89fa840a324e701cc85e3..5e8d95a2f511512ae7dd0ca9d77800bee5d56586 100644 (file)
@@ -26,6 +26,7 @@
  */
 
 #include <common.h>
+#include <environment.h>
 
 static int check_crc(bd_t *bd)
 {
index 53339fb2cc9baf458832eebd9b14a386d388e0ae..fb25902df2a44da159355379947ccfd0afe9f444 100644 (file)
@@ -220,7 +220,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last)
 
        if (info->protect[sect] == 0)
        {       /* not protected */
-           vushort *addr = (vushort *)(info->start[sect]);
+           vu_short *addr = (vu_short *)(info->start[sect]);
 
            MEM_FLASH_ADDR1 = CMD_UNLOCK1;
            MEM_FLASH_ADDR2 = CMD_UNLOCK2;
@@ -296,7 +296,7 @@ outahere:
 
 volatile static int write_hword (flash_info_t *info, ulong dest, ushort data)
 {
-    vushort *addr = (vushort *)dest;
+    vu_short *addr = (vu_short *)dest;
     ushort result;
     int rc = ERR_OK;
     int cflag, iflag;
@@ -411,7 +411,7 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
      * handle word aligned part
      */
     while (cnt >= 2) {
-       data = *((vushort*)src);
+       data = *((vu_short*)src);
        if ((rc = write_hword(info, wp, data)) != 0) {
            return (rc);
        }
index 56cc4b2f48fda8ccf45ad2ca8daf8fc25c6ddce3..9fecce52edc7b53d95cce53ee390f8047d335731 100644 (file)
@@ -67,6 +67,8 @@ static inline void delay (unsigned long loops)
 
 int board_init (void)
 {
+       DECLARE_GLOBAL_DATA_PTR;
+
        /* to reduce PLL lock time, adjust the LOCKTIME register */
        rLOCKTIME = 0xFFFFFF;
 
@@ -100,17 +102,19 @@ int board_init (void)
        rGPHUP = 0x000007FF;
 
        /* arch number of SMDK2410-Board */
-       bd->bi_arch_number = 193;
+       gd->bd->bi_arch_number = 193;
 
        /* adress of boot parameters */
-       bd->bi_boot_params = 0x30000100;
+       gd->bd->bi_boot_params = 0x30000100;
 
        return 0;
 }
 
 int dram_init (void)
 {
-       bd->bi_dram[0].start = PHYS_SDRAM_1;
-       bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+       DECLARE_GLOBAL_DATA_PTR;
+
+       gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+       gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
        return PHYS_SDRAM_1_SIZE;
 }
index 421c905a2a0b7fccf9e8cc48334c3a2f636803ec..a1d7179ad15f1c8b2adc2d0937e2e4c26c46967c 100644 (file)
@@ -46,6 +46,10 @@ static void print_num(const char *, ulong);
 static void print_str(const char *, const char *);
 int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return 0;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
        DECLARE_GLOBAL_DATA_PTR;
 
        int i;
@@ -100,6 +104,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        printf ("\nIP addr     = ");    print_IPaddr (bd->bi_ip_addr);
        printf ("\nbaudrate    = %6ld bps\n", bd->bi_baudrate   );
        return 0;
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 }
 
 static void print_num(const char *name, ulong value)
index 9524e1d38759f0578d9f73ab67378c4f2ad4585f..b3a5f786933002e7c5031f8e3e896d96d7c436fb 100644 (file)
@@ -271,6 +271,10 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
                ulong   *len_ptr,
                int     verify)
 {
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
        DECLARE_GLOBAL_DATA_PTR;
 
        ulong   sp;
@@ -529,6 +533,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
         *   r7: End   of command line string
         */
        (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 }
 
 static void
@@ -701,8 +706,8 @@ print_image_hdr (image_header_t *hdr)
                tm.tm_hour, tm.tm_min, tm.tm_sec);
 #endif /* CFG_CMD_DATE */
        printf ("   Image Type:   "); print_type(hdr); printf ("\n");
-       printf ("   Data Size:    %d Bytes = %d kB = %d MB\n",
-               hdr->ih_size, hdr->ih_size>>10, hdr->ih_size>>20);
+       printf ("   Data Size:    %d Bytes = ", hdr->ih_size);
+       print_size (hdr->ih_size, "\n");
        printf ("   Load Address: %08x\n", hdr->ih_load);
        printf ("   Entry Point:  %08x\n", hdr->ih_ep);
 
@@ -712,8 +717,8 @@ print_image_hdr (image_header_t *hdr)
 
                printf ("   Contents:\n");
                for (i=0; *len_ptr; ++i, ++len_ptr) {
-                       printf ("   Image %d: %8ld Bytes = %ld kB = %ld MB\n",
-                               i, *len_ptr, *len_ptr>>10, *len_ptr>>20);
+                       printf ("   Image %d: %8ld Bytes = ", i, *len_ptr);
+                       print_size (*len_ptr, "\n");
                }
        }
 }
index 5f8fe8249669c343a2fcd0922ccf2be67b502d7f..46f4c3521715f2dc6397bdb77a25f661a45e5a36 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2000, 2001
+ * (C) Copyright 2000-2002
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
  * See file CREDITS for list of people who contributed to this
@@ -30,7 +30,8 @@
 #include <watchdog.h>
 #include <command.h>
 #include <image.h>
-#ifdef CONFIG_IDE_8xx_DIRECT
+#include <asm/byteorder.h>
+#if defined(CONFIG_IDE_8xx_DIRECT) || defined(CONFIG_IDE_PCMCIA)
 # include <pcmcia.h>
 #endif
 #ifdef CONFIG_8xx
@@ -402,11 +403,11 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        hdr = (image_header_t *)addr;
 
-       if (hdr->ih_magic == IH_MAGIC) {
+       if (ntohl(hdr->ih_magic) == IH_MAGIC) {
 
                print_image_hdr (hdr);
 
-               cnt = (hdr->ih_size + sizeof(image_header_t));
+               cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t));
                cnt += info.blksz - 1;
                cnt /= info.blksz;
                cnt -= 1;
index 72e99d2a9ba2460bd09bb9ba549b7fceb0b85727..d1fa3f74f8f9dd0d06141d4b15a44d72f77ddf70 100644 (file)
@@ -136,7 +136,12 @@ static uchar *flash_addr = (uchar *)CFG_ENV_ADDR;
 static env_t *env_ptr = NULL;
 
 #else
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ /* nothing XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 # error Define one of CFG_ENV_IS_IN_NVRAM, CFG_ENV_IS_IN_EEPROM, CFG_ENV_IS_IN_FLASH, CFG_ENV_IS_NOWHERE
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 #endif /* CFG_ENV_IS_IN_FLASH */
 
 /*----------------------------------------------------------------------*/
@@ -253,6 +258,10 @@ static uchar *(*get_env_addr)(int) = get_env_addr_memory;
 
 void env_relocate (void)
 {
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
        DECLARE_GLOBAL_DATA_PTR;
 
        DEBUGF ("%s[%d] offset = 0x%lx\n", __FUNCTION__,__LINE__,
@@ -321,6 +330,7 @@ void env_relocate (void)
        }
 #endif
        gd->env_addr = (ulong)&(env_ptr->data);
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 }
 /************************************************************************
 ************************************************************************/
@@ -330,6 +340,10 @@ void env_relocate (void)
  */
 static uchar get_env_char_memory (int index)
 {
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return 0;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
        DECLARE_GLOBAL_DATA_PTR;
 
        if (gd->env_valid) {
@@ -337,11 +351,16 @@ static uchar get_env_char_memory (int index)
        } else {
                return ( default_environment[index] );
        }
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 }
 
 
 static uchar *get_env_addr_memory(int index)
 {
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return 0;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
        DECLARE_GLOBAL_DATA_PTR;
 
        if (gd->env_valid) {
@@ -349,11 +368,16 @@ static uchar *get_env_addr_memory(int index)
        } else {
                return (&default_environment[index]);
        }
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 }
 
 #if defined(CFG_ENV_IS_IN_NVRAM) && defined(CFG_NVRAM_ACCESS_ROUTINE)
 static uchar  get_env_char_nvram(int index)
 {
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return 0;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
        DECLARE_GLOBAL_DATA_PTR;
        uchar c;
 
@@ -364,6 +388,7 @@ static uchar  get_env_char_nvram(int index)
                c = default_environment[index];
 
        return c;
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 }
 #endif
 
@@ -373,6 +398,10 @@ static uchar  get_env_char_nvram(int index)
  */
 static uchar get_env_char_eeprom (int index)
 {
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return 0;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
        DECLARE_GLOBAL_DATA_PTR;
        uchar c;
 
@@ -387,6 +416,7 @@ static uchar get_env_char_eeprom (int index)
        }
 
        return (c);
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 }
 #endif /* CFG_ENV_IS_IN_EEPROM */
 
@@ -455,6 +485,10 @@ int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 int _do_setenv (int flag, int argc, char *argv[])
 {
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return 0;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
        DECLARE_GLOBAL_DATA_PTR;
 
        int   i, len, oldval;
@@ -662,6 +696,7 @@ int _do_setenv (int flag, int argc, char *argv[])
        }
 #endif /* CFG_CMD_NET */
        return 0;
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 }
 
 void setenv (char *varname, char *varvalue)
@@ -867,6 +902,10 @@ int saveenv(void)
 
 int saveenv(void)
 {
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return 0;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
        int len, rc;
        ulong end_addr;
        uchar *flash_sect_addr;
@@ -918,6 +957,7 @@ int saveenv(void)
        /* try to re-protect */
        (void) flash_sect_protect (1, (ulong)flash_sect_addr, end_addr);
        return rcode;
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 }
 
 #endif /* CFG_CMD_ENV + CFG_CMD_FLASH */
@@ -966,6 +1006,10 @@ int env_init(void)
 #else
 int  env_init(void)
 {
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+ return 0;
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
        DECLARE_GLOBAL_DATA_PTR;
 
        if (crc32(0, env_ptr->data, ENV_SIZE) == env_ptr->crc) {
@@ -977,6 +1021,7 @@ int  env_init(void)
        }
 
        return (0);
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 }
 #endif /* defined(CFG_ENV_IS_IN_NVRAM) && defined(CFG_NVRAM_ACCESS_ROUTINE) */
 
index dbcd3689c8edc676de4748f4a37df2065a9c5dc1..b231662b5ca70eb8ae05019c1339b0f8416372c3 100644 (file)
@@ -27,6 +27,8 @@
 #include <console.h>
 #include <syscall.h>
 
+void **syscall_tbl;
+
 #ifdef CFG_CONSOLE_IS_IN_ENV
 /*
  * if overwrite_console returns 1, the stdin, stderr and stdout
index 3d19e24a23f868fc462061cf0b1a65921548d59d..7521fbaf5fcf731dab6209e923bf41623551520f 100644 (file)
@@ -131,7 +131,9 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        disable_interrupts ();
        reset_cpu (0);
- /*NOTREACHED*/}
+       /*NOTREACHED*/
+       return (0);
+}
 
 void icache_enable (void)
 {
index 050bcae0305a2241494272b1c562698834d41f69..88311865c0a9276c748c67f65e501fad79b2bbd1 100644 (file)
@@ -28,7 +28,8 @@
 
 #include <common.h>
 #include <clps7111.h>
-#include <ptregs.h>
+
+#include <asm/proc-armv/ptrace.h>
 
 extern void reset_cpu(ulong addr);
 
index 708b9e9a42c25e78fcbc1ef47957fad208b7cd57..d38ac39472c4705e7a713e7cbf497abe9d8fcd94 100644 (file)
@@ -116,3 +116,11 @@ int serial_getc (void)
 
        return IO_UARTDR1 & 0xff;
 }
+
+void
+serial_puts (const char *s)
+{
+       while (*s) {
+               serial_putc (*s++);
+       }
+}
index 2567c9794bf8dbce3a5aefd132207a11ad69f329..b37d23afd475f37e361cc75120954b8447afd908 100644 (file)
@@ -170,3 +170,11 @@ int serial_tstc (void)
        return rUTRSTAT1 & 0x1;
 #endif
 }
+
+void
+serial_puts (const char *s)
+{
+       while (*s) {
+               serial_putc (*s++);
+       }
+}
index b57be49efd7040efd30b085a956dc46aeb6d7d81..be52849dbae7d4e9d022c735c12cfe4071691236 100644 (file)
@@ -28,7 +28,8 @@
 
 #include <common.h>
 #include <SA-1100.h>
-#include <ptregs.h>
+
+#include <asm/proc-armv/ptrace.h>
 
 extern void reset_cpu (ulong addr);
 
index 5a0acbe1a91082d9a7f3d3cb2b48386848fb6098..cbb894ce18d79d8f015649c78c97ef43cf65f11b 100644 (file)
@@ -148,3 +148,11 @@ int serial_getc (void)
        return (char) Ser3UTDR & 0xff;
 #endif
 }
+
+void
+serial_puts (const char *s)
+{
+       while (*s) {
+               serial_putc (*s++);
+       }
+}
index 643d77bf5b294704c90f95ea9190a0b4b2feac6d..6a396b5fc9079a33de1c1f599235be2a73519b6e 100644 (file)
@@ -133,3 +133,11 @@ int serial_getc (void)
 #elif CONFIG_STUART
 #endif
 }
+
+void
+serial_puts (const char *s)
+{
+       while (*s) {
+               serial_putc (*s++);
+       }
+}
index 2fd21252f37c13f46ff60258615759da1de8d8dd..808a10bb8589605599ef3fa5fd512d40b409360e 100644 (file)
@@ -64,7 +64,7 @@
 
 #ifdef CONFIG_DRIVER_3C589
 
-#include <3c589.h>
+#include "3c589.h"
 
 
 // Use power-down feature of the chip
index fff3b1917b5dcf90a70f6f006a86979c23ab9a35..28846ee06a53ddad51dc4d506647faf63d33589a 100644 (file)
@@ -27,9 +27,14 @@ include $(TOPDIR)/config.mk
 
 LIB    = libdrivers.a
 
-OBJS   = ns87308.o ns16550.o serial.o pci_auto.o pci.o pci_indirect.o \
-               eepro100.o dc2114x.o w83c553f.o sym53c8xx.o pcnet.o \
-               tigon3.o bcm570x.o bcm570x_autoneg.o 5701rls.o
+OBJS   = 3c589.o 5701rls.o bcm570x.o bcm570x_autoneg.o \
+         cs8900.o dc2114x.o eepro100.o \
+         ns16550.o ns87308.o \
+         pci.o pci_auto.o pci_indirect.o \
+         pcnet.o serial.o \
+         smc91111.o sym53c8xx.o \
+         tigon3.o w83c553f.o
+
 all:   $(LIB)
 
 $(LIB):        $(OBJS)
index 64748f1cdc42897bd63e961bf9ad5676553ae4a2..a4664a79188cd4a873b6076b9c933826e18a08d6 100644 (file)
@@ -34,7 +34,7 @@
 
 #include <common.h>
 #include <command.h>
-#include <cs8900.h>
+#include "cs8900.h"
 #include <net.h>
 
 #ifdef CONFIG_DRIVER_CS8900
index dbd329eed8e32618aa94d84698e4c07904570525..ac26df2fcde47ac58c4cf2674a3821dec0a71d35 100644 (file)
@@ -32,7 +32,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <types.h>
+#include <asm/types.h>
 #include <config.h>
 
 #ifdef CONFIG_DRIVER_CS8900
index b8dfc5de1a8dd86034f6178c5486120293d30b2c..a2c3be788252294f01de0f3bb0da6293aecda697 100644 (file)
@@ -60,7 +60,7 @@
 
 #include <common.h>
 #include <command.h>
-#include <smc91111.h>
+#include "smc91111.h"
 #include <net.h>
 
 #ifdef CONFIG_DRIVER_SMC91111
@@ -278,7 +278,7 @@ static int poll4int( byte mask, int timeout ) {
 
     PRINTK2("Polling...\n");
     SMC_SELECT_BANK(2);
-    while((SMC_inw(INT_REG) & mask) == 0) 
+    while((SMC_inw(SMC91111_INT_REG) & mask) == 0) 
     {
         if (get_timer(0) >= tmo) {
          is_timeout = 1;
@@ -475,10 +475,10 @@ again:
        try++;
        time_out = MEMORY_WAIT_TIME;
        do {
-               status = SMC_inb( INT_REG );
+               status = SMC_inb( SMC91111_INT_REG );
                if ( status & IM_ALLOC_INT ) {
                        /* acknowledge the interrupt */
-                       SMC_outb( IM_ALLOC_INT, INT_REG );
+                       SMC_outb( IM_ALLOC_INT, SMC91111_INT_REG );
                        break;
                }
        } while ( -- time_out );
@@ -528,11 +528,11 @@ again:
        /* send the packet length ( +6 for status, length and ctl byte )
           and the status word ( set to zeros ) */
 #ifdef USE_32_BIT
-       SMC_outl(  (length +6 ) << 16 , DATA_REG );
+       SMC_outl(  (length +6 ) << 16 , SMC91111_DATA_REG );
 #else
-       SMC_outw( 0, DATA_REG );
+       SMC_outw( 0, SMC91111_DATA_REG );
        /* send the packet length ( +6 for status words, length, and ctl*/
-       SMC_outw( (length+6), DATA_REG );
+       SMC_outw( (length+6), SMC91111_DATA_REG );
 #endif
 
        /* send the actual data
@@ -543,18 +543,18 @@ again:
         . almost as much time as is saved?
        */
 #ifdef USE_32_BIT
-       SMC_outsl(DATA_REG, buf,  length >> 2 );
+       SMC_outsl(SMC91111_DATA_REG, buf,  length >> 2 );
        if ( length & 0x2  )
-               SMC_outw(*((word *)(buf + (length & 0xFFFFFFFC))), DATA_REG);
+               SMC_outw(*((word *)(buf + (length & 0xFFFFFFFC))), SMC91111_DATA_REG);
 #else
-       SMC_outsw(DATA_REG , buf, (length ) >> 1);
+       SMC_outsw(SMC91111_DATA_REG , buf, (length ) >> 1);
 #endif // USE_32_BIT
 
        /* Send the last byte, if there is one.   */
        if ( (length & 1) == 0 ) {
-               SMC_outw( 0, DATA_REG );
+               SMC_outw( 0, SMC91111_DATA_REG );
        } else {
-               SMC_outw( buf[length -1 ] | 0x2000, DATA_REG );
+               SMC_outw( buf[length -1 ] | 0x2000, SMC91111_DATA_REG );
        }
 
        /* and let the chipset deal with it */
@@ -581,7 +581,7 @@ again:
                return 0;
        } else {
                /* ack. int */
-               SMC_outw(IM_TX_INT, INT_REG);
+               SMC_outw(IM_TX_INT, SMC91111_INT_REG);
                PRINTK2("%s: Sent packet of length %d \n", SMC_DEV_NAME, length);
 
                /* release packet */
@@ -719,12 +719,12 @@ static int smc_rcv()
 
        /* First two words are status and packet_length */
 #ifdef USE_32_BIT
-   stat_len = SMC_inl(DATA_REG);
+   stat_len = SMC_inl(SMC91111_DATA_REG);
    status = stat_len & 0xffff;
    packet_length = stat_len >> 16;
 #else
-       status          = SMC_inw( DATA_REG );
-       packet_length   = SMC_inw( DATA_REG );
+       status          = SMC_inw( SMC91111_DATA_REG );
+       packet_length   = SMC_inw( SMC91111_DATA_REG );
 #endif
 
        packet_length &= 0x07ff;  /* mask off top bits */
@@ -749,20 +749,20 @@ static int smc_rcv()
                   to send the DWORDs or the bytes first, or some
                   mixture.  A mixture might improve already slow PIO
                   performance  */
-               SMC_insl( DATA_REG , NetRxPackets[0], packet_length >> 2 );
+               SMC_insl( SMC91111_DATA_REG , NetRxPackets[0], packet_length >> 2 );
                /* read the left over bytes */
           if (packet_length & 3) 
       {
          int i;
                   byte *tail = NetRxPackets[0] + (packet_length & ~3);
-                  dword leftover = SMC_inl(DATA_REG);
+                  dword leftover = SMC_inl(SMC91111_DATA_REG);
                   for (i=0; i<(packet_length & 3); i++) 
                           *tail++ = (byte) (leftover >> (8*i)) & 0xff;
           }           
 #else
                PRINTK3(" Reading %d words and %d byte(s) \n",
                        (packet_length >> 1 ), packet_length & 1 );
-               SMC_insw(DATA_REG , NetRxPackets[0], packet_length >> 1);
+               SMC_insw(SMC91111_DATA_REG , NetRxPackets[0], packet_length >> 1);
 
 #endif // USE_32_BIT
 
index 4d2ed74d86e70f8fb53cd232efc356e6a356967e..e517957704386a97b35f1d82250853ef5d17547a 100644 (file)
@@ -41,7 +41,7 @@
 #ifndef _SMC91111_H_
 #define _SMC91111_H_
 
-#include <types.h>
+#include <asm/types.h>
 #include <config.h>
 
 
@@ -372,12 +372,12 @@ typedef unsigned long int                 dword;
 
 // Data Register
 /* BANK 2 */
-#define        DATA_REG        0x0008
+#define        SMC91111_DATA_REG       0x0008
 
 
 // Interrupt Status/Acknowledge Register
 /* BANK 2 */
-#define        INT_REG         0x000C
+#define        SMC91111_INT_REG        0x000C
 
 
 // Interrupt Mask Register
index 01dd1109a9dc074bd901143325cc7c07dbdd60f8..9e8725edcd097412305848eb69a307819d0ce9c7 100644 (file)
@@ -2,6 +2,42 @@
 #include <ppc_defs.h>
 #include <syscall.h>
 
+#ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+#warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+       .global mon_getc
+       .type   mon_getc,function
+mon_getc:
+       .global mon_tstc
+       .type   mon_tstc,function
+mon_tstc:
+       .global mon_putc
+       .type   mon_putc,function
+mon_putc:
+       .global mon_puts
+       .type   mon_puts,function
+mon_puts:
+       .global mon_printf
+       .type   mon_printf,function
+mon_printf:
+       .global mon_install_hdlr
+       .type   mon_install_hdlr,function
+mon_install_hdlr:
+       .global mon_free_hdlr
+       .type   mon_free_hdlr,function
+mon_free_hdlr:
+       .global mon_malloc
+       .type   mon_malloc,function
+mon_malloc:
+       .global mon_free
+       .type   mon_free,function
+mon_free:
+       @ args = 0, pretend = 0, frame = 0
+       @ frame_needed = 1, current_function_anonymous_args = 0
+       mov     ip, sp
+       stmfd   sp!, {fp, ip, lr, pc}
+       sub     fp, ip, #4
+       ldmea   fp, {fp, sp, pc}
+#else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
 #define SYSCALL(name,n) \
        .globl name             ; \
 name:                          ; \
@@ -25,3 +61,4 @@ name:                         ; \
        SYSCALL(mon_free_hdlr,SYSCALL_FREE_HDLR)
        SYSCALL(mon_malloc,SYSCALL_MALLOC)
        SYSCALL(mon_free,SYSCALL_FREE)
+#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
index 5ac8cf43d964ac52f774a0bab4a25162a88f7cc6..5191286650959a1374cac581dd6fbf7873c46473 100644 (file)
@@ -37,15 +37,15 @@ typedef     struct  global_data {
        bd_t            *bd;
        unsigned long   flags;
        unsigned long   baudrate;
+       unsigned long   have_console;   /* serial_init() was called */
+       unsigned long   reloc_off;      /* Relocation Offset */
 #if 0
        unsigned long   cpu_clk;        /* CPU clock in Hz!             */
        unsigned long   bus_clk;
        unsigned long   ram_size;       /* RAM size */
-       unsigned long   reloc_off;      /* Relocation Offset */
        unsigned long   reset_status;   /* reset status register at boot */
        unsigned long   env_addr;       /* Address  of Environment struct */
        unsigned long   env_valid;      /* Checksum of Environment valid? */
-       unsigned long   have_console;   /* serial_init() was called */
 #endif
 } gd_t;
 
index cff09e5f6a7df66a0dfab96ab6d8655bdddef930..0d55ca25b46ee3ca01ca249a40c518c9e5f7d2c7 100644 (file)
@@ -20,9 +20,8 @@
 #ifndef __ASM_ARM_IO_H
 #define __ASM_ARM_IO_H
 
-#ifdef __KERNEL__
-
 #include <linux/types.h>
+#include <asm/byteorder.h>
 #include <asm/memory.h>
 #include <asm/arch/hardware.h>
 
@@ -281,5 +280,5 @@ out:
 #define isa_check_signature(io,sig,len)        (0)
 
 #endif /* __mem_isa */
-#endif /* __KERNEL__ */
+
 #endif /* __ASM_ARM_IO_H */
index 08668635154ac123f564c486b6f39064d766979e..b0adb509af5b27042ba1355d68af4bc68f7b27e6 100644 (file)
@@ -44,11 +44,6 @@ int  cleanup_before_linux(void);
 int    board_init(void);
 int    dram_init (void);
 
-/* arm/display_options.c */
-int    display_banner(void);
-int    display_dram_config(void);
-void   display_flash_config(ulong);
-
 /* ------------------------------------------------------------ */
 /* Here is a list of some prototypes which are incompatible to */
 /* the PPCBoot implementation                                  */
index 426f9262b019883b289db9d9f7fed6a9b1fe9819..652b12baf5e564836f99d48ffa5032303e5f640d 100644 (file)
@@ -1,5 +1,5 @@
 /* originally from linux source.
- * removed the dependacies on CONFIG_ values
+ * removed the dependencies on CONFIG_ values
  * removed virt_to_phys stuff (and in fact everything surrounded by #if __KERNEL__)
  * Modified By Rob Taylor, Flying Pig Systems, 2000
  */
index 5a802ae4b59c74a5fb39a4778a97b5d48e0abac7..630e74e3c60c8b012052e80a6ed65f221ccefb2f 100644 (file)
@@ -49,6 +49,9 @@ typedef volatile unsigned char        vu_char;
 #ifdef CONFIG_HYMOD
 #include <asm/hymod.h>
 #endif
+#ifdef CONFIG_ARM
+#define asmlinkage     /* nothing */
+#endif
 
 #include <part.h>
 #include <flash.h>
@@ -91,6 +94,7 @@ void  hang          (void);
 /* */
 long int initdram (int);
 int    display_options (void);
+void   print_size (ulong, const char *);
 
 /* common/main.c */
 void   main_loop       (void);
@@ -359,7 +363,7 @@ ulong crc32 (ulong, const unsigned char *, uint);
 ulong crc32_no_comp (ulong, const unsigned char *, uint);
 
 /* common/console.c */
-void   **syscall_tbl;
+extern void **syscall_tbl;
 
 int    console_init_f(void);   /* Before relocation; uses the serial  stuff    */
 int    console_init_r(void);   /* After  relocation; uses the console stuff    */
index 5ecc5a854bf70293d8f0c77d808fb7b2c18b6cb1..7fc6776252dcec6c0d728dbd949e0dba3a8b5247 100644 (file)
@@ -52,7 +52,7 @@
  * Hardware drivers
  */
 #define CONFIG_DRIVER_SMC91111
-#define SMC91111_BASE 0x20000300
+#define CONFIG_SMC91111_BASE 0x20000300
 
 
 /*
index 4b8e9ccb37bb596437d519240be09d3a0e25c86f..30eb49cbbda9711f68a763c784ceb517fb393328 100644 (file)
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_BOOTARGS        "devfs=mount root=ramfs console=ttyS0,9600"
 #define CONFIG_ETHADDR 08:00:3e:21:c7:f7
-//#define CONFIG_NETMASK        255.255.0.0
-//#define CONFIG_IPADDR                172.22.2.128
-//#define CONFIG_SERVERIP      172.22.2.126
-//#define CONFIG_BOOTFILE      "impa7"
+/*#define CONFIG_NETMASK        255.255.0.0    */
+/*#define CONFIG_IPADDR                172.22.2.128    */
+/*#define CONFIG_SERVERIP      172.22.2.126    */
+/*#define CONFIG_BOOTFILE      "impa7" */
 #define CONFIG_BOOTCOMMAND     "bootp;bootm"
 
 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
index 2a02c439fa438a716278de8b6cb48ec40e9cbcaa..eef1e4b00005e7f390123008110e76151601bbce 100644 (file)
 
 #define CONFIG_BOOTDELAY       3
 #define CONFIG_BOOTARGS        "devfs=mount root=ramfs console=ttyS0,9600"
-//#define CONFIG_ETHADDR       08:00:3e:26:0a:5a
-//#define CONFIG_NETMASK        255.255.0.0
-//#define CONFIG_IPADDR                172.22.2.128
-//#define CONFIG_SERVERIP      172.22.2.126
-//#define CONFIG_BOOTFILE      "impa7"
+/*#define CONFIG_ETHADDR       08:00:3e:26:0a:5a       */
+/*#define CONFIG_NETMASK        255.255.0.0    */
+/*#define CONFIG_IPADDR                172.22.2.128    */
+/*#define CONFIG_SERVERIP      172.22.2.126    */
+/*#define CONFIG_BOOTFILE      "impa7" */
 #define CONFIG_BOOTCOMMAND     "bootp;bootm"
 
 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
index 41a4c5778cc2ba5e396b3afa5d112274bff94725..db2724de43b32f1065e445faf2377a78844eb5f2 100644 (file)
 
 #define CONFIG_BAUDRATE                115200
 
+#if 0 /* XXX - cannot test IDE anyway, so disabled for now - wd */
 #define CONFIG_COMMANDS                (CONFIG_CMD_DFL | \
                                 CFG_CMD_PCMCIA | \
                                 CFG_CMD_IDE)
+#endif /* 0 */
 
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
index 61c75ddf7ad6229e1d9c4706f2f0e81ea0ca537f..070e54b1117270868bea0ecfeecd86ca7891f700 100644 (file)
 #include <cmd_confdefs.h>
 
 #define CONFIG_BOOTDELAY       3
-//#define CONFIG_BOOTARGS      "root=ramfs devfs=mount console=ttySA0,9600"
-//#define CONFIG_ETHADDR       08:00:3e:26:0a:5b
+/*#define CONFIG_BOOTARGS      "root=ramfs devfs=mount console=ttySA0,9600" */
+/*#define CONFIG_ETHADDR       08:00:3e:26:0a:5b */
 #define CONFIG_NETMASK          255.255.255.0
 #define CONFIG_IPADDR          10.0.0.110
 #define CONFIG_SERVERIP                10.0.0.1
-//#define CONFIG_BOOTFILE      "elinos-lart"
-//#define CONFIG_BOOTCOMMAND   "tftp; bootm"
+/*#define CONFIG_BOOTFILE      "elinos-lart" */
+/*#define CONFIG_BOOTCOMMAND   "tftp; bootm" */
 
 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
 #define CONFIG_KGDB_BAUDRATE   115200          /* speed to run kgdb serial port */
index fe6e955cf203c693564f49b49c013c8695eacc84..3045149ed44b5107bb4cd1d947997a19c15fd7bf 100644 (file)
@@ -184,6 +184,7 @@ extern int flash_real_protect(flash_info_t *info, long sector, int prot);
 #define INTEL_ID_28F640C3T  0x88CC88CC /*  64M = 4M x 16 top boot sector       */
 #define INTEL_ID_28F640C3B  0x88CD88CD /*  64M = 4M x 16 bottom boot sector    */
 
+#define INTEL_ID_28F128J3   0x89189818  /*  16M = 8M x 16 x 128        */
 #define INTEL_ID_28F640J5   0x00150015 /*  64M = 128K x  64                    */
 #define INTEL_ID_28F320J3A  0x00160016 /*  32M = 128K x  32                    */
 #define INTEL_ID_28F640J3A  0x00170017 /*  64M = 128K x  64                    */
index af63c407da3b0812af13c73208c7cb4417c84c57..e8adb833aca7148e0fd9c0bb959d125fce023aa3 100644 (file)
@@ -18,6 +18,7 @@
 #define CONFIG_NET_MULTI
 #endif
 #endif
+#include <asm/byteorder.h>     /* for nton* / ntoh* stuff */
 
 
 /*
index 8ebc797820095fc5e88f68571bc15c36fdde6390..de5e5dd9ab2266424b7a392e134e7292de266a56 100644 (file)
@@ -25,9 +25,10 @@ include $(TOPDIR)/config.mk
 
 LIB    = lib$(ARCH).a
 
-AOBJS  = 
+AOBJS  = _udivsi3.o _umodsi3.o
 
-COBJS  = armlinux.o board.o
+COBJS  = armlinux.o board.o \
+         cache.o div0.o
 
 OBJS   = $(AOBJS) $(COBJS)
 
diff --git a/lib_arm/_udivsi3.S b/lib_arm/_udivsi3.S
new file mode 100644 (file)
index 0000000..d1543e9
--- /dev/null
@@ -0,0 +1,77 @@
+/* # 1 "libgcc1.S" */
+@ libgcc1 routines for ARM cpu.
+@ Division routines, written by Richard Earnshaw, (rearnsha@armltd.co.uk)
+dividend       .req    r0
+divisor                .req    r1
+result         .req    r2
+curbit         .req    r3
+ip             .req    r12
+sp             .req    r13
+lr             .req    r14
+pc             .req    r15
+       .text
+       .globl   __udivsi3      
+       .type  __udivsi3       ,function 
+       .align  0
+ __udivsi3      :
+       cmp     divisor, #0
+       beq     Ldiv0
+       mov     curbit, #1
+       mov     result, #0
+       cmp     dividend, divisor
+       bcc     Lgot_result
+Loop1:
+       @ Unless the divisor is very big, shift it up in multiples of
+       @ four bits, since this is the amount of unwinding in the main
+       @ division loop.  Continue shifting until the divisor is 
+       @ larger than the dividend.
+       cmp     divisor, #0x10000000
+       cmpcc   divisor, dividend
+       movcc   divisor, divisor, lsl #4
+       movcc   curbit, curbit, lsl #4
+       bcc     Loop1
+Lbignum:
+       @ For very big divisors, we must shift it a bit at a time, or
+       @ we will be in danger of overflowing.
+       cmp     divisor, #0x80000000
+       cmpcc   divisor, dividend
+       movcc   divisor, divisor, lsl #1
+       movcc   curbit, curbit, lsl #1
+       bcc     Lbignum
+Loop3:
+       @ Test for possible subtractions, and note which bits
+       @ are done in the result.  On the final pass, this may subtract
+       @ too much from the dividend, but the result will be ok, since the
+       @ "bit" will have been shifted out at the bottom.
+       cmp     dividend, divisor
+       subcs   dividend, dividend, divisor
+       orrcs   result, result, curbit
+       cmp     dividend, divisor, lsr #1
+       subcs   dividend, dividend, divisor, lsr #1
+       orrcs   result, result, curbit, lsr #1
+       cmp     dividend, divisor, lsr #2
+       subcs   dividend, dividend, divisor, lsr #2
+       orrcs   result, result, curbit, lsr #2
+       cmp     dividend, divisor, lsr #3
+       subcs   dividend, dividend, divisor, lsr #3
+       orrcs   result, result, curbit, lsr #3
+       cmp     dividend, #0                    @ Early termination?
+       movnes  curbit, curbit, lsr #4          @ No, any more bits to do?
+       movne   divisor, divisor, lsr #4
+       bne     Loop3
+Lgot_result:
+       mov     r0, result
+       mov     pc, lr
+Ldiv0:
+       str     lr, [sp, #-4]!
+       bl       __div0       (PLT) 
+       mov     r0, #0                  @ about as wrong as it could be
+       ldmia   sp!, {pc} 
+       .size  __udivsi3       , . -  __udivsi3        
+/* # 235 "libgcc1.S" */
+/* # 320 "libgcc1.S" */
+/* # 421 "libgcc1.S" */
+/* # 433 "libgcc1.S" */
+/* # 456 "libgcc1.S" */
+/* # 500 "libgcc1.S" */
+/* # 580 "libgcc1.S" */
diff --git a/lib_arm/_umodsi3.S b/lib_arm/_umodsi3.S
new file mode 100644 (file)
index 0000000..89aee5a
--- /dev/null
@@ -0,0 +1,88 @@
+/* # 1 "libgcc1.S" */
+@ libgcc1 routines for ARM cpu.
+@ Division routines, written by Richard Earnshaw, (rearnsha@armltd.co.uk)
+/* # 145 "libgcc1.S" */
+dividend       .req    r0
+divisor                .req    r1
+overdone       .req    r2
+curbit         .req    r3
+ip             .req    r12
+sp             .req    r13
+lr             .req    r14
+pc             .req    r15
+       .text
+       .globl   __umodsi3      
+       .type  __umodsi3       ,function 
+       .align 0
+ __umodsi3      :
+       cmp     divisor, #0
+       beq     Ldiv0
+       mov     curbit, #1
+       cmp     dividend, divisor
+       movcc   pc, lr
+Loop1:
+       @ Unless the divisor is very big, shift it up in multiples of
+       @ four bits, since this is the amount of unwinding in the main
+       @ division loop.  Continue shifting until the divisor is 
+       @ larger than the dividend.
+       cmp     divisor, #0x10000000
+       cmpcc   divisor, dividend
+       movcc   divisor, divisor, lsl #4
+       movcc   curbit, curbit, lsl #4
+       bcc     Loop1
+Lbignum:
+       @ For very big divisors, we must shift it a bit at a time, or
+       @ we will be in danger of overflowing.
+       cmp     divisor, #0x80000000
+       cmpcc   divisor, dividend
+       movcc   divisor, divisor, lsl #1
+       movcc   curbit, curbit, lsl #1
+       bcc     Lbignum
+Loop3:
+       @ Test for possible subtractions.  On the final pass, this may 
+       @ subtract too much from the dividend, so keep track of which
+       @ subtractions are done, we can fix them up afterwards...
+       mov     overdone, #0
+       cmp     dividend, divisor
+       subcs   dividend, dividend, divisor
+       cmp     dividend, divisor, lsr #1
+       subcs   dividend, dividend, divisor, lsr #1
+       orrcs   overdone, overdone, curbit, ror #1
+       cmp     dividend, divisor, lsr #2
+       subcs   dividend, dividend, divisor, lsr #2
+       orrcs   overdone, overdone, curbit, ror #2
+       cmp     dividend, divisor, lsr #3
+       subcs   dividend, dividend, divisor, lsr #3
+       orrcs   overdone, overdone, curbit, ror #3
+       mov     ip, curbit
+       cmp     dividend, #0                    @ Early termination?
+       movnes  curbit, curbit, lsr #4          @ No, any more bits to do?
+       movne   divisor, divisor, lsr #4
+       bne     Loop3
+       @ Any subtractions that we should not have done will be recorded in
+       @ the top three bits of "overdone".  Exactly which were not needed
+       @ are governed by the position of the bit, stored in ip.
+       @ If we terminated early, because dividend became zero,
+       @ then none of the below will match, since the bit in ip will not be
+       @ in the bottom nibble.
+       ands    overdone, overdone, #0xe0000000
+       moveq   pc, lr                          @ No fixups needed
+       tst     overdone, ip, ror #3
+       addne   dividend, dividend, divisor, lsr #3
+       tst     overdone, ip, ror #2
+       addne   dividend, dividend, divisor, lsr #2
+       tst     overdone, ip, ror #1
+       addne   dividend, dividend, divisor, lsr #1
+       mov     pc, lr
+Ldiv0:
+       str     lr, [sp, #-4]!
+       bl       __div0       (PLT) 
+       mov     r0, #0                  @ about as wrong as it could be
+       ldmia   sp!, {pc} 
+       .size  __umodsi3       , . -  __umodsi3        
+/* # 320 "libgcc1.S" */
+/* # 421 "libgcc1.S" */
+/* # 433 "libgcc1.S" */
+/* # 456 "libgcc1.S" */
+/* # 500 "libgcc1.S" */
+/* # 580 "libgcc1.S" */
index 5f192c2df8732a9452a818b62416a916a846306c..e9d333556347f414f0918596abed8ebd75f9aef0 100644 (file)
@@ -30,6 +30,9 @@
 #include <devices.h>
 #include <version.h>
 
+const char version_string[] =
+       PPCBOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
+
 #ifdef CONFIG_DRIVER_CS8900
 extern void cs8900_get_enetaddr (uchar * addr);
 #endif
@@ -68,6 +71,7 @@ void *sbrk (ptrdiff_t increment)
  * Init Utilities                                                      *
  ************************************************************************
  * Some of this code should be moved into the core functions,
+ * or dropped completely,
  * but let's get it working (again) first...
  */
 
@@ -85,6 +89,49 @@ static int init_baudrate (void)
        return (0);
 }
 
+static int display_banner (void)
+{
+
+       printf ("\n\n%s\n\n", version_string);
+       printf ("ARMBoot code: %08lx -> %08lx\n",
+               _armboot_start, _armboot_end);
+#ifdef CONFIG_USE_IRQ
+       printf ("IRQ Stack: %08lx\n", IRQ_STACK_START);
+       printf ("FIQ Stack: %08lx\n", FIQ_STACK_START);
+#endif
+       return (0);
+}
+
+/*
+ * WARNING: this code looks "cleaner" than the PowerPC version, but
+ * has the disadvantage that you either get nothing, or everything.
+ * On PowerPC, you might see "DRAM: " before the system hangs - which
+ * gives a simple yet clear indication which part of the
+ * initialization if failing.
+ */
+static int display_dram_config (void)
+{
+       DECLARE_GLOBAL_DATA_PTR;
+       int i;
+
+       puts ("DRAM Configuration:\n");
+
+       for(i=0; i<CONFIG_NR_DRAM_BANKS; i++) {
+               printf ("Bank #%d: %08lx ", i, gd->bd->bi_dram[i].start);
+               print_size (gd->bd->bi_dram[i].size, "\n");
+       }
+
+       return (0);
+}
+
+static void display_flash_config (ulong size)
+{
+       puts ("Flash: ");
+       print_size (size, "\n");
+}
+
+
+
 /*
  * Breath some life into the board...
  *
@@ -117,7 +164,7 @@ init_fnc_t *init_sequence[] = {
        init_baudrate,          /* initialze baudrate settings */
        serial_init,            /* serial communications setup */
        display_banner,
-       interrupt_init,         /* set up execptions */
+       interrupt_init,         /* set up exceptions */
        dram_init,              /* configure available RAM banks */
        display_dram_config,
 
diff --git a/lib_arm/cache.c b/lib_arm/cache.c
new file mode 100644 (file)
index 0000000..4f3cbc2
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * (C) Copyright 2002
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * 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
+ */
+
+/* for now: just dummy functions to satisfy the linker */
+
+void  flush_cache (unsigned long dummy1, unsigned long dummy2)
+{
+       return;
+}
diff --git a/lib_arm/div0.c b/lib_arm/div0.c
new file mode 100644 (file)
index 0000000..6267bf1
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * (C) Copyright 2002
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * 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
+ */
+
+/* Replacement (=dummy) for GNU/Linux division-by zero handler */
+void __div0 (void)
+{
+       extern void hang (void);
+
+       hang();
+}
index 669376340088f7a9cc8ee4fd5c40f813187cf193..ac04bff17ac87edb88bc1230bda0af3fc844aba1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2000
+ * (C) Copyright 2000-2002
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
  * See file CREDITS for list of people who contributed to this
@@ -34,3 +34,29 @@ int display_options (void)
 #endif
        return 0;
 }
+
+/*
+ * print sizes as "xxx kB", "xxx.y kB", "xxx MB" or "xxx.y MB" as needed;
+ * allow for optional trailing string (like "\n")
+ */
+void print_size (ulong size, const char *s)
+{
+       ulong m, n;
+       ulong d = 1 << 20;              /* 1 MB */
+       char  c = 'M';
+
+       if (size < d) {                 /* print in kB */
+               c = 'k';
+               d = 1 << 10;
+       }
+
+       n = size / d;
+
+       m = (10 * (size - (n * d)) + (d / 2) ) / d;
+
+       printf ("%2ld", n);
+       if (m) {
+               printf (".%ld", m);
+       }
+       printf (" %cB%s", c, s);
+}
index d3bd31967a9659e9fc016c8538af17aaa8e61a4d..d6b84b70d413c820bdf93137a7d696a239864638 100644 (file)
 #include <linux/ctype.h>
 #include <malloc.h>
 
-#define __HAVE_ARCH_BCOPY
+#ifdef CONFIG_ARM
+#undef  __HAVE_ARCH_MEMCMP
+#undef  __HAVE_ARCH_MEMCPY
+#undef  __HAVE_ARCH_MEMMOVE
+#undef  __HAVE_ARCH_MEMSET
+#undef  __HAVE_ARCH_BCOPY
+#undef  __HAVE_ARCH_STRCAT
+#undef  __HAVE_ARCH_STRCHR
+#undef  __HAVE_ARCH_STRCMP
+#undef  __HAVE_ARCH_STRCPY
+#undef  __HAVE_ARCH_STRLEN
+#undef  __HAVE_ARCH_STRNCPY
+#else
 #define __HAVE_ARCH_MEMCMP
 #define __HAVE_ARCH_MEMCPY
 #define __HAVE_ARCH_MEMMOVE
 #define __HAVE_ARCH_MEMSET
+#define __HAVE_ARCH_BCOPY
 #define __HAVE_ARCH_STRCAT
 #define __HAVE_ARCH_STRCMP
 #define __HAVE_ARCH_STRCPY
 #define __HAVE_ARCH_STRLEN
 #define __HAVE_ARCH_STRNCPY
+#endif
 
 #ifndef __HAVE_ARCH_STRNICMP
 /**
index 4856362ae550ec1ed9a9cd7e5e564a7ebf09972e..afe74cd493d5120e0736412f3072b766fe628448 100644 (file)
@@ -204,7 +204,7 @@ static int init_func_ram (void)
        puts ("DRAM:  ");
 
        if ((gd->ram_size = initdram (board_type)) > 0) {
-               printf ("%2ld MB\n", gd->ram_size >> 20);
+               print_size (gd->ram_size, "\n");
                return (0);
        }
        puts (failed);
@@ -650,11 +650,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
        if ((flash_size = flash_init ()) > 0) {
 #ifdef CFG_FLASH_CHECKSUM
-               if (flash_size >= (1 << 20)) {
-                       printf ("%2ld MB", flash_size >> 20);
-               } else {
-                       printf ("%2ld kB", flash_size >> 10);
-               }
+               print_size (flash_size, "");
                /*
                 * Compute and print flash CRC if flashchecksum is set to 'y'
                 *
@@ -670,11 +666,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
                }
                putc ('\n');
 #else
-               if (flash_size >= (1 << 20)) {
-                       printf ("%2ld MB\n", flash_size >> 20);
-               } else {
-                       printf ("%2ld kB\n", flash_size >> 10);
-               }
+               print_size (flash_size, "");
 #endif /* CFG_FLASH_CHECKSUM */
        } else {
                puts (failed);
index d7d90bdb23f9ed3a2a70e693789a7e033365b5a2..3aa745b5f158db91126712ccd96eb6835411b7d0 100644 (file)
@@ -296,10 +296,8 @@ TftpStart (void)
        printf ("Filename '%s'.", tftp_filename);
 
        if (NetBootFileSize) {
-           printf (" Size is %d%s kB => %x Bytes",
-               NetBootFileSize/2,
-               (NetBootFileSize%2) ? ".5" : "",
-               NetBootFileSize<<9);
+               printf (" Size is 0x%x Bytes = ", NetBootFileSize<<9);
+               print_size (NetBootFileSize<<9, "");
        }
 
        putc ('\n');