public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
* [PATCH v3 1/3] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series
@ 2026-05-15 11:59 Robert Marko
  2026-05-15 11:59 ` [PATCH v3 2/3] nvmem: lan9662-otp: add support for LAN969x Robert Marko
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Robert Marko @ 2026-05-15 11:59 UTC (permalink / raw)
  To: srini, robh, krzk+dt, conor+dt, nicolas.ferre, claudiu.beznea,
	horatiu.vultur, daniel.machon, devicetree, linux-kernel,
	linux-arm-kernel
  Cc: luka.perkov, Robert Marko, Conor Dooley

From: Robert Marko <robert.marko@sartura•hr>

Unlike LAN966x series which has 8K of OTP space, LAN969x series has 16K of
OTP space, so document the compatible.

Acked-by: Conor Dooley <conor.dooley@microchip•com>
Signed-off-by: Robert Marko <robert.marko@sartura•hr>
---
Changes in v3:
* Pick Acked-by from Conor

 .../devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml        | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml b/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
index f97c6beb4766..c03e96afe564 100644
--- a/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
+++ b/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
@@ -25,6 +25,7 @@ properties:
           - const: microchip,lan9662-otpc
       - enum:
           - microchip,lan9662-otpc
+          - microchip,lan9691-otpc
 
   reg:
     maxItems: 1
-- 
2.54.0



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

* [PATCH v3 2/3] nvmem: lan9662-otp: add support for LAN969x
  2026-05-15 11:59 [PATCH v3 1/3] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Robert Marko
@ 2026-05-15 11:59 ` Robert Marko
  2026-05-16 16:27   ` Claudiu Beznea
  2026-05-15 11:59 ` [PATCH v3 3/3] arm64: dts: microchip: lan969x: add OTP node Robert Marko
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Robert Marko @ 2026-05-15 11:59 UTC (permalink / raw)
  To: srini, robh, krzk+dt, conor+dt, nicolas.ferre, claudiu.beznea,
	horatiu.vultur, daniel.machon, devicetree, linux-kernel,
	linux-arm-kernel
  Cc: luka.perkov, Robert Marko

From: Horatiu Vultur <horatiu.vultur@microchip•com>

Microchip LAN969x provides OTP with the same control logic, only the size
differs as LAN969x has 16KB of OTP instead of 8KB like on LAN966x.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip•com>
Signed-off-by: Robert Marko <robert.marko@sartura•hr>
---
Changes in v3:
* Rebase onto current next-20260508

 drivers/nvmem/Kconfig        |  2 +-
 drivers/nvmem/lan9662-otpc.c | 12 +++++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig
index 74ddbd0f79b0..78b648e14727 100644
--- a/drivers/nvmem/Kconfig
+++ b/drivers/nvmem/Kconfig
@@ -138,7 +138,7 @@ config NVMEM_JZ4780_EFUSE
 
 config NVMEM_LAN9662_OTPC
 	tristate "Microchip LAN9662 OTP controller support"
-	depends on SOC_LAN966 || COMPILE_TEST
+	depends on SOC_LAN966 || ARCH_LAN969X || COMPILE_TEST
 	depends on HAS_IOMEM
 	help
 	  This driver enables the OTP controller available on Microchip LAN9662
diff --git a/drivers/nvmem/lan9662-otpc.c b/drivers/nvmem/lan9662-otpc.c
index 56fc19f092a7..62d1d6381bf8 100644
--- a/drivers/nvmem/lan9662-otpc.c
+++ b/drivers/nvmem/lan9662-otpc.c
@@ -27,7 +27,6 @@
 #define OTP_OTP_STATUS_OTP_CPUMPEN		BIT(1)
 #define OTP_OTP_STATUS_OTP_BUSY			BIT(0)
 
-#define OTP_MEM_SIZE 8192
 #define OTP_SLEEP_US 10
 #define OTP_TIMEOUT_US 500000
 
@@ -176,7 +175,6 @@ static struct nvmem_config otp_config = {
 	.word_size = 1,
 	.reg_read = lan9662_otp_read,
 	.reg_write = lan9662_otp_write,
-	.size = OTP_MEM_SIZE,
 };
 
 static int lan9662_otp_probe(struct platform_device *pdev)
@@ -196,6 +194,7 @@ static int lan9662_otp_probe(struct platform_device *pdev)
 
 	otp_config.priv = otp;
 	otp_config.dev = dev;
+	otp_config.size = (uintptr_t) device_get_match_data(dev);
 
 	nvmem = devm_nvmem_register(dev, &otp_config);
 
