public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] imx: require CCM driver only on i.MX8MM
@ 2019-10-14 10:52 Patrick Wildt
  2019-10-15  6:16 ` Peng Fan
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Wildt @ 2019-10-14 10:52 UTC (permalink / raw)
  To: u-boot

Since there is no clock driver like that for i.MX8MQ, we cannot
require it on that platform, so make sure it is only built for
i.MX8MM.  This makes i.MX8MQ platforms work again.

Signed-off-by: Patrick Wildt <patrick@blueri.se>
---
 arch/arm/mach-imx/imx8m/soc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index aeca82cdbf..11ca8c86b3 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -229,6 +229,7 @@ static void imx_set_wdog_powerdown(bool enable)
 	writew(enable, &wdog3->wmcr);
 }
 
+#ifdef CONFIG_ARCH_IMX8MM
 int arch_cpu_init_dm(void)
 {
 	struct udevice *dev;
@@ -244,6 +245,7 @@ int arch_cpu_init_dm(void)
 
 	return 0;
 }
+#endif
 
 int arch_cpu_init(void)
 {
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] imx: require CCM driver only on i.MX8MM
  2019-10-14 10:52 [U-Boot] [PATCH] imx: require CCM driver only on i.MX8MM Patrick Wildt
@ 2019-10-15  6:16 ` Peng Fan
  2019-10-15 13:17   ` Patrick Wildt
  0 siblings, 1 reply; 3+ messages in thread
From: Peng Fan @ 2019-10-15  6:16 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH] imx: require CCM driver only on i.MX8MM
> 
> Since there is no clock driver like that for i.MX8MQ, we cannot require it on
> that platform, so make sure it is only built for i.MX8MM.  This makes
> i.MX8MQ platforms work again.


I would add this:
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index c46031dd12..3e73ca3cca 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -236,12 +236,14 @@ 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;
+       if (CONFIG_IS_ENABLED(CLK)) {
+               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;

Thanks,
Peng.

> 
> Signed-off-by: Patrick Wildt <patrick@blueri.se>
> ---
>  arch/arm/mach-imx/imx8m/soc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/mach-imx/imx8m/soc.c
> b/arch/arm/mach-imx/imx8m/soc.c index aeca82cdbf..11ca8c86b3 100644
> --- a/arch/arm/mach-imx/imx8m/soc.c
> +++ b/arch/arm/mach-imx/imx8m/soc.c
> @@ -229,6 +229,7 @@ static void imx_set_wdog_powerdown(bool enable)
>  	writew(enable, &wdog3->wmcr);
>  }
> 
> +#ifdef CONFIG_ARCH_IMX8MM
>  int arch_cpu_init_dm(void)
>  {
>  	struct udevice *dev;
> @@ -244,6 +245,7 @@ int arch_cpu_init_dm(void)
> 
>  	return 0;
>  }
> +#endif
> 
>  int arch_cpu_init(void)
>  {
> --
> 2.23.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] imx: require CCM driver only on i.MX8MM
  2019-10-15  6:16 ` Peng Fan
@ 2019-10-15 13:17   ` Patrick Wildt
  0 siblings, 0 replies; 3+ messages in thread
From: Patrick Wildt @ 2019-10-15 13:17 UTC (permalink / raw)
  To: u-boot

On Tue, Oct 15, 2019 at 06:16:15AM +0000, Peng Fan wrote:
> > Subject: [PATCH] imx: require CCM driver only on i.MX8MM
> > 
> > Since there is no clock driver like that for i.MX8MQ, we cannot require it on
> > that platform, so make sure it is only built for i.MX8MM.  This makes
> > i.MX8MQ platforms work again.
> 
> 
> I would add this:
> diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
> index c46031dd12..3e73ca3cca 100644
> --- a/arch/arm/mach-imx/imx8m/soc.c
> +++ b/arch/arm/mach-imx/imx8m/soc.c
> @@ -236,12 +236,14 @@ 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;
> +       if (CONFIG_IS_ENABLED(CLK)) {
> +               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;
> 
> Thanks,
> Peng.

That looks good to me and does indeed work.

Reviewed-by: Patrick Wildt <patrick@blueri.se>
Tested-by: Patrick Wildt <patrick@blueri.se>

> > 
> > Signed-off-by: Patrick Wildt <patrick@blueri.se>
> > ---
> >  arch/arm/mach-imx/imx8m/soc.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/arch/arm/mach-imx/imx8m/soc.c
> > b/arch/arm/mach-imx/imx8m/soc.c index aeca82cdbf..11ca8c86b3 100644
> > --- a/arch/arm/mach-imx/imx8m/soc.c
> > +++ b/arch/arm/mach-imx/imx8m/soc.c
> > @@ -229,6 +229,7 @@ static void imx_set_wdog_powerdown(bool enable)
> >  	writew(enable, &wdog3->wmcr);
> >  }
> > 
> > +#ifdef CONFIG_ARCH_IMX8MM
> >  int arch_cpu_init_dm(void)
> >  {
> >  	struct udevice *dev;
> > @@ -244,6 +245,7 @@ int arch_cpu_init_dm(void)
> > 
> >  	return 0;
> >  }
> > +#endif
> > 
> >  int arch_cpu_init(void)
> >  {
> > --
> > 2.23.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-15 13:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-14 10:52 [U-Boot] [PATCH] imx: require CCM driver only on i.MX8MM Patrick Wildt
2019-10-15  6:16 ` Peng Fan
2019-10-15 13:17   ` Patrick Wildt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox