Module Name: src
Committed By: jmcneill
Date: Thu Jun 7 00:39:27 UTC 2018
Modified Files:
src/sys/arch/arm/sunxi: sunxi_mmc.c
Log Message:
Disable HS200 and DDR52 on A64 eMMC for now, and use len=0 for max length
transfers.
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/sunxi/sunxi_mmc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/arm/sunxi/sunxi_mmc.c
diff -u src/sys/arch/arm/sunxi/sunxi_mmc.c:1.24 src/sys/arch/arm/sunxi/sunxi_mmc.c:1.25
--- src/sys/arch/arm/sunxi/sunxi_mmc.c:1.24 Mon May 21 22:04:27 2018
+++ src/sys/arch/arm/sunxi/sunxi_mmc.c Thu Jun 7 00:39:27 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_mmc.c,v 1.24 2018/05/21 22:04:27 jmcneill Exp $ */
+/* $NetBSD: sunxi_mmc.c,v 1.25 2018/06/07 00:39:27 jmcneill Exp $ */
/*-
* Copyright (c) 2014-2017 Jared McNeill <[email protected]>
@@ -29,7 +29,7 @@
#include "opt_sunximmc.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.24 2018/05/21 22:04:27 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.25 2018/06/07 00:39:27 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -254,8 +254,7 @@ static const struct sunxi_mmc_config sun
.idma_xferlen = 0x2000,
.dma_ftrglevel = 0x20070008,
.delays = NULL,
- .flags = SUNXI_MMC_FLAG_CALIB_REG |
- SUNXI_MMC_FLAG_HS200,
+ .flags = SUNXI_MMC_FLAG_CALIB_REG,
};
static const struct sunxi_mmc_config sun50i_h6_mmc_config = {
@@ -554,10 +553,14 @@ sunxi_mmc_attach_i(device_t self)
SMC_CAPS_AUTO_STOP |
SMC_CAPS_SD_HIGHSPEED |
SMC_CAPS_MMC_HIGHSPEED |
- SMC_CAPS_MMC_DDR52 |
SMC_CAPS_POLLING;
+
+ if (sc->sc_config->delays || (flags & SUNXI_MMC_FLAG_NEW_TIMINGS))
+ saa.saa_caps |= SMC_CAPS_MMC_DDR52;
+
if (flags & SUNXI_MMC_FLAG_HS200)
saa.saa_caps |= SMC_CAPS_MMC_HS200;
+
if (width == 4)
saa.saa_caps |= SMC_CAPS_4BIT_MODE;
if (width == 8)
@@ -967,7 +970,8 @@ sunxi_mmc_dma_prepare(struct sunxi_mmc_s
if (desc == sc->sc_idma_ndesc)
break;
len = min(sc->sc_config->idma_xferlen, resid);
- dma[desc].dma_buf_size = htole32(len);
+ dma[desc].dma_buf_size =
+ htole32(len == sc->sc_config->idma_xferlen ? 0 : len);
dma[desc].dma_buf_addr = htole32(paddr + off);
dma[desc].dma_config = htole32(SUNXI_MMC_IDMA_CONFIG_CH |
SUNXI_MMC_IDMA_CONFIG_OWN);