Date: Mon, 3 Jul 2006 23:02:17 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 100529 for review Message-ID: <200607032302.k63N2Hpd049927@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=100529 Change 100529 by imp@imp_lighthouse on 2006/07/03 23:01:39 Mark flags as volatile better interface. need more info to start than is available in the start bus interface command... Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_twi.c#15 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_twi.c#15 (text+ko) ==== @@ -52,7 +52,7 @@ struct resource *irq_res; /* IRQ resource */ struct resource *mem_res; /* Memory resource */ struct mtx sc_mtx; /* basically a perimeter lock */ - int flags; + volatile int flags; #define RXRDY 4 #define TXRDY 0x10 uint32_t cwgr; @@ -268,8 +268,6 @@ sc = device_get_softc(dev); WR4(sc, TWI_MMR, TWI_MMR_DADR(slave)); - WR4(sc, TWI_CR, TWI_CR_START); - sc->sc_started = 1; return (0); } @@ -283,7 +281,6 @@ sc = device_get_softc(dev); WR4(sc, TWI_MMR, TWI_MMR_DADR(slave)); - WR4(sc, TWI_CR, TWI_CR_START); sc->sc_started = 1; return (0); } @@ -297,8 +294,10 @@ walker = buf; sc = device_get_softc(dev); + AT91_TWI_LOCK(sc); WR4(sc, TWI_MMR, TWI_MMR_MWRITE | RD4(sc, TWI_MMR)); - AT91_TWI_LOCK(sc); + WR4(sc, TWI_CR, TWI_CR_START); + sc->sc_started = 1; WR4(sc, TWI_IER, TWI_SR_TXRDY); while (len--) { WR4(sc, TWI_THR, *walker++); @@ -327,6 +326,8 @@ sc = device_get_softc(dev); AT91_TWI_LOCK(sc); WR4(sc, TWI_MMR, ~TWI_MMR_MWRITE & RD4(sc, TWI_MMR)); + WR4(sc, TWI_CR, TWI_CR_START); + sc->sc_started = 1; WR4(sc, TWI_IER, TWI_SR_RXRDY); while (len-- > 0) { err = 0;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607032302.k63N2Hpd049927>