linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID
@ 2020-11-24  1:59 Alice Guo
  2020-11-24  1:59 ` [PATCH v6 2/4] arm64: dts: imx8m: add SoC ID compatible Alice Guo
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Alice Guo @ 2020-11-24  1:59 UTC (permalink / raw)
  To: robh+dt, shawnguo, s.hauer, krzk
  Cc: devicetree, peng.fan, linux-imx, linux-arm-kernel, linux-kernel

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
v6: none

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

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

 ...
--
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v6 2/4] arm64: dts: imx8m: add SoC ID compatible
  2020-11-24  1:59 [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID Alice Guo
@ 2020-11-24  1:59 ` Alice Guo
  2020-11-24  1:59 ` [PATCH v6 3/4] arm64: dts: imx8m: add NVMEM provider and consumer to read soc unique ID Alice Guo
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Alice Guo @ 2020-11-24  1:59 UTC (permalink / raw)
  To: robh+dt, shawnguo, s.hauer, krzk
  Cc: devicetree, peng.fan, linux-imx, linux-arm-kernel, linux-kernel

Add compatible string to .dtsi files for binding of imx8_soc_info and
device.

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
v6: leave only the changelog under '---'

 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(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
index c824f2615fe8..d457ce815e68 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
@@ -257,7 +257,7 @@
 	};

 	soc@0 {
-		compatible = "simple-bus";
+		compatible = "fsl,imx8mm-soc", "simple-bus";
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges = <0x0 0x0 0x0 0x3e000000>;
diff --git a/arch/arm64/boot/dts/freescale/imx8mn.dtsi b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
index a06d2a6268e6..6d3a809a00fd 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
@@ -241,7 +241,7 @@
 	};

 	soc@0 {
-		compatible = "simple-bus";
+		compatible = "fsl,imx8mn-soc", "simple-bus";
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges = <0x0 0x0 0x0 0x3e000000>;
diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index ecccfbb4f5ad..ec6ac523ecfc 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -218,7 +218,7 @@
 	};

 	soc@0 {
-		compatible = "simple-bus";
+		compatible = "fsl,imx8mp-soc", "simple-bus";
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges = <0x0 0x0 0x0 0x3e000000>;
diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
index a841a023e8e0..9b6d9307e5d7 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
@@ -286,7 +286,7 @@
 	};

 	soc@0 {
-		compatible = "simple-bus";
+		compatible = "fsl,imx8mq-soc", "simple-bus";
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges = <0x0 0x0 0x0 0x3e000000>;
--
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v6 3/4] arm64: dts: imx8m: add NVMEM provider and consumer to read soc unique ID
  2020-11-24  1:59 [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID Alice Guo
  2020-11-24  1:59 ` [PATCH v6 2/4] arm64: dts: imx8m: add SoC ID compatible Alice Guo
@ 2020-11-24  1:59 ` Alice Guo
  2020-11-24  9:47   ` Krzysztof Kozlowski
  2020-11-24  1:59 ` [PATCH v6 4/4] soc: imx8m: change to use platform driver Alice Guo
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Alice Guo @ 2020-11-24  1:59 UTC (permalink / raw)
  To: robh+dt, shawnguo, s.hauer, krzk
  Cc: devicetree, peng.fan, linux-imx, linux-arm-kernel, linux-kernel

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>
---

v2: remove the subject prefix "LF-2571-3"
v3: convert register addresses and sizes to hex
v4: delete "stuff" in subject and commit message, add detailed
    description
v5: change underscore of device node to hyphen
v6: none

 arch/arm64/boot/dts/freescale/imx8mm.dtsi | 6 ++++++
 arch/arm64/boot/dts/freescale/imx8mn.dtsi | 6 ++++++
 arch/arm64/boot/dts/freescale/imx8mp.dtsi | 6 ++++++
 arch/arm64/boot/dts/freescale/imx8mq.dtsi | 6 ++++++
 4 files changed, 24 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
index d457ce815e68..9bee6f1889a4 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
@@ -261,6 +261,8 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges = <0x0 0x0 0x0 0x3e000000>;
+		nvmem-cells = <&imx8mm_uid>;
+		nvmem-cell-names = "soc_unique_id";

 		aips1: bus@30000000 {
 			compatible = "fsl,aips-bus", "simple-bus";
@@ -518,6 +520,10 @@
 				#address-cells = <1>;
 				#size-cells = <1>;

+				imx8mm_uid: unique-id@410 {
+					reg = <0x4 0x8>;
+				};
+
 				cpu_speed_grade: speed-grade@10 {
 					reg = <0x10 4>;
 				};
diff --git a/arch/arm64/boot/dts/freescale/imx8mn.dtsi b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
index 6d3a809a00fd..2edfde1119b8 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
@@ -245,6 +245,8 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges = <0x0 0x0 0x0 0x3e000000>;
+		nvmem-cells = <&imx8mn_uid>;
+		nvmem-cell-names = "soc_unique_id";

 		aips1: bus@30000000 {
 			compatible = "fsl,aips-bus", "simple-bus";
@@ -388,6 +390,10 @@
 				#address-cells = <1>;
 				#size-cells = <1>;

+				imx8mn_uid: unique-id@410 {
+					reg = <0x4 0x8>;
+				};
+
 				cpu_speed_grade: speed-grade@10 {
 					reg = <0x10 4>;
 				};
diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index ec6ac523ecfc..9401e92f1c84 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -222,6 +222,8 @@
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges = <0x0 0x0 0x0 0x3e000000>;
+		nvmem-cells = <&imx8mp_uid>;
+		nvmem-cell-names = "soc_unique_id";

 		aips1: bus@30000000 {
 			compatible = "fsl,aips-bus", "simple-bus";
@@ -328,6 +330,10 @@
 				#address-cells = <1>;
 				#size-cells = <1>;

+				imx8mp_uid: unique-id@420 {
+					reg = <0x8 0x8>;
+				};
+
 				cpu_speed_grade: speed-grade@10 {
 					reg = <0x10 4>;
 				};
diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
index 9b6d9307e5d7..a2a885f1a07a 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
@@ -291,6 +291,8 @@
 		#size-cells = <1>;
 		ranges = <0x0 0x0 0x0 0x3e000000>;
 		dma-ranges = <0x40000000 0x0 0x40000000 0xc0000000>;
+		nvmem-cells = <&imx8mq_uid>;
+		nvmem-cell-names = "soc_unique_id";

 		bus@30000000 { /* AIPS1 */
 			compatible = "fsl,aips-bus", "simple-bus";
@@ -555,6 +557,10 @@
 				#address-cells = <1>;
 				#size-cells = <1>;

+				imx8mq_uid: soc-uid@410 {
+					reg = <0x4 0x8>;
+				};
+
 				cpu_speed_grade: speed-grade@10 {
 					reg = <0x10 4>;
 				};
--
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v6 4/4] soc: imx8m: change to use platform driver
  2020-11-24  1:59 [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID Alice Guo
  2020-11-24  1:59 ` [PATCH v6 2/4] arm64: dts: imx8m: add SoC ID compatible Alice Guo
  2020-11-24  1:59 ` [PATCH v6 3/4] arm64: dts: imx8m: add NVMEM provider and consumer to read soc unique ID Alice Guo
@ 2020-11-24  1:59 ` Alice Guo
  2020-11-24  9:48   ` Krzysztof Kozlowski
                     ` (2 more replies)
  2020-11-24  9:46 ` [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID Krzysztof Kozlowski
  2020-11-30 21:57 ` Rob Herring
  4 siblings, 3 replies; 16+ messages in thread
