svn commit: r354397 - head/sys/arm/allwinner
Emmanuel Vadot
manu at FreeBSD.org
Wed Nov 6 14:58:25 UTC 2019
Author: manu
Date: Wed Nov 6 14:58:25 2019
New Revision: 354397
URL: https://svnweb.freebsd.org/changeset/base/354397
Log:
arm: allwinner: aw_mmc: Check if the regulator support the voltage
Don't blindy say that we support both 3.3V and 1.8V.
If we have a regulator for the data lines, check that the voltage is
supported before adding the signaling caps.
If we don't have a regulator, just assume that the data lines are 3.3V
This unbreak eMMC on some allwinner boards.
Reported by: ganbold
MFC after: 1 month
X-MFC-With: r354396
Modified:
head/sys/arm/allwinner/aw_mmc.c
Modified: head/sys/arm/allwinner/aw_mmc.c
==============================================================================
--- head/sys/arm/allwinner/aw_mmc.c Wed Nov 6 14:55:24 2019 (r354396)
+++ head/sys/arm/allwinner/aw_mmc.c Wed Nov 6 14:58:25 2019 (r354397)
@@ -511,7 +511,13 @@ aw_mmc_attach(device_t dev)
MMC_CAP_UHS_SDR25 | MMC_CAP_UHS_SDR50 |
MMC_CAP_UHS_DDR50 | MMC_CAP_MMC_DDR52;
- sc->aw_host.caps |= MMC_CAP_SIGNALING_330 | MMC_CAP_SIGNALING_180;
+ if (sc->aw_reg_vqmmc != NULL) {
+ if (regulator_check_voltage(sc->aw_reg_vqmmc, 1800000) == 0)
+ sc->aw_host.caps |= MMC_CAP_SIGNALING_180;
+ if (regulator_check_voltage(sc->aw_reg_vqmmc, 3300000) == 0)
+ sc->aw_host.caps |= MMC_CAP_SIGNALING_330;
+ } else
+ sc->aw_host.caps |= MMC_CAP_SIGNALING_330;
if (bus_width >= 4)
sc->aw_host.caps |= MMC_CAP_4_BIT_DATA;
More information about the svn-src-head
mailing list