@@ -203,7 +202,14 @@ static int lan9662_otp_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id lan9662_otp_match[] = {
-	{ .compatible = "microchip,lan9662-otpc", },
+	{
+		.compatible = "microchip,lan9662-otpc",
+		.data = (const void *) SZ_8K,
+	},
+	{
+		.compatible = "microchip,lan9691-otpc",
+		.data = (const void *) SZ_16K,
+	},
 	{ },
 };
 MODULE_DEVICE_TABLE(of, lan9662_otp_match);
-- 
2.54.0



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

* [PATCH v3 3/3] arm64: dts: microchip: lan969x: add OTP node
  2026-05-15 11:59 [PATCH v3 1/3] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Robert Marko
  2026-05-15 11:59 ` [PATCH v3 2/3] nvmem: lan9662-otp: add support for LAN969x Robert Marko
@ 2026-05-15 11:59 ` Robert Marko
  2026-05-16 16:26   ` Claudiu Beznea
  2026-05-16 16:27 ` [PATCH v3 1/3] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Claudiu Beznea
  2026-05-19 15:11 ` (subset) " Srinivas Kandagatla
  3 siblings, 1 reply; 7+ messages in thread
From: Robert Marko @ 2026-05-15 11:59 UTC (permalink / raw)
  To: srini, robh, krzk+dt, conor+dt, nicolas.ferre, claudiu.beznea,
	horatiu.vultur, daniel.machon, devicetree, linux-kernel,
	linux-arm-kernel
  Cc: luka.perkov, Robert Marko

From: Robert Marko <robert.marko@sartura•hr>

Add the required OTP on LAN969x.

Signed-off-by: Robert Marko <robert.marko@sartura•hr>
---
 arch/arm64/boot/dts/microchip/lan9691.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/microchip/lan9691.dtsi b/arch/arm64/boot/dts/microchip/lan9691.dtsi
index 235e56bebbdb..ed997d87dd09 100644
--- a/arch/arm64/boot/dts/microchip/lan9691.dtsi
+++ b/arch/arm64/boot/dts/microchip/lan9691.dtsi
@@ -100,6 +100,11 @@ usb: usb@300000 {
 			status = "disabled";
 		};
 
+		otp: otp@e0021000 {
+			compatible = "microchip,lan9691-otpc";
+			reg = <0xe0021000 0x1000>;
+		};
+
 		flx0: flexcom@e0040000 {
 			compatible = "microchip,lan9691-flexcom", "atmel,sama5d2-flexcom";
 			reg = <0xe0040000 0x100>;
-- 
2.54.0



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

* Re: [PATCH v3 3/3] arm64: dts: microchip: lan969x: add OTP node
  2026-05-15 11:59 ` [PATCH v3 3/3] arm64: dts: microchip: lan969x: add OTP node Robert Marko
@ 2026-05-16 16:26   ` Claudiu Beznea
  0 siblings, 0 replies; 7+ messages in thread
From: Claudiu Beznea @ 2026-05-16 16:26 UTC (permalink / raw)
  To: Robert Marko, srini, robh, krzk+dt, conor+dt, nicolas.ferre,
	horatiu.vultur, daniel.machon, devicetree, linux-kernel,
	linux-arm-kernel
  Cc: luka.perkov



On 5/15/26 14:59, Robert Marko wrote:
> From: Robert Marko<robert.marko@sartura•hr>
> 
> Add the required OTP on LAN969x.
> 
> Signed-off-by: Robert Marko<robert.marko@sartura•hr>

Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon•dev>


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

* Re: [PATCH v3 2/3] nvmem: lan9662-otp: add support for LAN969x
  2026-05-15 11:59 ` [PATCH v3 2/3] nvmem: lan9662-otp: add support for LAN969x Robert Marko
