Date: Wed, 5 Jul 2006 22:59:44 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 100666 for review Message-ID: <200607052259.k65Mxigs079682@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=100666 Change 100666 by imp@imp_lighthouse on 2006/07/05 22:59:17 Get a silly test working. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_twi.c#17 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/Makefile#12 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/ee.c#1 add .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/ee.h#1 add .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.c#15 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/main.c#13 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_twi.c#17 (text+ko) ==== @@ -295,7 +295,7 @@ walker = buf; sc = device_get_softc(dev); AT91_TWI_LOCK(sc); - WR4(sc, TWI_MMR, TWI_MMR_MWRITE | RD4(sc, TWI_MMR)); + WR4(sc, TWI_MMR, ~TWI_MMR_MREAD & RD4(sc, TWI_MMR)); WR4(sc, TWI_CR, TWI_CR_START); sc->sc_started = 1; WR4(sc, TWI_IER, TWI_SR_TXRDY); @@ -325,7 +325,7 @@ walker = buf; sc = device_get_softc(dev); AT91_TWI_LOCK(sc); - WR4(sc, TWI_MMR, ~TWI_MMR_MWRITE & RD4(sc, TWI_MMR)); + WR4(sc, TWI_MMR, TWI_MMR_MREAD | RD4(sc, TWI_MMR)); WR4(sc, TWI_CR, TWI_CR_START); sc->sc_started = 1; WR4(sc, TWI_IER, TWI_SR_RXRDY); @@ -349,7 +349,6 @@ *walker = RD4(sc, TWI_RHR) & 0xff; if (read) *read = walker - buf; - sc->sc_started = 0; errout:; WR4(sc, TWI_IDR, TWI_SR_RXRDY); AT91_TWI_UNLOCK(sc); ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/Makefile#12 (text+ko) ==== @@ -2,7 +2,7 @@ P=bootspi FILES=${P} -SRCS=arm_init.S main.c loader_prompt.c env_vars.c +SRCS=arm_init.S main.c loader_prompt.c env_vars.c ee.c #SRCS+=ints.c mci_device.c sd-card.c stormy16-lib2.c NO_MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.c#15 (text+ko) ==== @@ -30,6 +30,7 @@ #include "lib.h" #include "spi_flash.h" #include "fpga.h" +#include "ee.h" /******************************* GLOBALS *************************************/ @@ -172,7 +173,7 @@ return (pCount); } - +#if 0 static void UpdateEEProm(int eeaddr) { @@ -184,6 +185,7 @@ printf("\r\nDownloaded %u bytes.\r\n", len); WriteEEPROM(eeaddr, 0, addr, len); } +#endif static void UpdateFlash(int offset) @@ -324,9 +326,14 @@ break; case COMMAND_REPLACE_ID_EEPROM: - printf("Updating ID EEPROM image\r\n"); - UpdateEEProm(2); + { + char buf[25]; + printf("Testing Config EEPROM\r\n"); + EEWrite(0, "This is a test", 15); + EERead(0, buf, 15); + printf("Found '%s'\r\n", buf); break; + } default: break; } ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/main.c#13 (text+ko) ==== @@ -41,11 +41,13 @@ #include "emac.h" #include "lib.h" #include "spi_flash.h" +#include "ee.h" int main(void) { printf("\r\nBoot\r\n"); + EEInit(); SPI_InitFlash(); #ifdef TSC_FPGA fpga_load();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607052259.k65Mxigs079682>