[PATCH] ramips: add NVMEM cells with Netgear R6220 wifi EEPROMs

Sander Vanheule sander at svanheule.net
Tue May 9 06:06:37 PDT 2023


Hi Rafał,

On Mon, 2023-05-08 at 18:02 +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal at milecki.pl>
> 
> This allows reading EEPROMs using NVMEM interface.

OK, but why do you need to do that though? Some userspace application?

> 
> Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
> ---
>  target/linux/ramips/dts/mt7621_netgear_r6220.dts | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/target/linux/ramips/dts/mt7621_netgear_r6220.dts
> b/target/linux/ramips/dts/mt7621_netgear_r6220.dts
> index 0f476ef060..2ebe58ca63 100644
> --- a/target/linux/ramips/dts/mt7621_netgear_r6220.dts
> +++ b/target/linux/ramips/dts/mt7621_netgear_r6220.dts
> @@ -42,9 +42,22 @@
>                 };
>  
>                 factory: partition at 2e00000 {
> +                       compatible = "nvmem-cells";
>                         label = "factory";
>                         reg = <0x2e00000 0x100000>;
>                         read-only;
> +
> +                       #address-cells = <1>;
> +                       #size-cells = <1>;
> +                       ranges = <0 0x2e00000 0x100000>;
> +
> +                       eeprom0: eeprom at 0 {
> +                               reg = <0x0 0x400>;
> +                       };
> +
> +                       eeprom1: eeprom at 8000 {
> +                               reg = <0x8000 0x200>;
> +                       };

You're adding labels to these new nodes, but there aren't any references.

This all seemed a bit off, so I also looked at the full DTS. There's already an
nvmem-cells 'extension' of &factory at the end of the file, with macaddr at 4
overlapping with the new eeprom at 0 node.

Maybe I'm just missing some context here, but this patch doesn't make much sense
to me.


Best,
Sander



More information about the openwrt-devel mailing list