@ 2026-05-16 16:27   ` Claudiu Beznea
  0 siblings, 0 replies; 7+ messages in thread
From: Claudiu Beznea @ 2026-05-16 16:27 UTC (permalink / raw)
  To: Robert Marko, srini, robh, krzk+dt, conor+dt, nicolas.ferre,
	horatiu.vultur, daniel.machon, devicetree, linux-kernel,
	linux-arm-kernel
  Cc: luka.perkov

Hi, Robert,

>   static int lan9662_otp_probe(struct platform_device *pdev)
> @@ -196,6 +194,7 @@ static int lan9662_otp_probe(struct platform_device *pdev)
>   
>   	otp_config.priv = otp;
>   	otp_config.dev = dev;
> +	otp_config.size = (uintptr_t) device_get_match_data(dev);
>   
>   	nvmem = devm_nvmem_register(dev, &otp_config);
>   
> @@ -203,7 +202,14 @@ static int lan9662_otp_probe(struct platform_device *pdev)
>   }
>   
>   static const struct of_device_id lan9662_otp_match[] = {
> -	{ .compatible = "microchip,lan9662-otpc", },
> +	{
> +		.compatible = "microchip,lan9662-otpc",
> +		.data = (const void *) SZ_8K,
> +	},
> +	{
> +		.compatible = "microchip,lan9691-otpc",
> +		.data = (const void *) SZ_16K,
> +	},

Some checks from checkpatch:

[Checkpatch]      CHECK: No space is necessary after a cast
#51: FILE: drivers/nvmem/lan9662-otpc.c:197:
+       otp_config.size = (uintptr_t) device_get_match_data(dev);

CHECK: No space is necessary after a cast
#62: FILE: drivers/nvmem/lan9662-otpc.c:207:
+               .data = (const void *) SZ_8K,

CHECK: No space is necessary after a cast
#66: FILE: drivers/nvmem/lan9662-otpc.c:211:
+               .data = (const void *) SZ_16K,

total: 0 errors, 0 warnings, 3 checks, 44 lines checked


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

* Re: [PATCH v3 1/3] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series
  2026-05-15 11:59 [PATCH v3 1/3] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Robert Marko
  2026-05-15 11:59 ` [PATCH v3 2/3] nvmem: lan9662-otp: add support for LAN969x Robert Marko
  2026-05-15 11:59 ` [PATCH v3 3/3] arm64: dts: microchip: lan969x: add OTP node Robert Marko
@ 2026-05-16 16:27 ` Claudiu Beznea
  2026-05-19 15:11 ` (subset) " Srinivas Kandagatla
  3 siblings, 0 replies; 7+ messages in thread
From: Claudiu Beznea @ 2026-05-16 16:27 UTC (permalink / raw)
  To: Robert Marko, srini, robh, krzk+dt, conor+dt, nicolas.ferre,
	horatiu.vultur, daniel.machon, devicetree, linux-kernel,
	linux-arm-kernel
  Cc: luka.perkov, Conor Dooley



On 5/15/26 14:59, Robert Marko wrote:
> From: Robert Marko <robert.marko@sartura•hr>
> 
> Unlike LAN966x series which has 8K of OTP space, LAN969x series has 16K of
> OTP space, so document the compatible.
> 
> Acked-by: Conor Dooley <conor.dooley@microchip•com>
> Signed-off-by: Robert Marko <robert.marko@sartura•hr>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon•dev>


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

* Re: (subset) [PATCH v3 1/3] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series
  2026-05-15 11:59 [PATCH v3 1/3] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Robert Marko
                   ` (2 preceding siblings ...)
  2026-05-16 16:27 ` [PATCH v3 1/3] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Claudiu Beznea
@ 2026-05-19 15:11 ` Srinivas Kandagatla
  3 siblings, 0 replies; 7+ messages in thread
From: Srinivas Kandagatla @ 2026-05-19 15:11 UTC (permalink / raw)
  To: robh, krzk+dt, conor+dt, nicolas.ferre, claudiu.beznea,
	horatiu.vultur, daniel.machon, devicetree, linux-kernel,
	linux-arm-kernel, Robert Marko
  Cc: luka.perkov, Conor Dooley


On Fri, 15 May 2026 13:59:07 +0200, Robert Marko wrote:
> Unlike LAN966x series which has 8K of OTP space, LAN969x series has 16K of
> OTP space, so document the compatible.
> 
> 

Applied, thanks!

[1/3] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series
      commit: dbb14a8de386286bd986513c89eefedd8471aa45
[2/3] nvmem: lan9662-otp: add support for LAN969x
      commit: e5b013d742acf9894c9ec534bbc8ebf1a3dd3c64

Best regards,
-- 
Srinivas Kandagatla <srini@kernel•org>



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

end of thread, other threads:[~2026-05-19 15:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15 11:59 [PATCH v3 1/3] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Robert Marko
2026-05-15 11:59 ` [PATCH v3 2/3] nvmem: lan9662-otp: add support for LAN969x Robert Marko
2026-05-16 16:27   ` Claudiu Beznea
2026-05-15 11:59 ` [PATCH v3 3/3] arm64: dts: microchip: lan969x: add OTP node Robert Marko
2026-05-16 16:26   ` Claudiu Beznea
2026-05-16 16:27 ` [PATCH v3 1/3] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Claudiu Beznea
2026-05-19 15:11 ` (subset) " Srinivas Kandagatla

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