]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
* allow 0x... prefix on input
authorwdenk <wdenk>
Wed, 8 Aug 2001 00:17:55 +0000 (00:17 +0000)
committerwdenk <wdenk>
Wed, 8 Aug 2001 00:17:55 +0000 (00:17 +0000)
  (based on idea by Mads Dydensborg, Tue, 7 Aug 2001)

* allow to put "preboot" command in default configuration

* extended flash chip support for TQM8260 board (AM29LV800T/B,
  AM29LV160T/B, AM29DL322T/B, AM29DL323T/B)
* BCR tweakage for the 8260 bus mode on TQM8260
* SIUMCR tweakage enabling the MI interrupt (IRQ7) on TQM8260
* To simplify switching between bus modes, a new configuration option
  (CONFIG_BUSMODE_60x) has been added to the "config_TQM8260.h" file.
  If defined, BCR will be configured for the 60x mode, otherwise for
  8260 mode.

15 files changed:
CHANGELOG
board/tqm8260/flash.c
common/cmd_nvedit.c
common/environment.S
disk/part.c
doc/README.TQM8260
include/config_CCM.h
include/config_TQM823L.h
include/config_TQM8260.h
include/config_TQM850L.h
include/config_TQM855L.h
include/config_TQM860L.h
include/config_lwmon.h
include/version.h
ppc/vsprintf.c

index 0e6217b79edfa5b3e86dc21ee68d05153a1bf8c5..7fd546e6a8f8fa25643b40c17a8cd580eaedff7e 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -52,6 +52,24 @@ To do:
 * "last user address" is set even if bootp is used without parameters
   (and it uses default address).
 
+======================================================================
+Modifications for 1.0.5:
+======================================================================
+
+* allow 0x... prefix on input
+  (based on idea by Mads Dydensborg, Tue, 7 Aug 2001)
+
+* allow to put "preboot" command in default configuration
+
+* extended flash chip support for TQM8260 board (AM29LV800T/B,
+  AM29LV160T/B, AM29DL322T/B, AM29DL323T/B)
+* BCR tweakage for the 8260 bus mode on TQM8260
+* SIUMCR tweakage enabling the MI interrupt (IRQ7) on TQM8260
+* To simplify switching between bus modes, a new configuration option
+  (CONFIG_BUSMODE_60x) has been added to the "config_TQM8260.h" file.
+  If defined, BCR will be configured for the 60x mode, otherwise for
+  8260 mode.
+
 ======================================================================
 Modifications for 1.0.4:
 ======================================================================
index 50c2559555ea61e4f821f528bf7552ca20fec9bd..abc8849e9308e600e9abe10d40eb04ad384918ab 100644 (file)
@@ -2,7 +2,7 @@
  * (C) Copyright 2001
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * Flash Routines for AM29LV640U devices
+ * Flash Routines for AMD devices on the TQM8260 board
  *
  *--------------------------------------------------------------------
  * See file CREDITS for list of people who contributed to this
@@ -79,18 +79,73 @@ ulong flash_get_size( ulong baseaddr, flash_info_t *info )
   else
     switch( flashtest_h )
     {
+      case AMD_ID_LV800T:
+        info->flash_id += FLASH_AM800T;
+        info->sector_count = 19;
+        info->size = 0x00400000;  break;       /* 4 * 1 MB = 4 MB      */
+      case AMD_ID_LV800B:
+        info->flash_id += FLASH_AM800B;
+        info->sector_count = 19;
+        info->size = 0x00400000;  break;       /* 4 * 1 MB = 4 MB      */
+      case AMD_ID_LV160T:
+        info->flash_id += FLASH_AM160T;
+        info->sector_count = 35;
+        info->size = 0x00800000;  break;       /* 4 * 2 MB = 8 MB      */
+      case AMD_ID_LV160B:
+        info->flash_id += FLASH_AM160B;
+        info->sector_count = 35;
+        info->size = 0x00800000;  break;       /* 4 * 2 MB = 8 MB      */
+      case AMD_ID_DL322T:
+        info->flash_id += FLASH_AMDL322T;
+        info->sector_count = 71;
+        info->size = 0x01000000;  break;       /* 4 * 4 MB = 16 MB     */
+      case AMD_ID_DL322B:
+        info->flash_id += FLASH_AMDL322B;
+        info->sector_count = 71;
+        info->size = 0x01000000;  break;       /* 4 * 4 MB = 16 MB     */
+      case AMD_ID_DL323T:
+        info->flash_id += FLASH_AMDL323T;
+        info->sector_count = 71;
+        info->size = 0x01000000;  break;       /* 4 * 4 MB = 16 MB     */
+      case AMD_ID_DL323B:
+        info->flash_id += FLASH_AMDL323B;
+        info->sector_count = 71;
+        info->size = 0x01000000;  break;       /* 4 * 4 MB = 16 MB     */
       case AMD_ID_LV640U:
         info->flash_id += FLASH_AM640U;
         info->sector_count = 128;
-        info->size = 0x02000000;  break;       /* 4 * 8 MB = 32 MB        */
+        info->size = 0x02000000;  break;       /* 4 * 8 MB = 32 MB     */
       default:
         info->flash_id = FLASH_UNKNOWN;
         return( 0 );                           /* no or unknown flash     */
     }
 
