devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series
@ 2025-10-24 19:24 Robert Marko
  2025-10-24 19:24 ` [PATCH 2/2] nvmem: lan9662-otp: add support for LAN969x Robert Marko
  2025-10-26 10:10 ` [PATCH 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Krzysztof Kozlowski
  0 siblings, 2 replies; 6+ messages in thread
From: Robert Marko @ 2025-10-24 19:24 UTC (permalink / raw)
  To: srini, robh, krzk+dt, conor+dt, horatiu.vultur, devicetree,
	linux-kernel, daniel.machon
  Cc: luka.perkov, Robert Marko

LAN969x series also has the same HW block, its just 16KB instead of 8KB
like on LAN966x series.

So, document compatibles for the LAN969x series.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
 .../devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml  | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml b/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
index f97c6beb4766..f8c68cf22c1c 100644
--- a/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
+++ b/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
@@ -23,8 +23,15 @@ properties:
       - items:
           - const: microchip,lan9668-otpc
           - const: microchip,lan9662-otpc
+          - const: microchip,lan9691-otpc
+          - const: microchip,lan9692-otpc
+          - const: microchip,lan9693-otpc
+          - const: microchip,lan9694-otpc
+          - const: microchip,lan9696-otpc
+          - const: microchip,lan9698-otpc
       - enum:
           - microchip,lan9662-otpc
+          - microchip,lan9691-otpc
 
   reg:
     maxItems: 1
-- 
2.51.0


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

* [PATCH 2/2] nvmem: lan9662-otp: add support for LAN969x
  2025-10-24 19:24 [PATCH 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Robert Marko
@ 2025-10-24 19:24 ` Robert Marko
  2025-10-26 10:10 ` [PATCH 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Krzysztof Kozlowski
  1 sibling, 0 replies; 6+ messages in thread
From: Robert Marko @ 2025-10-24 19:24 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 e0d88d3199c1..d88b917889bf 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.0


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

* Re: [PATCH 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series
  2025-10-24 19:24 [PATCH 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Robert Marko
  2025-10-24 19:24 ` [PATCH 2/2] nvmem: lan9662-otp: add support for LAN969x Robert Marko
@ 2025-10-26 10:10 ` Krzysztof Kozlowski
  2025-10-27 12:23   ` Robert Marko
  1 sibling, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-26 10:10 UTC (permalink / raw)
  To: Robert Marko, srini, robh, krzk+dt, conor+dt, horatiu.vultur,
	devicetree, linux-kernel, daniel.machon
  Cc: luka.perkov

On 24/10/2025 21:24, Robert Marko wrote:
> LAN969x series also has the same HW block, its just 16KB instead of 8KB
> like on LAN966x series.
> 
> So, document compatibles for the LAN969x series.
> 
> Signed-off-by: Robert Marko <robert.marko@sartura.hr>
> ---
>  .../devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml  | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml b/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
> index f97c6beb4766..f8c68cf22c1c 100644
> --- a/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
> +++ b/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
> @@ -23,8 +23,15 @@ properties:
>        - items:
>            - const: microchip,lan9668-otpc
>            - const: microchip,lan9662-otpc
> +          - const: microchip,lan9691-otpc
> +          - const: microchip,lan9692-otpc
> +          - const: microchip,lan9693-otpc
> +          - const: microchip,lan9694-otpc
> +          - const: microchip,lan9696-otpc
> +          - const: microchip,lan9698-otpc

Why are you changing lan9668? Nothing on this is explained in commit
msg. Also, list of more than 3 items is not really useful.

>        - enum:
>            - microchip,lan9662-otpc
> +          - microchip,lan9691-otpc

Why is it listed twice? First you say lan9662 is compatible with
lan9691, now you say it is not.

Best regards,
Krzysztof

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

* Re: [PATCH 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series
  2025-10-26 10:10 ` [PATCH 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Krzysztof Kozlowski
@ 2025-10-27 12:23   ` Robert Marko
  2025-10-27 13:42     ` Krzysztof Kozlowski
  2025-10-27 18:22     ` Rob Herring
  0 siblings, 2 replies; 6+ messages in thread
From: Robert Marko @ 2025-10-27 12:23 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: srini, robh, krzk+dt, conor+dt, horatiu.vultur, devicetree,
	linux-kernel, daniel.machon, luka.perkov

On Sun, Oct 26, 2025 at 11:10 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 24/10/2025 21:24, Robert Marko wrote:
> > LAN969x series also has the same HW block, its just 16KB instead of 8KB
> > like on LAN966x series.
> >
> > So, document compatibles for the LAN969x series.
> >
> > Signed-off-by: Robert Marko <robert.marko@sartura.hr>
> > ---
> >  .../devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml  | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml b/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
> > index f97c6beb4766..f8c68cf22c1c 100644
> > --- a/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
> > +++ b/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
> > @@ -23,8 +23,15 @@ properties:
> >        - items:
> >            - const: microchip,lan9668-otpc
> >            - const: microchip,lan9662-otpc
> > +          - const: microchip,lan9691-otpc
> > +          - const: microchip,lan9692-otpc
> > +          - const: microchip,lan9693-otpc
> > +          - const: microchip,lan9694-otpc
> > +          - const: microchip,lan9696-otpc
> > +          - const: microchip,lan9698-otpc
>
> Why are you changing lan9668? Nothing on this is explained in commit
> msg. Also, list of more than 3 items is not really useful.

I am not chaning lan9668 but rather lan9698.
I agree that a list of all possible SoC models is not ideal but I was
just following the current
style in the binding.

As far as I know, the whole LAN969x series has identical OTP so just
using a single
microchip,lan9691-otpc compatible is enough.

>
> >        - enum:
> >            - microchip,lan9662-otpc
> > +          - microchip,lan9691-otpc
>
> Why is it listed twice? First you say lan9662 is compatible with
> lan9691, now you say it is not.

They differ in OTP size, LAN966x series has 8KB while LAN969x series
has 16KB of OTP space.

I am open to suggestions, for me just a single microchip,lan9691-otpc
compatible is enough.

Regards,
Robert

>
> Best regards,
> Krzysztof



-- 
Robert Marko
Staff Embedded Linux Engineer
Sartura d.d.
Lendavska ulica 16a
10000 Zagreb, Croatia
Email: robert.marko@sartura.hr
Web: www.sartura.hr

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

* Re: [PATCH 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series
  2025-10-27 12:23   ` Robert Marko
@ 2025-10-27 13:42     ` Krzysztof Kozlowski
  2025-10-27 18:22     ` Rob Herring
  1 sibling, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-27 13:42 UTC (permalink / raw)
  To: Robert Marko
  Cc: srini, robh, krzk+dt, conor+dt, horatiu.vultur, devicetree,
	linux-kernel, daniel.machon, luka.perkov

On 27/10/2025 13:23, Robert Marko wrote:
> On Sun, Oct 26, 2025 at 11:10 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>
>> On 24/10/2025 21:24, Robert Marko wrote:
>>> LAN969x series also has the same HW block, its just 16KB instead of 8KB
>>> like on LAN966x series.
>>>
>>> So, document compatibles for the LAN969x series.
>>>
>>> Signed-off-by: Robert Marko <robert.marko@sartura.hr>
>>> ---
>>>  .../devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml  | 7 +++++++
>>>  1 file changed, 7 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml b/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
>>> index f97c6beb4766..f8c68cf22c1c 100644
>>> --- a/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
>>> +++ b/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
>>> @@ -23,8 +23,15 @@ properties:
>>>        - items:
>>>            - const: microchip,lan9668-otpc
>>>            - const: microchip,lan9662-otpc
>>> +          - const: microchip,lan9691-otpc
>>> +          - const: microchip,lan9692-otpc
>>> +          - const: microchip,lan9693-otpc
>>> +          - const: microchip,lan9694-otpc
>>> +          - const: microchip,lan9696-otpc
>>> +          - const: microchip,lan9698-otpc
>>
>> Why are you changing lan9668? Nothing on this is explained in commit
>> msg. Also, list of more than 3 items is not really useful.
> 
> I am not chaning lan9668 but rather lan9698.


I clearly see lan9668 being affected here.


> I agree that a list of all possible SoC models is not ideal but I was
> just following the current
> style in the binding.
> 
> As far as I know, the whole LAN969x series has identical OTP so just
> using a single
> microchip,lan9691-otpc compatible is enough.
> 
>>
>>>        - enum:
>>>            - microchip,lan9662-otpc
>>> +          - microchip,lan9691-otpc
>>
>> Why is it listed twice? First you say lan9662 is compatible with
>> lan9691, now you say it is not.
> 
> They differ in OTP size, LAN966x series has 8KB while LAN969x series
> has 16KB of OTP space.

This does not explain how they can be compatible and not compatible the
same time. It's not Shroedinger's cat.


Best regards,
Krzysztof

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

* Re: [PATCH 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series
  2025-10-27 12:23   ` Robert Marko
  2025-10-27 13:42     ` Krzysztof Kozlowski
@ 2025-10-27 18:22     ` Rob Herring
  1 sibling, 0 replies; 6+ messages in thread
From: Rob Herring @ 2025-10-27 18:22 UTC (permalink / raw)
  To: Robert Marko
  Cc: Krzysztof Kozlowski, srini, krzk+dt, conor+dt, horatiu.vultur,
	devicetree, linux-kernel, daniel.machon, luka.perkov

On Mon, Oct 27, 2025 at 01:23:20PM +0100, Robert Marko wrote:
> On Sun, Oct 26, 2025 at 11:10 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> >
> > On 24/10/2025 21:24, Robert Marko wrote:
> > > LAN969x series also has the same HW block, its just 16KB instead of 8KB
> > > like on LAN966x series.
> > >
> > > So, document compatibles for the LAN969x series.
> > >
> > > Signed-off-by: Robert Marko <robert.marko@sartura.hr>
> > > ---
> > >  .../devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml  | 7 +++++++
> > >  1 file changed, 7 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml b/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
> > > index f97c6beb4766..f8c68cf22c1c 100644
> > > --- a/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
> > > +++ b/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
> > > @@ -23,8 +23,15 @@ properties:
> > >        - items:
> > >            - const: microchip,lan9668-otpc
> > >            - const: microchip,lan9662-otpc
> > > +          - const: microchip,lan9691-otpc
> > > +          - const: microchip,lan9692-otpc
> > > +          - const: microchip,lan9693-otpc
> > > +          - const: microchip,lan9694-otpc
> > > +          - const: microchip,lan9696-otpc
> > > +          - const: microchip,lan9698-otpc
> >
> > Why are you changing lan9668? Nothing on this is explained in commit
> > msg. Also, list of more than 3 items is not really useful.
> 
> I am not chaning lan9668 but rather lan9698.
> I agree that a list of all possible SoC models is not ideal but I was
> just following the current
> style in the binding.
> 
> As far as I know, the whole LAN969x series has identical OTP so just
> using a single
> microchip,lan9691-otpc compatible is enough.

The above is a *list* of what a "compatible" entry must contain.

> 
> >
> > >        - enum:
> > >            - microchip,lan9662-otpc
> > > +          - microchip,lan9691-otpc

"enum" on the other hand is a list of possible values for 1 entry in 
"compatible".

Rob

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

end of thread, other threads:[~2025-10-27 18:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-24 19:24 [PATCH 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Robert Marko
2025-10-24 19:24 ` [PATCH 2/2] nvmem: lan9662-otp: add support for LAN969x Robert Marko
2025-10-26 10:10 ` [PATCH 1/2] dt-bindings: nvmem: lan9662-otpc: Add LAN969x series Krzysztof Kozlowski
2025-10-27 12:23   ` Robert Marko
2025-10-27 13:42     ` Krzysztof Kozlowski
2025-10-27 18:22     ` Rob Herring

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