public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] rockchip,otp: Add support for rk3562 and rk3568
@ 2025-04-15 10:32 Kever Yang
  2025-04-15 10:32 ` [PATCH v3 1/3] dt-bindings: nvmem: " Kever Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Kever Yang @ 2025-04-15 10:32 UTC (permalink / raw)
  To: heiko
  Cc: linux-rockchip, Kever Yang, devicetree, Conor Dooley, Rob Herring,
	Srinivas Kandagatla, linux-kernel, Krzysztof Kozlowski,
	linux-arm-kernel


Rockchip rk3562 and rk3568 has the same otp controller, which is
different with those already support in the driver, add support for it.

This patch set depends on Jonas's change[1].

[1] https://lore.kernel.org/r/20250316191900.1858944-1-jonas@kwiboo.se

Changes in v3:
- update the clock name from "usr" to "otp" and re-order to sync with
 other soc.
- rebase on rk3576 and rk3528, changes suggest by Jonas
- Use rk3568 data structure for rk3562

Changes in v2:
- Update the commit message and add maxItems in schema.

Finley Xiao (2):
  nvmem: rockchip-otp: Add support for rk3568-otp
  nvmem: rockchip-otp: Add support for rk3562

Kever Yang (1):
  dt-bindings: nvmem: rockchip,otp: Add support for rk3562 and rk3568

 .../bindings/nvmem/rockchip,otp.yaml          | 53 ++++++++++++--
 drivers/nvmem/rockchip-otp.c                  | 73 +++++++++++++++++++
 2 files changed, 119 insertions(+), 7 deletions(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v3 1/3] dt-bindings: nvmem: rockchip,otp: Add support for rk3562 and rk3568
  2025-04-15 10:32 [PATCH v3 0/3] rockchip,otp: Add support for rk3562 and rk3568 Kever Yang
@ 2025-04-15 10:32 ` Kever Yang
  2025-04-21 18:45   ` Rob Herring (Arm)
  2025-04-22 10:06   ` Heiko Stübner
  2025-04-15 10:32 ` [PATCH v3 2/3] nvmem: rockchip-otp: Add support for rk3568-otp Kever Yang
  2025-04-15 10:32 ` [PATCH v3 3/3] nvmem: rockchip-otp: Add support for rk3562 Kever Yang
  2 siblings, 2 replies; 12+ messages in thread
From: Kever Yang @ 2025-04-15 10:32 UTC (permalink / raw)
  To: heiko
  Cc: linux-rockchip, Kever Yang, devicetree, Conor Dooley, Rob Herring,
	Srinivas Kandagatla, linux-kernel, Krzysztof Kozlowski,
	linux-arm-kernel

Add compatible entry for the otp controller in rk3562 and rk3568, add schema
for different clock names for new entry.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

Changes in v3:
- update the clock name from "usr" to "otp" and re-order to sync with
 other soc.

Changes in v2:
- Update the commit message and add maxItems in schema.

 .../bindings/nvmem/rockchip,otp.yaml          | 53 ++++++++++++++++---
 1 file changed, 46 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml b/Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml
index a44d44b32809..8b257662f282 100644
--- a/Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml
+++ b/Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml
@@ -14,6 +14,8 @@ properties:
     enum:
       - rockchip,px30-otp
       - rockchip,rk3308-otp
+      - rockchip,rk3562-otp
+      - rockchip,rk3568-otp
       - rockchip,rk3588-otp
 
   reg:
@@ -25,19 +27,15 @@ properties:
 
   clock-names:
     minItems: 3
-    items:
-      - const: otp
-      - const: apb_pclk
-      - const: phy
-      - const: arb
+    maxItems: 4
 
   resets:
     minItems: 1
-    maxItems: 3
+    maxItems: 4
 
   reset-names:
     minItems: 1
-    maxItems: 3
+    maxItems: 4
 
 required:
   - compatible
@@ -62,12 +60,45 @@ allOf:
       properties:
         clocks:
           maxItems: 3
