* [PATCH 0/3] nvmem: rockchip-otp: Add support for RK3506
@ 2026-11-28 22:17 Jonas Karlman
2026-11-28 22:17 ` [PATCH 1/3] dt-bindings: nvmem: rockchip,otp: Add compatible " Jonas Karlman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jonas Karlman @ 2026-11-28 22:17 UTC (permalink / raw)
To: Srinivas Kandagatla, Heiko Stuebner
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-rockchip,
devicetree, linux-arm-kernel, Jonas Karlman
This series adds support for the OTP controller in Rockchip RK3506 SoC.
The OTP controller is very similar to the one in RK3528, except that
trying to read data from byte offset 120-127 result in an ECC error:
rockchip-otp ff4f0000.efuse: ecc check error during read setup
So, size have been limited to 120 bytes instead of RK3528's 128 bytes.
The final devicetree patch depends on the series "ARM: dts: rockchip:
Add Luckfox Lyra boards" [1] for a clean apply.
hexdump from an ArmSoM Forge1 RK3506J board:
> hexdump -C /sys/devices/platform/soc/ff4f0000.efuse/rockchip-otp0/nvmem
00000000 52 4b 35 06 32 00 ff 00 0a 01 4d 34 53 33 37 34 |RK5.2.....M4S374|
00000010 00 00 00 00 00 00 00 04 0f 3a 00 00 00 00 03 04 |.........:......|
00000020 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 00 00 00 3d 00 00 00 00 00 00 00 00 00 00 00 |....=...........|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000070 00 00 00 00 00 00 00 00 |........|
00000078
[1] https://patch.msgid.link/20261125214421.1580359-1-jonas@kwiboo.se/
Jonas Karlman (3):
dt-bindings: nvmem: rockchip,otp: Add compatible for RK3506
nvmem: rockchip-otp: Add support for RK3506
ARM: dts: rockchip: Enable OTP controller for RK3506
.../bindings/nvmem/rockchip,otp.yaml | 2 +
arch/arm/boot/dts/rockchip/rk3506.dtsi | 43 +++++++++++++++++++
drivers/nvmem/rockchip-otp.c | 12 ++++++
3 files changed, 57 insertions(+)
---
Based-on: <20261125214421.1580359-1-jonas@kwiboo.se>
--
2.56.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] dt-bindings: nvmem: rockchip,otp: Add compatible for RK3506
2026-11-28 22:17 [PATCH 0/3] nvmem: rockchip-otp: Add support for RK3506 Jonas Karlman
@ 2026-11-28 22:17 ` Jonas Karlman
2026-11-28 22:17 ` [PATCH 2/3] nvmem: rockchip-otp: Add support " Jonas Karlman
2026-11-28 22:17 ` [PATCH 3/3] ARM: dts: rockchip: Enable OTP controller " Jonas Karlman
2 siblings, 0 replies; 4+ messages in thread
From: Jonas Karlman @ 2026-11-28 22:17 UTC (permalink / raw)
To: Srinivas Kandagatla, Heiko Stuebner, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-rockchip, devicetree, linux-arm-kernel, Jonas Karlman
Add compatible string for the OTP controller in RK3506. Similar to the
RK3528 the OTP in RK3506 does not have a phy clock or reset.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml b/Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml
index 7e4d5e1c4ced..52f2290a8a50 100644
--- a/Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml
+++ b/Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml
@@ -14,6 +14,7 @@ properties:
enum:
- rockchip,px30-otp
- rockchip,rk3308-otp
+ - rockchip,rk3506-otp
- rockchip,rk3528-otp
- rockchip,rk3562-otp
- rockchip,rk3568-otp
@@ -78,6 +79,7 @@ allOf:
compatible:
contains:
enum:
+ - rockchip,rk3506-otp
- rockchip,rk3528-otp
then:
properties:
--
2.56.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] nvmem: rockchip-otp: Add support for RK3506
2026-11-28 22:17 [PATCH 0/3] nvmem: rockchip-otp: Add support for RK3506 Jonas Karlman
2026-11-28 22:17 ` [PATCH 1/3] dt-bindings: nvmem: rockchip,otp: Add compatible " Jonas Karlman
@ 2026-11-28 22:17 ` Jonas Karlman
2026-11-28 22:17 ` [PATCH 3/3] ARM: dts: rockchip: Enable OTP controller " Jonas Karlman
2 siblings, 0 replies; 4+ messages in thread
From: Jonas Karlman @ 2026-11-28 22:17 UTC (permalink / raw)
To: Srinivas Kandagatla, Heiko Stuebner
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-rockchip,
devicetree, linux-arm-kernel, Jonas Karlman
Add support for the OTP controller in RK3506. The OTPC is similar to the
OTP controller in RK3528, except that reading from the last 8 bytes,
offset 120-127, fails ECC on RK3506.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
drivers/nvmem/rockchip-otp.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/nvmem/rockchip-otp.c b/drivers/nvmem/rockchip-otp.c
index 7eb834516ab4..3422017d391e 100644
--- a/drivers/nvmem/rockchip-otp.c
+++ b/drivers/nvmem/rockchip-otp.c
@@ -345,6 +345,14 @@ static const char * const rk3528_otp_clocks[] = {
"otp", "apb_pclk", "sbpi",
};
+static const struct rockchip_data rk3506_data = {
+ .size = 0x78,
+ .word_size = sizeof(u16),
+ .clks = rk3528_otp_clocks,
+ .num_clks = ARRAY_SIZE(rk3528_otp_clocks),
+ .reg_read = rk3568_otp_read,
+};
+
static const struct rockchip_data rk3528_data = {
.size = 0x80,
.word_size = sizeof(u16),
@@ -396,6 +404,10 @@ static const struct of_device_id rockchip_otp_match[] = {
.compatible = "rockchip,rk3308-otp",
.data = &px30_data,
},
+ {
+ .compatible = "rockchip,rk3506-otp",
+ .data = &rk3506_data,
+ },
{
.compatible = "rockchip,rk3528-otp",
.data = &rk3528_data,
--
2.56.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] ARM: dts: rockchip: Enable OTP controller for RK3506
2026-11-28 22:17 [PATCH 0/3] nvmem: rockchip-otp: Add support for RK3506 Jonas Karlman
2026-11-28 22:17 ` [PATCH 1/3] dt-bindings: nvmem: rockchip,otp: Add compatible " Jonas Karlman
2026-11-28 22:17 ` [PATCH 2/3] nvmem: rockchip-otp: Add support " Jonas Karlman
@ 2026-11-28 22:17 ` Jonas Karlman
2 siblings, 0 replies; 4+ messages in thread
From: Jonas Karlman @ 2026-11-28 22:17 UTC (permalink / raw)
To: Srinivas Kandagatla, Heiko Stuebner, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-rockchip, devicetree, linux-arm-kernel, Jonas Karlman
Enable the One Time Programmable Controller (OTPC) in RK3506 and add
an initial nvmem fixed layout.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
arch/arm/boot/dts/rockchip/rk3506.dtsi | 43 ++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/arch/arm/boot/dts/rockchip/rk3506.dtsi b/arch/arm/boot/dts/rockchip/rk3506.dtsi
index 6e4d735bd32f..9972a58b5fd3 100644
--- a/arch/arm/boot/dts/rockchip/rk3506.dtsi
+++ b/arch/arm/boot/dts/rockchip/rk3506.dtsi
@@ -500,6 +500,49 @@ saradc: adc@ff4e8000 {
status = "disabled";
};
+ otp: efuse@ff4f0000 {
+ compatible = "rockchip,rk3506-otp";
+ reg = <0xff4f0000 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@5 {
+ reg = <0x05 0x1>;
+ bits = <3 3>;
+ };
+
+ otp_id: id@a {
+ reg = <0x0a 0x10>;
+ };
+
+ cpu_leakage: cpu-leakage@1e {
+ reg = <0x1e 0x1>;
+ };
+
+ logic_leakage: logic-leakage@1f {
+ reg = <0x1f 0x1>;
+ };
+
+ tsadc_trim: tsadc-trim@20 {
+ reg = <0x20 0x2>;
+ bits = <0 10>;
+ };
+ };
+ };
+
gic: interrupt-controller@ff581000 {
compatible = "arm,gic-400";
reg = <0xff581000 0x1000>,
--
2.56.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-28 22:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-28 22:17 [PATCH 0/3] nvmem: rockchip-otp: Add support for RK3506 Jonas Karlman
2026-11-28 22:17 ` [PATCH 1/3] dt-bindings: nvmem: rockchip,otp: Add compatible " Jonas Karlman
2026-11-28 22:17 ` [PATCH 2/3] nvmem: rockchip-otp: Add support " Jonas Karlman
2026-11-28 22:17 ` [PATCH 3/3] ARM: dts: rockchip: Enable OTP controller " Jonas Karlman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox