MFp4: Don't fix the size at 8k, and some minor cleanups. andre@ contributed

to fixing this problem.
This commit is contained in:
Warner Losh 2006-11-16 00:49:50 +00:00
parent b9f3efc87a
commit a2288572aa

View File

@ -32,12 +32,19 @@ int
main(void)
{
char *addr = (char *)SDRAM_BASE + (1 << 20); /* Load to base + 1MB */
int len, sec;
while (xmodem_rx(addr) == -1)
printf("\nSend data to be written into EEPROM\n");
while ((len = xmodem_rx(addr)) == -1)
continue;
sec = GetSeconds() + 1;
while (sec >= GetSeconds())
continue;
printf("\nWriting EEPROM from 0x%x to addr 0, 0x%x bytes\n", addr,
len);
InitEEPROM();
printf("Writing EEPROM from 0x%x to addr 0\n", addr);
WriteEEPROM(0, addr, 8192);
printf("Write complete. Press reset\n");
printf("init done\n");
WriteEEPROM(0, addr, len);
printf("\nWrote %d bytes. Press reset\n", len);
return (1);
}