summaryrefslogtreecommitdiffstats
path: root/sys/dev/sdmmc
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2018-05-01 18:30:37 +0000
committerpatrick <patrick@openbsd.org>2018-05-01 18:30:37 +0000
commitebece86da6e49471abfd5e7bbe5e4570f0a4570c (patch)
tree5ce0245ee8df72dcb3ee3fe7caef6aec26a2376f /sys/dev/sdmmc
parentSimplify/refactor the way vendor/product/serial informations are (diff)
downloadwireguard-openbsd-ebece86da6e49471abfd5e7bbe5e4570f0a4570c.tar.xz
wireguard-openbsd-ebece86da6e49471abfd5e7bbe5e4570f0a4570c.zip
Bump the clock frequency to a higher level that every card (per spec)
has to support for MMC cards prior to reading the extended registers. We already do this for SD cards. Fixes eMMC support on the i.MX8M. Tested by and ok kettenis@
Diffstat (limited to 'sys/dev/sdmmc')
-rw-r--r--sys/dev/sdmmc/sdmmc_mem.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/sdmmc/sdmmc_mem.c b/sys/dev/sdmmc/sdmmc_mem.c
index 8c7f1728e26..0afcbf6af1a 100644
--- a/sys/dev/sdmmc/sdmmc_mem.c
+++ b/sys/dev/sdmmc/sdmmc_mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdmmc_mem.c,v 1.31 2018/03/20 04:18:40 jmatthew Exp $ */
+/* $OpenBSD: sdmmc_mem.c,v 1.32 2018/05/01 18:30:37 patrick Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -674,6 +674,12 @@ sdmmc_mem_mmc_init(struct sdmmc_softc *sc, struct sdmmc_function *sf)
int timing = SDMMC_TIMING_LEGACY;
u_int32_t sectors = 0;
+ error = sdmmc_chip_bus_clock(sc->sct, sc->sch, speed, timing);
+ if (error) {
+ printf("%s: can't change bus clock\n", DEVNAME(sc));
+ return error;
+ }
+
if (sf->csd.mmcver >= MMC_CSD_MMCVER_4_0) {
/* read EXT_CSD */
error = sdmmc_mem_send_cxd_data(sc,