21 EERead(0, (uint8_t *)&sig, sizeof(sig));
22 if (sig != 0xaa55aa55)
25 EERead(48+5, mac+3, 3);
34 printf("MAC %x:%x:%x:%x:%x:%x\n", mac[0],
35 mac[1], mac[2], mac[3], mac[4], mac[5]);
39 #define FLASH_OFFSET (0 * FLASH_PAGE_SIZE)
40 #define KERNEL_OFFSET (220 * FLASH_PAGE_SIZE)
41 #define KERNEL_LEN (6 * 1024 * FLASH_PAGE_SIZE)
44 UpdateFlash(int offset)
46 char *addr = (char *)0x20000000 + (1 << 20); /* Load to base + 1MB */
49 while ((len = xmodem_rx(addr)) == -1)
51 printf("\nDownloaded %u bytes.\n", len);
52 for (i = 0; i < len; i+= FLASH_PAGE_SIZE) {
54 SPI_WriteFlash(off, addr + i, FLASH_PAGE_SIZE);
60 UpdateFlash(FLASH_OFFSET);
77 EMAC_SetMACAddress(mac);
81 #include "../bootspi/ee.c"
84 drvread(void *buf, unsigned lba, unsigned nblk)
86 return (MCI_read((char *)buf, lba << 9, nblk << 9));