+        clock-names:
+          items:
+            - const: otp
+            - const: apb_pclk
+            - const: phy
         resets:
           maxItems: 1
         reset-names:
           items:
             - const: phy
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - rockchip,rk3562-otp
+              - rockchip,rk3568-otp
+    then:
+      properties:
+        clocks:
+          minItems: 4
+          maxItems: 4
+        clock-names:
+          items:
+            - const: otp
+            - const: apb_pclk
+            - const: phy
+            - const: sbpi
+        resets:
+          minItems: 4
+          maxItems: 4
+        reset-names:
+          items:
+            - const: otp
+            - const: apb
+            - const: phy
+            - const: sbpi
+
   - if:
       properties:
         compatible:
@@ -78,8 +109,16 @@ allOf:
       properties:
         clocks:
           minItems: 4
+          maxItems: 4
+        clock-names:
+          items:
+            - const: otp
+            - const: apb_pclk
+            - const: phy
+            - const: arb
         resets:
           minItems: 3
+          maxItems: 3
         reset-names:
           items:
             - const: otp
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 2/3] nvmem: rockchip-otp: Add support for rk3568-otp
  2025-04-15 10:32 [PATCH v3 0/3] rockchip,otp: Add support for rk3562 and rk3568 Kever Yang
  2025-04-15 10:32 ` [PATCH v3 1/3] dt-bindings: nvmem: " Kever Yang
@ 2025-04-15 10:32 ` Kever Yang
  2025-04-22 10:07   ` Heiko Stübner
  2025-04-15 10:32 ` [PATCH v3 3/3] nvmem: rockchip-otp: Add support for rk3562 Kever Yang
  2 siblings, 1 reply; 12+ messages in thread
From: Kever Yang @ 2025-04-15 10:32 UTC (permalink / raw)
  To: heiko
  Cc: linux-rockchip, Finley Xiao, Kever Yang, linux-arm-kernel,
	linux-kernel, Srinivas Kandagatla

From: Finley Xiao <finley.xiao@rock-chips.com>

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>
---

Changes in v3:
- rebase on rk3576 and rk3528, changes suggest by Jonas

Changes in v2: None

 drivers/nvmem/rockchip-otp.c | 69 ++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/drivers/nvmem/rockchip-otp.c b/drivers/nvmem/rockchip-otp.c
index 45bbb6147fb7..cfb69bc58869 100644
--- a/drivers/nvmem/rockchip-otp.c
+++ b/drivers/nvmem/rockchip-otp.c
@@ -27,6 +27,7 @@
 #define OTPC_USER_CTRL			0x0100
 #define OTPC_USER_ADDR			0x0104
 #define OTPC_USER_ENABLE		0x0108
+#define OTPC_USER_QP			0x0120
 #define OTPC_USER_Q			0x0124
 #define OTPC_INT_STATUS			0x0304
 #define OTPC_SBPI_CMD0_OFFSET		0x1000
@@ -184,6 +185,58 @@ static int px30_otp_read(void *context, unsigned int offset,
 	return ret;
 }
 
