From: wdenk Date: Mon, 2 Jul 2001 17:21:40 +0000 (+0000) Subject: * Fix bug in calculation of initrd size X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=998fa1deca61b35a6b0c630ba245506a4f10ba74;p=users%2Frw%2Fppcboot.git * Fix bug in calculation of initrd size Patch by Hannes Fertala, 2 Jul 2001 * Fix bug in environment offset handling (when environment starts not at the beginning of EEPROM). --- diff --git a/CHANGELOG b/CHANGELOG index f9c6cab..de84b22 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -52,6 +52,16 @@ To do: * "last user address" is set even if bootp is used without parameters (and it uses default address). +====================================================================== +Modifications for 1.0.2: +====================================================================== + +* Fix bug in calculation of initrd size + Patch by Hannes Fertala, 2 Jul 2001 + +* Fix bug in environment offset handling + (when environment starts not at the beginning of EEPROM). + ====================================================================== Modifications for 1.0.1: ====================================================================== diff --git a/board/evb64260/pci.c b/board/evb64260/pci.c index b1b97bb..5bd4629 100644 --- a/board/evb64260/pci.c +++ b/board/evb64260/pci.c @@ -4,7 +4,7 @@ #include #include -#include +#include /******************************************************************** * pci0ScanDevices - This function scan PCI0 bus, if found any device on diff --git a/board/pcu_e/flash.c b/board/pcu_e/flash.c index 6dd5dec..e63db12 100644 --- a/board/pcu_e/flash.c +++ b/board/pcu_e/flash.c @@ -652,6 +652,11 @@ static int write_data (flash_info_t *info, ulong dest, ulong data) addr[0x02AA] = 0x0055; addr[0x0555] = 0x00A0; +#ifdef WORKAROUND_FOR_BROKEN_HARDWARE + /* work around the timeout bugs */ + udelay(20); +#endif + *sdest = sdata; /* re-enable interrupts if necessary */ diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 0fe3e74..f38f6f5 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -444,7 +444,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[], nsp &= ~0xF; if (nsp > initrd_high) /* limit as specified */ nsp = initrd_high; - nsp -= hdr->ih_size; + nsp -= len; nsp &= ~(4096 - 1); /* align on page */ if (nsp >= sp) initrd_start = nsp; @@ -456,7 +456,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[], printf ("## initrd at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n", data, data + len - 1, len, len); #endif - initrd_end = initrd_start + hdr->ih_size; + initrd_end = initrd_start + len; printf (" Loading Ramdisk to %08lx, end %08lx ... ", initrd_start, initrd_end); memmove ((void *)initrd_start, (void *)data, len); diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index ca902c0..7aba859 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -226,7 +226,9 @@ void env_relocate (ulong offset) DEBUGF ("%s[%d] ENV is valid\n", __FUNCTION__,__LINE__); # if defined(CFG_ENV_IS_IN_EEPROM) DEBUGF ("%s[%d] read ENV from EEPROM\n", __FUNCTION__,__LINE__); - eeprom_read (offsetof(env_t,data), env_ptr->data, ENV_SIZE); + eeprom_read (CFG_ENV_OFFSET+offsetof(env_t,data), + env_ptr->data, + ENV_SIZE); # else DEBUGF ("%s[%d] read ENV from NVRAM/FLASH\n",__FUNCTION__,__LINE__); memcpy (env_ptr->data, @@ -277,7 +279,7 @@ static uchar get_env_char_eeprom (int index) /* if the EEPROM crc was bad, use the default environment */ if (idata->env_valid) - eeprom_read (index+offsetof(env_t,data), &c, 1); + eeprom_read (CFG_ENV_OFFSET+index+offsetof(env_t,data), &c, 1); else c = default_environment[index]; @@ -813,7 +815,8 @@ void env_init(init_data_t *idata) eeprom_init (); /* prepare for EEPROM read/write */ /* read old CRC */ - eeprom_read (offsetof(env_t,crc), (uchar *)&crc, sizeof(ulong)); + eeprom_read (CFG_ENV_OFFSET+offsetof(env_t,crc), (uchar *)&crc, + sizeof(ulong)); new = 0; len = ENV_SIZE; @@ -821,7 +824,7 @@ void env_init(init_data_t *idata) while (len > 0) { int n = (len > sizeof(buf)) ? sizeof(buf) : len; - eeprom_read (off, buf, n); + eeprom_read (CFG_ENV_OFFSET+off, buf, n); new = crc32 (new, buf, n); len -= n; off += n; diff --git a/cpu/mpc8xx/soft_i2c.c b/cpu/mpc8xx/soft_i2c.c index 2c50f8a..9d8b81a 100644 --- a/cpu/mpc8xx/soft_i2c.c +++ b/cpu/mpc8xx/soft_i2c.c @@ -307,7 +307,7 @@ void i2c_init (int speed, int slaveaddr) * len: number of bytes to read * Warning: it is expected that the device is really * capable of reading `len' sequential bytes; no - * checking is doen here + * checking is done here */ void i2c_read (uchar *addr, int alen, uchar *buffer, int len) { diff --git a/include/config_EVB64260.h b/include/config_EVB64260.h index 9476a56..0922b36 100644 --- a/include/config_EVB64260.h +++ b/include/config_EVB64260.h @@ -98,12 +98,12 @@ #define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAULT | \ CONFIG_BOOTP_BOOTFILESIZE) -#if 0 +#if 1 #define CONFIG_COMMANDS (CFG_CMD_ALL & ~(CFG_CMD_KGDB | CFG_CMD_IDE \ | CFG_CMD_PCMCIA | CFG_CMD_PCI \ | CFG_CMD_EEPROM | CFG_CMD_DATE)) #else -#define CONFIG_COMMANDS CFG_CMD_DFL +#define CONFIG_COMMANDS CONFIG_CMD_DFL #endif /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ diff --git a/include/config_pcu_e.h b/include/config_pcu_e.h index 1b271a5..69acb80 100644 --- a/include/config_pcu_e.h +++ b/include/config_pcu_e.h @@ -218,7 +218,7 @@ #else /* Final version: environment in EEPROM */ #define CFG_ENV_IS_IN_EEPROM 1 -#define CFG_ENV_OFFSET 0 +#define CFG_ENV_OFFSET 1024 #define CFG_ENV_SIZE 1024 #endif