[PATCH v2 04/10] arm64: dts: imx8mn: Add access-controller references

Alexander Stein posted 10 patches 1 year ago
[PATCH v2 04/10] arm64: dts: imx8mn: Add access-controller references
Posted by Alexander Stein 1 year ago
Mark ocotp as a access-controller and add references on peripherals
which can be disabled (fused).

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 arch/arm64/boot/dts/freescale/imx8mn.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mn.dtsi b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
index a5f9cfb46e5dd..ee6c3a4be87fd 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn.dtsi
@@ -11,6 +11,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/thermal/thermal.h>
 
+#include "imx8mn-ocotp.h"
 #include "imx8mn-pinfunc.h"
 
 / {
@@ -431,6 +432,7 @@ easrc: easrc@300c0000 {
 					firmware-name = "imx/easrc/easrc-imx8mn.bin";
 					fsl,asrc-rate = <8000>;
 					fsl,asrc-format = <2>;
+					access-controllers = <&ocotp IMX8MN_OCOTP_ASRC_DISABLE>;
 					status = "disabled";
 				};
 			};
@@ -571,6 +573,7 @@ ocotp: efuse@30350000 {
 				clocks = <&clk IMX8MN_CLK_OCOTP_ROOT>;
 				#address-cells = <1>;
 				#size-cells = <1>;
+				#access-controller-cells = <2>;
 
 				/*
 				 * The register address below maps to the MX8M
@@ -1053,6 +1056,7 @@ fec1: ethernet@30be0000 {
 				nvmem-cells = <&fec_mac_address>;
 				nvmem-cell-names = "mac-address";
 				fsl,stop-mode = <&gpr 0x10 3>;
+				access-controllers = <&ocotp IMX8MN_OCOTP_ENET_DISABLE>;
 				status = "disabled";
 			};
 
@@ -1091,6 +1095,7 @@ mipi_dsi: dsi@32e10000 {
 				clock-names = "bus_clk", "sclk_mipi";
 				interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
 				power-domains = <&disp_blk_ctrl IMX8MN_DISPBLK_PD_MIPI_DSI>;
+				access-controllers = <&ocotp IMX8MN_OCOTP_MIPI_DSI_DISABLE>;
 				status = "disabled";
 
 				ports {
@@ -1195,6 +1200,7 @@ mipi_csi: mipi-csi@32e30000 {
 					 <&clk IMX8MN_CLK_DISP_AXI_ROOT>;
 				clock-names = "pclk", "wrap", "phy", "axi";
 				power-domains = <&disp_blk_ctrl IMX8MN_DISPBLK_PD_MIPI_CSI>;
+				access-controllers = <&ocotp IMX8MN_OCOTP_MIPI_CSI_DISABLE>;
 				status = "disabled";
 
 				ports {
@@ -1225,6 +1231,7 @@ usbotg1: usb@32e40000 {
 				phys = <&usbphynop1>;
 				fsl,usbmisc = <&usbmisc1 0>;
 				power-domains = <&pgc_hsiomix>;
+				access-controllers = <&ocotp IMX8MN_OCOTP_USB_OTG1_DISABLE>;
 				status = "disabled";
 			};
 
@@ -1288,6 +1295,7 @@ gpu: gpu@38000000 {
 					       <400000000>,
 					       <1200000000>;
 			power-domains = <&pgc_gpumix>;
+			access-controllers = <&ocotp IMX8MN_OCOTP_GPU3D_DISABLE>;
 		};
 
 		gic: interrupt-controller@38800000 {
-- 
2.34.1
Re: [PATCH v2 04/10] arm64: dts: imx8mn: Add access-controller references
Posted by Peng Fan 1 year ago
On Fri, Feb 07, 2025 at 09:36:09AM +0100, Alexander Stein wrote:
>Mark ocotp as a access-controller and add references on peripherals
>which can be disabled (fused).

I am not sure whether gpcv2 changes should be included in this patchset
or not. Just add access-controller for fused IP will not work.

i.MX8M BLK-CTRL/GPC will hang if the related power domain is still touched
by kernel. The pgc can't power up/down because clock is gated. 

This comment also apply to i.MX8MM/P.

Regards
Peng
Re: [PATCH v2 04/10] arm64: dts: imx8mn: Add access-controller references
Posted by Alexander Stein 1 year ago
Hi Peng,

Am Freitag, 7. Februar 2025, 13:02:13 CET schrieb Peng Fan:
> On Fri, Feb 07, 2025 at 09:36:09AM +0100, Alexander Stein wrote:
> >Mark ocotp as a access-controller and add references on peripherals
> >which can be disabled (fused).
> 
> I am not sure whether gpcv2 changes should be included in this patchset
> or not. Just add access-controller for fused IP will not work.

Well, I was able to successfully boot a i.MX8M Nano DualLite.

> i.MX8M BLK-CTRL/GPC will hang if the related power domain is still touched
> by kernel. The pgc can't power up/down because clock is gated. 

Well, with GPU node disabled, no one should enable the power domain.
But to be on the safe side I would also add access-controllers to the
corresponding power domains as well.

> This comment also apply to i.MX8MM/P.

Sure. Do you have any information what is actually disabled by those fused?
It seems it's the IP and their power domains. Anything else?

Best regards,
Alexander
-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/