-  /* set up sector start adress table (uniform sector type!) */
-  for( i = 0; i < info->sector_count; i++ )
-    info->start[i] = baseaddr + (i * 0x00040000);
+  if (flashtest_h == AMD_ID_LV640U)
+  {
+    /* set up sector start adress table (uniform sector type) */
+    for( i = 0; i < info->sector_count; i++ )
+      info->start[i] = baseaddr + (i * 0x00040000);
+  }
+  else if (info->flash_id & FLASH_BTYPE)
+  {
+    /* set up sector start adress table (bottom sector type) */
+    info->start[0] = baseaddr + 0x00000000;
+    info->start[1] = baseaddr + 0x00010000;
+    info->start[2] = baseaddr + 0x00018000;
+    info->start[3] = baseaddr + 0x00020000;
+    for( i = 4; i < info->sector_count; i++ )
+      info->start[i] = baseaddr + (i * 0x00040000) - 0x000C0000;
+  }
+  else
+  {
+    /* set up sector start adress table (top sector type) */
+    i = info->sector_count - 1;
+    info->start[i--] = baseaddr + info->size - 0x00010000;
+    info->start[i--] = baseaddr + info->size - 0x00018000;
+    info->start[i--] = baseaddr + info->size - 0x00020000;
+    for( ; i >= 0; i-- )
+      info->start[i] = baseaddr + i * 0x00040000;
+  }
 
   /* check for protected sectors */
   for( i = 0; i < info->sector_count; i++ )
@@ -122,17 +177,11 @@ unsigned long flash_init (void)
     /* Static FLASH Bank configuration here (only one bank) */
 
     size_b0 = flash_get_size(CFG_FLASH0_BASE, &flash_info[0]);
-    if (flash_info[0].flash_id == FLASH_UNKNOWN)
+    if (flash_info[0].flash_id == FLASH_UNKNOWN || size_b0 == 0)
     {
        printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
                size_b0, size_b0>>20);
     }
