linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] arm64: dts: imx8mx: move soc device into ocotp
@ 2021-06-07 18:05 Robin Gong
  2021-06-12  8:01 ` Shawn Guo
  2021-06-12 11:49 ` Aisheng Dong
  0 siblings, 2 replies; 4+ messages in thread
From: Robin Gong @ 2021-06-07 18:05 UTC (permalink / raw)
  To: alice.guo, robh+dt, shawnguo, s.hauer, festevam, kernel, linux-imx
  Cc: devicetree, linux-arm-kernel, linux-kernel

move soc device into ocotp device node instead of the parent device
of the all devices which located in 'soc@0', otherwise, all probed
children devices will be reorder to dmp_list again once 'imx8mx-soc'
device defered probed, which may break driver's suspend/resume sequence,
such as imx_spdif and fsl_spdif, hence the later would suspended before
the former as below and endless interrupt may never be handled since
clock has been disabled already in the later.

[    1.930598] calling  fsl_spdif_driver_init+0x0/0x20 @ 1
[    1.955712] initcall fsl_spdif_driver_init+0x0/0x20 returned 0 after 24512 usecs
[    1.981963] calling  imx_spdif_driver_init+0x0/0x20 @ 1
[    1.986600] initcall imx_spdif_driver_init+0x0/0x20 returned 0 after 4509 usecs
[    2.901408]   #0: imx-spdif
[   21.151529] fsl-spdif-dai 30090000.spdif: calling platform_pm_suspend+0x0/0x70 @ 470, parent: 30000000.bus
[   21.161189] fsl-spdif-dai 30090000.spdif: platform_pm_suspend+0x0/0x70 returned 0 after 0 usecs
[   21.474311] imx-spdif sound-spdif: calling platform_pm_suspend+0x0/0x70 @ 470, parent: platform
[   21.483024] imx-spdif sound-spdif: platform_pm_suspend+0x0/0x70 returned 0 after 9 usecs

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8mm.dtsi | 12 ++++++++----
 arch/arm64/boot/dts/freescale/imx8mn.dtsi | 13 +++++++++----
 arch/arm64/boot/dts/freescale/imx8mp.dtsi | 13 +++++++++----
 arch/arm64/boot/dts/freescale/imx8mq.dtsi | 12 ++++++++----
 4 files changed, 34 insertions(+), 16 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
