* "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:
======================================================================
* (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
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++ )
/* 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
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;
#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"
};
.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"
#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
/* ------------------------------------------------------------------------- */
/*
- * reports device info to the user
+ * reports device info to the user
*/
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));
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)
{
}
-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
{
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);
=>
------------------------------------------------------------------------------
+
+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.
* - "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_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)
#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; " \
#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
/*-----------------------------------------------------------------------
#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; " \
#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; " \
#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; " \
#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 */
#ifndef __VERSION_H__
#define __VERSION_H__
-#define PPCBOOT_VERSION "PPCBoot 1.0.4"
+#define PPCBOOT_VERSION "PPCBoot 1.0.5"
#endif /* __VERSION_H__ */
{
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) {