]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
rockchip: replace nvmem otp patch with upstream
authorChukun Pan <amadeus@jmu.edu.cn>
Wed, 3 Jun 2026 12:20:01 +0000 (20:20 +0800)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Sun, 21 Jun 2026 18:55:29 +0000 (20:55 +0200)
Replace the rockchip-otp patch with the upstream version.
Also backports OTP support for RK3562 and RK3568 SoCs.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/23770
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
target/linux/rockchip/patches-6.18/038-1-v7.1-nvmem-rockchip-otp-Handle-internal-word_size-in-main.patch [moved from target/linux/rockchip/patches-6.18/162-01-nvmem-rockchip-otp-Handle-internal-word_size-in-main.patch with 92% similarity]
target/linux/rockchip/patches-6.18/038-2-v7.1-nvmem-rockchip-otp-Add-support-for-RK3568.patch [moved from target/linux/rockchip/patches-6.18/162-02-nvmem-rockchip-otp-Add-support-for-RK3568.patch with 89% similarity]
target/linux/rockchip/patches-6.18/038-3-v7.1-nvmem-rockchip-otp-Add-support-for-RK3562.patch [new file with mode: 0644]
target/linux/rockchip/patches-6.18/038-4-v7.1-nvmem-rockchip-otp-Add-support-for-RK3528.patch [moved from target/linux/rockchip/patches-6.18/162-03-nvmem-rockchip-otp-Add-support-for-RK3528.patch with 73% similarity]
target/linux/rockchip/patches-6.18/072-1-v7.1-arm64-dts-rockchip-Enable-OTP-controller-for-RK3562.patch [new file with mode: 0644]
target/linux/rockchip/patches-6.18/072-2-v7.1-arm64-dts-rockchip-Enable-OTP-controller-for-RK356x.patch [new file with mode: 0644]
target/linux/rockchip/patches-6.18/072-3-v7.1-arm64-dts-rockchip-Enable-OTP-controller-for-RK3528.patch [moved from target/linux/rockchip/patches-6.18/163-01-arm64-dts-rockchip-Enable-OTP-controller-for-RK3528.patch with 73% similarity]

similarity index 92%
rename from target/linux/rockchip/patches-6.18/162-01-nvmem-rockchip-otp-Handle-internal-word_size-in-main.patch
rename to target/linux/rockchip/patches-6.18/038-1-v7.1-nvmem-rockchip-otp-Handle-internal-word_size-in-main.patch
index c339e6144d9bdab153ba1618072f03d81f87b878..43b9c7951e9a699854393eb1b4f59612fd1e9b8c 100644 (file)
@@ -1,6 +1,6 @@
-From 7f6f8fc3ee62f6eb633320c7989d4ba502787e3c Mon Sep 17 00:00:00 2001
+From 6c403594354d59fb288978c5a23008da89ba2741 Mon Sep 17 00:00:00 2001
 From: Jonas Karlman <jonas@kwiboo.se>
-Date: Sun, 16 Mar 2025 19:18:58 +0000
+Date: Fri, 27 Mar 2026 13:17:48 +0000
 Subject: [PATCH] nvmem: rockchip-otp: Handle internal word_size in main
  reg_read op
 
@@ -19,8 +19,13 @@ specific read_reg operation and allow code reuse in a future RK3568
 reg_read operation.
 
 Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
+Tested-by: Willy Tarreau <w@1wt.eu>
+Signed-off-by: Heiko Stuebner <heiko@sntech.de>
 Reviewed-by: Heiko Stuebner <heiko@sntech.de>
 Tested-by: Heiko Stuebner <heiko@sntech.de>
+Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
+Link: https://patch.msgid.link/20260327131751.3026030-7-srini@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
  drivers/nvmem/rockchip-otp.c | 72 ++++++++++++++++++++----------------
  1 file changed, 40 insertions(+), 32 deletions(-)
similarity index 89%
rename from target/linux/rockchip/patches-6.18/162-02-nvmem-rockchip-otp-Add-support-for-RK3568.patch
rename to target/linux/rockchip/patches-6.18/038-2-v7.1-nvmem-rockchip-otp-Add-support-for-RK3568.patch
index 98c3a31334052701acc8a4472d4e3892602bbe10..07fafb0d00002978861978b5877f22b099ab1ec9 100644 (file)
@@ -1,15 +1,18 @@
-From 24ddbf99c76a352cc1931ccb5118bca0656034b8 Mon Sep 17 00:00:00 2001
+From 902fa931a2095566de6be12c8153f7fa9b31ab5f Mon Sep 17 00:00:00 2001
 From: Finley Xiao <finley.xiao@rock-chips.com>
