Skip to contentSkip to conversation

dt-bindings: nvmem: imx-iim: Allow syscon fallback on i.MX5

PATCH In review Fabio Estevam 2 participants 3 messages Oct 16 – Oct 18

Subsystems (4)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/2 dt-bindings: nvmem: imx-iim: Allow syscon fallback on i.MX5

The i.MX51 and i.MX53 SoC device code reads the unique ID through syscon_regmap_lookup_by_compatible(). Their IIM nodes therefore need the syscon fallback so the syscon core can instantiate a regmap.

Allow the two-item compatible sequence for these SoCs. This prepares for restoring the fallback removed while making the IIM nodes conform to the binding.

Fixes d5b55c35e033 ("ARM: dts: imx: Fix the iim compatible string")
---
 .../devicetree/bindings/nvmem/imx-iim.yaml    | 20 +++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
Documentation/devicetree/bindings/nvmem/imx-iim.yaml +12 -8
index bb37d72c9eaa..ebfd947e6800 100644
@@ -20,13 +20,17 @@ allOf:
 
 properties:
   compatible:
-    enum:
-      - fsl,imx25-iim
-      - fsl,imx27-iim
-      - fsl,imx31-iim
-      - fsl,imx35-iim
-      - fsl,imx51-iim
-      - fsl,imx53-iim
+    oneOf:
+      - enum:
+          - fsl,imx25-iim
+          - fsl,imx27-iim
+          - fsl,imx31-iim
+          - fsl,imx35-iim
+      - items:
+          - enum:
+              - fsl,imx51-iim
+              - fsl,imx53-iim
+          - const: syscon
 
   reg:
     maxItems: 1
@@ -50,7 +54,7 @@ examples:
     #include <dt-bindings/clock/imx5-clock.h>
 
     iim: efuse@63f98000 {
-        compatible = "fsl,imx53-iim";
+        compatible = "fsl,imx53-iim", "syscon";
         reg = <0x63f98000 0x4000>;
         interrupts = <69>;
         clocks = <&clks IMX5_CLK_IIM_GATE>;
Signature · 1 line
2.43.0
author reviewer
#1 lore raw

PATCH 2/2 ARM: dts: imx5: Restore IIM syscon fallback

Commit d5b55c35e033 ("ARM: dts: imx: Fix the iim compatible string") removed all IIM fallback compatibles because the binding only accepted one compatible. The i.MX51 and i.MX53 SoC device code still looks up the IIM with syscon_regmap_lookup_by_compatible(), though. Without the syscon fallback, syscon_node_to_regmap() cannot instantiate the regmap and boot reports:

imx_soc_device_init: failed to find fsl,imx53-iim regmap!

Restore the syscon fallback on i.MX51 and i.MX53.

Fixes d5b55c35e033 ("ARM: dts: imx: Fix the iim compatible string")
---
 arch/arm/boot/dts/nxp/imx/imx51.dtsi | 2 +-
 arch/arm/boot/dts/nxp/imx/imx53.dtsi | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/nxp/imx/imx51.dtsi +1 -1
index c8698a9af1a7..e0494aa30a6b 100644
@@ -476,7 +476,7 @@ aipstz2: bridge@83f00000 {
 			};
 
 			iim: efuse@83f98000 {
-				compatible = "fsl,imx51-iim";
+				compatible = "fsl,imx51-iim", "syscon";
 				reg = <0x83f98000 0x4000>;
 				interrupts = <69>;
 				clocks = <&clks IMX5_CLK_IIM_GATE>;
arch/arm/boot/dts/nxp/imx/imx53.dtsi +1 -1
index 93225a56896f..13550d12f694 100644
@@ -668,7 +668,7 @@ aipstz2: bridge@63f00000 {
 			};
 
 			iim: efuse@63f98000 {
-				compatible = "fsl,imx53-iim";
+				compatible = "fsl,imx53-iim", "syscon";
 				reg = <0x63f98000 0x4000>;
 				interrupts = <69>;
 				clocks = <&clks IMX5_CLK_IIM_GATE>;
Signature · 1 line
2.43.0
#2 lore raw
In reply to Fabio Estevam
Quoted 7 lines · Fabio Estevam

The i.MX51 and i.MX53 SoC device code reads the unique ID through syscon_regmap_lookup_by_compatible(). Their IIM nodes therefore need the syscon fallback so the syscon core can instantiate a regmap.

Allow the two-item compatible sequence for these SoCs. This prepares for restoring the fallback removed while making the IIM nodes conform to the binding.

Making it a syscon is only the right thing to do if it genuinely is a syscon. If it's not, then don't. The nvmem driver doesn't treat this as a syscon, so the inbuilt regmap locking doesn't actually do anything here.
Surely the right thing to do is for the soc driver to access the efuse through the nvmem subsystem somehow?

Quoted 3 lines
Fixes d5b55c35e033 ("ARM: dts: imx: Fix the iim compatible string")

A binding should not have a fixes tag pointing to a devicetree.

Quoted 46 lines
---
 .../devicetree/bindings/nvmem/imx-iim.yaml    | 20 +++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
Documentation/devicetree/bindings/nvmem/imx-iim.yaml +12 -8
index bb37d72c9eaa..ebfd947e6800 100644
@@ -20,13 +20,17 @@ allOf:
 
 properties:
   compatible:
-    enum:
-      - fsl,imx25-iim
-      - fsl,imx27-iim
-      - fsl,imx31-iim
-      - fsl,imx35-iim
-      - fsl,imx51-iim
-      - fsl,imx53-iim
+    oneOf:
+      - enum:
+          - fsl,imx25-iim
+          - fsl,imx27-iim
+          - fsl,imx31-iim
+          - fsl,imx35-iim
+      - items:
+          - enum:
+              - fsl,imx51-iim
+              - fsl,imx53-iim
+          - const: syscon
 
   reg:
     maxItems: 1
@@ -50,7 +54,7 @@ examples:
     #include <dt-bindings/clock/imx5-clock.h>
 
     iim: efuse@63f98000 {
-        compatible = "fsl,imx53-iim";
+        compatible = "fsl,imx53-iim", "syscon";
         reg = <0x63f98000 0x4000>;
         interrupts = <69>;
         clocks = <&clks IMX5_CLK_IIM_GATE>;
Signature · 1 line
2.43.0