]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
* Fix bug in calculation of initrd size
authorwdenk <wdenk>
Mon, 2 Jul 2001 17:21:40 +0000 (17:21 +0000)
committerwdenk <wdenk>
Mon, 2 Jul 2001 17:21:40 +0000 (17:21 +0000)
  Patch by Hannes Fertala, 2 Jul 2001

* Fix bug in environment offset handling
  (when environment starts not at the beginning of EEPROM).

CHANGELOG
board/evb64260/pci.c
board/pcu_e/flash.c
common/cmd_bootm.c
common/cmd_nvedit.c
cpu/mpc8xx/soft_i2c.c
include/config_EVB64260.h
include/config_pcu_e.h

index f9c6cab999730efbeb3c41f6aededc75f66e08f4..de84b22800f1108982c86a558c321f2fbf41609a 100644 (file)
--- 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:
 ======================================================================
index b1b97bbdf8626ee9d789b118677368effedcb095..5bd4629e53c9e3382af589b960f1d2f4c5a6145a 100644 (file)
@@ -4,7 +4,7 @@
 
 #include <galileo/core.h>
 #include <galileo/pci.h>
-#include <string.h>
+#include <linux/string.h>
 
 /********************************************************************
 * pci0ScanDevices   - This function scan PCI0 bus, if found any device on
index 6dd5decac90eff8630cb9cb4fb21725e62444187..e63db1246b7220c2df1f890526bcf55d64fbf6e0 100644 (file)
@@ -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 */
index 0fe3e74ddb70ef000c35c1db619493669685a2fc..f38f6f5b8e55b8aa0a196be3bf55790d845fc626 100644 (file)
@@ -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);
index ca902c05bb92605c0010d1d6f817b7be66dff6d8..7aba8595b102b5ce64d06447516114ef4282f57a 100644 (file)
@@ -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;
index 2c50f8a231af54ed3bc221655d2016cc3e2d729d..9d8b81a289f7edf41bd5ce4a3e8ac621a10f4f99 100644 (file)
@@ -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)
 {
index 9476a566dc20a2ed351761ea5968c683788988e2..0922b360fa66bffc1416284b27640238138450f8 100644 (file)
 #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) */
index 1b271a521a79bb97506aa6cdc04b8062aa9e1728..69acb80a21eae3aeb2502ab19bca16de6f570f43 100644 (file)
 #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