-    if (flash_info[0].size != (CFG_FLASH0_SIZE<<20))
-    {
-       printf ("## FLASH size on Bank 0 does not match CFG_FLASH0_SIZE: "
-               "0x%lx != 0x%x\n", flash_info[0].size,
-                                 CFG_FLASH0_SIZE<<20);
-    }
 
     /*
      * protect monitor and environment sectors
@@ -182,6 +231,30 @@ void flash_print_info  (flash_info_t *info)
 
     switch (info->flash_id & FLASH_TYPEMASK)
     {
+    case FLASH_AM800T:
+       printf ("29LV800T (8 M, top sector)\n");
+       break;
+    case FLASH_AM800B:
+       printf ("29LV800T (8 M, bottom sector)\n");
+       break;
+    case FLASH_AM160T:
+       printf ("29LV160T (16 M, top sector)\n");
+       break;
+    case FLASH_AM160B:
+       printf ("29LV160B (16 M, bottom sector)\n");
+       break;
+    case FLASH_AMDL322T:
+       printf ("29DL322T (32 M, top sector)\n");
+       break;
+    case FLASH_AMDL322B:
+       printf ("29DL322B (32 M, bottom sector)\n");
+       break;
+    case FLASH_AMDL323T:
+       printf ("29DL323T (32 M, top sector)\n");
+       break;
+    case FLASH_AMDL323B:
+       printf ("29DL323B (32 M, bottom sector)\n");
+       break;
     case FLASH_AM640U:
        printf ("29LV640D (64 M, uniform sector)\n");
        break;
index f19a6a291ee22daf8833edb6184b3f7302165821..af2245784b89d3ab1e16bf154eb59e9ac6417262 100644 (file)
@@ -132,20 +132,41 @@ static uchar default_environment[] = {
 #ifdef CONFIG_BOOTCOMMAND
        "bootcmd="      CONFIG_BOOTCOMMAND              "\0"
 #endif
-#if (CONFIG_BOOTDELAY >= 0)
+#ifdef CONFIG_RAMBOOTCOMMAND
+       "ramboot="      CONFIG_RAMBOOTCOMMAND           "\0"
+#endif
+#ifdef CONFIG_NFSBOOTCOMMAND
+       "nfsboot="      CONFIG_NFSBOOTCOMMAND           "\0"
+#endif
+#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
        "bootdelay="    MK_STR(CONFIG_BOOTDELAY)        "\0"
 #endif
-#if (CONFIG_BAUDRATE >= 0)
+#if defined(CONFIG_BAUDRATE) && (CONFIG_BAUDRATE >= 0)
        "baudrate="     MK_STR(CONFIG_BAUDRATE)         "\0"
 #endif
+#ifdef CONFIG_LOADS_ECHO
+       "loads_echo="   MK_STR(CONFIG_LOADS_ECHO)       "\0"
+#endif
 #ifdef CONFIG_ETHADDR
        "ethaddr="      MK_STR(CONFIG_ETHADDR)          "\0"
 #endif
+#ifdef CONFIG_ETH2ADDR
+       "eth2addr="     MK_STR(CONFIG_ETH2ADDR)         "\0"
+#endif
+#ifdef CONFIG_ETH3ADDR
+       "eth3addr="     MK_STR(CONFIG_ETH3ADDR)         "\0"
+#endif
 #ifdef CONFIG_IPADDR
        "ipaddr="       MK_STR(CONFIG_IPADDR)           "\0"
 #endif
 #ifdef CONFIG_SERVERIP
        "serverip="     MK_STR(CONFIG_SERVERIP)         "\0"
+#endif
+#ifdef CFG_AUTOLOAD
+       "autoload="     CFG_AUTOLOAD                    "\0"
+#endif
+#ifdef CONFIG_PREBOOT
+       "preboot="      MK_STR(CONFIG_PREBOOT)          "\0"
 #endif
        "\0"
 };
index 7769c2c8fc13d1d228f16615e40df63a282477d1..dc89d7c111ca0acf2e53b92abd8698d9ee37631e 100644 (file)
@@ -107,6 +107,11 @@ env_data:
        .ascii  "autoload="
        .ascii          CFG_AUTOLOAD
        .ascii          "\0"
+#endif
+#ifdef CONFIG_PREBOOT
+       .ascii  "preboot="
+       .ascii          MK_STR(CONFIG_PREBOOT)
+       .ascii          "\0"
 #endif
        /* terminate list of environment strings */
        .ascii  "\0"
index e6d6e9a75c0d4347240193dabf1b6c69353df937..2e938940ee8b4c289ac724d19698545b9290b117 100644 (file)
@@ -34,7 +34,7 @@
 #define PRINTF(fmt,args...)
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI)  
+#if (CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI)
 
 /* stdlib.h causes some compatibility problems; should fixe these! -- wd */
 #ifndef __ldiv_t_defined
@@ -49,7 +49,7 @@ extern ldiv_t ldiv (long int __numer, long int __denom);
 
 /* ------------------------------------------------------------------------- */
 /*
- * reports device info to the user 
+ * reports device info to the user
  */
 void dev_print(block_dev_desc_t *dev_desc)
 {
@@ -59,22 +59,35 @@ void dev_print(block_dev_desc_t *dev_desc)
                printf("not available\n");
                return;
        }
