aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKornel Duleba <mindal@semihalf.com>2021-11-28 11:24:07 +0000
committerMarcin Wojtas <mw@FreeBSD.org>2021-11-29 16:02:01 +0000
commit8661e085fb953855dbc7059f21a64a05ae61b22c (patch)
tree556798254161a9606e07d784899dce67cd6aeed8
parent181751a8b6ef580c44d49ef3cac1c6627bfa461e (diff)
downloadsrc-8661e085fb953855dbc7059f21a64a05ae61b22c.tar.gz
src-8661e085fb953855dbc7059f21a64a05ae61b22c.zip
mmc: Fix HS200/HS400 capability check
HS200 and HS400 speeds can be enabled either with 1.2, or 1.8V signaling voltage. Because of that we have four cabability flags: MMC_CAP_MMC_HS200_120, MMC_CAP_MMC_HS200_180, MMC_CAP_MMC_HS400_120, MMC_CAP_MMC_HS400_180. MMC logic only enables HS200/HS400 mode if both flags are set for the corresponding speed. Fix that by being more permissive in host timing cap check. Reviewed by: manu, mw MFC after: 2 weeks Obtained from: Semihalf Sponsored by: Alstom Group Differential revision: https://reviews.freebsd.org/D33130
-rw-r--r--sys/dev/mmc/mmc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/mmc/mmc.c b/sys/dev/mmc/mmc.c
index 1fc25e372f2b..9c73dfd57ce0 100644
--- a/sys/dev/mmc/mmc.c
+++ b/sys/dev/mmc/mmc.c
@@ -1543,9 +1543,11 @@ mmc_host_timing(device_t dev, enum mmc_bus_timing timing)
case bus_timing_mmc_ddr52:
return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_DDR52));
case bus_timing_mmc_hs200:
- return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_HS200));
+ return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_HS200_120) ||
+ HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_HS200_180));
case bus_timing_mmc_hs400:
- return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_HS400));
+ return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_HS400_120) ||
+ HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_HS400_180));
case bus_timing_mmc_hs400es:
return (HOST_TIMING_CAP(host_caps, MMC_CAP_MMC_HS400 |
MMC_CAP_MMC_ENH_STROBE));