+static int rk3568_otp_read(void *context, unsigned int offset, void *val,
+			   size_t count)
+{
+	struct rockchip_otp *otp = context;
+	u16 *buf = val;
+	u32 otp_qp;
+	int ret;
+
+	ret = rockchip_otp_reset(otp);
+	if (ret) {
+		dev_err(otp->dev, "failed to reset otp phy\n");
+		return ret;
+	}
+
+	ret = rockchip_otp_ecc_enable(otp, true);
+	if (ret) {
+		dev_err(otp->dev, "rockchip_otp_ecc_enable err\n");
+		return ret;
+	}
+
+	writel(OTPC_USE_USER | OTPC_USE_USER_MASK, otp->base + OTPC_USER_CTRL);
+	udelay(5);
+
+	while (count--) {
+		writel(offset++ | OTPC_USER_ADDR_MASK,
+		       otp->base + OTPC_USER_ADDR);
+		writel(OTPC_USER_FSM_ENABLE | OTPC_USER_FSM_ENABLE_MASK,
+		       otp->base + OTPC_USER_ENABLE);
+
+		ret = rockchip_otp_wait_status(otp, OTPC_INT_STATUS,
+					       OTPC_USER_DONE);
+		if (ret) {
+			dev_err(otp->dev, "timeout during read setup\n");
+			goto read_end;
+		}
+
+		otp_qp = readl(otp->base + OTPC_USER_QP);
+		if (((otp_qp & 0xc0) == 0xc0) || (otp_qp & 0x20)) {
+			ret = -EIO;
+			dev_err(otp->dev, "ecc check error during read setup\n");
+			goto read_end;
+		}
+
+		*buf++ = readl(otp->base + OTPC_USER_Q);
+	}
+
+read_end:
+	writel(0x0 | OTPC_USE_USER_MASK, otp->base + OTPC_USER_CTRL);
+
+	return ret;
+}
+
 static int rk3588_otp_read(void *context, unsigned int offset,
 			   void *val, size_t count)
 {
@@ -280,6 +333,18 @@ static const struct rockchip_data px30_data = {
 	.reg_read = px30_otp_read,
 };
 
+static const char * const rk3568_otp_clocks[] = {
+	"otp", "apb_pclk", "phy", "sbpi",
+};
+
+static const struct rockchip_data rk3568_data = {
+	.size = 0x80,
+	.word_size = sizeof(u16),
+	.clks = rk3568_otp_clocks,
+	.num_clks = ARRAY_SIZE(rk3568_otp_clocks),
+	.reg_read = rk3568_otp_read,
+};
+
 static const struct rockchip_data rk3576_data = {
 	.size = 0x100,
 	.read_offset = 0x700,
@@ -311,6 +376,10 @@ static const struct of_device_id rockchip_otp_match[] = {
 		.compatible = "rockchip,rk3308-otp",
 		.data = &px30_data,
 	},
+	{
+		.compatible = "rockchip,rk3568-otp",
+		.data = &rk3568_data,
+	},
 	{
 		.compatible = "rockchip,rk3576-otp",
 		.data = &rk3576_data,
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 3/3] nvmem: rockchip-otp: Add support for rk3562
  2025-04-15 10:32 [PATCH v3 0/3] rockchip,otp: Add support for rk3562 and rk3568 Kever Yang
  2025-04-15 10:32 ` [PATCH v3 1/3] dt-bindings: nvmem: " Kever Yang
  2025-04-15 10:32 ` [PATCH v3 2/3] nvmem: rockchip-otp: Add support for rk3568-otp Kever Yang
@ 2025-04-15 10:32 ` Kever Yang
  2025-04-22 10:07   ` Heiko Stübner
  2025-07-28 19:01   ` Willy Tarreau
  2 siblings, 2 replies; 12+ messages in thread
From: Kever Yang @ 2025-04-15 10:32 UTC (permalink / raw)
  To: heiko
  Cc: linux-rockchip, Finley Xiao, Kever Yang, linux-arm-kernel,
	linux-kernel, Srinivas Kandagatla

From: Finley Xiao <finley.xiao@rock-chips.com>

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>
---

Changes in v3:
- Use rk3568 data structure for rk3562

Changes in v2: None

 drivers/nvmem/rockchip-otp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/nvmem/rockchip-otp.c b/drivers/nvmem/rockchip-otp.c
index cfb69bc58869..62ce22d72586 100644
--- a/drivers/nvmem/rockchip-otp.c
+++ b/drivers/nvmem/rockchip-otp.c
@@ -376,6 +376,10 @@ static const struct of_device_id rockchip_otp_match[] = {
 		.compatible = "rockchip,rk3308-otp",
 		.data = &px30_data,
 	},
+	{
+		.compatible = "rockchip,rk3562-otp",
+		.data = &rk3568_data,
+	},
 	{
 		.compatible = "rockchip,rk3568-otp",
 		.data = &rk3568_data,
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 1/3] dt-bindings: nvmem: rockchip,otp: Add support for rk3562 and rk3568
  2025-04-15 10:32 ` [PATCH v3 1/3] dt-bindings: nvmem: " Kever Yang
@ 2025-04-21 18:45   ` Rob Herring (Arm)
  2025-04-22 10:06   ` Heiko Stübner
  1 sibling, 0 replies; 12+ messages in thread
From: Rob Herring (Arm) @ 2025-04-21 18:45 UTC (permalink / raw)
  To: Kever Yang
  Cc: Srinivas Kandagatla, Krzysztof Kozlowski, heiko, devicetree,
	linux-arm-kernel, linux-rockchip, linux-kernel, Conor Dooley


On Tue, 15 Apr 2025 18:32:01 +0800, Kever Yang wrote:
> Add compatible entry for the otp controller in rk3562 and rk3568, add schema
> for different clock names for new entry.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
> 
> Changes in v3:
> - update the clock name from "usr" to "otp" and re-order to sync with
>  other soc.
> 
> Changes in v2:
> - Update the commit message and add maxItems in schema.
> 
>  .../bindings/nvmem/rockchip,otp.yaml          | 53 ++++++++++++++++---
>  1 file changed, 46 insertions(+), 7 deletions(-)
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 1/3] dt-bindings: nvmem: rockchip,otp: Add support for rk3562 and rk3568
  2025-04-15 10:32 ` [PATCH v3 1/3] dt-bindings: nvmem: " Kever Yang
  2025-04-21 18:45   ` Rob Herring (Arm)
@ 2025-04-22 10:06   ` Heiko Stübner
  1 sibling, 0 replies; 12+ messages in thread
From: Heiko Stübner @ 2025-04-22 10:06 UTC (permalink / raw)
  To: Kever Yang
  Cc: linux-rockchip, Kever Yang, devicetree, Conor Dooley, Rob Herring,
	Srinivas Kandagatla, linux-kernel, Krzysztof Kozlowski,
	linux-arm-kernel

Am Dienstag, 15. April 2025, 12:32:01 Mitteleuropäische Sommerzeit schrieb Kever Yang:
> Add compatible entry for the otp controller in rk3562 and rk3568, add schema
> for different clock names for new entry.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 2/3] nvmem: rockchip-otp: Add support for rk3568-otp
  2025-04-15 10:32 ` [PATCH v3 2/3] nvmem: rockchip-otp: Add support for rk3568-otp Kever Yang
@ 2025-04-22 10:07   ` Heiko Stübner
  0 siblings, 0 replies; 12+ messages in thread
From: Heiko Stübner @ 2025-04-22 10:07 UTC (permalink / raw)
  To: Kever Yang
  Cc: linux-rockchip, Finley Xiao, Kever Yang, linux-arm-kernel,
	linux-kernel, Srinivas Kandagatla

Am Dienstag, 15. April 2025, 12:32:02 Mitteleuropäische Sommerzeit schrieb Kever Yang:
> From: Finley Xiao <finley.xiao@rock-chips.com>
> 
> 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>


Reviewed-by: Heiko Stuebner <heiko@sntech.de>

On a Quartz64b
Tested-by: Heiko Stuebner <heiko@sntech.de>


> ---
> 
> Changes in v3:
> - rebase on rk3576 and rk3528, changes suggest by Jonas
> 
> Changes in v2: None
> 
>  drivers/nvmem/rockchip-otp.c | 69 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 69 insertions(+)
> 
> diff --git a/drivers/nvmem/rockchip-otp.c b/drivers/nvmem/rockchip-otp.c
> index 45bbb6147fb7..cfb69bc58869 100644
> --- a/drivers/nvmem/rockchip-otp.c
> +++ b/drivers/nvmem/rockchip-otp.c
> @@ -27,6 +27,7 @@
>  #define OTPC_USER_CTRL			0x0100
>  #define OTPC_USER_ADDR			0x0104
>  #define OTPC_USER_ENABLE		0x0108
> +#define OTPC_USER_QP			0x0120
>  #define OTPC_USER_Q			0x0124
>  #define OTPC_INT_STATUS			0x0304
>  #define OTPC_SBPI_CMD0_OFFSET		0x1000
> @@ -184,6 +185,58 @@ static int px30_otp_read(void *context, unsigned int offset,
>  	return ret;
>  }
>  
> +static int rk3568_otp_read(void *context, unsigned int offset, void *val,
> +			   size_t count)
> +{
> +	struct rockchip_otp *otp = context;
> +	u16 *buf = val;
> +	u32 otp_qp;
> +	int ret;
> +
> +	ret = rockchip_otp_reset(otp);
> +	if (ret) {
> +		dev_err(otp->dev, "failed to reset otp phy\n");
> +		return ret;
> +	}
> +
> +	ret = rockchip_otp_ecc_enable(otp, true);
> +	if (ret) {
> +		dev_err(otp->dev, "rockchip_otp_ecc_enable err\n");
> +		return ret;
> +	}
> +
> +	writel(OTPC_USE_USER | OTPC_USE_USER_MASK, otp->base + OTPC_USER_CTRL);
> +	udelay(5);
> +
> +	while (count--) {
> +		writel(offset++ | OTPC_USER_ADDR_MASK,
> +		       otp->base + OTPC_USER_ADDR);
> +		writel(OTPC_USER_FSM_ENABLE | OTPC_USER_FSM_ENABLE_MASK,
> +		       otp->base + OTPC_USER_ENABLE);
> +
> +		ret = rockchip_otp_wait_status(otp, OTPC_INT_STATUS,
> +					       OTPC_USER_DONE);
> +		if (ret) {
> +			dev_err(otp->dev, "timeout during read setup\n");
> +			goto read_end;
> +		}
> +
> +		otp_qp = readl(otp->base + OTPC_USER_QP);
> +		if (((otp_qp & 0xc0) == 0xc0) || (otp_qp & 0x20)) {
> +			ret = -EIO;
> +			dev_err(otp->dev, "ecc check error during read setup\n");
> +			goto read_end;
> +		}
> +
> +		*buf++ = readl(otp->base + OTPC_USER_Q);
> +	}
> +
> +read_end:
> +	writel(0x0 | OTPC_USE_USER_MASK, otp->base + OTPC_USER_CTRL);
> +
> +	return ret;
> +}
> +
>  static int rk3588_otp_read(void *context, unsigned int offset,
>  			   void *val, size_t count)
>  {
> @@ -280,6 +333,18 @@ static const struct rockchip_data px30_data = {
>  	.reg_read = px30_otp_read,
>  };
>  
> +static const char * const rk3568_otp_clocks[] = {
> +	"otp", "apb_pclk", "phy", "sbpi",
> +};
> +
> +static const struct rockchip_data rk3568_data = {
> +	.size = 0x80,
> +	.word_size = sizeof(u16),
> +	.clks = rk3568_otp_clocks,
> +	.num_clks = ARRAY_SIZE(rk3568_otp_clocks),
> +	.reg_read = rk3568_otp_read,
> +};
> +
>  static const struct rockchip_data rk3576_data = {
>  	.size = 0x100,
>  	.read_offset = 0x700,
> @@ -311,6 +376,10 @@ static const struct of_device_id rockchip_otp_match[] = {
>  		.compatible = "rockchip,rk3308-otp",
>  		.data = &px30_data,
>  	},
> +	{
> +		.compatible = "rockchip,rk3568-otp",
> +		.data = &rk3568_data,
> +	},
>  	{
>  		.compatible = "rockchip,rk3576-otp",
>  		.data = &rk3576_data,
> 






^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/3] nvmem: rockchip-otp: Add support for rk3562
  2025-04-15 10:32 ` [PATCH v3 3/3] nvmem: rockchip-otp: Add support for rk3562 Kever Yang
@ 2025-04-22 10:07   ` Heiko Stübner
  2025-07-28 19:01   ` Willy Tarreau
  1 sibling, 0 replies; 12+ messages in thread
From: Heiko Stübner @ 2025-04-22 10:07 UTC (permalink / raw)
  To: Kever Yang
  Cc: linux-rockchip, Finley Xiao, Kever Yang, linux-arm-kernel,
	linux-kernel, Srinivas Kandagatla

Am Dienstag, 15. April 2025, 12:32:03 Mitteleuropäische Sommerzeit schrieb Kever Yang:
> From: Finley Xiao <finley.xiao@rock-chips.com>
> 
> 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>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/3] nvmem: rockchip-otp: Add support for rk3562
  2025-04-15 10:32 ` [PATCH v3 3/3] nvmem: rockchip-otp: Add support for rk3562 Kever Yang
  2025-04-22 10:07   ` Heiko Stübner
