Date: Tue, 5 Sep 2006 22:34:44 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 105703 for review Message-ID: <200609052234.k85MYiFW020384@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=105703 Change 105703 by imp@imp_lighthouse on 2006/09/05 22:34:21 Load that thar FPGA Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#11 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#11 (text+ko) ==== @@ -186,6 +186,47 @@ } } +#ifdef BOOT_TSC +#define TSC_FPGA +#endif + +#ifdef TSC_FPGA +#include "at91rm9200.h" +#include "spi_flash.h" +#include "fpga.h" + +#define FPGA_OFFSET (15 * FLASH_PAGE_SIZE) +#define FPGA_LEN (212608) + +char buffer[FPGA_LEN]; + +const struct fpga main_fpga = +{ + AT91C_BASE_PIOB, AT91C_PIO_PB0, + AT91C_BASE_PIOC, AT91C_PIO_PC11, + AT91C_BASE_PIOB, AT91C_PIO_PB2, + AT91C_BASE_PIOC, AT91C_PIO_PC12 +}; + +void +fpga_load(void) +{ + int len, off, i, offset; + char *addr = buffer; + + len = FPGA_LEN; + offset = FPGA_OFFSET; + for (i = 0; i < len; i+= FLASH_PAGE_SIZE) { + off = i + offset; + SPI_ReadFlash(off, addr + i, FLASH_PAGE_SIZE); + } + fpga_init(&main_fpga); + fpga_clear(&main_fpga); + fpga_write_bytes(&main_fpga, addr, len); + fpga_done(&main_fpga); +} +#endif + int main(void) { @@ -195,6 +236,12 @@ if (kname[0]) printf("bss not zero\r\n"); +#ifdef TSC_FPGA + SPI_InitFlash(); + printf("Loading FPGA..."); + fpga_load(); + printf("done\r\n"); +#endif EMAC_Init(); sdcard_init(); EMAC_SetMACAddress(mac);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609052234.k85MYiFW020384>