Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/broadcom Only use 128-bit mode when the transfe...
details: https://anonhg.NetBSD.org/src/rev/95a8c6fac3bc
branches: trunk
changeset: 333998:95a8c6fac3bc
user: skrll <skrll%NetBSD.org@localhost>
date: Tue Nov 25 14:30:05 2014 +0000
description:
Only use 128-bit mode when the transfer is a multiple of this.
>From Jared (the arm periph guy)
diffstat:
sys/arch/arm/broadcom/bcm2835_emmc.c | 27 +++++++++++++++++++++------
1 files changed, 21 insertions(+), 6 deletions(-)
diffs (64 lines):
diff -r cd415c68effd -r 95a8c6fac3bc sys/arch/arm/broadcom/bcm2835_emmc.c
--- a/sys/arch/arm/broadcom/bcm2835_emmc.c Tue Nov 25 13:42:31 2014 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_emmc.c Tue Nov 25 14:30:05 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_emmc.c,v 1.19 2014/10/04 18:10:04 jmcneill Exp $ */
+/* $NetBSD: bcm2835_emmc.c,v 1.20 2014/11/25 14:30:05 skrll Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.19 2014/10/04 18:10:04 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.20 2014/11/25 14:30:05 skrll Exp $");
#include "bcmdmac.h"
@@ -248,9 +248,21 @@
for (seg = 0; seg < cmd->c_dmamap->dm_nsegs; seg++) {
sc->sc_cblk[seg].cb_ti =
__SHIFTIN(11, DMAC_TI_PERMAP); /* e.MMC */
+ sc->sc_cblk[seg].cb_txfr_len =
+ cmd->c_dmamap->dm_segs[seg].ds_len;
+ /*
+ * All transfers are assumed to be multiples of 32-bits.
+ */
+ KASSERTMSG((sc->sc_cblk[seg].cb_txfr_len & 0x3) == 0,
+ "seg %zu len %d", seg, sc->sc_cblk[seg].cb_txfr_len);
if (ISSET(cmd->c_flags, SCF_CMD_READ)) {
sc->sc_cblk[seg].cb_ti |= DMAC_TI_DEST_INC;
- sc->sc_cblk[seg].cb_ti |= DMAC_TI_DEST_WIDTH;
+ /*
+ * Use 128-bit mode if transfer is a multiple of
+ * 16-bytes.
+ */
+ if ((sc->sc_cblk[seg].cb_txfr_len & 0xf) == 0)
+ sc->sc_cblk[seg].cb_ti |= DMAC_TI_DEST_WIDTH;
sc->sc_cblk[seg].cb_ti |= DMAC_TI_SRC_DREQ;
sc->sc_cblk[seg].cb_source_ad =
BCM2835_PERIPHERALS_TO_BUS(sc->sc_physaddr +
@@ -259,7 +271,12 @@
cmd->c_dmamap->dm_segs[seg].ds_addr;
} else {
sc->sc_cblk[seg].cb_ti |= DMAC_TI_SRC_INC;
- sc->sc_cblk[seg].cb_ti |= DMAC_TI_SRC_WIDTH;
+ /*
+ * Use 128-bit mode if transfer is a multiple of
+ * 16-bytes.
+ */
+ if ((sc->sc_cblk[seg].cb_txfr_len & 0xf) == 0)
+ sc->sc_cblk[seg].cb_ti |= DMAC_TI_SRC_WIDTH;
sc->sc_cblk[seg].cb_ti |= DMAC_TI_DEST_DREQ;
sc->sc_cblk[seg].cb_source_ad =
cmd->c_dmamap->dm_segs[seg].ds_addr;
@@ -267,8 +284,6 @@
BCM2835_PERIPHERALS_TO_BUS(sc->sc_physaddr +
SDHC_DATA);
}
- sc->sc_cblk[seg].cb_txfr_len =
- cmd->c_dmamap->dm_segs[seg].ds_len;
sc->sc_cblk[seg].cb_stride = 0;
if (seg == cmd->c_dmamap->dm_nsegs - 1) {
sc->sc_cblk[seg].cb_ti |= DMAC_TI_WAIT_RESP;
Home |
Main Index |
Thread Index |
Old Index