From: Alice Guo @ 2020-11-24  1:59 UTC (permalink / raw)
  To: robh+dt, shawnguo, s.hauer, krzk
  Cc: devicetree, peng.fan, linux-imx, linux-arm-kernel, linux-kernel

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>
---

v2: remove the subject prefix "LF-2571-4"
v3: Keep the original way which uses device_initcall to read soc unique
    ID, and add the other way which uses module_platform_driver and
    nvmem API, so that it will not break the old version DTBs.
v4: delete "__maybe_unused"
    delete MODULE_DEVICE_TABLE(of, imx8m_soc_match);
    rename match table, "fsl,imx8mm/n/q/p" is actually a machine
compabile and "fsl,imx8mm/n/q/p-soc" is a compabile of soc@0
    delete "flag" and change to determine whether the pointer is NULL
    ues of_find_matching_node_and_match()
    delete of_match_ptr()
v5: add cleanup part "of_node_put"
    add note to explain that why device_initcall still exists
v6: none

 drivers/soc/imx/soc-imx8m.c | 87 ++++++++++++++++++++++++++++++++-----
 1 file changed, 75 insertions(+), 12 deletions(-)

diff --git a/drivers/soc/imx/soc-imx8m.c b/drivers/soc/imx/soc-imx8m.c
index cc57a384d74d..250530177920 100644
--- a/drivers/soc/imx/soc-imx8m.c
+++ b/drivers/soc/imx/soc-imx8m.c
@@ -5,6 +5,8 @@

 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/module.h>
+#include <linux/nvmem-consumer.h>
 #include <linux/of_address.h>
 #include <linux/slab.h>
 #include <linux/sys_soc.h>
@@ -29,7 +31,7 @@

 struct imx8_soc_data {
 	char *name;
-	u32 (*soc_revision)(void);
+	u32 (*soc_revision)(struct device *dev);
 };

 static u64 soc_uid;
@@ -50,7 +52,7 @@ static u32 imx8mq_soc_revision_from_atf(void)
 static inline u32 imx8mq_soc_revision_from_atf(void) { return 0; };
 #endif

-static u32 __init imx8mq_soc_revision(void)
+static u32 __init imx8mq_soc_revision(struct device *dev)
 {
 	struct device_node *np;
 	void __iomem *ocotp_base;
@@ -75,9 +77,20 @@ static u32 __init imx8mq_soc_revision(void)
 			rev = REV_B1;
 	}

-	soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH);
-	soc_uid <<= 32;
-	soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW);
+	if (dev) {
+		int ret = 0;
+
+		ret = nvmem_cell_read_u64(dev, "soc_unique_id", &soc_uid);
+		if (ret) {
+			iounmap(ocotp_base);
+			of_node_put(np);
+			return ret;
+		}
+	} else {
+		soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH);
+		soc_uid <<= 32;
+		soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW);
+	}

 	iounmap(ocotp_base);
 	of_node_put(np);
@@ -107,7 +120,7 @@ static void __init imx8mm_soc_uid(void)
 	of_node_put(np);
 }

-static u32 __init imx8mm_soc_revision(void)
+static u32 __init imx8mm_soc_revision(struct device *dev)
 {
 	struct device_node *np;
 	void __iomem *anatop_base;
@@ -125,7 +138,15 @@ static u32 __init imx8mm_soc_revision(void)
 	iounmap(anatop_base);
 	of_node_put(np);

-	imx8mm_soc_uid();
+	if (dev) {
+		int ret = 0;
+
+		ret = nvmem_cell_read_u64(dev, "soc_unique_id", &soc_uid);
+		if (ret)
+			return ret;
+	} else {
+		imx8mm_soc_uid();
+	}

 	return rev;
 }
@@ -150,7 +171,7 @@ static const struct imx8_soc_data imx8mp_soc_data = {
 	.soc_revision = imx8mm_soc_revision,
 };

