devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series
@ 2025-11-12 13:01 Robert Marko
  2025-11-12 13:02 ` [PATCH v2 2/2] nvmem: lan9662-otp: add support for LAN969x Robert Marko
  2025-11-12 18:49 ` [PATCH v2 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Conor Dooley
  0 siblings, 2 replies; 3+ messages in thread
From: Robert Marko @ 2025-11-12 13:01 UTC (permalink / raw)
  To: srini, robh, krzk+dt, conor+dt, horatiu.vultur, devicetree,
	linux-kernel, daniel.machon
  Cc: luka.perkov, Robert Marko

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

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
Changes in v2:
* Drop individual SoC models since they all use the same HW

 .../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.51.1


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

* [PATCH v2 2/2] nvmem: lan9662-otp: add support for LAN969x
  2025-11-12 13:01 [PATCH v2 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Robert Marko
@ 2025-11-12 13:02 ` Robert Marko
  2025-11-12 18:49 ` [PATCH v2 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Conor Dooley
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Marko @ 2025-11-12 13:02 UTC (permalink / raw)
  To: srini, robh, krzk+dt, conor+dt, horatiu.vultur, devicetree,
	linux-kernel, daniel.machon
  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>
---
 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 bf47a982cf62..f182a7c2ff93 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.51.1


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

* Re: [PATCH v2 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series
  2025-11-12 13:01 [PATCH v2 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Robert Marko
  2025-11-12 13:02 ` [PATCH v2 2/2] nvmem: lan9662-otp: add support for LAN969x Robert Marko
@ 2025-11-12 18:49 ` Conor Dooley
  1 sibling, 0 replies; 3+ messages in thread
From: Conor Dooley @ 2025-11-12 18:49 UTC (permalink / raw)
  To: Robert Marko
  Cc: srini, robh, krzk+dt, conor+dt, horatiu.vultur, devicetree,
	linux-kernel, daniel.machon, luka.perkov

[-- Attachment #1: Type: text/plain, Size: 168 bytes --]

Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
(Although idk anything about the device despite my employer, I am just
reviewing th binding)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

end of thread, other threads:[~2025-11-12 18:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-12 13:01 [PATCH v2 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Robert Marko
2025-11-12 13:02 ` [PATCH v2 2/2] nvmem: lan9662-otp: add support for LAN969x Robert Marko
2025-11-12 18:49 ` [PATCH v2 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Conor Dooley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).