index e7648c3..9ef0554 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
@@ -257,13 +257,11 @@
 	};
 
 	soc@0 {
-		compatible = "fsl,imx8mm-soc", "simple-bus";
+		compatible = "simple-bus";
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges = <0x0 0x0 0x0 0x3e000000>;
 		dma-ranges = <0x40000000 0x0 0x40000000 0xc0000000>;
-		nvmem-cells = <&imx8mm_uid>;
-		nvmem-cell-names = "soc_unique_id";
 
 		aips1: bus@30000000 {
 			compatible = "fsl,aips-bus", "simple-bus";
@@ -522,7 +520,7 @@
 			};
 
 			ocotp: efuse@30350000 {
-				compatible = "fsl,imx8mm-ocotp", "syscon";
+				compatible = "fsl,imx8mm-ocotp", "syscon", "simple-mfd";
 				reg = <0x30350000 0x10000>;
 				clocks = <&clk IMX8MM_CLK_OCOTP_ROOT>;
 				/* For nvmem subnodes */
@@ -540,6 +538,12 @@
 				fec_mac_address: mac-address@90 {
 					reg = <0x90 6>;
 				};
+
+				imx8mm_soc: imx8mm-soc {
+					compatible = "fsl,imx8mm-soc";
+					nvmem-cells = <&imx8mm_uid>;
+					nvmem-cell-names = "soc_unique_id";
+				};
 			};
 
 			anatop: anatop@30360000 {
diff --git a/arch/arm64/boot/dts/freescale/imx8mn.dtsi b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
index d4231e0..f82905c 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
@@ -241,13 +241,11 @@
 	};
 
 	soc@0 {
-		compatible = "fsl,imx8mn-soc", "simple-bus";
+		compatible = "simple-bus";
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges = <0x0 0x0 0x0 0x3e000000>;
 		dma-ranges = <0x40000000 0x0 0x40000000 0xc0000000>;
-		nvmem-cells = <&imx8mn_uid>;
-		nvmem-cell-names = "soc_unique_id";
 
 		aips1: bus@30000000 {
 			compatible = "fsl,aips-bus", "simple-bus";
@@ -528,7 +526,8 @@
 			};
 
 			ocotp: efuse@30350000 {
-				compatible = "fsl,imx8mn-ocotp", "fsl,imx8mm-ocotp", "syscon";
+				compatible = "fsl,imx8mn-ocotp", "fsl,imx8mm-ocotp", "syscon",
+						"simple-mfd";
 				reg = <0x30350000 0x10000>;
 				clocks = <&clk IMX8MN_CLK_OCOTP_ROOT>;
 				#address-cells = <1>;
@@ -545,6 +544,12 @@
 				fec_mac_address: mac-address@90 {
 					reg = <0x90 6>;
 				};
+
+				imx8mn_soc: imx8mn-soc {
+					compatible = "fsl,imx8mn-soc";
+					nvmem-cells = <&imx8mn_uid>;
+					nvmem-cell-names = "soc_unique_id";
+				};
 			};
 
 			anatop: anatop@30360000 {
diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index 9f7c7f5..d113691 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -220,12 +220,10 @@
 	};
 
 	soc@0 {
-		compatible = "fsl,imx8mp-soc", "simple-bus";
+		compatible = "simple-bus";
 		#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";
@@ -341,7 +339,8 @@
 			};
 
 			ocotp: efuse@30350000 {
-				compatible = "fsl,imx8mp-ocotp", "fsl,imx8mm-ocotp", "syscon";
+				compatible = "fsl,imx8mp-ocotp", "fsl,imx8mm-ocotp", "syscon",
+						"simple-mfd";
 				reg = <0x30350000 0x10000>;
 				clocks = <&clk IMX8MP_CLK_OCOTP_ROOT>;
 				/* For nvmem subnodes */
@@ -359,6 +358,12 @@
 				eth_mac1: mac-address@90 {
 					reg = <0x90 6>;
 				};
+
+				imx8mp_soc: imx8mp-soc {
+					compatible = "fsl,imx8mp-soc";
+					nvmem-cells = <&imx8mp_uid>;
+					nvmem-cell-names = "soc_unique_id";
+				};
 			};
 
 			anatop: anatop@30360000 {
diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
index 91df9c5..8cfbc77 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
@@ -287,13 +287,11 @@
 	};
 
 	soc@0 {
-		compatible = "fsl,imx8mq-soc", "simple-bus";
+		compatible = "simple-bus";
 		#address-cells = <1>;
 		#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";
@@ -554,7 +552,7 @@
 			};
 
 			ocotp: efuse@30350000 {
-				compatible = "fsl,imx8mq-ocotp", "syscon";
+				compatible = "fsl,imx8mq-ocotp", "syscon", "simple-mfd";
 				reg = <0x30350000 0x10000>;
 				clocks = <&clk IMX8MQ_CLK_OCOTP_ROOT>;
 				#address-cells = <1>;
@@ -571,6 +569,12 @@
 				fec_mac_address: mac-address@90 {
 					reg = <0x90 6>;
 				};
+
+				imx8mq_soc: imx8mq-soc {
+					compatible = "fsl,imx8mq-soc";
+					nvmem-cells = <&imx8mq_uid>;
+					nvmem-cell-names = "soc_unique_id";
+				};
 			};
 
 			anatop: syscon@30360000 {
-- 
2.7.4


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

* Re: [PATCH v1] arm64: dts: imx8mx: move soc device into ocotp
  2021-06-07 18:05 [PATCH v1] arm64: dts: imx8mx: move soc device into ocotp Robin Gong
@ 2021-06-12  8:01 ` Shawn Guo
  2021-06-15  9:35   ` Robin Gong
  2021-06-12 11:49 ` Aisheng Dong
  1 sibling, 1 reply; 4+ messages in thread
From: Shawn Guo @ 2021-06-12  8:01 UTC (permalink / raw)
  To: Robin Gong
  Cc: alice.guo, robh+dt, s.hauer, festevam, kernel, linux-imx,
	devicetree, linux-arm-kernel, linux-kernel

On Tue, Jun 08, 2021 at 02:05:12AM +0800, Robin Gong wrote:
> move soc device into ocotp device node instead of the parent device
> of the all devices which located in 'soc@0', otherwise, all probed
> children devices will be reorder to dmp_list again once 'imx8mx-soc'
> device defered probed, which may break driver's suspend/resume sequence,
> such as imx_spdif and fsl_spdif, hence the later would suspended before
> the former as below and endless interrupt may never be handled since
> clock has been disabled already in the later.
> 
> [    1.930598] calling  fsl_spdif_driver_init+0x0/0x20 @ 1
> [    1.955712] initcall fsl_spdif_driver_init+0x0/0x20 returned 0 after 24512 usecs
> [    1.981963] calling  imx_spdif_driver_init+0x0/0x20 @ 1
> [    1.986600] initcall imx_spdif_driver_init+0x0/0x20 returned 0 after 4509 usecs
> [    2.901408]   #0: imx-spdif
> [   21.151529] fsl-spdif-dai 30090000.spdif: calling platform_pm_suspend+0x0/0x70 @ 470, parent: 30000000.bus
> [   21.161189] fsl-spdif-dai 30090000.spdif: platform_pm_suspend+0x0/0x70 returned 0 after 0 usecs
> [   21.474311] imx-spdif sound-spdif: calling platform_pm_suspend+0x0/0x70 @ 470, parent: platform
> [   21.483024] imx-spdif sound-spdif: platform_pm_suspend+0x0/0x70 returned 0 after 9 usecs

DT is written as a description of hardware, not for resolving Linux
specific issue.

Shawn

> 
> Signed-off-by: Robin Gong <yibin.gong@nxp.com>
> ---
>  arch/arm64/boot/dts/freescale/imx8mm.dtsi | 12 ++++++++----
>  arch/arm64/boot/dts/freescale/imx8mn.dtsi | 13 +++++++++----
>  arch/arm64/boot/dts/freescale/imx8mp.dtsi | 13 +++++++++----
>  arch/arm64/boot/dts/freescale/imx8mq.dtsi | 12 ++++++++----
>  4 files changed, 34 insertions(+), 16 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> index e7648c3..9ef0554 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> @@ -257,13 +257,11 @@
>  	};
>  
>  	soc@0 {
> -		compatible = "fsl,imx8mm-soc", "simple-bus";
> +		compatible = "simple-bus";
>  		#address-cells = <1>;
>  		#size-cells = <1>;
>  		ranges = <0x0 0x0 0x0 0x3e000000>;
>  		dma-ranges = <0x40000000 0x0 0x40000000 0xc0000000>;
> -		nvmem-cells = <&imx8mm_uid>;
> -		nvmem-cell-names = "soc_unique_id";
>  
>  		aips1: bus@30000000 {
>  			compatible = "fsl,aips-bus", "simple-bus";
> @@ -522,7 +520,7 @@
>  			};
>  
>  			ocotp: efuse@30350000 {
> -				compatible = "fsl,imx8mm-ocotp", "syscon";
> +				compatible = "fsl,imx8mm-ocotp", "syscon", "simple-mfd";
>  				reg = <0x30350000 0x10000>;
>  				clocks = <&clk IMX8MM_CLK_OCOTP_ROOT>;
>  				/* For nvmem subnodes */
> @@ -540,6 +538,12 @@
>  				fec_mac_address: mac-address@90 {
>  					reg = <0x90 6>;
>  				};
> +
> +				imx8mm_soc: imx8mm-soc {
> +					compatible = "fsl,imx8mm-soc";
> +					nvmem-cells = <&imx8mm_uid>;
> +					nvmem-cell-names = "soc_unique_id";
> +				};
>  			};
>  
>  			anatop: anatop@30360000 {
> diff --git a/arch/arm64/boot/dts/freescale/imx8mn.dtsi b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
> index d4231e0..f82905c 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mn.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
> @@ -241,13 +241,11 @@
>  	};
>  
>  	soc@0 {
> -		compatible = "fsl,imx8mn-soc", "simple-bus";
> +		compatible = "simple-bus";
>  		#address-cells = <1>;
>  		#size-cells = <1>;
>  		ranges = <0x0 0x0 0x0 0x3e000000>;
>  		dma-ranges = <0x40000000 0x0 0x40000000 0xc0000000>;
> -		nvmem-cells = <&imx8mn_uid>;
> -		nvmem-cell-names = "soc_unique_id";
>  
>  		aips1: bus@30000000 {
>  			compatible = "fsl,aips-bus", "simple-bus";
> @@ -528,7 +526,8 @@
>  			};
>  
>  			ocotp: efuse@30350000 {
> -				compatible = "fsl,imx8mn-ocotp", "fsl,imx8mm-ocotp", "syscon";
> +				compatible = "fsl,imx8mn-ocotp", "fsl,imx8mm-ocotp", "syscon",
> +						"simple-mfd";
>  				reg = <0x30350000 0x10000>;
>  				clocks = <&clk IMX8MN_CLK_OCOTP_ROOT>;
>  				#address-cells = <1>;
> @@ -545,6 +544,12 @@
>  				fec_mac_address: mac-address@90 {
>  					reg = <0x90 6>;
>  				};
> +
> +				imx8mn_soc: imx8mn-soc {
> +					compatible = "fsl,imx8mn-soc";
> +					nvmem-cells = <&imx8mn_uid>;
> +					nvmem-cell-names = "soc_unique_id";
> +				};
>  			};
>  
>  			anatop: anatop@30360000 {
> diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> index 9f7c7f5..d113691 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> @@ -220,12 +220,10 @@
>  	};
>  
>  	soc@0 {
> -		compatible = "fsl,imx8mp-soc", "simple-bus";
> +		compatible = "simple-bus";
>  		#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";
> @@ -341,7 +339,8 @@
>  			};
>  
>  			ocotp: efuse@30350000 {
> -				compatible = "fsl,imx8mp-ocotp", "fsl,imx8mm-ocotp", "syscon";
> +				compatible = "fsl,imx8mp-ocotp", "fsl,imx8mm-ocotp", "syscon",
> +						"simple-mfd";
>  				reg = <0x30350000 0x10000>;
>  				clocks = <&clk IMX8MP_CLK_OCOTP_ROOT>;
>  				/* For nvmem subnodes */
> @@ -359,6 +358,12 @@
>  				eth_mac1: mac-address@90 {
>  					reg = <0x90 6>;
>  				};
> +
> +				imx8mp_soc: imx8mp-soc {
> +					compatible = "fsl,imx8mp-soc";
> +					nvmem-cells = <&imx8mp_uid>;
> +					nvmem-cell-names = "soc_unique_id";
> +				};
>  			};
>  
>  			anatop: anatop@30360000 {
> diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> index 91df9c5..8cfbc77 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> @@ -287,13 +287,11 @@
>  	};
>  
>  	soc@0 {
> -		compatible = "fsl,imx8mq-soc", "simple-bus";
> +		compatible = "simple-bus";
>  		#address-cells = <1>;
>  		#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";
> @@ -554,7 +552,7 @@
>  			};
>  
>  			ocotp: efuse@30350000 {
> -				compatible = "fsl,imx8mq-ocotp", "syscon";
> +				compatible = "fsl,imx8mq-ocotp", "syscon", "simple-mfd";
>  				reg = <0x30350000 0x10000>;
>  				clocks = <&clk IMX8MQ_CLK_OCOTP_ROOT>;
>  				#address-cells = <1>;
> @@ -571,6 +569,12 @@
>  				fec_mac_address: mac-address@90 {
>  					reg = <0x90 6>;
>  				};
> +
> +				imx8mq_soc: imx8mq-soc {
> +					compatible = "fsl,imx8mq-soc";
> +					nvmem-cells = <&imx8mq_uid>;
> +					nvmem-cell-names = "soc_unique_id";
> +				};
>  			};
>  
>  			anatop: syscon@30360000 {
> -- 
> 2.7.4
> 

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

* RE: [PATCH v1] arm64: dts: imx8mx: move soc device into ocotp
  2021-06-07 18:05 [PATCH v1] arm64: dts: imx8mx: move soc device into ocotp Robin Gong
  2021-06-12  8:01 ` Shawn Guo
@ 2021-06-12 11:49 ` Aisheng Dong
  1 sibling, 0 replies; 4+ messages in thread
From: Aisheng Dong @ 2021-06-12 11:49 UTC (permalink / raw)
  To: Robin Gong, Alice Guo, robh+dt, shawnguo, s.hauer, festevam,
	kernel, dl-linux-imx
  Cc: devicetree, linux-arm-kernel, linux-kernel

> From: Robin Gong <yibin.gong@nxp.com>
> Sent: Tuesday, June 8, 2021 2:05 AM
> 
> move soc device into ocotp device node instead of the parent device of the all
> devices which located in 'soc@0', otherwise, all probed children devices will be
> reorder to dmp_list again once 'imx8mx-soc'
> device defered probed, which may break driver's suspend/resume sequence,
> such as imx_spdif and fsl_spdif, hence the later would suspended before the
> former as below and endless interrupt may never be handled since clock has
> been disabled already in the later.
> 
> [    1.930598] calling  fsl_spdif_driver_init+0x0/0x20 @ 1
> [    1.955712] initcall fsl_spdif_driver_init+0x0/0x20 returned 0 after 24512
> usecs
> [    1.981963] calling  imx_spdif_driver_init+0x0/0x20 @ 1
> [    1.986600] initcall imx_spdif_driver_init+0x0/0x20 returned 0 after 4509
> usecs
> [    2.901408]   #0: imx-spdif
> [   21.151529] fsl-spdif-dai 30090000.spdif: calling
> platform_pm_suspend+0x0/0x70 @ 470, parent: 30000000.bus
> [   21.161189] fsl-spdif-dai 30090000.spdif: platform_pm_suspend+0x0/0x70
> returned 0 after 0 usecs
> [   21.474311] imx-spdif sound-spdif: calling
> platform_pm_suspend+0x0/0x70 @ 470, parent: platform
> [   21.483024] imx-spdif sound-spdif: platform_pm_suspend+0x0/0x70
> returned 0 after 9 usecs
> 
> Signed-off-by: Robin Gong <yibin.gong@nxp.com>

You need change binding doc first and pass make dtbs_check.
Basically I agree it's is better moving fsl,imx8x-soc compatible string
into ocotp as an sub mfd function nodes from HW point of view.

But I think there's a few issues you also need address:
1. as you changed to mfd way now, the code implementation should also align with it
e.g. nvmem-cells could be dropped

2. The common nvmem dt schema may not be compatible with common mfd binding
e.g. according to nvmem dt schema, all subnodes are nvmem cells.
You can check if make dtbs_check complain. If yes, I guess you need update nvmem
Binding to be compatible with mfd binding.

Regards
Aisheng

> ---
>  arch/arm64/boot/dts/freescale/imx8mm.dtsi | 12 ++++++++----
> arch/arm64/boot/dts/freescale/imx8mn.dtsi | 13 +++++++++----
> arch/arm64/boot/dts/freescale/imx8mp.dtsi | 13 +++++++++----
> arch/arm64/boot/dts/freescale/imx8mq.dtsi | 12 ++++++++----
>  4 files changed, 34 insertions(+), 16 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> index e7648c3..9ef0554 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> @@ -257,13 +257,11 @@
>  	};
> 
>  	soc@0 {
> -		compatible = "fsl,imx8mm-soc", "simple-bus";
> +		compatible = "simple-bus";
>  		#address-cells = <1>;
>  		#size-cells = <1>;
>  		ranges = <0x0 0x0 0x0 0x3e000000>;
>  		dma-ranges = <0x40000000 0x0 0x40000000 0xc0000000>;
> -		nvmem-cells = <&imx8mm_uid>;
> -		nvmem-cell-names = "soc_unique_id";
> 
>  		aips1: bus@30000000 {
>  			compatible = "fsl,aips-bus", "simple-bus"; @@ -522,7 +520,7
> @@
>  			};
> 
>  			ocotp: efuse@30350000 {
> -				compatible = "fsl,imx8mm-ocotp", "syscon";
> +				compatible = "fsl,imx8mm-ocotp", "syscon", "simple-mfd";
>  				reg = <0x30350000 0x10000>;
>  				clocks = <&clk IMX8MM_CLK_OCOTP_ROOT>;
>  				/* For nvmem subnodes */
> @@ -540,6 +538,12 @@
>  				fec_mac_address: mac-address@90 {
>  					reg = <0x90 6>;
>  				};
> +
> +				imx8mm_soc: imx8mm-soc {
> +					compatible = "fsl,imx8mm-soc";
> +					nvmem-cells = <&imx8mm_uid>;
> +					nvmem-cell-names = "soc_unique_id";
> +				};
>  			};
> 
>  			anatop: anatop@30360000 {
> diff --git a/arch/arm64/boot/dts/freescale/imx8mn.dtsi
> b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
> index d4231e0..f82905c 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mn.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
> @@ -241,13 +241,11 @@
>  	};
> 
>  	soc@0 {
> -		compatible = "fsl,imx8mn-soc", "simple-bus";
> +		compatible = "simple-bus";
>  		#address-cells = <1>;
>  		#size-cells = <1>;
>  		ranges = <0x0 0x0 0x0 0x3e000000>;
>  		dma-ranges = <0x40000000 0x0 0x40000000 0xc0000000>;
> -		nvmem-cells = <&imx8mn_uid>;
> -		nvmem-cell-names = "soc_unique_id";
> 
>  		aips1: bus@30000000 {
>  			compatible = "fsl,aips-bus", "simple-bus"; @@ -528,7 +526,8
> @@
>  			};
> 
>  			ocotp: efuse@30350000 {
> -				compatible = "fsl,imx8mn-ocotp", "fsl,imx8mm-ocotp",
> "syscon";
> +				compatible = "fsl,imx8mn-ocotp", "fsl,imx8mm-ocotp",
> "syscon",
> +						"simple-mfd";
>  				reg = <0x30350000 0x10000>;
>  				clocks = <&clk IMX8MN_CLK_OCOTP_ROOT>;
>  				#address-cells = <1>;
> @@ -545,6 +544,12 @@
>  				fec_mac_address: mac-address@90 {
>  					reg = <0x90 6>;
>  				};
> +
> +				imx8mn_soc: imx8mn-soc {
> +					compatible = "fsl,imx8mn-soc";
> +					nvmem-cells = <&imx8mn_uid>;
> +					nvmem-cell-names = "soc_unique_id";
> +				};
>  			};
> 
>  			anatop: anatop@30360000 {
> diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> index 9f7c7f5..d113691 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> @@ -220,12 +220,10 @@
>  	};
> 
>  	soc@0 {
> -		compatible = "fsl,imx8mp-soc", "simple-bus";
> +		compatible = "simple-bus";
>  		#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"; @@ -341,7 +339,8
> @@
>  			};
> 
>  			ocotp: efuse@30350000 {
> -				compatible = "fsl,imx8mp-ocotp", "fsl,imx8mm-ocotp",
> "syscon";
> +				compatible = "fsl,imx8mp-ocotp", "fsl,imx8mm-ocotp",
> "syscon",
> +						"simple-mfd";
>  				reg = <0x30350000 0x10000>;
>  				clocks = <&clk IMX8MP_CLK_OCOTP_ROOT>;
>  				/* For nvmem subnodes */
> @@ -359,6 +358,12 @@
>  				eth_mac1: mac-address@90 {
>  					reg = <0x90 6>;
>  				};
> +
> +				imx8mp_soc: imx8mp-soc {
> +					compatible = "fsl,imx8mp-soc";
> +					nvmem-cells = <&imx8mp_uid>;
> +					nvmem-cell-names = "soc_unique_id";
> +				};
>  			};
> 
>  			anatop: anatop@30360000 {
> diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> index 91df9c5..8cfbc77 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> @@ -287,13 +287,11 @@
>  	};
> 
>  	soc@0 {
> -		compatible = "fsl,imx8mq-soc", "simple-bus";
> +		compatible = "simple-bus";
>  		#address-cells = <1>;
>  		#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"; @@ -554,7 +552,7
> @@
>  			};
> 
>  			ocotp: efuse@30350000 {
> -				compatible = "fsl,imx8mq-ocotp", "syscon";
> +				compatible = "fsl,imx8mq-ocotp", "syscon", "simple-mfd";
>  				reg = <0x30350000 0x10000>;
>  				clocks = <&clk IMX8MQ_CLK_OCOTP_ROOT>;
>  				#address-cells = <1>;
> @@ -571,6 +569,12 @@
>  				fec_mac_address: mac-address@90 {
>  					reg = <0x90 6>;
>  				};
> +
> +				imx8mq_soc: imx8mq-soc {
> +					compatible = "fsl,imx8mq-soc";
> +					nvmem-cells = <&imx8mq_uid>;
> +					nvmem-cell-names = "soc_unique_id";
> +				};
>  			};
> 
>  			anatop: syscon@30360000 {
> --
> 2.7.4


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

* RE: [PATCH v1] arm64: dts: imx8mx: move soc device into ocotp
  2021-06-12  8:01 ` Shawn Guo
@ 2021-06-15  9:35   ` Robin Gong
  0 siblings, 0 replies; 4+ messages in thread
From: Robin Gong @ 2021-06-15  9:35 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Alice Guo, robh+dt, s.hauer, festevam, kernel, dl-linux-imx,
	devicetree, linux-arm-kernel, linux-kernel

On 12/06/21 16:01 Shawn Guo <shawnguo@kernel.org> wrote:
> On Tue, Jun 08, 2021 at 02:05:12AM +0800, Robin Gong wrote:
> > move soc device into ocotp device node instead of the parent device of
> > the all devices which located in 'soc@0', otherwise, all probed
> > children devices will be reorder to dmp_list again once 'imx8mx-soc'
> > device defered probed, which may break driver's suspend/resume
> > sequence, such as imx_spdif and fsl_spdif, hence the later would
> > suspended before the former as below and endless interrupt may never
> > be handled since clock has been disabled already in the later.
> >
> > [    1.930598] calling  fsl_spdif_driver_init+0x0/0x20 @ 1
> > [    1.955712] initcall fsl_spdif_driver_init+0x0/0x20 returned 0 after
> 24512 usecs
> > [    1.981963] calling  imx_spdif_driver_init+0x0/0x20 @ 1
> > [    1.986600] initcall imx_spdif_driver_init+0x0/0x20 returned 0 after
> 4509 usecs
> > [    2.901408]   #0: imx-spdif
> > [   21.151529] fsl-spdif-dai 30090000.spdif: calling
> platform_pm_suspend+0x0/0x70 @ 470, parent: 30000000.bus
> > [   21.161189] fsl-spdif-dai 30090000.spdif:
> platform_pm_suspend+0x0/0x70 returned 0 after 0 usecs
> > [   21.474311] imx-spdif sound-spdif: calling
> platform_pm_suspend+0x0/0x70 @ 470, parent: platform
> > [   21.483024] imx-spdif sound-spdif: platform_pm_suspend+0x0/0x70
> returned 0 after 9 usecs
> 
> DT is written as a description of hardware, not for resolving Linux specific
> issue.
Yes. But this issue is brought by previous patch in dts as below which force all IP
devices in soc@0 to be children devices of 'imx8mx-soc' platform device. Maybe
I should split it into several patches to fix below per soc to make things clear.

commit ce58459d8c7f4174e7b8a8ea903dd949631334a3
Author: Alice Guo <alice.guo@nxp.com>
Date:   Mon Jan 4 17:15:42 2021 +0800

    arm64: dts: imx8m: add SoC ID compatible

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

> 
> >
> > Signed-off-by: Robin Gong <yibin.gong@nxp.com>
> > ---
> >  arch/arm64/boot/dts/freescale/imx8mm.dtsi | 12 ++++++++----
> > arch/arm64/boot/dts/freescale/imx8mn.dtsi | 13 +++++++++----
> > arch/arm64/boot/dts/freescale/imx8mp.dtsi | 13 +++++++++----
> > arch/arm64/boot/dts/freescale/imx8mq.dtsi | 12 ++++++++----
> >  4 files changed, 34 insertions(+), 16 deletions(-)
> >
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> > b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> > index e7648c3..9ef0554 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> > @@ -257,13 +257,11 @@
> >  	};
> >
> >  	soc@0 {
> > -		compatible = "fsl,imx8mm-soc", "simple-bus";
> > +		compatible = "simple-bus";
> >  		#address-cells = <1>;
> >  		#size-cells = <1>;
> >  		ranges = <0x0 0x0 0x0 0x3e000000>;
> >  		dma-ranges = <0x40000000 0x0 0x40000000 0xc0000000>;
> > -		nvmem-cells = <&imx8mm_uid>;
> > -		nvmem-cell-names = "soc_unique_id";
> >
> >  		aips1: bus@30000000 {
> >  			compatible = "fsl,aips-bus", "simple-bus"; @@ -522,7 +520,7
> @@
> >  			};
> >
> >  			ocotp: efuse@30350000 {
> > -				compatible = "fsl,imx8mm-ocotp", "syscon";
> > +				compatible = "fsl,imx8mm-ocotp", "syscon", "simple-mfd";
> >  				reg = <0x30350000 0x10000>;
> >  				clocks = <&clk IMX8MM_CLK_OCOTP_ROOT>;
> >  				/* For nvmem subnodes */
> > @@ -540,6 +538,12 @@
> >  				fec_mac_address: mac-address@90 {
> >  					reg = <0x90 6>;
> >  				};
> > +
> > +				imx8mm_soc: imx8mm-soc {
> > +					compatible = "fsl,imx8mm-soc";
> > +					nvmem-cells = <&imx8mm_uid>;
> > +					nvmem-cell-names = "soc_unique_id";
> > +				};
> >  			};
> >
> >  			anatop: anatop@30360000 {
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mn.dtsi
> > b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
> > index d4231e0..f82905c 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8mn.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
> > @@ -241,13 +241,11 @@
> >  	};
> >
> >  	soc@0 {
> > -		compatible = "fsl,imx8mn-soc", "simple-bus";
> > +		compatible = "simple-bus";
> >  		#address-cells = <1>;
> >  		#size-cells = <1>;
> >  		ranges = <0x0 0x0 0x0 0x3e000000>;
> >  		dma-ranges = <0x40000000 0x0 0x40000000 0xc0000000>;
> > -		nvmem-cells = <&imx8mn_uid>;
> > -		nvmem-cell-names = "soc_unique_id";
> >
> >  		aips1: bus@30000000 {
> >  			compatible = "fsl,aips-bus", "simple-bus"; @@ -528,7 +526,8
> @@
> >  			};
> >
> >  			ocotp: efuse@30350000 {
> > -				compatible = "fsl,imx8mn-ocotp", "fsl,imx8mm-ocotp",
> "syscon";
> > +				compatible = "fsl,imx8mn-ocotp", "fsl,imx8mm-ocotp",
> "syscon",
> > +						"simple-mfd";
> >  				reg = <0x30350000 0x10000>;
> >  				clocks = <&clk IMX8MN_CLK_OCOTP_ROOT>;
> >  				#address-cells = <1>;
> > @@ -545,6 +544,12 @@
> >  				fec_mac_address: mac-address@90 {
> >  					reg = <0x90 6>;
> >  				};
> > +
> > +				imx8mn_soc: imx8mn-soc {
> > +					compatible = "fsl,imx8mn-soc";
> > +					nvmem-cells = <&imx8mn_uid>;
> > +					nvmem-cell-names = "soc_unique_id";
> > +				};
> >  			};
> >
> >  			anatop: anatop@30360000 {
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > index 9f7c7f5..d113691 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > @@ -220,12 +220,10 @@
> >  	};
> >
> >  	soc@0 {
> > -		compatible = "fsl,imx8mp-soc", "simple-bus";
> > +		compatible = "simple-bus";
> >  		#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"; @@ -341,7 +339,8
> @@
> >  			};
> >
> >  			ocotp: efuse@30350000 {
> > -				compatible = "fsl,imx8mp-ocotp", "fsl,imx8mm-ocotp",
> "syscon";
> > +				compatible = "fsl,imx8mp-ocotp", "fsl,imx8mm-ocotp",
> "syscon",
> > +						"simple-mfd";
> >  				reg = <0x30350000 0x10000>;
> >  				clocks = <&clk IMX8MP_CLK_OCOTP_ROOT>;
> >  				/* For nvmem subnodes */
> > @@ -359,6 +358,12 @@
> >  				eth_mac1: mac-address@90 {
> >  					reg = <0x90 6>;
> >  				};
> > +
> > +				imx8mp_soc: imx8mp-soc {
> > +					compatible = "fsl,imx8mp-soc";
> > +					nvmem-cells = <&imx8mp_uid>;
> > +					nvmem-cell-names = "soc_unique_id";
> > +				};
> >  			};
> >
> >  			anatop: anatop@30360000 {
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> > b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> > index 91df9c5..8cfbc77 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> > @@ -287,13 +287,11 @@
> >  	};
> >
> >  	soc@0 {
> > -		compatible = "fsl,imx8mq-soc", "simple-bus";
> > +		compatible = "simple-bus";
> >  		#address-cells = <1>;
> >  		#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"; @@ -554,7 +552,7
> @@
> >  			};
> >
> >  			ocotp: efuse@30350000 {
> > -				compatible = "fsl,imx8mq-ocotp", "syscon";
> > +				compatible = "fsl,imx8mq-ocotp", "syscon", "simple-mfd";
> >  				reg = <0x30350000 0x10000>;
> >  				clocks = <&clk IMX8MQ_CLK_OCOTP_ROOT>;
> >  				#address-cells = <1>;
> > @@ -571,6 +569,12 @@
> >  				fec_mac_address: mac-address@90 {
> >  					reg = <0x90 6>;
> >  				};
> > +
> > +				imx8mq_soc: imx8mq-soc {
> > +					compatible = "fsl,imx8mq-soc";
> > +					nvmem-cells = <&imx8mq_uid>;
> > +					nvmem-cell-names = "soc_unique_id";
> > +				};
> >  			};
> >
> >  			anatop: syscon@30360000 {
> > --
> > 2.7.4
> >

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

end of thread, other threads:[~2021-06-15  9:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07 18:05 [PATCH v1] arm64: dts: imx8mx: move soc device into ocotp Robin Gong
2021-06-12  8:01 ` Shawn Guo
2021-06-15  9:35   ` Robin Gong
2021-06-12 11:49 ` Aisheng Dong

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