Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Nov 2006 04:59:03 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 110653 for review
Message-ID:  <200611290459.kAT4x338096387@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=110653

Change 110653 by imp@imp_lighthouse on 2006/11/29 04:58:35

	Fix the counts so that the spi transfers happen as intended.

Affected files ...

.. //depot/projects/arm/src/sys/arm/at91/at91_spi.c#12 edit

Differences ...

==== //depot/projects/arm/src/sys/arm/at91/at91_spi.c#12 (text+ko) ====

@@ -223,7 +223,7 @@
 			cmd->tx_data_sz, at91_getaddr, &addr, 0) != 0)
 			goto out;
 		WR4(sc, PDC_TNPR, addr);
-		WR4(sc, PDC_TNCR, cmd->tx_cmd_sz);
+		WR4(sc, PDC_TNCR, cmd->tx_data_sz);
 		bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREWRITE);
 		mode[i++] = BUS_DMASYNC_POSTWRITE;
 	}
@@ -234,12 +234,12 @@
 	WR4(sc, PDC_RCR, cmd->tx_cmd_sz);
 	bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREREAD);
 	mode[i++] = BUS_DMASYNC_POSTREAD;
-	if (cmd->tx_data_sz > 0) {
+	if (cmd->rx_data_sz > 0) {
 		if (bus_dmamap_load(sc->dmatag, sc->map[i], cmd->rx_data,
 			cmd->tx_data_sz, at91_getaddr, &addr, 0) != 0)
 			goto out;
 		WR4(sc, PDC_RNPR, addr);
-		WR4(sc, PDC_RNCR, cmd->tx_data_sz);
+		WR4(sc, PDC_RNCR, cmd->rx_data_sz);
 		bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREREAD);
 		mode[i++] = BUS_DMASYNC_POSTREAD;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611290459.kAT4x338096387>