Skip to contentSkip to conversation

imx: require CCM driver only on i.MX8MM

PATCH New Patrick Wildt 2 participants 3 messages Oct 14, 2019 – Oct 15, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 arch/arm/mach-imx/imx8m/soc.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-imx/imx8m/soc.c +2 -0
index aeca82cdbf..11ca8c86b3 100644
@@ -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)
 {
Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/1 imx: require CCM driver only on i.MX8MM

Quoted 5 lines

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:

arch/arm/mach-imx/imx8m/soc.c +8 -6
index c46031dd12..3e73ca3cca 100644
@@ -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.

Quoted 28 lines
---
 arch/arm/mach-imx/imx8m/soc.c | 2 ++
 1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/arch/arm/mach-imx/imx8m/soc.c index aeca82cdbf..11ca8c86b3 100644

arch/arm/mach-imx/imx8m/soc.c +2 -1
@@ -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

#2 lore raw

PATCH 1/1 imx: require CCM driver only on i.MX8MM

Quoted 34 lines · Peng Fan
Quoted 5 lines

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:

arch/arm/mach-imx/imx8m/soc.c +8 -6
index c46031dd12..3e73ca3cca 100644
@@ -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;
Quoted 2 lines

Thanks,
Peng.

That looks good to me and does indeed work.

Quoted 29 lines
Quoted 28 lines
---
 arch/arm/mach-imx/imx8m/soc.c | 2 ++
 1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/arch/arm/mach-imx/imx8m/soc.c index aeca82cdbf..11ca8c86b3 100644

arch/arm/mach-imx/imx8m/soc.c +2 -1
@@ -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