From: Peng Fan Date: Tue, 27 Aug 2019 06:25:58 +0000 (+0000) Subject: imx8m: soc: probe clock device in arch_cpu_init_dm X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=e663c703b16b515ce0038f971c5d10d33884869b;p=u-boot.git imx8m: soc: probe clock device in arch_cpu_init_dm Because we need to get cpu freq in print_cpuinfo at very early stage, so we need to make sure the ccm be probed. Signed-off-by: Peng Fan --- diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 3a54db4898..f904049120 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -228,6 +229,22 @@ static void imx_set_wdog_powerdown(bool enable) writew(enable, &wdog3->wmcr); } +int arch_cpu_init_dm(void) +{ + struct udevice *dev; + int ret; + + ret = uclass_get_device_by_name(UCLASS_CLK, + "clock-controller@30380000", + &dev); + if (ret < 0) { + printf("Failed to find clock node. Check device tree\n"); + return ret; + } + + return 0; +} + int arch_cpu_init(void) { struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;