summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2018-05-01 18:30:38 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2018-05-01 18:30:38 +0000
commitec03278638efbbd3aad18c8de36b4fe0b988ef5e (patch)
tree55ea29d74cc180b78502e7ceeef6acdbbb5314be
parentc9e7c3964bbfdc4be983152cc3929cacb3c94458 (diff)
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@
-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,