From owner-p4-projects@FreeBSD.ORG Wed Jul 5 22:59:45 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 57CBA16A50C; Wed, 5 Jul 2006 22:59:45 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2AB9516A506 for ; Wed, 5 Jul 2006 22:59:45 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C8B2943D45 for ; Wed, 5 Jul 2006 22:59:44 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k65Mxi8D079685 for ; Wed, 5 Jul 2006 22:59:44 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k65Mxigs079682 for perforce@freebsd.org; Wed, 5 Jul 2006 22:59:44 GMT (envelope-from imp@freebsd.org) Date: Wed, 5 Jul 2006 22:59:44 GMT Message-Id: <200607052259.k65Mxigs079682@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 100666 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jul 2006 22:59:45 -0000 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();