-static __maybe_unused const struct of_device_id imx8_soc_match[] = {
+static const struct of_device_id imx8_machine_match[] = {
 	{ .compatible = "fsl,imx8mq", .data = &imx8mq_soc_data, },
 	{ .compatible = "fsl,imx8mm", .data = &imx8mm_soc_data, },
 	{ .compatible = "fsl,imx8mn", .data = &imx8mn_soc_data, },
@@ -158,12 +179,20 @@ static __maybe_unused const struct of_device_id imx8_soc_match[] = {
 	{ }
 };

+static const struct of_device_id imx8_soc_match[] = {
+	{ .compatible = "fsl,imx8mq-soc", .data = &imx8mq_soc_data, },
+	{ .compatible = "fsl,imx8mm-soc", .data = &imx8mm_soc_data, },
+	{ .compatible = "fsl,imx8mn-soc", .data = &imx8mn_soc_data, },
+	{ .compatible = "fsl,imx8mp-soc", .data = &imx8mp_soc_data, },
+	{ }
+};
+
 #define imx8_revision(soc_rev) \
 	soc_rev ? \
 	kasprintf(GFP_KERNEL, "%d.%d", (soc_rev >> 4) & 0xf,  soc_rev & 0xf) : \
 	"unknown"

-static int __init imx8_soc_init(void)
+static int imx8_soc_info(struct platform_device *pdev)
 {
 	struct soc_device_attribute *soc_dev_attr;
 	struct soc_device *soc_dev;
@@ -182,7 +211,10 @@ static int __init imx8_soc_init(void)
 	if (ret)
 		goto free_soc;

-	id = of_match_node(imx8_soc_match, of_root);
+	if (pdev)
+		id = of_match_node(imx8_soc_match, pdev->dev.of_node);
+	else
+		id = of_match_node(imx8_machine_match, of_root);
 	if (!id) {
 		ret = -ENODEV;
 		goto free_soc;
@@ -191,8 +223,16 @@ static int __init imx8_soc_init(void)
 	data = id->data;
 	if (data) {
 		soc_dev_attr->soc_id = data->name;
-		if (data->soc_revision)
-			soc_rev = data->soc_revision();
+		if (data->soc_revision) {
+			if (pdev) {
+				soc_rev = data->soc_revision(&pdev->dev);
+				ret = soc_rev;
+				if (ret < 0)
+					goto free_soc;
+			} else {
+				soc_rev = data->soc_revision(NULL);
+			}
+		}
 	}

 	soc_dev_attr->revision = imx8_revision(soc_rev);
@@ -230,4 +270,27 @@ static int __init imx8_soc_init(void)
 	kfree(soc_dev_attr);
 	return ret;
 }
+
+/* Retain device_initcall is for backward compatibility with DTS. */
+static int __init imx8_soc_init(void)
+{
+	int ret = 0;
+
+	if (of_find_matching_node_and_match(NULL, imx8_soc_match, NULL))
+		return 0;
+
+	ret = imx8_soc_info(NULL);
+	return ret;
+}
 device_initcall(imx8_soc_init);
+
+static struct platform_driver imx8_soc_info_driver = {
+	.probe = imx8_soc_info,
+	.driver = {
+		.name = "imx8_soc_info",
+		.of_match_table = imx8_soc_match,
+	},
+};
+
+module_platform_driver(imx8_soc_info_driver);
+MODULE_LICENSE("GPL v2");
--
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID
  2020-11-24  1:59 [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID Alice Guo
                   ` (2 preceding siblings ...)
  2020-11-24  1:59 ` [PATCH v6 4/4] soc: imx8m: change to use platform driver Alice Guo
@ 2020-11-24  9:46 ` Krzysztof Kozlowski
  2020-11-30 21:57 ` Rob Herring
  4 siblings, 0 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2020-11-24  9:46 UTC (permalink / raw)
  To: Alice Guo
  Cc: devicetree, peng.fan, s.hauer, linux-kernel, robh+dt, linux-imx,
	shawnguo, linux-arm-kernel

On Tue, Nov 24, 2020 at 09:59:46AM +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>

I already reviewed it.

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

Best regards,
Krzysztof


> ---
> 
> 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
> v6: none
> 
>  .../devicetree/bindings/arm/fsl.yaml          | 47 +++++++++++++++++++
>  1 file changed, 47 insertions(+)

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v6 3/4] arm64: dts: imx8m: add NVMEM provider and consumer to read soc unique ID
  2020-11-24  1:59 ` [PATCH v6 3/4] arm64: dts: imx8m: add NVMEM provider and consumer to read soc unique ID Alice Guo
@ 2020-11-24  9:47   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2020-11-24  9:47 UTC (permalink / raw)
  To: Alice Guo
  Cc: devicetree, peng.fan, s.hauer, linux-kernel, robh+dt, linux-imx,
	shawnguo, linux-arm-kernel

On Tue, Nov 24, 2020 at 09:59:48AM +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>

I already reviewed it. Do not ignore received tags.

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

Best regards,
Krzysztof

> ---
> 
> v2: remove the subject prefix "LF-2571-3"
> v3: convert register addresses and sizes to hex
> v4: delete "stuff" in subject and commit message, add detailed
>     description
> v5: change underscore of device node to hyphen
> v6: none

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v6 4/4] soc: imx8m: change to use platform driver
  2020-11-24  1:59 ` [PATCH v6 4/4] soc: imx8m: change to use platform driver Alice Guo
@ 2020-11-24  9:48   ` Krzysztof Kozlowski
  2020-11-25  0:44   ` Adam Ford
  2020-12-02  1:27   ` kernel test robot
  2 siblings, 0 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2020-11-24  9:48 UTC (permalink / raw)
  To: Alice Guo
  Cc: devicetree, peng.fan, s.hauer, linux-kernel, robh+dt, linux-imx,
	shawnguo, linux-arm-kernel

On Tue, Nov 24, 2020 at 09:59:49AM +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>

I already reviewed it. You skipped all my review tags from v5.

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

Best regards,
Krzysztof

> ---
> 
> v2: remove the subject prefix "LF-2571-4"
> v3: Keep the original way which uses device_initcall to read soc unique
>     ID, and add the other way which uses module_platform_driver and
>     nvmem API, so that it will not break the old version DTBs.
> v4: delete "__maybe_unused"
>     delete MODULE_DEVICE_TABLE(of, imx8m_soc_match);
>     rename match table, "fsl,imx8mm/n/q/p" is actually a machine
> compabile and "fsl,imx8mm/n/q/p-soc" is a compabile of soc@0
>     delete "flag" and change to determine whether the pointer is NULL
>     ues of_find_matching_node_and_match()
>     delete of_match_ptr()
> v5: add cleanup part "of_node_put"
>     add note to explain that why device_initcall still exists
> v6: none

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v6 4/4] soc: imx8m: change to use platform driver
  2020-11-24  1:59 ` [PATCH v6 4/4] soc: imx8m: change to use platform driver Alice Guo
  2020-11-24  9:48   ` Krzysztof Kozlowski
@ 2020-11-25  0:44   ` Adam Ford
  2020-11-25  7:33     ` Krzysztof Kozlowski
  2020-11-26  2:15     ` Alice Guo
  2020-12-02  1:27   ` kernel test robot
  2 siblings, 2 replies; 16+ messages in thread
From: Adam Ford @ 2020-11-25  0:44 UTC (permalink / raw)
  To: Alice Guo
  Cc: devicetree, Peng Fan, Sascha Hauer, Linux Kernel Mailing List,
	Krzysztof Kozlowski, Rob Herring, NXP Linux Team, Shawn Guo,
	arm-soc

On Mon, Nov 23, 2020 at 8:04 PM Alice Guo <alice.guo@nxp.com> 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>
> ---
>
The patch reads V6, but the change log only shows V2.  Can you
elaborate on what has changed between V2 and V6?

adam

> v2: remove the subject prefix "LF-2571-4"
> v3: Keep the original way which uses device_initcall to read soc unique
>     ID, and add the other way which uses module_platform_driver and
>     nvmem API, so that it will not break the old version DTBs.
> v4: delete "__maybe_unused"
>     delete MODULE_DEVICE_TABLE(of, imx8m_soc_match);
>     rename match table, "fsl,imx8mm/n/q/p" is actually a machine
> compabile and "fsl,imx8mm/n/q/p-soc" is a compabile of soc@0
>     delete "flag" and change to determine whether the pointer is NULL
>     ues of_find_matching_node_and_match()
>     delete of_match_ptr()
> v5: add cleanup part "of_node_put"
>     add note to explain that why device_initcall still exists
> v6: none
>
>  drivers/soc/imx/soc-imx8m.c | 87 ++++++++++++++++++++++++++++++++-----
>  1 file changed, 75 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/soc/imx/soc-imx8m.c b/drivers/soc/imx/soc-imx8m.c
> index cc57a384d74d..250530177920 100644
> --- a/drivers/soc/imx/soc-imx8m.c
> +++ b/drivers/soc/imx/soc-imx8m.c
> @@ -5,6 +5,8 @@
>
>  #include <linux/init.h>
>  #include <linux/io.h>
> +#include <linux/module.h>
> +#include <linux/nvmem-consumer.h>
>  #include <linux/of_address.h>
>  #include <linux/slab.h>
>  #include <linux/sys_soc.h>
> @@ -29,7 +31,7 @@
>
>  struct imx8_soc_data {
>         char *name;
> -       u32 (*soc_revision)(void);
> +       u32 (*soc_revision)(struct device *dev);
>  };
>
>  static u64 soc_uid;
> @@ -50,7 +52,7 @@ static u32 imx8mq_soc_revision_from_atf(void)
>  static inline u32 imx8mq_soc_revision_from_atf(void) { return 0; };
>  #endif
>
> -static u32 __init imx8mq_soc_revision(void)
> +static u32 __init imx8mq_soc_revision(struct device *dev)
>  {
>         struct device_node *np;
>         void __iomem *ocotp_base;
> @@ -75,9 +77,20 @@ static u32 __init imx8mq_soc_revision(void)
>                         rev = REV_B1;
>         }
>
> -       soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH);
> -       soc_uid <<= 32;
> -       soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW);
> +       if (dev) {
> +               int ret = 0;
> +
> +               ret = nvmem_cell_read_u64(dev, "soc_unique_id", &soc_uid);
> +               if (ret) {
> +                       iounmap(ocotp_base);
> +                       of_node_put(np);
> +                       return ret;
> +               }
> +       } else {
> +               soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH);
> +               soc_uid <<= 32;
> +               soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW);
> +       }
>
>         iounmap(ocotp_base);
>         of_node_put(np);
> @@ -107,7 +120,7 @@ static void __init imx8mm_soc_uid(void)
>         of_node_put(np);
>  }
>
> -static u32 __init imx8mm_soc_revision(void)
> +static u32 __init imx8mm_soc_revision(struct device *dev)
>  {
>         struct device_node *np;
>         void __iomem *anatop_base;
> @@ -125,7 +138,15 @@ static u32 __init imx8mm_soc_revision(void)
>         iounmap(anatop_base);
>         of_node_put(np);
>
> -       imx8mm_soc_uid();
> +       if (dev) {
> +               int ret = 0;
> +
> +               ret = nvmem_cell_read_u64(dev, "soc_unique_id", &soc_uid);
> +               if (ret)
> +                       return ret;
> +       } else {
> +               imx8mm_soc_uid();
> +       }
>
>         return rev;
>  }
> @@ -150,7 +171,7 @@ static const struct imx8_soc_data imx8mp_soc_data = {
>         .soc_revision = imx8mm_soc_revision,
>  };
>
> -static __maybe_unused const struct of_device_id imx8_soc_match[] = {
> +static const struct of_device_id imx8_machine_match[] = {
>         { .compatible = "fsl,imx8mq", .data = &imx8mq_soc_data, },
>         { .compatible = "fsl,imx8mm", .data = &imx8mm_soc_data, },
>         { .compatible = "fsl,imx8mn", .data = &imx8mn_soc_data, },
> @@ -158,12 +179,20 @@ static __maybe_unused const struct of_device_id imx8_soc_match[] = {
>         { }
>  };
>
> +static const struct of_device_id imx8_soc_match[] = {
> +       { .compatible = "fsl,imx8mq-soc", .data = &imx8mq_soc_data, },
> +       { .compatible = "fsl,imx8mm-soc", .data = &imx8mm_soc_data, },
> +       { .compatible = "fsl,imx8mn-soc", .data = &imx8mn_soc_data, },
> +       { .compatible = "fsl,imx8mp-soc", .data = &imx8mp_soc_data, },
> +       { }
> +};
> +
>  #define imx8_revision(soc_rev) \
>         soc_rev ? \
>         kasprintf(GFP_KERNEL, "%d.%d", (soc_rev >> 4) & 0xf,  soc_rev & 0xf) : \
>         "unknown"
>
> -static int __init imx8_soc_init(void)
> +static int imx8_soc_info(struct platform_device *pdev)
>  {
>         struct soc_device_attribute *soc_dev_attr;
>         struct soc_device *soc_dev;
> @@ -182,7 +211,10 @@ static int __init imx8_soc_init(void)
>         if (ret)
>                 goto free_soc;
>
> -       id = of_match_node(imx8_soc_match, of_root);
> +       if (pdev)
> +               id = of_match_node(imx8_soc_match, pdev->dev.of_node);
> +       else
> +               id = of_match_node(imx8_machine_match, of_root);
>         if (!id) {
>                 ret = -ENODEV;
>                 goto free_soc;
> @@ -191,8 +223,16 @@ static int __init imx8_soc_init(void)
>         data = id->data;
>         if (data) {
>                 soc_dev_attr->soc_id = data->name;
> -               if (data->soc_revision)
> -                       soc_rev = data->soc_revision();
> +               if (data->soc_revision) {
> +                       if (pdev) {
> +                               soc_rev = data->soc_revision(&pdev->dev);
> +                               ret = soc_rev;
> +                               if (ret < 0)
> +                                       goto free_soc;
> +                       } else {
> +                               soc_rev = data->soc_revision(NULL);
> +                       }
> +               }
>         }
>
>         soc_dev_attr->revision = imx8_revision(soc_rev);
> @@ -230,4 +270,27 @@ static int __init imx8_soc_init(void)
>         kfree(soc_dev_attr);
>         return ret;
>  }
> +
> +/* Retain device_initcall is for backward compatibility with DTS. */
> +static int __init imx8_soc_init(void)
> +{
> +       int ret = 0;
> +
> +       if (of_find_matching_node_and_match(NULL, imx8_soc_match, NULL))
> +               return 0;
> +
> +       ret = imx8_soc_info(NULL);
> +       return ret;
> +}
>  device_initcall(imx8_soc_init);
> +
> +static struct platform_driver imx8_soc_info_driver = {
> +       .probe = imx8_soc_info,
> +       .driver = {
> +               .name = "imx8_soc_info",
> +               .of_match_table = imx8_soc_match,
> +       },
> +};
> +
> +module_platform_driver(imx8_soc_info_driver);
> +MODULE_LICENSE("GPL v2");
> --
> 2.17.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v6 4/4] soc: imx8m: change to use platform driver
  2020-11-25  0:44   ` Adam Ford
@ 2020-11-25  7:33     ` Krzysztof Kozlowski
  2020-11-26  2:15     ` Alice Guo
  1 sibling, 0 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2020-11-25  7:33 UTC (permalink / raw)
  To: Adam Ford
  Cc: devicetree, Peng Fan, Alice Guo, Sascha Hauer,
	Linux Kernel Mailing List, Rob Herring, NXP Linux Team,
	Shawn Guo, arm-soc

On Wed, 25 Nov 2020 at 01:44, Adam Ford <aford173@gmail.com> wrote:
>
> On Mon, Nov 23, 2020 at 8:04 PM Alice Guo <alice.guo@nxp.com> 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>
> > ---
> >
> The patch reads V6, but the change log only shows V2.  Can you
> elaborate on what has changed between V2 and V6?
>
> adam
>
> > v2: remove the subject prefix "LF-2571-4"
> > v3: Keep the original way which uses device_initcall to read soc unique
> >     ID, and add the other way which uses module_platform_driver and
> >     nvmem API, so that it will not break the old version DTBs.
> > v4: delete "__maybe_unused"
> >     delete MODULE_DEVICE_TABLE(of, imx8m_soc_match);
> >     rename match table, "fsl,imx8mm/n/q/p" is actually a machine
> > compabile and "fsl,imx8mm/n/q/p-soc" is a compabile of soc@0
> >     delete "flag" and change to determine whether the pointer is NULL
> >     ues of_find_matching_node_and_match()
> >     delete of_match_ptr()
> > v5: add cleanup part "of_node_put"
> >     add note to explain that why device_initcall still exists
> > v6: none

Hi Adam,

It says up to v6, just in unnatural order... I was also surprised.

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH v6 4/4] soc: imx8m: change to use platform driver
  2020-11-25  0:44   ` Adam Ford
  2020-11-25  7:33     ` Krzysztof Kozlowski
@ 2020-11-26  2:15     ` Alice Guo
  2020-11-26  8:07       ` Krzysztof Kozlowski
  1 sibling, 1 reply; 16+ messages in thread
From: Alice Guo @ 2020-11-26  2:15 UTC (permalink / raw)
  To: Adam Ford, Krzysztof Kozlowski, shawnguo
  Cc: devicetree, Peng Fan, Sascha Hauer, Linux Kernel Mailing List,
	Krzysztof Kozlowski, Rob Herring, dl-linux-imx, arm-soc



> -----Original Message-----
> From: linux-arm-kernel <linux-arm-kernel-bounces@lists.infradead.org> On
> Behalf Of Adam Ford
> Sent: 2020年11月25日 8:45
> To: Alice Guo <alice.guo@nxp.com>
> Cc: devicetree <devicetree@vger.kernel.org>; Peng Fan <peng.fan@nxp.com>;
> Sascha Hauer <s.hauer@pengutronix.de>; Linux Kernel Mailing List
> <linux-kernel@vger.kernel.org>; Krzysztof Kozlowski <krzk@kernel.org>; Rob
> Herring <robh+dt@kernel.org>; dl-linux-imx <linux-imx@nxp.com>; Shawn Guo
> <shawnguo@kernel.org>; arm-soc <linux-arm-kernel@lists.infradead.org>
> Subject: Re: [PATCH v6 4/4] soc: imx8m: change to use platform driver
> 
> On Mon, Nov 23, 2020 at 8:04 PM Alice Guo <alice.guo@nxp.com> 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>
> > ---
> >
> The patch reads V6, but the change log only shows V2.  Can you elaborate on
> what has changed between V2 and V6?
> 
> adam

Hi,

Sorry. The order of changlog is reversed. Thank Adam for pointing out the problem, and thank Krzysztof for reviewing my patch.
Do I need to resend the patchset with the correct changelog order?

Best regards,
Alice

> > v2: remove the subject prefix "LF-2571-4"
> > v3: Keep the original way which uses device_initcall to read soc unique
> >     ID, and add the other way which uses module_platform_driver and
> >     nvmem API, so that it will not break the old version DTBs.
> > v4: delete "__maybe_unused"
> >     delete MODULE_DEVICE_TABLE(of, imx8m_soc_match);
> >     rename match table, "fsl,imx8mm/n/q/p" is actually a machine
> > compabile and "fsl,imx8mm/n/q/p-soc" is a compabile of soc@0
> >     delete "flag" and change to determine whether the pointer is NULL
> >     ues of_find_matching_node_and_match()
> >     delete of_match_ptr()
> > v5: add cleanup part "of_node_put"
> >     add note to explain that why device_initcall still exists
> > v6: none
> >
> >  drivers/soc/imx/soc-imx8m.c | 87
> > ++++++++++++++++++++++++++++++++-----
> >  1 file changed, 75 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/soc/imx/soc-imx8m.c b/drivers/soc/imx/soc-imx8m.c
> > index cc57a384d74d..250530177920 100644
> > --- a/drivers/soc/imx/soc-imx8m.c
> > +++ b/drivers/soc/imx/soc-imx8m.c
> > @@ -5,6 +5,8 @@
> >
> >  #include <linux/init.h>
> >  #include <linux/io.h>
> > +#include <linux/module.h>
> > +#include <linux/nvmem-consumer.h>
> >  #include <linux/of_address.h>
> >  #include <linux/slab.h>
> >  #include <linux/sys_soc.h>
> > @@ -29,7 +31,7 @@
> >
> >  struct imx8_soc_data {
> >         char *name;
> > -       u32 (*soc_revision)(void);
> > +       u32 (*soc_revision)(struct device *dev);
> >  };
> >
> >  static u64 soc_uid;
> > @@ -50,7 +52,7 @@ static u32 imx8mq_soc_revision_from_atf(void)
> >  static inline u32 imx8mq_soc_revision_from_atf(void) { return 0; };
> > #endif
> >
> > -static u32 __init imx8mq_soc_revision(void)
> > +static u32 __init imx8mq_soc_revision(struct device *dev)
> >  {
> >         struct device_node *np;
> >         void __iomem *ocotp_base;
> > @@ -75,9 +77,20 @@ static u32 __init imx8mq_soc_revision(void)
> >                         rev = REV_B1;
> >         }
> >
> > -       soc_uid = readl_relaxed(ocotp_base + OCOTP_UID_HIGH);
> > -       soc_uid <<= 32;
> > -       soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW);
> > +       if (dev) {
> > +               int ret = 0;
> > +
> > +               ret = nvmem_cell_read_u64(dev, "soc_unique_id",
> &soc_uid);
> > +               if (ret) {
> > +                       iounmap(ocotp_base);
> > +                       of_node_put(np);
> > +                       return ret;
> > +               }
> > +       } else {
> > +               soc_uid = readl_relaxed(ocotp_base +
> OCOTP_UID_HIGH);
> > +               soc_uid <<= 32;
> > +               soc_uid |= readl_relaxed(ocotp_base +
> OCOTP_UID_LOW);
> > +       }
> >
> >         iounmap(ocotp_base);
> >         of_node_put(np);
> > @@ -107,7 +120,7 @@ static void __init imx8mm_soc_uid(void)
> >         of_node_put(np);
> >  }
> >
> > -static u32 __init imx8mm_soc_revision(void)
> > +static u32 __init imx8mm_soc_revision(struct device *dev)
> >  {
> >         struct device_node *np;
> >         void __iomem *anatop_base;
> > @@ -125,7 +138,15 @@ static u32 __init imx8mm_soc_revision(void)
> >         iounmap(anatop_base);
> >         of_node_put(np);
> >
> > -       imx8mm_soc_uid();
> > +       if (dev) {
> > +               int ret = 0;
> > +
> > +               ret = nvmem_cell_read_u64(dev, "soc_unique_id",
> &soc_uid);
> > +               if (ret)
> > +                       return ret;
> > +       } else {
> > +               imx8mm_soc_uid();
> > +       }
> >
> >         return rev;
> >  }
> > @@ -150,7 +171,7 @@ static const struct imx8_soc_data imx8mp_soc_data
> = {
> >         .soc_revision = imx8mm_soc_revision,  };
> >
> > -static __maybe_unused const struct of_device_id imx8_soc_match[] = {
> > +static const struct of_device_id imx8_machine_match[] = {
> >         { .compatible = "fsl,imx8mq", .data = &imx8mq_soc_data, },
> >         { .compatible = "fsl,imx8mm", .data = &imx8mm_soc_data, },
> >         { .compatible = "fsl,imx8mn", .data = &imx8mn_soc_data, }, @@
> > -158,12 +179,20 @@ static __maybe_unused const struct of_device_id
> imx8_soc_match[] = {
> >         { }
> >  };
> >
> > +static const struct of_device_id imx8_soc_match[] = {
> > +       { .compatible = "fsl,imx8mq-soc", .data = &imx8mq_soc_data, },
> > +       { .compatible = "fsl,imx8mm-soc", .data = &imx8mm_soc_data, },
> > +       { .compatible = "fsl,imx8mn-soc", .data = &imx8mn_soc_data, },
> > +       { .compatible = "fsl,imx8mp-soc", .data = &imx8mp_soc_data, },
> > +       { }
> > +};
> > +
> >  #define imx8_revision(soc_rev) \
> >         soc_rev ? \
> >         kasprintf(GFP_KERNEL, "%d.%d", (soc_rev >> 4) & 0xf,  soc_rev &
> 0xf) : \
> >         "unknown"
> >
> > -static int __init imx8_soc_init(void)
> > +static int imx8_soc_info(struct platform_device *pdev)
> >  {
> >         struct soc_device_attribute *soc_dev_attr;
> >         struct soc_device *soc_dev;
> > @@ -182,7 +211,10 @@ static int __init imx8_soc_init(void)
> >         if (ret)
> >                 goto free_soc;
> >
> > -       id = of_match_node(imx8_soc_match, of_root);
> > +       if (pdev)
> > +               id = of_match_node(imx8_soc_match,
> pdev->dev.of_node);
> > +       else
> > +               id = of_match_node(imx8_machine_match, of_root);
> >         if (!id) {
> >                 ret = -ENODEV;
> >                 goto free_soc;
> > @@ -191,8 +223,16 @@ static int __init imx8_soc_init(void)
> >         data = id->data;
> >         if (data) {
> >                 soc_dev_attr->soc_id = data->name;
> > -               if (data->soc_revision)
> > -                       soc_rev = data->soc_revision();
> > +               if (data->soc_revision) {
> > +                       if (pdev) {
> > +                               soc_rev =
> data->soc_revision(&pdev->dev);
> > +                               ret = soc_rev;
> > +                               if (ret < 0)
> > +                                       goto free_soc;
> > +                       } else {
> > +                               soc_rev = data->soc_revision(NULL);
> > +                       }
> > +               }
> >         }
> >
> >         soc_dev_attr->revision = imx8_revision(soc_rev); @@ -230,4
> > +270,27 @@ static int __init imx8_soc_init(void)
> >         kfree(soc_dev_attr);
> >         return ret;
> >  }
> > +
> > +/* Retain device_initcall is for backward compatibility with DTS. */
> > +static int __init imx8_soc_init(void) {
> > +       int ret = 0;
> > +
> > +       if (of_find_matching_node_and_match(NULL, imx8_soc_match,
> NULL))
> > +               return 0;
> > +
> > +       ret = imx8_soc_info(NULL);
> > +       return ret;
> > +}
> >  device_initcall(imx8_soc_init);
> > +
> > +static struct platform_driver imx8_soc_info_driver = {
> > +       .probe = imx8_soc_info,
> > +       .driver = {
> > +               .name = "imx8_soc_info",
> > +               .of_match_table = imx8_soc_match,
> > +       },
> > +};
> > +
> > +module_platform_driver(imx8_soc_info_driver);
> > +MODULE_LICENSE("GPL v2");
> > --
> > 2.17.1
> >
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v6 4/4] soc: imx8m: change to use platform driver
  2020-11-26  2:15     ` Alice Guo
@ 2020-11-26  8:07       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2020-11-26  8:07 UTC (permalink / raw)
  To: Alice Guo
  Cc: devicetree, Peng Fan, Adam Ford, Sascha Hauer,
	Linux Kernel Mailing List, Rob Herring, dl-linux-imx, shawnguo,
	arm-soc

On Thu, Nov 26, 2020 at 02:15:35AM +0000, Alice Guo wrote:
> 
> 
> > -----Original Message-----
> > From: linux-arm-kernel <linux-arm-kernel-bounces@lists.infradead.org> On
> > Behalf Of Adam Ford
> > Sent: 2020年11月25日 8:45
> > To: Alice Guo <alice.guo@nxp.com>
> > Cc: devicetree <devicetree@vger.kernel.org>; Peng Fan <peng.fan@nxp.com>;
> > Sascha Hauer <s.hauer@pengutronix.de>; Linux Kernel Mailing List
> > <linux-kernel@vger.kernel.org>; Krzysztof Kozlowski <krzk@kernel.org>; Rob
> > Herring <robh+dt@kernel.org>; dl-linux-imx <linux-imx@nxp.com>; Shawn Guo
> > <shawnguo@kernel.org>; arm-soc <linux-arm-kernel@lists.infradead.org>
> > Subject: Re: [PATCH v6 4/4] soc: imx8m: change to use platform driver
> > 
> > On Mon, Nov 23, 2020 at 8:04 PM Alice Guo <alice.guo@nxp.com> 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>
> > > ---
> > >
> > The patch reads V6, but the change log only shows V2.  Can you elaborate on
> > what has changed between V2 and V6?
> > 
> > adam
> 
> Hi,
> 
> Sorry. The order of changlog is reversed. Thank Adam for pointing out the problem, and thank Krzysztof for reviewing my patch.
> Do I need to resend the patchset with the correct changelog order?

No, no need.

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID
  2020-11-24  1:59 [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID Alice Guo
                   ` (3 preceding siblings ...)
  2020-11-24  9:46 ` [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID Krzysztof Kozlowski
@ 2020-11-30 21:57 ` Rob Herring
  2020-12-01  3:31   ` Alice Guo (OSS)
  4 siblings, 1 reply; 16+ messages in thread
From: Rob Herring @ 2020-11-30 21:57 UTC (permalink / raw)
  To: Alice Guo
  Cc: devicetree, peng.fan, s.hauer, linux-kernel, krzk, linux-imx,
	shawnguo, linux-arm-kernel

On Tue, Nov 24, 2020 at 09:59:46AM +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

No, I prefer this be a separate schema file and not clutter board/soc 
schemas with child nodes.

>     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
> v6: none
> 
>  .../devicetree/bindings/arm/fsl.yaml          | 47 +++++++++++++++++++
>  1 file changed, 47 insertions(+)
> 
> 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

Fix your dts files and drop this.

> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - fsl,imx8mm
> +              - fsl,imx8mn
> +              - fsl,imx8mp
> +              - fsl,imx8mq
> +
> +    then:
> +      patternProperties:
> +        "^soc@[0-9a-f]+$":

And this is just wrong. First you say the node is 'soc' and then here it 
has a unit address.

> +          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
> 
>  ...
> --
> 2.17.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID
  2020-11-30 21:57 ` Rob Herring
@ 2020-12-01  3:31   ` Alice Guo (OSS)
  2020-12-09  2:30     ` Alice Guo (OSS)
  0 siblings, 1 reply; 16+ messages in thread
From: Alice Guo (OSS) @ 2020-12-01  3:31 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, shawnguo
  Cc: devicetree, Peng Fan, s.hauer, linux-kernel, krzk, dl-linux-imx,
	linux-arm-kernel



> -----Original Message-----
> From: linux-arm-kernel <linux-arm-kernel-bounces@lists.infradead.org> On
> Behalf Of Rob Herring
> Sent: 2020年12月1日 5:57
> To: Alice Guo <alice.guo@nxp.com>
> Cc: devicetree@vger.kernel.org; Peng Fan <peng.fan@nxp.com>;
> s.hauer@pengutronix.de; linux-kernel@vger.kernel.org; krzk@kernel.org;
> dl-linux-imx <linux-imx@nxp.com>; shawnguo@kernel.org;
> linux-arm-kernel@lists.infradead.org
> Subject: Re: [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc
> unique ID
> 
> On Tue, Nov 24, 2020 at 09:59:46AM +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
> 
> No, I prefer this be a separate schema file and not clutter board/soc schemas
> with child nodes.

Hi,
Thank you for your comments. I read "Documentation/devicetree/bindings/arm/arm,realview.yaml"
in which there is a "soc". So I added my "soc" to this current file. Can I keep it in 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
> > v6: none
> >
> >  .../devicetree/bindings/arm/fsl.yaml          | 47
> +++++++++++++++++++
> >  1 file changed, 47 insertions(+)
> >
> > 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
> 
> Fix your dts files and drop this.

My changes are below.

> 
> > +
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            enum:
> > +              - fsl,imx8mm
> > +              - fsl,imx8mn
> > +              - fsl,imx8mp
> > +              - fsl,imx8mq
> > +
> > +    then:
> > +      patternProperties:
> > +        "^soc@[0-9a-f]+$":
> 
> And this is just wrong. First you say the node is 'soc' and then here it has a unit
> address.

Here are my changes. I deleted the section from "soc:" to "- const: simple bus". Please help me to see if they are correct and workable. Thank you.
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

Best Regards,
Alice Guo


> 
> > +          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
> >
> >  ...
> > --
> > 2.17.1
> >
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v6 4/4] soc: imx8m: change to use platform driver
  2020-11-24  1:59 ` [PATCH v6 4/4] soc: imx8m: change to use platform driver Alice Guo
  2020-11-24  9:48   ` Krzysztof Kozlowski
  2020-11-25  0:44   ` Adam Ford
@ 2020-12-02  1:27   ` kernel test robot
  2 siblings, 0 replies; 16+ messages in thread
From: kernel test robot @ 2020-12-02  1:27 UTC (permalink / raw)
  To: Alice Guo, robh+dt, shawnguo, s.hauer, krzk
  Cc: devicetree, peng.fan, kbuild-all, linux-kernel,
	clang-built-linux, linux-imx, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 2481 bytes --]

Hi Alice,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on v5.10-rc6 next-20201201]
[cannot apply to shawnguo/for-next krzk/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Alice-Guo/dt-bindings-soc-imx8m-add-DT-Binding-doc-for-soc-unique-ID/20201124-100402
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: mips-randconfig-r026-20201201 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 2671fccf0381769276ca8246ec0499adcb9b0355)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://github.com/0day-ci/linux/commit/410e3191d62767ba3d347a48d38ad3bd00bee387
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alice-Guo/dt-bindings-soc-imx8m-add-DT-Binding-doc-for-soc-unique-ID/20201124-100402
        git checkout 410e3191d62767ba3d347a48d38ad3bd00bee387
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/soc/imx/soc-imx8m.c:174:34: warning: unused variable 'imx8_machine_match' [-Wunused-const-variable]
   static const struct of_device_id imx8_machine_match[] = {
                                    ^
   1 warning generated.

vim +/imx8_machine_match +174 drivers/soc/imx/soc-imx8m.c

   173	
 > 174	static const struct of_device_id imx8_machine_match[] = {
   175		{ .compatible = "fsl,imx8mq", .data = &imx8mq_soc_data, },
   176		{ .compatible = "fsl,imx8mm", .data = &imx8mm_soc_data, },
   177		{ .compatible = "fsl,imx8mn", .data = &imx8mn_soc_data, },
   178		{ .compatible = "fsl,imx8mp", .data = &imx8mp_soc_data, },
   179		{ }
   180	};
   181	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 21800 bytes --]