-       if(dev_desc->if_type==IF_TYPE_SCSI) 
+       if(dev_desc->if_type==IF_TYPE_SCSI)  {
                printf ("(%d:%d) ", dev_desc->target,dev_desc->lun);
-       if(dev_desc->if_type==IF_TYPE_IDE) 
-               printf ("Model: %s Firm: %s Ser#: %s\n", dev_desc->vendor,dev_desc->revision,dev_desc->product);
-       else
-               printf ("Vendor: %s Prod.: %s Rev: %s\n", dev_desc->vendor,dev_desc->product,dev_desc->revision);
-       printf("              Type: ");
+       }
+       if(dev_desc->if_type==IF_TYPE_IDE) {
+               printf ("Model: %s Firm: %s Ser#: %s\n",
+                       dev_desc->vendor,
+                       dev_desc->revision,
+                       dev_desc->product);
+       } else {
+               printf ("Vendor: %s Prod.: %s Rev: %s\n",
+                       dev_desc->vendor,
+                       dev_desc->product,
+                       dev_desc->revision);
+       }
+       printf("            Type: ");
        if(dev_desc->removable)
                printf ("Removable ");
        switch(dev_desc->type & 0x1F) {
-               case DEV_TYPE_HARDDISK: printf("Hard Disk"); break;
-               case DEV_TYPE_CDROM:            printf("CD ROM"); break;
-               case DEV_TYPE_OPDISK:   printf("Optical Device"); break;
-               case DEV_TYPE_TAPE:             printf("Tape"); break;
-               default:                                                        printf("# %02X #",dev_desc->type & 0x1F); break;
-       } 
+               case DEV_TYPE_HARDDISK: printf("Hard Disk");
+                                       break;
+               case DEV_TYPE_CDROM:    printf("CD ROM");
+                                       break;
+               case DEV_TYPE_OPDISK:   printf("Optical Device");
+                                       break;
+               case DEV_TYPE_TAPE:     printf("Tape");
+                                       break;
+               default:                printf("# %02X #", dev_desc->type & 0x1F);
+                                       break;
+       }
        printf("\n");
        if((dev_desc->lba * dev_desc->blksz)>0L) {
                lba512=(dev_desc->lba * (dev_desc->blksz/512));
@@ -86,16 +99,22 @@ void dev_print(block_dev_desc_t *dev_desc)
                gb = ldiv(10 * mb.quot + mb.rem, 10240);
                gb.rem += 512;
                gb.rem /= 1024;
-               printf ("              Capacity: %ld.%ld MB = %ld.%ld GB (%ld x %ld)\n",mb.quot, mb.rem, gb.quot, gb.rem,dev_desc->lba,dev_desc->blksz);
+               printf ("            Capacity: %ld.%ld MB = %ld.%ld GB (%ld x %ld)\n",
+                       mb.quot, mb.rem,
+                       gb.quot, gb.rem,
+                       dev_desc->lba,
+                       dev_desc->blksz);
        }
        else {
-               printf ("              Capacity: not available\n");
+               printf ("            Capacity: not available\n");
        }
 }
 
 
 
-#if defined(CONFIG_MAC_PARTITION) || defined(CONFIG_DOS_PARTITION) || defined(CONFIG_ISO_PARTITION)
+#if defined(CONFIG_MAC_PARTITION) || \
+    defined(CONFIG_DOS_PARTITION) || \
+    defined(CONFIG_ISO_PARTITION)
 
 void init_part (block_dev_desc_t * dev_desc)
 {
@@ -122,7 +141,7 @@ void init_part (block_dev_desc_t * dev_desc)
 }
 
 
