Skip to contentSkip to conversation

Add devicetree nodes for RK3528, RK3562 and RK356x

PATCH Applied Heiko Stuebner 2 participants 7 messages Mar 12 – Mar 24

Subsystems (2)
lore
Share & tools
lore

Heiko Stuebner

author maintainer
#0 lore raw

v2 cover Add devicetree nodes for RK3528, RK3562 and RK356x

This is a companion series to the binding+driver changes [0], that adds the relevant OTP controller nodes to the core SoC devicetrees.

[0] https://lore.kernel.org/linux-rockchip/[email protected]/T/#t

changes in v2:
- rename node-names to be efuse@... following the dt-specfication 2.2.2. Generic Names Recommendation

Heiko Stuebner (2):
arm64: dts: rockchip: Enable OTP controller for RK3562
arm64: dts: rockchip: Enable OTP controller for RK356x

Jonas Karlman (1):
arm64: dts: rockchip: Enable OTP controller for RK3528

 arch/arm64/boot/dts/rockchip/rk3528.dtsi      | 47 +++++++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3562.dtsi      | 46 ++++++++++++++++++
 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 46 ++++++++++++++++++
 3 files changed, 139 insertions(+)
Signature · 1 line
2.47.3
author maintainer
#1 lore raw

PATCH v2 1/3 arm64: dts: rockchip: Enable OTP controller for RK3562

Enable the One Time Programmable Controller (OTPC) in RK3562 and add an initial nvmem fixed layout.

---
 arch/arm64/boot/dts/rockchip/rk3562.dtsi | 46 ++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
arch/arm64/boot/dts/rockchip/rk3562.dtsi +46 -0
index f84676b47b27..e4816aa3dae0 100644
@@ -1093,6 +1093,52 @@ sdmmc1: mmc@ff890000 {
 			status = "disabled";
 		};
 