[-- Attachment #3: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID
  2020-12-01  3:31   ` Alice Guo (OSS)
@ 2020-12-09  2:30     ` Alice Guo (OSS)
  2020-12-09  7:43       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 16+ messages in thread
From: Alice Guo (OSS) @ 2020-12-09  2:30 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, shawnguo
  Cc: devicetree, Peng Fan, s.hauer, linux-kernel, krzk, dl-linux-imx,
	linux-arm-kernel

Gentle ping..  and Krzysztof Kozlowski, do you agree?

Best Regards,
Alice Guo

> -----Original Message-----
> From: linux-arm-kernel <linux-arm-kernel-bounces@lists.infradead.org> On
> Behalf Of Alice Guo (OSS)
> Sent: 2020年12月1日 11:31
> To: Rob Herring <robh@kernel.org>; Krzysztof Kozlowski <krzk@kernel.org>;
> shawnguo@kernel.org
> Cc: devicetree@vger.kernel.org; Peng Fan <peng.fan@nxp.com>;
> s.hauer@pengutronix.de; linux-kernel@vger.kernel.org; krzk@kernel.org;
> dl-linux-imx <linux-imx@nxp.com>; linux-arm-kernel@lists.infradead.org
> Subject: RE: [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc
> unique ID
> 
> 
> 
> > -----Original Message-----
> > From: linux-arm-kernel <linux-arm-kernel-bounces@lists.infradead.org>
> > On Behalf Of Rob Herring
> > Sent: 2020年12月1日 5:57
> > To: Alice Guo <alice.guo@nxp.com>
> > Cc: devicetree@vger.kernel.org; Peng Fan <peng.fan@nxp.com>;
> > s.hauer@pengutronix.de; linux-kernel@vger.kernel.org; krzk@kernel.org;
> > dl-linux-imx <linux-imx@nxp.com>; shawnguo@kernel.org;
> > linux-arm-kernel@lists.infradead.org
> > Subject: Re: [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding
> > doc for soc unique ID
> >
> > On Tue, Nov 24, 2020 at 09:59:46AM +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
> >
> > No, I prefer this be a separate schema file and not clutter board/soc
> > schemas with child nodes.
> 
> Hi,
> Thank you for your comments. I read
> "Documentation/devicetree/bindings/arm/arm,realview.yaml"
> in which there is a "soc". So I added my "soc" to this current file. Can I keep it in
> 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
> > > v6: none
> > >
> > >  .../devicetree/bindings/arm/fsl.yaml          | 47
> > +++++++++++++++++++
> > >  1 file changed, 47 insertions(+)
> > >
> > > 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
> >
> > Fix your dts files and drop this.
> 
> My changes are below.
> 
> >
> > > +
> > > +allOf:
> > > +  - if:
> > > +      properties:
> > > +        compatible:
> > > +          contains:
> > > +            enum:
> > > +              - fsl,imx8mm
> > > +              - fsl,imx8mn
> > > +              - fsl,imx8mp
> > > +              - fsl,imx8mq
> > > +
> > > +    then:
> > > +      patternProperties:
> > > +        "^soc@[0-9a-f]+$":
> >
> > And this is just wrong. First you say the node is 'soc' and then here
> > it has a unit address.
> 
> Here are my changes. I deleted the section from "soc:" to "- const: simple bus".
> Please help me to see if they are correct and workable. Thank you.
> 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
> 
> Best Regards,
> Alice Guo
> 
> 
> >
> > > +          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
> > >
> > >  ...
> > > --
> > > 2.17.1
> > >
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID
  2020-12-09  2:30     ` Alice Guo (OSS)
@ 2020-12-09  7:43       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 16+ messages in thread
From: Krzysztof Kozlowski @ 2020-12-09  7:43 UTC (permalink / raw)
  To: Alice Guo (OSS)
  Cc: Rob Herring, Peng Fan, devicetree, s.hauer, linux-kernel,
	dl-linux-imx, shawnguo, linux-arm-kernel

On Wed, Dec 09, 2020 at 02:30:22AM +0000, Alice Guo (OSS) wrote:
> Gentle ping..  and Krzysztof Kozlowski, do you agree?

I did not know that you wait for something from my side.

> 
> Best Regards,
> Alice Guo
> 
> > -----Original Message-----
> > From: linux-arm-kernel <linux-arm-kernel-bounces@lists.infradead.org> On
> > Behalf Of Alice Guo (OSS)
> > Sent: 2020年12月1日 11:31
> > To: Rob Herring <robh@kernel.org>; Krzysztof Kozlowski <krzk@kernel.org>;
> > shawnguo@kernel.org
> > Cc: devicetree@vger.kernel.org; Peng Fan <peng.fan@nxp.com>;
> > s.hauer@pengutronix.de; linux-kernel@vger.kernel.org; krzk@kernel.org;
> > dl-linux-imx <linux-imx@nxp.com>; linux-arm-kernel@lists.infradead.org
> > Subject: RE: [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc
> > unique ID
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: linux-arm-kernel <linux-arm-kernel-bounces@lists.infradead.org>
> > > On Behalf Of Rob Herring
> > > Sent: 2020年12月1日 5:57
> > > To: Alice Guo <alice.guo@nxp.com>
> > > Cc: devicetree@vger.kernel.org; Peng Fan <peng.fan@nxp.com>;
> > > s.hauer@pengutronix.de; linux-kernel@vger.kernel.org; krzk@kernel.org;
> > > dl-linux-imx <linux-imx@nxp.com>; shawnguo@kernel.org;
> > > linux-arm-kernel@lists.infradead.org
> > > Subject: Re: [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding
> > > doc for soc unique ID
> > >
> > > On Tue, Nov 24, 2020 at 09:59:46AM +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
> > >
> > > No, I prefer this be a separate schema file and not clutter board/soc
> > > schemas with child nodes.
> > 
> > Hi,
> > Thank you for your comments. I read
> > "Documentation/devicetree/bindings/arm/arm,realview.yaml"
> > in which there is a "soc". So I added my "soc" to this current file. Can I keep it in
> > Documentation/devicetree/bindings/arm/fsl.yaml?

Please go with Rob's suggestion.

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-12-09  7:44 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-24  1:59 [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID Alice Guo
2020-11-24  1:59 ` [PATCH v6 2/4] arm64: dts: imx8m: add SoC ID compatible Alice Guo
2020-11-24  1:59 ` [PATCH v6 3/4] arm64: dts: imx8m: add NVMEM provider and consumer to read soc unique ID Alice Guo
2020-11-24  9:47   ` Krzysztof Kozlowski
2020-11-24  1:59 ` [PATCH v6 4/4] soc: imx8m: change to use platform driver Alice Guo
2020-11-24  9:48   ` Krzysztof Kozlowski
2020-11-25  0:44   ` Adam Ford
2020-11-25  7:33     ` Krzysztof Kozlowski
2020-11-26  2:15     ` Alice Guo
2020-11-26  8:07       ` Krzysztof Kozlowski
2020-12-02  1:27   ` kernel test robot
2020-11-24  9:46 ` [PATCH v6 1/4] dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID Krzysztof Kozlowski
2020-11-30 21:57 ` Rob Herring
2020-12-01  3:31   ` Alice Guo (OSS)
2020-12-09  2:30     ` Alice Guo (OSS)
2020-12-09  7:43       ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).