-int get_partition_info (block_dev_desc_t * dev_desc, int part, disk_partition_t *info)
+int get_partition_info(block_dev_desc_t *dev_desc, int part, disk_partition_t *info)
 {
                switch(dev_desc->part_type) {
 #ifdef CONFIG_MAC_PARTITION
@@ -161,10 +180,14 @@ static void print_part_header (const char *type, block_dev_desc_t * dev_desc)
 {
        printf ("\nPartition Map for ");
        switch(dev_desc->if_type) {
-               case IF_TYPE_IDE:       printf("IDE"); break;
-               case IF_TYPE_SCSI:      printf("SCSI"); break;
-               case IF_TYPE_ATAPI:     printf("ATAPI"); break;
-               default:                                                printf("UNKNOWN"); break;
+               case IF_TYPE_IDE:       printf("IDE");
+                                       break;
+               case IF_TYPE_SCSI:      printf("SCSI");
+                                       break;
+               case IF_TYPE_ATAPI:     printf("ATAPI");
+                                       break;
+               default:                printf("UNKNOWN");
+                                       break;
        }
        printf(" device %d  --   Partition Type: %s\n\n",
                        dev_desc->dev, type);
index b5be14e9f3a32c2967f22076e73e9e005e03f22f..55c600b3178539b7197ac9eac23b6f14eb1845dc 100644 (file)
@@ -395,3 +395,21 @@ EEPROM read: addr 00050000  off 0000  count 64 ... done
 => 
 ------------------------------------------------------------------------------
 
+
+Patch per Mon, 06 Aug 2001 17:57:27:
+
+- upgraded Flash support (added support for the following chips:
+  AM29LV800T/B, AM29LV160T/B, AM29DL322T/B, AM29DL323T/B)
+- BCR tweakage for the 8260 bus mode
+- SIUMCR tweakage enabling the MI interrupt (IRQ7)
+
+To simplify switching between the bus modes, a new configuration
+option (CONFIG_BUSMODE_60x) has been added to the "config_TQM8260.h"
+file. If it is defined, BCR will be configured for the 60x mode,
+otherwise - for the 8260 mode.
+
+Concerning the SIUMCR modification: it's hard to predict whether it
+will induce any problems on the other (60x mode) board. However, the
+problems (if they appear) should be easy to notice - if the board
+does not boot, it's most likely caused by the DPPC configuration in
+SIUMCR.
index 871c33ae3574f10f2f9467a6e642877500d88044..1323d8270bba2c72dd828243126595bef8ee0417 100644 (file)
  * - "read" mode:
  *     BR4: 0x10100801         OR4: 0xffff8530
  * - "load" mode (chip select on UPM B):
- *     BR4: 0x101008c1         OR4: 0xffff8630
+ *     BR4: 0x101004c1         OR4: 0xffff8630
  *
  * Default initialization is in "read" mode
  */
 #define PUMA_CONF_READ_TIMING  (OR_G5LA | OR_BI | OR_SCY_3_CLK)
 
 #define PUMA_CONF_BR_LOAD      ((PUMA_CONF_BASE & BR_BA_MSK) | \
-                                       BR_PS_16 | BR_MS_UPMB | BR_V)
+                                       BR_PS_ | BR_MS_UPMB | BR_V)
 #define PUMA_CONF_OR_LOAD      (PUMA_CONF_OR_AM | PUMA_CONF_LOAD_TIMING)
 
 #define PUMA_CONF_BR_READ      ((PUMA_CONF_BASE & BR_BA_MSK) | BR_PS_16 | BR_V)
index 7d2c9789ef763ee8449daaa99564b47ff08802d3..011463ad0ac14271637b7a0084fd63edf6966aa0 100644 (file)
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
 #endif
 
+#define CONFIG_PREBOOT "echo;" \
+       "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
+       "echo"
+
 #undef CONFIG_BOOTARGS
 #define CONFIG_BOOTCOMMAND                                                     \
        "bootp; "                                                               \
index c12fe217f5dd5cd45858c03086977dfa7a84efeb..f3de7b0db34aab0704780da3bd60e206a87e4d7e 100644 (file)
 
 #define CONFIG_MPC8260         1       /* This is a MPC8260 CPU                */
 #define CONFIG_TQM8260         100     /* ...on a TQM8260 module Rev.100       */
+#if 0
+#define        CONFIG_BUSMODE_60x      1       /* bus mode: 60x                        */
+#else
+#undef CONFIG_BUSMODE_60x              /* bus mode: 8260                       */
+#endif
+
 #define CONFIG_82xx_CONS_SMC1  1       /* console on SMC1                      */
 
 #if 0
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
 #endif
 
+#define CONFIG_PREBOOT "echo;" \
+       "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
+       "echo"
+
 #undef CONFIG_BOOTARGS
 #define CONFIG_BOOTCOMMAND                                                     \
        "bootp; "                                                               \
  * BCR - Bus Configuration                                       4-25
  *-----------------------------------------------------------------------
  */
+#ifdef CONFIG_BUSMODE_60x
 #define CFG_BCR         (BCR_EBM|BCR_L2C|BCR_LETM|\
-                        BCR_NPQM0|BCR_NPQM1|BCR_NPQM2)
+                        BCR_NPQM0|BCR_NPQM1|BCR_NPQM2) /* 60x mode  */
+#else
+#define BCR_APD01      0x10000000
+#define CFG_BCR                (BCR_APD01|BCR_ETM|BCR_LETM)    /* 8260 mode */
+#endif
 
 /*-----------------------------------------------------------------------
  * SIUMCR - SIU Module Configuration                             4-31
  *-----------------------------------------------------------------------
  */