+		otp: efuse@ff930000 {
+			compatible = "rockchip,rk3562-otp";
+			reg = <0x0 0xff930000 0x0 0x4000>;
+			clocks = <&cru CLK_USER_OTPC_NS>, <&cru PCLK_OTPC_NS>,
+				 <&cru PCLK_OTPPHY>, <&cru CLK_SBPI_OTPC_NS>;
+			clock-names = "otp", "apb_pclk", "phy", "sbpi";
+			resets = <&cru SRST_USER_OTPC_NS>, <&cru SRST_P_OTPC_NS>,
+				 <&cru SRST_P_OTPPHY>, <&cru SRST_SBPI_OTPC_NS>;
+			reset-names = "otp", "apb", "phy", "sbpi";
+
+			nvmem-layout {
+				compatible = "fixed-layout";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				cpu_code: cpu-code@2 {
+					reg = <0x02 0x2>;
+				};
+
+				otp_cpu_version: cpu-version@8 {
+					reg = <0x08 0x1>;
+					bits = <3 3>;
+				};
+
+				otp_id: id@a {
+					reg = <0x0a 0x10>;
+				};
+
+				cpu_leakage: cpu-leakage@1a {
+					reg = <0x1a 0x1>;
+				};
+
+				log_leakage: log-leakage@1b {
+					reg = <0x1b 0x1>;
+				};
+
+				npu_leakage: npu-leakage@1c {
+					reg = <0x1c 0x1>;
+				};
+
+				gpu_leakage: gpu-leakage@1d {
+					reg = <0x1d 0x1>;
+				};
+			};
+		};
+
 		dmac: dma-controller@ff990000 {
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x0 0xff990000 0x0 0x4000>;
Signature · 1 line
2.47.3
author maintainer
#2 lore raw

PATCH v2 2/3 arm64: dts: rockchip: Enable OTP controller for RK356x

In reply to Heiko Stuebner

Enable the One Time Programmable Controller (OTPC) in RK356x and add an initial nvmem fixed layout.

---
 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +46 -0
index 68b48606f601..c8321af7de7d 100644
@@ -1123,6 +1123,52 @@ rng: rng@fe388000 {
 		status = "disabled";
 	};
 
+	otp: efuse@fe38c000 {
+		compatible = "rockchip,rk3568-otp";
+		reg = <0x0 0xfe38c000 0x0 0x4000>;
+		clocks = <&cru CLK_OTPC_NS_USR>, <&cru PCLK_OTPC_NS>,
+			 <&cru PCLK_OTPPHY>, <&cru CLK_OTPC_NS_SBPI>;
+		clock-names = "otp", "apb_pclk", "phy", "sbpi";
+		resets = <&cru SRST_OTPC_NS_USR>, <&cru SRST_P_OTPC_NS>,
+			 <&cru SRST_OTPPHY>, <&cru SRST_OTPC_NS_SBPI>;
+		reset-names = "otp", "apb", "phy", "sbpi";
+
+		nvmem-layout {
+			compatible = "fixed-layout";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			cpu_code: cpu-code@2 {
+				reg = <0x02 0x2>;
+			};
+
+			otp_cpu_version: cpu-version@8 {
+				reg = <0x08 0x1>;
+				bits = <3 3>;
+			};
+
+			otp_id: id@a {
+				reg = <0x0a 0x10>;
+			};
+
+			cpu_leakage: cpu-leakage@1a {
+				reg = <0x1a 0x1>;
+			};
+
+			log_leakage: log-leakage@1b {
+				reg = <0x1b 0x1>;
+			};
+
+			npu_leakage: npu-leakage@1c {
+				reg = <0x1c 0x1>;
+			};
+
+			gpu_leakage: gpu-leakage@1d {
+				reg = <0x1d 0x1>;
+			};
+		};
+	};
+
 	i2s0_8ch: i2s@fe400000 {
 		compatible = "rockchip,rk3568-i2s-tdm";
 		reg = <0x0 0xfe400000 0x0 0x1000>;
Signature · 1 line
2.47.3
Tested-by on v2 2/3
#3 lore raw

Re: [PATCH v2 2/3] arm64: dts: rockchip: Enable OTP controller for RK356x

Hi Heiko,

Quoted 2 lines · Heiko Stuebner

Enable the One Time Programmable Controller (OTPC) in RK356x and add an initial nvmem fixed layout.

I build a kernel with the nvmem patches and your patches from this series and tried it out on my NanoPi R5S with a RK3568 SoC. Navigating to ``/sys/bus/nvmem/devices/rockchip-otp0/cells`` and then doing ``hexdump <cell-name>`` showed all kind of values.

Then I did the same with my PineNote with a RK3566 SoC and that gave different values, except for npu-leakage, which I guess is fine. So feel free to include my

Cheers,
Diederik

Quoted 62 lines
---
 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +46 -0
index 68b48606f601..c8321af7de7d 100644
@@ -1123,6 +1123,52 @@ rng: rng@fe388000 {
 		status = "disabled";
 	};
 
+	otp: efuse@fe38c000 {
+		compatible = "rockchip,rk3568-otp";
+		reg = <0x0 0xfe38c000 0x0 0x4000>;
+		clocks = <&cru CLK_OTPC_NS_USR>, <&cru PCLK_OTPC_NS>,
+			 <&cru PCLK_OTPPHY>, <&cru CLK_OTPC_NS_SBPI>;
+		clock-names = "otp", "apb_pclk", "phy", "sbpi";
+		resets = <&cru SRST_OTPC_NS_USR>, <&cru SRST_P_OTPC_NS>,
+			 <&cru SRST_OTPPHY>, <&cru SRST_OTPC_NS_SBPI>;
+		reset-names = "otp", "apb", "phy", "sbpi";
+
+		nvmem-layout {
+			compatible = "fixed-layout";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			cpu_code: cpu-code@2 {
+				reg = <0x02 0x2>;
+			};
+
+			otp_cpu_version: cpu-version@8 {
+				reg = <0x08 0x1>;
+				bits = <3 3>;
+			};
+
+			otp_id: id@a {
+				reg = <0x0a 0x10>;
+			};
+
+			cpu_leakage: cpu-leakage@1a {
+				reg = <0x1a 0x1>;
+			};
+
+			log_leakage: log-leakage@1b {
+				reg = <0x1b 0x1>;
+			};
+
+			npu_leakage: npu-leakage@1c {
+				reg = <0x1c 0x1>;
+			};
+
+			gpu_leakage: gpu-leakage@1d {
+				reg = <0x1d 0x1>;
+			};
+		};
+	};
+
 	i2s0_8ch: i2s@fe400000 {
 		compatible = "rockchip,rk3568-i2s-tdm";
 		reg = <0x0 0xfe400000 0x0 0x1000>;
#4 lore raw

Re: [PATCH v2 2/3] arm64: dts: rockchip: Enable OTP controller for RK356x

Hi Heiko,

Quoted 2 lines · Heiko Stuebner

Enable the One Time Programmable Controller (OTPC) in RK356x and add an initial nvmem fixed layout.

I build a kernel with the nvmem patches and your patches from this series and tried it out on my NanoPi R5S with a RK3568 SoC. Navigating to ``/sys/bus/nvmem/devices/rockchip-otp0/cells`` and then doing ``hexdump <cell-name>`` showed all kind of values.

Then I did the same with my PineNote with a RK3566 SoC and that gave different values, except for npu-leakage, which I guess is fine? So feel free to include my

Cheers,
Diederik

Quoted 62 lines
---
 arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
arch/arm64/boot/dts/rockchip/rk356x-base.dtsi +46 -0
index 68b48606f601..c8321af7de7d 100644
@@ -1123,6 +1123,52 @@ rng: rng@fe388000 {
 		status = "disabled";
 	};
 
+	otp: efuse@fe38c000 {
+		compatible = "rockchip,rk3568-otp";
+		reg = <0x0 0xfe38c000 0x0 0x4000>;
+		clocks = <&cru CLK_OTPC_NS_USR>, <&cru PCLK_OTPC_NS>,
+			 <&cru PCLK_OTPPHY>, <&cru CLK_OTPC_NS_SBPI>;
+		clock-names = "otp", "apb_pclk", "phy", "sbpi";
+		resets = <&cru SRST_OTPC_NS_USR>, <&cru SRST_P_OTPC_NS>,
+			 <&cru SRST_OTPPHY>, <&cru SRST_OTPC_NS_SBPI>;
+		reset-names = "otp", "apb", "phy", "sbpi";
+
+		nvmem-layout {
+			compatible = "fixed-layout";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			cpu_code: cpu-code@2 {
+				reg = <0x02 0x2>;
+			};
+
+			otp_cpu_version: cpu-version@8 {
+				reg = <0x08 0x1>;
+				bits = <3 3>;
+			};
+
+			otp_id: id@a {
+				reg = <0x0a 0x10>;
+			};
+
+			cpu_leakage: cpu-leakage@1a {
+				reg = <0x1a 0x1>;
+			};
+
+			log_leakage: log-leakage@1b {
+				reg = <0x1b 0x1>;
+			};
+
+			npu_leakage: npu-leakage@1c {
+				reg = <0x1c 0x1>;
+			};
+
+			gpu_leakage: gpu-leakage@1d {
+				reg = <0x1d 0x1>;
+			};
+		};
+	};
+
 	i2s0_8ch: i2s@fe400000 {
 		compatible = "rockchip,rk3568-i2s-tdm";
 		reg = <0x0 0xfe400000 0x0 0x1000>;
author maintainer
#5 lore raw

PATCH v2 3/3 arm64: dts: rockchip: Enable OTP controller for RK3528

In reply to Heiko Stuebner

From: Jonas Karlman <[email protected]>

Enable the One Time Programmable Controller (OTPC) in RK3528 and add an initial nvmem fixed layout.

---
 arch/arm64/boot/dts/rockchip/rk3528.dtsi | 47 ++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
arch/arm64/boot/dts/rockchip/rk3528.dtsi +47 -0
index d402f2828814..806b8109f67d 100644
@@ -1190,6 +1190,53 @@ sdmmc: mmc@ffc30000 {
 			status = "disabled";
 		};
 
+		otp: efuse@ffce0000 {
+			compatible = "rockchip,rk3528-otp";
+			reg = <0x0 0xffce0000 0x0 0x4000>;
+			clocks = <&cru CLK_USER_OTPC_NS>, <&cru PCLK_OTPC_NS>,
+				 <&cru CLK_SBPI_OTPC_NS>;
+			clock-names = "otp", "apb_pclk", "sbpi";
+			resets = <&cru SRST_USER_OTPC_NS>, <&cru SRST_P_OTPC_NS>,
+				 <&cru SRST_SBPI_OTPC_NS>;
+			reset-names = "otp", "apb", "sbpi";
+
+			nvmem-layout {
+				compatible = "fixed-layout";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				cpu_code: cpu-code@2 {
+					reg = <0x02 0x2>;
+				};
+
+				otp_cpu_version: cpu-version@8 {
+					reg = <0x08 0x1>;
+					bits = <3 3>;
+				};
+
+				otp_id: id@a {
+					reg = <0x0a 0x10>;
+				};
+
+				cpu_leakage: cpu-leakage@1a {
+					reg = <0x1a 0x1>;
+				};
+
+				logic_leakage: logic-leakage@1b {
+					reg = <0x1b 0x1>;
+				};
+
+				gpu_leakage: gpu-leakage@1c {
+					reg = <0x1c 0x1>;
+				};
+
+				tsadc_trim: tsadc-trim@44 {
+					reg = <0x44 0x2>;
+					bits = <0 10>;
+				};
+			};
+		};
+
 		dmac: dma-controller@ffd60000 {
 			compatible = "arm,pl330", "arm,primecell";
 			reg = <0x0 0xffd60000 0x0 0x4000>;
Signature · 1 line
2.47.3
author maintainer Applied
#6 lore raw
In reply to Heiko Stuebner
Quoted 10 lines · Heiko Stuebner

This is a companion series to the binding+driver changes [0], that adds the relevant OTP controller nodes to the core SoC devicetrees.

[0] https://lore.kernel.org/linux-rockchip/[email protected]/T/#t

changes in v2:
- rename node-names to be efuse@... following the dt-specfication 2.2.2. Generic Names Recommendation

[...]

Applied, thanks!

[1/3] arm64: dts: rockchip: Enable OTP controller for RK3562

      commit: d7a73e63b9c4c1e31bf7898d45418eaa69790057
[2/3] arm64: dts: rockchip: Enable OTP controller for RK356x
      commit: 2d7b5e1c962158833ef778a09d9293ed710fcc84
[3/3] arm64: dts: rockchip: Enable OTP controller for RK3528
      commit: a956b54f33de96e0d879e679c22a717d390e1afa

Best regards,

Signature · 1 line
Heiko Stuebner <[email protected]>