summaryrefslogtreecommitdiff
path: root/drivers/ddr/imx/imx9/ddr_init.c
diff options
context:
space:
mode:
authorSam Protsenko <semen.protsenko@linaro.org>2024-08-07 22:14:36 -0500
committerMinkyu Kang <mk7.kang@samsung.com>2024-08-19 16:09:06 +0900
commit97e7d1c1f028bc4de75477f517a16f0de4a34d6d (patch)
tree270757387e31a0f7d86b0e5344c0201d7352cc71 /drivers/ddr/imx/imx9/ddr_init.c
parent4f89f6029af82dc9ef18e8c23f25d9f158878a9e (diff)
mmc: exynos_dw_mmc: Set requested freq in get_mmc_clk() callback
By now exynos_dw_mmc driver was relying on the correct CIU clock frequency being set on driver init. But dw_mmc core is actually trying to change CIU clock rate dynamically, on init and in set_ios() callback, which it's requesting via host->get_mmc_clk() callback (the name is misleading: although it's called "get_mmc_clk()", it can actually request both get and set operations). Implement setting the requested rate for CIU clock in Exynos driver to achieve the correct dw_mmc core driver operation at all times. DDR mode requires the clock to be twice as fast (when 8 bit bus is used), so handle this too, to make DDR function properly. This change makes the eMMC throughput on E850-96 board twice as fast. That's because "clock-frequency" is set to 800 MHz in E850-96 device tree, but for DDR52 mode it should be 416 MHz (and TRM states it should be 400 MHz for DDR50/8bit mode). The dw_mmc core is requesting 52 MHz bus_hz for DDR52 mode, and DDR+8bit mode means it should be x2 fast, so: f_ciu = 2 * ciu_div * f_bus = 2 * 4 * 52e6 = 416 MHz, where f_ciu - freq of clock fed to DW MMC block from CMU (SDCLKIN), Hz f_bus - freq of clock fed to the card (CCLKIN), Hz ciu_div - value of internal divider (in DW MMC block). Another way to work that around would be overriding the "clock-frequency" property in corresponding dts. But setting the clock frequency dynamically as it's done here looks much neater. This implementation follows what's done in Linux kernel dw_mmc-exynos driver in .set_ios() callback for MMC_TIMING_MMC_DDR52 case. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'drivers/ddr/imx/imx9/ddr_init.c')
0 files changed, 0 insertions, 0 deletions