diff mbox series

[v2,4/5] imx8mn-var-som: read eth MAC address from EEPROM

Message ID 20230525210228.4164480-5-hugo@hugovil.com
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show
Series imx8mn-var-som: fix ethernet for Variscite symphony board and imx8m nano SOM | expand

Commit Message

Hugo Villeneuve May 25, 2023, 9:02 p.m. UTC
From: Hugo Villeneuve <hvilleneuve@dimonoff.com>

Read ethernet MAC address from EEPROM located on the SOM.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
---
 arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi | 13 +++++++++++++
 arch/arm/mach-imx/imx8m/Kconfig                  |  1 +
 2 files changed, 14 insertions(+)

Comments

Stefano Babic July 11, 2023, 7:46 p.m. UTC | #1
> From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> Read ethernet MAC address from EEPROM located on the SOM.
> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi b/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
index 7272fc2b4c..e0caf3179e 100644
--- a/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-var-som-symphony-u-boot.dtsi
@@ -13,6 +13,19 @@ 
 	bootph-pre-ram;
 };
 
+&eeprom_som {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	eth_mac_address: eth-mac-address@19 {
+		reg = <0x19 0x06>;
+	};
+};
+
+&fec1 {
+	nvmem-cells = <&eth_mac_address>;
+	nvmem-cell-names = "mac-address";
+};
+
 &gpio1 {
 	bootph-pre-ram;
 };
diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index a940d8a950..67db3e46ec 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -248,6 +248,7 @@  config TARGET_IMX8MN_VAR_SOM
 	select MISC
 	select I2C_EEPROM
 	select DM_ETH_PHY
+	select NVMEM
 
 config TARGET_KONTRON_PITX_IMX8M
 	bool "Support Kontron pITX-imx8m"