Date: Thu, 27 Apr 2006 22:44:33 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 96268 for review Message-ID: <200604272244.k3RMiXg5056875@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96268 Change 96268 by imp@imp_hammer on 2006/04/27 22:44:03 Now that we can write to the SPI flash, kill debugging code. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/boot0spi/main.c#7 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/boot0spi/main.c#7 (text) ==== @@ -33,47 +33,23 @@ int main(void) { + int len; char *addr = (char *)SDRAM_BASE + (1 << 20); /* Load to base + 1MB */ - int len, i; -#if 1 char *addr2 = (char *)SDRAM_BASE + (2 << 20); /* Load to base + 2MB */ char *addr3 = (char *)SDRAM_BASE + (3 << 20); /* Load to base + 2MB */ -#endif -// unsigned this_sec; SPI_InitFlash(); -#if 0 while ((len = xmodem_rx(addr)) == -1) continue; -#else - len = FLASH_PAGE_SIZE; - for (i = 0; i < FLASH_PAGE_SIZE; i++) - addr[i] = i * 3; - SPI_GetId(&i); - printf("I is %x\r\n", i); -#endif -#if 1 -// while (1) { - p_memcpy(addr3, addr, len); - printf("Writing %u bytes to flash\r\n", len); - SPI_WriteFlash(FLASH_PAGE_SIZE, addr, len); - printf("Reading back %u bytes from flash\r\n", len); - SPI_ReadFlash(FLASH_PAGE_SIZE, addr2, len); - if (p_memcmp(addr3, addr2, len) != 0) { - printf("Readback failed:\r\n"); - for (i = 0; i < 75; i++) - printf("%x ", addr3[i]); - printf("\r\n----------\r\n"); - for (i = 0; i < 75; i++) - printf("%x ", addr2[i]); - printf("\r\n"); - } else - printf("Readback OK\r\n"); -// this_sec = GetSeconds() + 1; -// while (GetSeconds() < this_sec) -// continue; -// } - reset(); -#endif + 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); + printf("Reading back %u bytes from flash\r\n", len); + SPI_ReadFlash(0, addr2, len); + if (p_memcmp(addr3, addr2, len) != 0) + printf("Readback failed\r\n"); + else + printf("Readback OK\r\n"); return (1); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604272244.k3RMiXg5056875>