PERFORCE change 98926 for review

Warner Losh imp at FreeBSD.org
Sat Jun 10 18:11:31 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=98926

Change 98926 by imp at imp_lighthouse on 2006/06/10 18:09:18

	Initialize the SD card, load the first 16MB of the card into
	RAM and jump to it.  This is a big hack to get something that we
	can boot off of.  the SPI part is too small w/o compression, and
	compression doesn't work for large kernels (and kernels?) with big
	ram disks.

Affected files ...

.. //depot/projects/arm/src/sys/boot/arm/at91/bootsd/Makefile#2 edit
.. //depot/projects/arm/src/sys/boot/arm/at91/bootsd/main.c#2 edit

Differences ...

==== //depot/projects/arm/src/sys/boot/arm/at91/bootsd/Makefile#2 (text+ko) ====

@@ -15,3 +15,4 @@
 .if ${MK_FPGA} != "no"
 CFLAGS += -DTSC_FPGA
 .endif
+CFLAGS += -I${.CURDIR}/../bootspi

==== //depot/projects/arm/src/sys/boot/arm/at91/bootsd/main.c#2 (text+ko) ====

@@ -39,6 +39,7 @@
 #include "emac.h"
 #include "lib.h"
 #include "spi_flash.h"
+#include "sd-card.h"
 
 #ifdef TSC_FPGA
 #include "fpga.h"
@@ -73,9 +74,13 @@
 }
 #endif
 
+unsigned char mac[6] = { 0x42, 0x53, 0x44, 0, 0, 1 };
+
 int
 main(void)
 {
+	unsigned	low_addr, high_addr;
+
 	printf("\r\nTSC SD Card boot...\r\n");
 	SPI_InitFlash();
 #ifdef TSC_FPGA
@@ -86,5 +91,11 @@
 	AT91C_BASE_PIOC->PIO_SODR = AT91C_PIO_PC7;
 #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)();
 	return (1);
 }


More information about the p4-projects mailing list