@ 2025-07-28 19:01   ` Willy Tarreau
  2026-02-05 12:50     ` Heiko Stübner
  1 sibling, 1 reply; 12+ messages in thread
From: Willy Tarreau @ 2025-07-28 19:01 UTC (permalink / raw)
  To: Kever Yang
  Cc: heiko, linux-rockchip, Finley Xiao, linux-arm-kernel,
	linux-kernel, Srinivas Kandagatla

On Tue, Apr 15, 2025 at 06:32:03PM +0800, Kever Yang wrote:
> From: Finley Xiao <finley.xiao@rock-chips.com>
> 
> 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>

Successfully tested with Jonas' patches on top of it on my
Radxa E20C (RK3528):

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

Willy


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/3] nvmem: rockchip-otp: Add support for rk3562
  2025-07-28 19:01   ` Willy Tarreau
@ 2026-02-05 12:50     ` Heiko Stübner
  2026-02-05 15:36       ` Willy Tarreau
  0 siblings, 1 reply; 12+ messages in thread
From: Heiko Stübner @ 2026-02-05 12:50 UTC (permalink / raw)
  To: Kever Yang, Willy Tarreau
  Cc: linux-rockchip, Finley Xiao, linux-arm-kernel, linux-kernel,
	Srinivas Kandagatla

Hi Willy,

Am Montag, 28. Juli 2025, 21:01:54 Mitteleuropäische Normalzeit schrieb Willy Tarreau:
> On Tue, Apr 15, 2025 at 06:32:03PM +0800, Kever Yang wrote:
> > From: Finley Xiao <finley.xiao@rock-chips.com>
> > 
> > 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>
> 
> Successfully tested with Jonas' patches on top of it on my
> Radxa E20C (RK3528):
> 
> Tested-by: Willy Tarreau <w@1wt.eu>

as you replied to the rk3562 variant, does that mean the rk3528
uses the same variant data?

Thanks
Heiko




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/3] nvmem: rockchip-otp: Add support for rk3562
  2026-02-05 12:50     ` Heiko Stübner
