diff options
author | Peng Fan <peng.fan@nxp.com> | 2019-12-11 06:17:12 +0000 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2020-01-08 13:18:55 +0100 |
commit | 392a4e6dd33ae76960c382a13b1e437b58b425b6 (patch) | |
tree | cfcd446d6a668717cfe7680d99f917030047ea7b /arch | |
parent | 279d0ab352f3d8cf36874d383d528ab2b318e76d (diff) | |
download | u-boot-392a4e6dd33ae76960c382a13b1e437b58b425b6.tar.gz |
imx: imx8mq: handle ESDHC in mxc_get_clock
fsl_esdhc_imx driver will call "mxc_get_clock(MXC_ESDHC_CLK +
dev->seq)", however mxc_get_clock wrongly handle MXC_ESDHC_CLK
as root clk and cause sd card could not be detected in U-Boot proper,
as below:
"Loading Environment from MMC... unable to select a mode"
Handle MXC_ESDHC_CLK in mxc_get_clock to fix the issue.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Baruch Siach <baruch@tkos.co.il>
Tested-by: Fabio Estevam <festevam@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/imx8m/clock_imx8mq.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mq.c b/arch/arm/mach-imx/imx8m/clock_imx8mq.c index 2db5bde211..878f2be166 100644 --- a/arch/arm/mach-imx/imx8m/clock_imx8mq.c +++ b/arch/arm/mach-imx/imx8m/clock_imx8mq.c @@ -326,16 +326,20 @@ unsigned int mxc_get_clock(enum mxc_clock clk) { u32 val; - if (clk == MXC_ARM_CLK) + switch(clk) { + case MXC_ARM_CLK: return get_root_clk(ARM_A53_CLK_ROOT); - - if (clk == MXC_IPG_CLK) { + case MXC_IPG_CLK: clock_get_target_val(IPG_CLK_ROOT, &val); val = val & 0x3; return get_root_clk(AHB_CLK_ROOT) / (val + 1); + case MXC_ESDHC_CLK: + return get_root_clk(USDHC1_CLK_ROOT); + case MXC_ESDHC2_CLK: + return get_root_clk(USDHC2_CLK_ROOT); + default: + return get_root_clk(clk); } - - return get_root_clk(clk); } u32 imx_get_uartclk(void) |