+#if 0
 #define CFG_SIUMCR      (SIUMCR_DPPC10|SIUMCR_APPC10)
+#else
+#define CFG_SIUMCR      (SIUMCR_DPPC00|SIUMCR_APPC10)
+#endif
 
 
 /*-----------------------------------------------------------------------
index 30f0d561c58e3a358e5baa22c8a91271b511d532..044360600337a8e1231e84809007f325bf8a97a9 100644 (file)
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
 #endif
 
+#define CONFIG_PREBOOT "echo;" \
+       "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
+       "echo"
+
 #undef CONFIG_BOOTARGS
 #define CONFIG_BOOTCOMMAND                                                     \
        "bootp; "                                                               \
index 5bcbceadeb3e52d072828b55ea0762de9a20c9a1..3b92af0e4c9a96452eb6d9d59d22c5ed76569af9 100644 (file)
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
 #endif
 
+#define CONFIG_PREBOOT "echo;" \
+       "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
+       "echo"
+
 #undef CONFIG_BOOTARGS
 #define CONFIG_BOOTCOMMAND                                                     \
        "bootp; "                                                               \
index 8b872b29226c6d4031d6f66a195bf018fdfbed7d..f6dbd6531c18f3bf48fae1dfd8fc33df5a879230 100644 (file)
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
 #endif
 
+#define CONFIG_PREBOOT "echo;" \
+       "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
+       "echo"
+
 #undef CONFIG_BOOTARGS
 #define CONFIG_BOOTCOMMAND                                                     \
        "bootp; "                                                               \
index f14b5f9c36bc327d09e7216d1ce36bf1bc178c12..1bffa0fa317662f5af6ee470a3d3ddfb5c81e7e1 100644 (file)
@@ -62,7 +62,7 @@
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #undef CFG_LOADS_BAUD_CHANGE           /* don't allow baudrate change  */
 
-#define        CONFIG_WATCHDOG                 /* watchdog disabled            */
+#define        CONFIG_WATCHDOG         1       /* watchdog enabled             */
 
 #undef CONFIG_STATUS_LED               /* Status LED disabled          */
 
index a0713cfdd39a55c26003f99f6fbb62f5520d90d0..05a81dc21b2ce426f16a15d1aa7d0608c056904e 100644 (file)
@@ -24,6 +24,6 @@
 #ifndef        __VERSION_H__
 #define        __VERSION_H__
 
-#define        PPCBOOT_VERSION "PPCBoot 1.0.4"
+#define        PPCBOOT_VERSION "PPCBoot 1.0.5"
 
 #endif /* __VERSION_H__ */
index 898c7c5a5caef665a693e960e8dff65244269b04..6e7d38de1d1e5c53330c2885bfab9adbf463cff1 100644 (file)
@@ -20,16 +20,18 @@ unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base)
 {
        unsigned long result = 0,value;
 
-       if (!base) {
-               base = 10;
-               if (*cp == '0') {
-                       base = 8;
+       if (*cp == '0') {
+               cp++;
+               if ((*cp == 'x') && isxdigit(cp[1])) {
+                       base = 16;
                        cp++;
-                       if ((*cp == 'x') && isxdigit(cp[1])) {
-                               cp++;
-                               base = 16;
-                       }
                }
+               if (!base) {
+                       base = 8;
+               }
+       }
+       if (!base) {
+               base = 10;
        }
        while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp)
            ? toupper(*cp) : *cp)-'A'+10) < base) {