summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2017-05-05 15:10:08 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2017-05-05 15:10:08 +0000
commit97f312d6506cec9c05d150482378eb6e09e824d6 (patch)
tree17a4d247df71d66c9723426da1aa3cd8934627c1
parent97a60ad4defbad0f2117f9dd5b2e877c4ba954ff (diff)
Implement two quirks to support the Arasan eMMC 5.1 controller found on
the Rockchip RK3399. - Make it possible to override sdhc_signal_voltage(). - Make it possible to disable double-data rate modes. ok patrick@
-rw-r--r--sys/dev/sdmmc/sdhc.c9
-rw-r--r--sys/dev/sdmmc/sdhcvar.h4
2 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/sdmmc/sdhc.c b/sys/dev/sdmmc/sdhc.c
index ca8fbaa4bc4..c242a600d4a 100644
--- a/sys/dev/sdmmc/sdhc.c
+++ b/sys/dev/sdmmc/sdhc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdhc.c,v 1.54 2017/04/06 03:15:29 deraadt Exp $ */
+/* $OpenBSD: sdhc.c,v 1.55 2017/05/05 15:10:07 kettenis Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -25,6 +25,7 @@
#include <sys/device.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
+#include <sys/proc.h>
#include <sys/systm.h>
#include <dev/sdmmc/sdhcreg.h>
@@ -317,6 +318,9 @@ sdhc_host_found(struct sdhc_softc *sc, bus_space_tag_t iot,
saa.caps |= SMC_CAPS_MMC_DDR52;
}
+ if (ISSET(sc->sc_flags, SDHC_F_NODDR50))
+ saa.caps &= ~SMC_CAPS_MMC_DDR52;
+
hp->sdmmc = config_found(&sc->sc_dev, &saa, NULL);
if (hp->sdmmc == NULL) {
error = 0;
@@ -684,6 +688,9 @@ sdhc_signal_voltage(sdmmc_chipset_handle_t sch, int signal_voltage)
{
struct sdhc_host *hp = sch;
+ if (hp->sc->sc_signal_voltage)
+ return hp->sc->sc_signal_voltage(hp->sc, signal_voltage);
+
if (SDHC_SPEC_VERSION(hp->version) < SDHC_SPEC_V3)
return EINVAL;
diff --git a/sys/dev/sdmmc/sdhcvar.h b/sys/dev/sdmmc/sdhcvar.h
index e6a419e2719..9d4d759a2bc 100644
--- a/sys/dev/sdmmc/sdhcvar.h
+++ b/sys/dev/sdmmc/sdhcvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdhcvar.h,v 1.9 2016/04/30 11:32:23 kettenis Exp $ */
+/* $OpenBSD: sdhcvar.h,v 1.10 2017/05/05 15:10:07 kettenis Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -32,6 +32,7 @@ struct sdhc_softc {
bus_dma_tag_t sc_dmat;
int (*sc_card_detect)(struct sdhc_softc *);
+ int (*sc_signal_voltage)(struct sdhc_softc *, int);
};
/* Host controller functions called by the attachment driver. */
@@ -45,5 +46,6 @@ void sdhc_needs_discover(struct sdhc_softc *);
/* flag values */
#define SDHC_F_NOPWR0 (1 << 0)
+#define SDHC_F_NODDR50 (1 << 1)
#endif