Date: Sat, 10 Jun 2006 18:09:24 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 98926 for review Message-ID: <200606101809.k5AI9O3A070538@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=98926 Change 98926 by imp@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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606101809.k5AI9O3A070538>
