From: wdenk Date: Wed, 8 Aug 2001 00:17:55 +0000 (+0000) Subject: * allow 0x... prefix on input X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=afbcd26bad6ffd81e53d976c2f24a2a8b60ccb15;p=users%2Frw%2Fppcboot.git * 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. --- diff --git a/CHANGELOG b/CHANGELOG index 0e6217b..7fd546e 100644 --- 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: ====================================================================== diff --git a/board/tqm8260/flash.c b/board/tqm8260/flash.c index 50c2559..abc8849 100644 --- a/board/tqm8260/flash.c +++ b/board/tqm8260/flash.c @@ -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; diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index f19a6a2..af22457 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -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" }; diff --git a/common/environment.S b/common/environment.S index 7769c2c..dc89d7c 100644 --- a/common/environment.S +++ b/common/environment.S @@ -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" diff --git a/disk/part.c b/disk/part.c index e6d6e9a..2e93894 100644 --- a/disk/part.c +++ b/disk/part.c @@ -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); diff --git a/doc/README.TQM8260 b/doc/README.TQM8260 index b5be14e..55c600b 100644 --- a/doc/README.TQM8260 +++ b/doc/README.TQM8260 @@ -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. diff --git a/include/config_CCM.h b/include/config_CCM.h index 871c33a..1323d82 100644 --- a/include/config_CCM.h +++ b/include/config_CCM.h @@ -362,7 +362,7 @@ * - "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 */ @@ -372,7 +372,7 @@ #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_8 | 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) diff --git a/include/config_TQM823L.h b/include/config_TQM823L.h index 7d2c978..011463a 100644 --- a/include/config_TQM823L.h +++ b/include/config_TQM823L.h @@ -48,6 +48,10 @@ #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; " \ diff --git a/include/config_TQM8260.h b/include/config_TQM8260.h index c12fe21..f3de7b0 100644 --- a/include/config_TQM8260.h +++ b/include/config_TQM8260.h @@ -35,6 +35,12 @@ #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 @@ -43,6 +49,10 @@ #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; " \ @@ -276,14 +286,23 @@ * 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 /*----------------------------------------------------------------------- diff --git a/include/config_TQM850L.h b/include/config_TQM850L.h index 30f0d56..0443606 100644 --- a/include/config_TQM850L.h +++ b/include/config_TQM850L.h @@ -48,6 +48,10 @@ #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; " \ diff --git a/include/config_TQM855L.h b/include/config_TQM855L.h index 5bcbcea..3b92af0 100644 --- a/include/config_TQM855L.h +++ b/include/config_TQM855L.h @@ -48,6 +48,10 @@ #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; " \ diff --git a/include/config_TQM860L.h b/include/config_TQM860L.h index 8b872b2..f6dbd65 100644 --- a/include/config_TQM860L.h +++ b/include/config_TQM860L.h @@ -48,6 +48,10 @@ #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; " \ diff --git a/include/config_lwmon.h b/include/config_lwmon.h index f14b5f9..1bffa0f 100644 --- a/include/config_lwmon.h +++ b/include/config_lwmon.h @@ -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 */ diff --git a/include/version.h b/include/version.h index a0713cf..05a81dc 100644 --- a/include/version.h +++ b/include/version.h @@ -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__ */ diff --git a/ppc/vsprintf.c b/ppc/vsprintf.c index 898c7c5..6e7d38d 100644 --- a/ppc/vsprintf.c +++ b/ppc/vsprintf.c @@ -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) {