@ 2026-02-05 15:36       ` Willy Tarreau
  2026-02-05 21:29         ` Heiko Stübner
  0 siblings, 1 reply; 12+ messages in thread
From: Willy Tarreau @ 2026-02-05 15:36 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: Kever Yang, linux-rockchip, Finley Xiao, linux-arm-kernel,
	linux-kernel, Srinivas Kandagatla

Hi Heiko,

On Thu, Feb 05, 2026 at 01:50:34PM +0100, Heiko Stübner wrote:
> Hi Willy,
> 
> Am Montag, 28. Juli 2025, 21:01:54 Mitteleuropäische Normalzeit schrieb Willy Tarreau:
> > On Tue, Apr 15, 2025 at 06:32:03PM +0800, Kever Yang wrote:
> > > From: Finley Xiao <finley.xiao@rock-chips.com>
> > > 
> > > 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>
> > 
> > Successfully tested with Jonas' patches on top of it on my
> > Radxa E20C (RK3528):
> > 
> > Tested-by: Willy Tarreau <w@1wt.eu>
> 
> as you replied to the rk3562 variant, does that mean the rk3528
> uses the same variant data?

Now you make me doubt, I'll have to recheck the original message
in its series and the patches that I had applied. I seem to
rememeber there were certain common patches between the two but
I don't remember which ones, and it's also possibly that I replied
by accident to the wrong message in the series or that I mistook
one patch for another when comparing them :-/

