Set the sdmmc(4) emmc highspeed flag if the capability register claims
authorjsg <jsg@openbsd.org>
Sat, 30 May 2015 03:20:54 +0000 (03:20 +0000)
committerjsg <jsg@openbsd.org>
Sat, 30 May 2015 03:20:54 +0000 (03:20 +0000)
it is supported.

sys/arch/armv7/imx/imxesdhc.c

index 9408dbe..432bcd7 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: imxesdhc.c,v 1.11 2015/05/30 02:17:36 jsg Exp $       */
+/*     $OpenBSD: imxesdhc.c,v 1.12 2015/05/30 03:20:54 jsg Exp $       */
 /*
  * Copyright (c) 2009 Dale Rahn <drahn@openbsd.org>
  * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
 #define SDHC_PROT_CTRL_DMASEL_SDMA_MASK                (0x3 << 8)
 #define SDHC_HOST_CTRL_CAP_MBL_SHIFT           16
 #define SDHC_HOST_CTRL_CAP_MBL_MASK            0x7
+#define SDHC_HOST_CTRL_CAP_HSS                 (1 << 21)
 #define SDHC_HOST_CTRL_CAP_VS33                        (1 << 24)
 #define SDHC_HOST_CTRL_CAP_VS30                        (1 << 25)
 #define SDHC_HOST_CTRL_CAP_VS18                        (1 << 26)
@@ -321,6 +322,8 @@ imxesdhc_attach(struct device *parent, struct device *self, void *args)
        saa.saa_busname = "sdmmc";
        saa.sct = &imxesdhc_functions;
        saa.sch = sc;
+       if (caps & SDHC_HOST_CTRL_CAP_HSS)
+               saa.caps |= SMC_CAPS_MMC_HIGHSPEED;
 
        sc->sdmmc = config_found(&sc->sc_dev, &saa, NULL);
        if (sc->sdmmc == NULL) {