From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Wildt Date: Fri, 11 Oct 2019 00:35:01 +0200 Subject: [U-Boot] [PATCH V3 24/27] imx8m: soc: probe clock device in arch_cpu_init_dm In-Reply-To: <20190827064033.28973-25-peng.fan@nxp.com> References: <20190827064033.28973-1-peng.fan@nxp.com> <20190827064033.28973-25-peng.fan@nxp.com> Message-ID: <20191010223501.GA15733@nox.fritz.box> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Aug 27, 2019 at 06:25:58AM +0000, Peng Fan wrote: > 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 > --- > arch/arm/mach-imx/imx8m/soc.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > 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 at 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; > -- > 2.16.4 > > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > https://lists.denx.de/listinfo/u-boot This commit broke my i.MX8MQ board. This is because the i.MX8MQ does not yet have a DM-based clock driver like i.MX8MM, so requiring the existence of such uclass device breaks i.MX8MQ. I would propse the following commit, which make the whole function only available for i.MX8MQ. ---