diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-05-19 15:47:33 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-05-19 15:47:33 +0000 |
commit | d2c0280eca4992ec2b7b52f8b082bde65665cc6d (patch) | |
tree | 8440aaaf788c42bf3316aaf094166edf4f0d1da4 /sys/dev | |
parent | b57ad3049a5babe4a28317690be579f80aed3cbd (diff) |
We need to double the clock frequency for DDR modes.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/fdt/amlmmc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/fdt/amlmmc.c b/sys/dev/fdt/amlmmc.c index db7b2f353ba..3f5738c82fa 100644 --- a/sys/dev/fdt/amlmmc.c +++ b/sys/dev/fdt/amlmmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: amlmmc.c,v 1.5 2020/05/17 22:19:43 kettenis Exp $ */ +/* $OpenBSD: amlmmc.c,v 1.6 2020/05/19 15:47:32 kettenis Exp $ */ /* * Copyright (c) 2019 Mark Kettenis <kettenis@openbsd.org> * @@ -500,6 +500,10 @@ amlmmc_bus_clock(sdmmc_chipset_handle_t sch, int freq, int timing) /* Convert clock frequency from kHz to Hz. */ freq = freq * 1000; + /* Double the clock rate for DDR modes. */ + if (timing == SDMMC_TIMING_MMC_DDR52) + freq = freq * 2; + if (freq < (sc->sc_clkin1 / SD_EMMC_CLOCK_DIV_MAX)) { div = (sc->sc_clkin0 + freq - 1) / freq; clock = SD_EMMC_CLOCK_CLK_SRC_24M | div; |