2021-10-10 14:56:59

by Chukun Pan

[permalink] [raw]
Subject: [PATCH v2 0/1] arm64: dts: allwinner: NanoPi R1S H5: Add generic compatible string for I2C EEPROM

Hi ChenYu,

> You should add the atmel compatible as a fallback one, not replace the
> microchip one.

Thanks for correcting, I did it, also upgrade the commit message.

> Please also add a cell representing the MAC address, and hook it up
> to the GMAC. You can find an example here [1].

Frankly speaking, I’m a little confused about this. There is a rtl8153
usb network card on this machine, the original factory seems to store
its mac address on this eeprom. It seems that there is no usb network
card written in dts in the kernel before, and the rtl8152 driver may
also need to be modified accordingly to support reading the mac address
from eeprom.

Sorry for my bad English.

Thanks,
Chukun

Changes from v2:
* Typo fixes for the position format.
* Add a nvmem cell representing the MAC address.

Chukun Pan (1):
arm64: dts: allwinner: NanoPi R1S H5: Add generic compatible string
for I2C EEPROM

.../arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

--
2.17.1


2021-10-10 15:17:22

by Chukun Pan

[permalink] [raw]
Subject: [PATCH v2 1/1] arm64: dts: allwinner: NanoPi R1S H5: Add generic compatible string for I2C EEPROM

The 'microchip,24c02' compatible does not match the at24 driver, so
add this generic fallback to the device node compatible string to
make the device to match the driver using the OF device ID table.

Also set this eeprom to read-only mode because it stores the mac
address of the onboard usb network card.

Signed-off-by: Chukun Pan <[email protected]>
---
.../arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
index 55bcdf8d1a07..55b369534a08 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
@@ -142,9 +142,16 @@
status = "okay";

eeprom@51 {
- compatible = "microchip,24c02";
+ compatible = "microchip,24c02", "atmel,24c02";
reg = <0x51>;
pagesize = <16>;
+ read-only;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ eth_mac1: mac-address@fa {
+ reg = <0xfa 0x06>;
+ };
};
};

--
2.17.1

2021-10-14 07:20:31

by Maxime Ripard

[permalink] [raw]
Subject: Re: (subset) [PATCH v2 1/1] arm64: dts: allwinner: NanoPi R1S H5: Add generic compatible string for I2C EEPROM

On Sun, 10 Oct 2021 21:50:17 +0800, Chukun Pan wrote:
> The 'microchip,24c02' compatible does not match the at24 driver, so
> add this generic fallback to the device node compatible string to
> make the device to match the driver using the OF device ID table.
>
> Also set this eeprom to read-only mode because it stores the mac
> address of the onboard usb network card.
>
> [...]

Applied to local tree (sunxi/dt-for-5.16).

Thanks!
Maxime