-Date: Tue, 15 Apr 2025 18:32:02 +0800
+Date: Fri, 27 Mar 2026 13:17:49 +0000
 Subject: [PATCH] nvmem: rockchip-otp: Add support for RK3568
 
 This adds the necessary data for handling otp the rk3568.
 
 Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
 Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
+Signed-off-by: Heiko Stuebner <heiko@sntech.de>
 Reviewed-by: Heiko Stuebner <heiko@sntech.de>
 Tested-by: Heiko Stuebner <heiko@sntech.de>
-Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
+Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
+Link: https://patch.msgid.link/20260327131751.3026030-8-srini@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
  drivers/nvmem/rockchip-otp.c | 69 ++++++++++++++++++++++++++++++++++++
  1 file changed, 69 insertions(+)
diff --git a/target/linux/rockchip/patches-6.18/038-3-v7.1-nvmem-rockchip-otp-Add-support-for-RK3562.patch b/target/linux/rockchip/patches-6.18/038-3-v7.1-nvmem-rockchip-otp-Add-support-for-RK3562.patch
new file mode 100644 (file)
index 0000000..49396b5
--- /dev/null
@@ -0,0 +1,33 @@
+From 7efe11aace70faa2199bc42d8949cd289b2998da Mon Sep 17 00:00:00 2001
+From: Finley Xiao <finley.xiao@rock-chips.com>
+Date: Fri, 27 Mar 2026 13:17:50 +0000
+Subject: [PATCH] nvmem: rockchip-otp: Add support for RK3562
+
+This adds the necessary data for handling otp on the rk3562.
+
+Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
+Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
+Signed-off-by: Heiko Stuebner <heiko@sntech.de>
+Tested-by: Willy Tarreau <w@1wt.eu>
+Reviewed-by: Heiko Stuebner <heiko@sntech.de>
+Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
+Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
+Link: https://patch.msgid.link/20260327131751.3026030-9-srini@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/nvmem/rockchip-otp.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/nvmem/rockchip-otp.c
++++ b/drivers/nvmem/rockchip-otp.c
+@@ -377,6 +377,10 @@ static const struct of_device_id rockchi
+               .data = &px30_data,
+       },
+       {
++              .compatible = "rockchip,rk3562-otp",
++              .data = &rk3568_data,
++      },
++      {
+               .compatible = "rockchip,rk3568-otp",
+               .data = &rk3568_data,
+       },
similarity index 73%
rename from target/linux/rockchip/patches-6.18/162-03-nvmem-rockchip-otp-Add-support-for-RK3528.patch
rename to target/linux/rockchip/patches-6.18/038-4-v7.1-nvmem-rockchip-otp-Add-support-for-RK3528.patch
index eed7271c57f2940d675621a81741e8e55077e4c6..b8b50cb71a9be66216c4b32343d997c75a8a0aa5 100644 (file)
@@ -1,12 +1,17 @@
-From 249b07e24d3d1d47b7ec23d5f09a56837b66d7f5 Mon Sep 17 00:00:00 2001
+From a255f352b0e0c06d4b91233f112ddd35eac89947 Mon Sep 17 00:00:00 2001
 From: Jonas Karlman <jonas@kwiboo.se>
-Date: Sun, 16 Mar 2025 00:05:45 +0000
+Date: Fri, 27 Mar 2026 13:17:51 +0000
 Subject: [PATCH] nvmem: rockchip-otp: Add support for RK3528
 
 Add support for the OTP controller in RK3528. The OTPC is similar to the
 OTPC in RK3562 and RK3568, exept for a missing phy clock and reset.
 
 Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
+Signed-off-by: Heiko Stuebner <heiko@sntech.de>
+Tested-by: Willy Tarreau <w@1wt.eu>
+Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
+Link: https://patch.msgid.link/20260327131751.3026030-10-srini@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
  drivers/nvmem/rockchip-otp.c | 16 ++++++++++++++++
  1 file changed, 16 insertions(+)
@@ -40,6 +45,6 @@ Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
 +              .data = &rk3528_data,
 +      },
 +      {
-               .compatible = "rockchip,rk3568-otp",
+               .compatible = "rockchip,rk3562-otp",
                .data = &rk3568_data,
        },
