PERFORCE change 99265 for review
Warner Losh
imp at FreeBSD.org
Wed Jun 14 23:50:36 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=99265
Change 99265 by imp at imp_lighthouse on 2006/06/14 23:49:59
Enough random hacks to get ramMonitor loading on the TCS board
from the sd card.
Affected files ...
.. //depot/projects/arm/src/sys/boot/arm/at91/bootsd/main.c#3 edit
Differences ...
==== //depot/projects/arm/src/sys/boot/arm/at91/bootsd/main.c#3 (text+ko) ====
@@ -76,26 +76,44 @@
unsigned char mac[6] = { 0x42, 0x53, 0x44, 0, 0, 1 };
+#define REAL
int
main(void)
{
unsigned low_addr, high_addr;
+#ifdef REAL
+ int i;
+#endif
- printf("\r\nTSC SD Card boot...\r\n");
+ printf("\r\nTSC boot...\r\n");
SPI_InitFlash();
#ifdef TSC_FPGA
+ printf("Loading FPGA...");
AT91C_BASE_PIOC->PIO_PER = AT91C_PIO_PC7;
AT91C_BASE_PIOC->PIO_OER = AT91C_PIO_PC7;
AT91C_BASE_PIOC->PIO_CODR = AT91C_PIO_PC7;
fpga_load();
AT91C_BASE_PIOC->PIO_SODR = AT91C_PIO_PC7;
+ printf("done\r\n");
#endif
EMAC_Init();
sdcard_init();
low_addr = (mac[3] << 24) | (mac[2] << 16) | (mac[1] << 8) | mac[0];
high_addr = (mac[5] << 8) | mac[4];
SetMACAddress(low_addr, high_addr);
- MCI_read((char *)0x20000000, 0, 16 << 20);
- ((void(*)())0x20000000)();
+ printf("Reading from card...");
+#ifdef REAL
+ for (i = 0; i < 7; i++)
+ {
+ MCI_read((char *)0x20000000 + ((i + 1) << 20), i << 20, 1 << 20);
+ printf("*");
+ }
+ printf("\r\nStarting...\r\n");
+ ((void(*)())(0x20000000 + (1 << 20)))();
+#else
+ MCI_read((char *)0x20000000, 0, 1 << 20);
+ printf("Found %s\r\n", (char *)0x20000000);
+ while (1);
+#endif
return (1);
}
More information about the p4-projects
mailing list