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

Rafał Miłecki rafal at milecki.pl
Tue May 9 06:26:35 PDT 2023


On 2023-05-09 15:06, Sander Vanheule wrote:
> 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?

The main purpose of DTS files is to describe hardware. Bindings are
meant to be system agnostic. Each system can use them the way it needs.
So just because OpenWrt won't use those doesn't really matter.

Of course I'm happy to share my plans. In long term I mean to use those
NVMEM cells to let wireless devices reference it. So wireless drivers
can use them for reading EEPROM / calibration data.


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

Right, I should drop them.


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

It's fishy indeed. There is no need to add anything to the
partition at 2e00000 node using its reference. It should be put directly
in that node.


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



More information about the openwrt-devel mailing list