Skip to contentSkip to conversation

ARM: mxs: Do not search for "fsl,clkctrl"

PATCH Applied Fabio Estevam 3 participants 5 messages Dec 5, 2023 – Dec 6, 2023

Subsystems (4)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/2 ARM: mxs: Do not search for "fsl,clkctrl"

From: Fabio Estevam <[email protected]>

The "fsl,clkctrl" compatible string is not documented.

It is used only to find the base address of the clock controller.

Instead of searching for an undocumented compatible string, search for "fsl,imx23-clkctrl" and "fsl,imx28-clkctrl".

---
 arch/arm/mach-mxs/mach-mxs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-mxs/mach-mxs.c +3 -1
index 3faf9a1e3e36..6e017fa306c8 100644
@@ -356,7 +356,9 @@ static int __init mxs_restart_init(void)
 {
 	struct device_node *np;
 
-	np = of_find_compatible_node(NULL, NULL, "fsl,clkctrl");
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx23-clkctrl");
+	if (!np)
+		np = of_find_compatible_node(NULL, NULL, "fsl,imx28-clkctrl");
 	reset_addr = of_iomap(np, 0);
 	if (!reset_addr)
 		return -ENODEV;
Signature · 7 lines
2.34.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
author reviewer
#1 lore raw

PATCH 2/2 ARM: dts: imx23/28: Remove undocumented "fsl,clkctrl"

From: Fabio Estevam <[email protected]>

Per imx23-clock.yaml and imx28-clock.yaml, fsl,clkctrl is not a valid compatible string.

Remove it to fix the following dt-schema warning:

imx28-evk.dtb: clkctrl@80040000: compatible: ['fsl,imx28-clkctrl', 'fsl,clkctrl'] is too long
from schema $id: http://devicetree.org/schemas/clock/imx28-clock.yaml#

---
 arch/arm/boot/dts/nxp/mxs/imx23.dtsi | 2 +-
 arch/arm/boot/dts/nxp/mxs/imx28.dtsi | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/nxp/mxs/imx23.dtsi +1 -1
index fdf18b7cb2f6..69e65e218afe 100644
@@ -484,7 +484,7 @@ apbx@80040000 {
 			ranges;
 
 			clks: clkctrl@80040000 {
-				compatible = "fsl,imx23-clkctrl", "fsl,clkctrl";
+				compatible = "fsl,imx23-clkctrl";
 				reg = <0x80040000 0x2000>;
 				#clock-cells = <1>;
 			};
arch/arm/boot/dts/nxp/mxs/imx28.dtsi +1 -1
index 6932d23fb29d..39b59619eb2e 100644
@@ -1100,7 +1100,7 @@ apbx@80040000 {
 			ranges;
 
 			clks: clkctrl@80040000 {
-				compatible = "fsl,imx28-clkctrl", "fsl,clkctrl";
+				compatible = "fsl,imx28-clkctrl";
 				reg = <0x80040000 0x2000>;
 				#clock-cells = <1>;
 			};
Signature · 7 lines
2.34.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] ARM: dts: imx23/28: Remove undocumented "fsl,clkctrl"

Hi Fabio,

Am 05.12.23 um 15:47 schrieb Fabio Estevam:

Quoted 21 lines

From: Fabio Estevam <[email protected]>

Per imx23-clock.yaml and imx28-clock.yaml, fsl,clkctrl is not a valid compatible string.

Remove it to fix the following dt-schema warning:

imx28-evk.dtb: clkctrl@80040000: compatible: ['fsl,imx28-clkctrl', 'fsl,clkctrl'] is too long
from schema $id: http://devicetree.org/schemas/clock/imx28-clock.yaml#

---
  arch/arm/boot/dts/nxp/mxs/imx23.dtsi | 2 +-
  arch/arm/boot/dts/nxp/mxs/imx28.dtsi | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/nxp/mxs/imx23.dtsi +0 -0
index fdf18b7cb2f6..69e65e218afe 100644

arch/arm/boot/dts/nxp/mxs/imx23.dtsi apbx@80040000 { · line 487

Quoted 5 lines
arch/arm/boot/dts/nxp/mxs/imx23.dtsi +1 -1
@@ -484,7 +484,7 @@ apbx@80040000 {
  			ranges;
 
  			clks: clkctrl@80040000 {
-				compatible = "fsl,imx23-clkctrl", "fsl,clkctrl";
+				compatible = "fsl,imx23-clkctrl";

this look fine:

Btw the node name clkctrl is also incorrect here. According to the yaml it should be clock-controller.

Regards

Quoted 8 lines
arch/arm/boot/dts/nxp/mxs/imx23.dtsi +0 -0
  				reg = <0x80040000 0x2000>;
  				#clock-cells = <1>;
  			};
arch/arm/boot/dts/nxp/mxs/imx28.dtsi +0 -0
index 6932d23fb29d..39b59619eb2e 100644

arch/arm/boot/dts/nxp/mxs/imx28.dtsi apbx@80040000 { · line 1106

Quoted 8 lines
arch/arm/boot/dts/nxp/mxs/imx28.dtsi +1 -1
@@ -1100,7 +1100,7 @@ apbx@80040000 {
  			ranges;
 
  			clks: clkctrl@80040000 {
-				compatible = "fsl,imx28-clkctrl", "fsl,clkctrl";
+				compatible = "fsl,imx28-clkctrl";
  				reg = <0x80040000 0x2000>;
  				#clock-cells = <1>;
  			};

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#3 lore raw
In reply to Fabio Estevam

Hi Fabio,

Am 05.12.23 um 15:47 schrieb Fabio Estevam:

Quoted 19 lines

From: Fabio Estevam <[email protected]>

The "fsl,clkctrl" compatible string is not documented.

It is used only to find the base address of the clock controller.

Instead of searching for an undocumented compatible string, search for "fsl,imx23-clkctrl" and "fsl,imx28-clkctrl".

---
  arch/arm/mach-mxs/mach-mxs.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-mxs/mach-mxs.c +0 -0
index 3faf9a1e3e36..6e017fa306c8 100644

arch/arm/mach-mxs/mach-mxs.c static int __init mxs_restart_init(void) · line 361

Quoted 7 lines
arch/arm/mach-mxs/mach-mxs.c +3 -1
@@ -356,7 +356,9 @@ static int __init mxs_restart_init(void)
  {
  	struct device_node *np;
 
-	np = of_find_compatible_node(NULL, NULL, "fsl,clkctrl");
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx23-clkctrl");
+	if (!np)
+		np = of_find_compatible_node(NULL, NULL, "fsl,imx28-clkctrl");

i'm fine with getting the rid off "fsl,clkctrl", but some lines below we search for "fsl,imx23-clkctrl" again to adjust reset_addr.

Can we avoid this unnecessary search?

arch/arm/mach-mxs/mach-mxs.c static int __init mxs_restart_init(void) · line 364

Quoted 3 lines
arch/arm/mach-mxs/mach-mxs.c +0 -0
  	reset_addr = of_iomap(np, 0);
  	if (!reset_addr)
  		return -ENODEV;

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Applied
#4 lore raw
In reply to Fabio Estevam
Quoted 10 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

The "fsl,clkctrl" compatible string is not documented.

It is used only to find the base address of the clock controller.

Instead of searching for an undocumented compatible string, search for "fsl,imx23-clkctrl" and "fsl,imx28-clkctrl".

Applied both, thanks!

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel