Date: Fri, 28 Apr 2006 22:58:04 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 96336 for review Message-ID: <200604282258.k3SMw4QY035463@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96336 Change 96336 by imp@imp_hammer on 2006/04/28 22:57:39 demo fpga loading progarm. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/boot0spi/main.c#8 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/boot0spi/main.c#8 (text) ==== @@ -29,27 +29,48 @@ #include "p_string.h" #include "at91rm9200_lowlevel.h" #include "spi_flash.h" +#include "fpga.h" +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 +}; + + int main(void) { int len; char *addr = (char *)SDRAM_BASE + (1 << 20); /* Load to base + 1MB */ +#if 0 char *addr2 = (char *)SDRAM_BASE + (2 << 20); /* Load to base + 2MB */ char *addr3 = (char *)SDRAM_BASE + (3 << 20); /* Load to base + 2MB */ +#endif SPI_InitFlash(); +#if 0 while ((len = xmodem_rx(addr)) == -1) continue; printf("Downloaded %u bytes.\r\n", len); p_memcpy(addr3, addr, len); printf("Writing %u bytes to flash\r\n", len); - SPI_WriteFlash(0, addr, len); + SPI_WriteFlash(15 * FLASH_PAGE_SIZE, addr, len); printf("Reading back %u bytes from flash\r\n", len); - SPI_ReadFlash(0, addr2, len); + SPI_ReadFlash(15 * FLASH_PAGE_SIZE, addr2, len); if (p_memcmp(addr3, addr2, len) != 0) printf("Readback failed\r\n"); else printf("Readback OK\r\n"); +#else + len = 212482; + SPI_ReadFlash(15 * FLASH_PAGE_SIZE, addr, len); + fpga_init(&main_fpga); + fpga_clear(&main_fpga); + fpga_write_bytes(&main_fpga, addr, len); + fpga_done(&main_fpga); +#endif return (1); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604282258.k3SMw4QY035463>