[PATCH v4 6/6] nvmem: rockchip-otp: Add support for RK3528

Heiko Stuebner posted 6 patches 3 days, 13 hours ago
[PATCH v4 6/6] nvmem: rockchip-otp: Add support for RK3528
Posted by Heiko Stuebner 3 days, 13 hours ago
From: Jonas Karlman <jonas@kwiboo.se>

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>
---
 drivers/nvmem/rockchip-otp.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/nvmem/rockchip-otp.c b/drivers/nvmem/rockchip-otp.c
index 62ce22d72586..0ec78b5e19e7 100644
--- a/drivers/nvmem/rockchip-otp.c
+++ b/drivers/nvmem/rockchip-otp.c
@@ -333,6 +333,18 @@ static const struct rockchip_data px30_data = {
 	.reg_read = px30_otp_read,
 };
 
+static const char * const rk3528_otp_clocks[] = {
+	"otp", "apb_pclk", "sbpi",
+};
+
+static const struct rockchip_data rk3528_data = {
+	.size = 0x80,
+	.word_size = sizeof(u16),
+	.clks = rk3528_otp_clocks,
+	.num_clks = ARRAY_SIZE(rk3528_otp_clocks),
+	.reg_read = rk3568_otp_read,
+};
+
 static const char * const rk3568_otp_clocks[] = {
 	"otp", "apb_pclk", "phy", "sbpi",
 };
@@ -376,6 +388,10 @@ static const struct of_device_id rockchip_otp_match[] = {
 		.compatible = "rockchip,rk3308-otp",
 		.data = &px30_data,
 	},
+	{
+		.compatible = "rockchip,rk3528-otp",
+		.data = &rk3528_data,
+	},
 	{
 		.compatible = "rockchip,rk3562-otp",
 		.data = &rk3568_data,
-- 
2.47.2
Re: [PATCH v4 6/6] nvmem: rockchip-otp: Add support for RK3528
Posted by Willy Tarreau 2 days ago
Hi Heiko,

On Thu, Feb 05, 2026 at 10:19:01PM +0100, Heiko Stuebner wrote:
> From: Jonas Karlman <jonas@kwiboo.se>
> 
> 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>

This time I'm making sure to respond to the right patch :-)

I applied your series on top of latest master and booted it on my
E20C (rk3528-based). It provides me with entries in which I can
read values, like when I applied Jonas' patch on 6.17, so I guess
that it's OK:

  # for i in /sys/devices/platform/soc/*/rockchip-otp0/cells/*; do echo ${i##*/}:;hexdump $i;done
  cpu-code@2,0:
  0000000 2835                                   
  0000002
  cpu-leakage@1a,0:
  0000000 000e                                   
  0000001
  cpu-version@8,3:
  0000000 0001                                   
  0000001
  gpu-leakage@1c,0:
  0000000 0003                                   
  0000001
  id@a,0:
  0000000 4e54 5532 3433 0000 0000 0000 0800 112d
  0000010
  logic-leakage@1b,0:
  0000000 0017                                   
  0000001
  tsadc-trim@44,0:
  0000000 0200                                   
  0000002

So feel free to add this if you want:

Tested-by: Willy Tarreau <w@1wt.eu>

Willy