Ah, I seem to have found it, there's indeed the 3562 in my local
patches and the 3528 as well, both of which rely on the 3568 one:

  commit a68433c468c8a9d4789641eb6a40ae571fb7f01f
  Author: Finley Xiao <finley.xiao@rock-chips.com>
  Date:   Tue Apr 15 18:32:03 2025 +0800

    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>
    Reviewed-by: Heiko Stuebner <heiko@sntech.de>
    Signed-off-by: Jonas Karlman <jonas@kwiboo.se>

and:

  commit 249b07e24d3d1d47b7ec23d5f09a56837b66d7f5
  Author: Jonas Karlman <jonas@kwiboo.se>
  Date:   Sun Mar 16 00:05:45 2025 +0000

    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>

It's very possible that I visually mistook one for the other when
responding to the series, and if so, I'm really sorry about that!

The former relies on rk3568_data and the latter on rk3528_data, which
is defined like this:

+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,
+};

Looks like the patches originally come from this branch that I
manually cherry-picked:

  https://github.com/Kwiboo/linux-rockchip/commits/next-20250620-rk3528

I have one extra E20C that's not yet in prod if you're interested in
me running some specific tests. It will not happen quickly but just let
me know if I can help, as it's a nice little machine.

Willy


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v3 3/3] nvmem: rockchip-otp: Add support for rk3562
  2026-02-05 15:36       ` Willy Tarreau
@ 2026-02-05 21:29         ` Heiko Stübner
  0 siblings, 0 replies; 12+ messages in thread
