Hi,

the SD/MMC supports two kinds of cards in memory mode as mass storage.
MMCs and SD cards.  In May 2016 kettenis@ changed the SD card code to
bump the frequency to a higher level that is required to be supported
by all SD cards, since on his controller the card didn't react if the
frequency was set too low prior to reading an extended register.

It turns out that on the i.MX8M I have the same issue, just with the
eMMC, which is of the MMC card type.  Bumping the frequency to a higher
level that that every card (per spec) has to support fixes this issue
on the i.MX8M controller as well and makes the internal eMMC usable.

To make sure this does not cause any regressions on e.g. Intel Atom
hardware, I would be happy if you could give this diff a go.  The
dmesg(8) output should be extended by a single debug line so that you
can see that you actually hit the code path. It contains the string
"sdmmc_mem_mmc_init".

Thank you,
Patrick

diff --git a/sys/dev/sdmmc/sdmmc_mem.c b/sys/dev/sdmmc/sdmmc_mem.c
index 8c7f1728e26..edfd9b59d2e 100644
--- a/sys/dev/sdmmc/sdmmc_mem.c
+++ b/sys/dev/sdmmc/sdmmc_mem.c
@@ -674,6 +674,13 @@ sdmmc_mem_mmc_init(struct sdmmc_softc *sc, struct 
sdmmc_function *sf)
        int timing = SDMMC_TIMING_LEGACY;
        u_int32_t sectors = 0;
 
+       printf("%s: %s\n", DEVNAME(sc), __func__);
+       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,

Reply via email to