diff --git a/target/linux/rockchip/patches-6.18/072-1-v7.1-arm64-dts-rockchip-Enable-OTP-controller-for-RK3562.patch b/target/linux/rockchip/patches-6.18/072-1-v7.1-arm64-dts-rockchip-Enable-OTP-controller-for-RK3562.patch
new file mode 100644 (file)
index 0000000..640bf45
--- /dev/null
@@ -0,0 +1,69 @@
+From 2448f33ff93ca9e41ce419e4bc7257010fa70a04 Mon Sep 17 00:00:00 2001
+From: Heiko Stuebner <heiko@sntech.de>
+Date: Thu, 12 Mar 2026 22:30:17 +0100
+Subject: [PATCH] arm64: dts: rockchip: Enable OTP controller for RK3562
+
+Enable the One Time Programmable Controller (OTPC) in RK3562 and add
+an initial nvmem fixed layout.
+
+Signed-off-by: Heiko Stuebner <heiko@sntech.de>
+Link: https://patch.msgid.link/20260312213019.13965-2-heiko@sntech.de
+---
+ arch/arm64/boot/dts/rockchip/rk3562.dtsi | 46 ++++++++++++++++++++++++
+ 1 file changed, 46 insertions(+)
+
+--- a/arch/arm64/boot/dts/rockchip/rk3562.dtsi
++++ b/arch/arm64/boot/dts/rockchip/rk3562.dtsi
+@@ -1093,6 +1093,52 @@
+                       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>;
diff --git a/target/linux/rockchip/patches-6.18/072-2-v7.1-arm64-dts-rockchip-Enable-OTP-controller-for-RK356x.patch b/target/linux/rockchip/patches-6.18/072-2-v7.1-arm64-dts-rockchip-Enable-OTP-controller-for-RK356x.patch
new file mode 100644 (file)
index 0000000..3805828
--- /dev/null
@@ -0,0 +1,70 @@
+From fae36d252e3344eefd95a94c026c170003805917 Mon Sep 17 00:00:00 2001
+From: Heiko Stuebner <heiko@sntech.de>
+Date: Thu, 12 Mar 2026 22:30:18 +0100
+Subject: [PATCH] arm64: dts: rockchip: Enable OTP controller for RK356x
+
+Enable the One Time Programmable Controller (OTPC) in RK356x and add
+an initial nvmem fixed layout.
+
+Tested-by: Diederik de Haas <diederik@cknow-tech.com>  # NanoPi R5S, PineNote
+Signed-off-by: Heiko Stuebner <heiko@sntech.de>
+Link: https://patch.msgid.link/20260312213019.13965-3-heiko@sntech.de
+---
+ arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 46 +++++++++++++++++++
+ 1 file changed, 46 insertions(+)
+
+--- a/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
++++ b/arch/arm64/boot/dts/rockchip/rk356x-base.dtsi
+@@ -1057,6 +1057,52 @@
+               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>;
similarity index 73%
rename from target/linux/rockchip/patches-6.18/163-01-arm64-dts-rockchip-Enable-OTP-controller-for-RK3528.patch
rename to target/linux/rockchip/patches-6.18/072-3-v7.1-arm64-dts-rockchip-Enable-OTP-controller-for-RK3528.patch
index ebd710c764c8bd6f647d4cceee9299098177974c..47dc01a2be168aba7ce85d1c2c0777dd9f41683d 100644 (file)
@@ -1,31 +1,31 @@
-From 8a50a4471e4b0db33a74c01229a7ad386918344b Mon Sep 17 00:00:00 2001
+From 8c2c73084bd10237a9bc8f1d5fd49fe3107e4562 Mon Sep 17 00:00:00 2001
 From: Jonas Karlman <jonas@kwiboo.se>
-Date: Sun, 16 Mar 2025 00:06:43 +0000
+Date: Thu, 12 Mar 2026 22:30:19 +0100
 Subject: [PATCH] arm64: dts: rockchip: Enable OTP controller for RK3528
 
 Enable the One Time Programmable Controller (OTPC) in RK3528 and add
 an initial nvmem fixed layout.
 
 Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
+Signed-off-by: Heiko Stuebner <heiko@sntech.de>
+Link: https://patch.msgid.link/20260312213019.13965-4-heiko@sntech.de
 ---
- arch/arm64/boot/dts/rockchip/rk3528.dtsi | 49 ++++++++++++++++++++++++
- 1 file changed, 49 insertions(+)
+ arch/arm64/boot/dts/rockchip/rk3528.dtsi | 47 ++++++++++++++++++++++++
+ 1 file changed, 47 insertions(+)
 
 --- a/arch/arm64/boot/dts/rockchip/rk3528.dtsi
 +++ b/arch/arm64/boot/dts/rockchip/rk3528.dtsi
-@@ -1190,6 +1190,55 @@
+@@ -1190,6 +1190,53 @@
                        status = "disabled";
                };
  
-+              otp: nvmem@ffce0000 {
++              otp: efuse@ffce0000 {
 +                      compatible = "rockchip,rk3528-otp";
 +                      reg = <0x0 0xffce0000 0x0 0x4000>;
-+                      clocks = <&cru CLK_USER_OTPC_NS>,
-+                               <&cru PCLK_OTPC_NS>,
++                      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>,
++                      resets = <&cru SRST_USER_OTPC_NS>, <&cru SRST_P_OTPC_NS>,
 +                               <&cru SRST_SBPI_OTPC_NS>;
 +                      reset-names = "otp", "apb", "sbpi";
 +