diff mbox series

[v5,1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID

Message ID 20201123095108.19724-1-alice.guo@nxp.com
State Superseded
Headers show
Series [v5,1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID | expand

Checks

Context Check Description
robh/dt-meta-schema success
robh/checkpatch warning total: 0 errors, 2 warnings, 53 lines checked

Commit Message

Alice Guo Nov. 23, 2020, 9:51 a.m. UTC
Add DT Binding doc for the Unique ID of i.MX 8M series.

Signed-off-by: Alice Guo <alice.guo@nxp.com>
---

v2: remove the subject prefix "LF-2571-1"
v3: put it into Documentation/devicetree/bindings/arm/fsl.yaml
    modify the description of nvmem-cells
    use "make ARCH=arm64 dtbs_check" to test it and fix errors
v4: use allOf to limit new version DTS files for i.MX8M to include
    "fsl,imx8mm/n/p/q-soc", nvmem-cells and nvmem-cells-names
v5: correct the error of using allOf

 .../devicetree/bindings/arm/fsl.yaml          | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)

--
2.17.1

Comments

Krzysztof Kozlowski Nov. 23, 2020, 4:56 p.m. UTC | #1
On Mon, Nov 23, 2020 at 05:51:05PM +0800, Alice Guo wrote:
> Add DT Binding doc for the Unique ID of i.MX 8M series.
> 
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
> ---
> 
> v2: remove the subject prefix "LF-2571-1"
> v3: put it into Documentation/devicetree/bindings/arm/fsl.yaml
>     modify the description of nvmem-cells
>     use "make ARCH=arm64 dtbs_check" to test it and fix errors
> v4: use allOf to limit new version DTS files for i.MX8M to include
>     "fsl,imx8mm/n/p/q-soc", nvmem-cells and nvmem-cells-names
> v5: correct the error of using allOf
> 
>  .../devicetree/bindings/arm/fsl.yaml          | 47 +++++++++++++++++++
>  1 file changed, 47 insertions(+)
> 

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof
Krzysztof Kozlowski Nov. 23, 2020, 4:57 p.m. UTC | #2
On Mon, Nov 23, 2020 at 05:51:06PM +0800, Alice Guo wrote:
> Add compatible string to .dtsi files for binding of imx8_soc_info and
> device.
> 
> v2: remove the subject prefix "LF-2571-2"
> v3: none
> v4: change subject and commit message, add Reviewed-by

You have here duplicated changelog. Leave only the one under '---'.
Thanks!


Best regards,
Krzysztof

> 
> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
> ---
> 
> v2: remove the subject prefix "LF-2571-2"
> v3: none
> v4: change subject and commit message, add Reviewed-by
> v5: none
> 
>  arch/arm64/boot/dts/freescale/imx8mm.dtsi | 2 +-
>  arch/arm64/boot/dts/freescale/imx8mn.dtsi | 2 +-
>  arch/arm64/boot/dts/freescale/imx8mp.dtsi | 2 +-
>  arch/arm64/boot/dts/freescale/imx8mq.dtsi | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
>
Krzysztof Kozlowski Nov. 23, 2020, 4:57 p.m. UTC | #3
On Mon, Nov 23, 2020 at 05:51:07PM +0800, Alice Guo wrote:
> In order to be able to use NVMEM APIs to read soc unique ID, add the
> nvmem data cell and name for nvmem-cells to the "soc" node, and add a
> nvmem node which provides soc unique ID to efuse@30350000.
> 
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
> ---
> 

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof
Krzysztof Kozlowski Nov. 23, 2020, 4:58 p.m. UTC | #4
On Mon, Nov 23, 2020 at 05:51:08PM +0800, Alice Guo wrote:
> Directly reading ocotp register depends on that bootloader enables ocotp
> clk, which is not always effective, so change to use nvmem API. Using
> nvmem API requires to support driver defer probe and thus change
> soc-imx8m.c to use platform driver.
> 
> The other reason is that directly reading ocotp register causes kexec
> kernel hang because the 1st kernel running will disable unused clks
> after kernel boots up, and then ocotp clk will be disabled even if
> bootloader enables it. When kexec kernel, ocotp clk needs to be enabled
> before reading ocotp registers, and nvmem API with platform driver
> supported can accomplish this.
> 
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
> ---
> 

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/arm/fsl.yaml b/Documentation/devicetree/bindings/arm/fsl.yaml
index 67980dcef66d..7132ffd41abb 100644
--- a/Documentation/devicetree/bindings/arm/fsl.yaml
+++ b/Documentation/devicetree/bindings/arm/fsl.yaml
@@ -918,6 +918,53 @@  properties:
               - fsl,s32v234-evb           # S32V234-EVB2 Customer Evaluation Board
           - const: fsl,s32v234

+  soc:
+    type: object
+    properties:
+      compatible:
+        oneOf:
+          - description: new version compatible for i.MX8M SoCs
+            items:
+              - enum:
+                  - fsl,imx8mm-soc
+                  - fsl,imx8mn-soc
+                  - fsl,imx8mp-soc
+                  - fsl,imx8mq-soc
+              - const: simple-bus
+
+          - description: old version compatible for i.MX8M SoCs
+            items:
+              - const: simple-bus
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - fsl,imx8mm
+              - fsl,imx8mn
+              - fsl,imx8mp
+              - fsl,imx8mq
+
+    then:
+      patternProperties:
+        "^soc@[0-9a-f]+$":
+          properties:
+            compatible:
+              items:
+                - enum:
+                    - fsl,imx8mm-soc
+                    - fsl,imx8mn-soc
+                    - fsl,imx8mp-soc
+                    - fsl,imx8mq-soc
+                - const: simple-bus
+
+          required:
+            - compatible
+            - nvmem-cells
+            - nvmem-cell-names
+
 additionalProperties: true

 ...