From: Heiko Stübner @ 2026-02-05 21:29 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: Kever Yang, linux-rockchip, Finley Xiao, linux-arm-kernel,
	linux-kernel, Srinivas Kandagatla

Hi Willy,

Am Donnerstag, 5. Februar 2026, 16:36:33 Mitteleuropäische Normalzeit schrieb Willy Tarreau:
> On Thu, Feb 05, 2026 at 01:50:34PM +0100, Heiko Stübner wrote:
> > Am Montag, 28. Juli 2025, 21:01:54 Mitteleuropäische Normalzeit schrieb Willy Tarreau:
> > > On Tue, Apr 15, 2025 at 06:32:03PM +0800, Kever Yang wrote:
> > > > From: Finley Xiao <finley.xiao@rock-chips.com>
> > > > 
> > > > 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>
> > > 
> > > Successfully tested with Jonas' patches on top of it on my
> > > Radxa E20C (RK3528):
> > > 
> > > Tested-by: Willy Tarreau <w@1wt.eu>
> > 
> > as you replied to the rk3562 variant, does that mean the rk3528
> > uses the same variant data?

[...]

> It's very possible that I visually mistook one for the other when
> responding to the series, and if so, I'm really sorry about that!

Really, no worries ... it just confused me a bit, while I was
resurrecting the whole thing :-)

[...]

> I have one extra E20C that's not yet in prod if you're interested in
> me running some specific tests. It will not happen quickly but just let
> me know if I can help, as it's a nice little machine.

With Jonas' blessing I added his patches for the RK3528 and send
the driver thing rebased onto a recent kernel just now [0] with you
in Cc.

I've also send in the corresponding DTS patches for all 3 [1], again
with you in Cc :-) .

So if you can give them a spin on your RK3528 board, that would be great.
Because I need to find my RK3528 board first :-) .


Thanks a lot
Heiko


[0] https://lore.kernel.org/linux-rockchip/20260205211901.490181-1-heiko@sntech.de/T/#t
[1] https://lore.kernel.org/linux-rockchip/20260205212347.490636-1-heiko@sntech.de/T/#t




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-02-05 21:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-15 10:32 [PATCH v3 0/3] rockchip,otp: Add support for rk3562 and rk3568 Kever Yang
2025-04-15 10:32 ` [PATCH v3 1/3] dt-bindings: nvmem: " Kever Yang
2025-04-21 18:45   ` Rob Herring (Arm)
2025-04-22 10:06   ` Heiko Stübner
2025-04-15 10:32 ` [PATCH v3 2/3] nvmem: rockchip-otp: Add support for rk3568-otp Kever Yang
2025-04-22 10:07   ` Heiko Stübner
2025-04-15 10:32 ` [PATCH v3 3/3] nvmem: rockchip-otp: Add support for rk3562 Kever Yang
2025-04-22 10:07   ` Heiko Stübner
2025-07-28 19:01   ` Willy Tarreau
2026-02-05 12:50     ` Heiko Stübner
2026-02-05 15:36       ` Willy Tarreau
2026-02-05 21:29         ` Heiko Stübner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox