* "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:
======================================================================
#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
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 */
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;
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);
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,
/* 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];
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;
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;
* 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)
{
#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) */
#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