Skip to contentSkip to conversation

ARM: dts: stm32: Add phandle to nvmem efuse into STM32MP13xx ethernet DT node

PATCH In review Marek Vasut 2 participants 3 messages Jun 23, 2024 – Jun 28, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts: stm32: Add phandle to nvmem efuse into STM32MP13xx ethernet DT node

The efuses on STM32MP13xx can be populated with ethernet MAC address. Add the nvmem-cells/nvmem-cell-name DT properties to ethernet MAC DT nodes to describe the placement of both MAC address fields within the efuses, so the ethernet MAC driver can access the efuses and populate the correct MAC address into the hardware.

---
Cc: Alexandre Torgue <[email protected]>
Cc: Christophe Roullier <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 arch/arm/boot/dts/st/stm32mp131.dtsi | 2 ++
 arch/arm/boot/dts/st/stm32mp133.dtsi | 2 ++
 2 files changed, 4 insertions(+)
arch/arm/boot/dts/st/stm32mp131.dtsi +2 -0
index f41508195eb51..55f4150524f3c 100644
@@ -1528,6 +1528,8 @@ ethernet1: ethernet@5800a000 {
 					 <&rcc ETH1RX>,
 					 <&rcc ETH1STP>,
 					 <&rcc ETH1CK_K>;
+				nvmem-cell-names = "mac-address";
+				nvmem-cells = <&ethernet_mac1_address>;
 				snps,axi-config = <&stmmac_axi_config_1>;
 				snps,mixed-burst;
 				snps,pbl = <2>;
arch/arm/boot/dts/st/stm32mp133.dtsi +2 -0
index ae2fbc09e93b9..48b6ddb59badf 100644
@@ -85,6 +85,8 @@ ethernet2: ethernet@5800e000 {
 			 <&rcc ETH2RX>,
 			 <&rcc ETH2STP>,
 			 <&rcc ETH2CK_K>;
+		nvmem-cell-names = "mac-address";
+		nvmem-cells = <&ethernet_mac2_address>;
 		snps,axi-config = <&stmmac_axi_config_2>;
 		snps,mixed-burst;
 		snps,pbl = <2>;
Signature · 1 line
2.43.0
maintainer
#1 lore raw

Hi Marek

Quoted 28 lines · Marek Vasut

The efuses on STM32MP13xx can be populated with ethernet MAC address. Add the nvmem-cells/nvmem-cell-name DT properties to ethernet MAC DT nodes to describe the placement of both MAC address fields within the efuses, so the ethernet MAC driver can access the efuses and populate the correct MAC address into the hardware.

---
Cc: Alexandre Torgue <[email protected]>
Cc: Christophe Roullier <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
  arch/arm/boot/dts/st/stm32mp131.dtsi | 2 ++
  arch/arm/boot/dts/st/stm32mp133.dtsi | 2 ++
  2 files changed, 4 insertions(+)
arch/arm/boot/dts/st/stm32mp131.dtsi +0 -0
index f41508195eb51..55f4150524f3c 100644

arch/arm/boot/dts/st/stm32mp131.dtsi ethernet1: ethernet@5800a000 { · line 1532

Quoted 5 lines
arch/arm/boot/dts/st/stm32mp131.dtsi +2 -0
@@ -1528,6 +1528,8 @@ ethernet1: ethernet@5800a000 {
  					 <&rcc ETH1RX>,
  					 <&rcc ETH1STP>,
  					 <&rcc ETH1CK_K>;
+				nvmem-cell-names = "mac-address";
+				nvmem-cells = <&ethernet_mac1_address>;

It should not be defined in soc dtsi file but rather in board file. OTP are provisioned by the end customer not by ST. If you order a SoC to ST it will not be provisioned OTP MAC addr will be set to 0.

Regards
alex

Quoted 16 lines
arch/arm/boot/dts/st/stm32mp131.dtsi +0 -0
  				snps,axi-config = <&stmmac_axi_config_1>;
  				snps,mixed-burst;
  				snps,pbl = <2>;
arch/arm/boot/dts/st/stm32mp133.dtsi +2 -0
index ae2fbc09e93b9..48b6ddb59badf 100644
@@ -85,6 +85,8 @@ ethernet2: ethernet@5800e000 {
  			 <&rcc ETH2RX>,
  			 <&rcc ETH2STP>,
  			 <&rcc ETH2CK_K>;
+		nvmem-cell-names = "mac-address";
+		nvmem-cells = <&ethernet_mac2_address>;
  		snps,axi-config = <&stmmac_axi_config_2>;
  		snps,mixed-burst;
  		snps,pbl = <2>;
#2 lore raw
Quoted 1 line · Alexandre TORGUE

Hi Marek

Hi,

Quoted 24 lines · Marek Vasut
Quoted 23 lines

The efuses on STM32MP13xx can be populated with ethernet MAC address. Add the nvmem-cells/nvmem-cell-name DT properties to ethernet MAC DT nodes to describe the placement of both MAC address fields within the efuses, so the ethernet MAC driver can access the efuses and populate the correct MAC address into the hardware.

---
Cc: Alexandre Torgue <[email protected]>
Cc: Christophe Roullier <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
  arch/arm/boot/dts/st/stm32mp131.dtsi | 2 ++ arch/arm/boot/dts/st/stm32mp133.dtsi | 2 ++

  2 files changed, 4 insertions(+)
Quoted 12 lines

arch/arm/boot/dts/st/stm32mp131.dtsi ethernet1: ethernet@5800a000 { · line 1532

Quoted 10 lines
arch/arm/boot/dts/st/stm32mp131.dtsi +2 -0
index f41508195eb51..55f4150524f3c 100644
@@ -1528,6 +1528,8 @@ ethernet1: ethernet@5800a000 {
                        <&rcc ETH1RX>,
                        <&rcc ETH1STP>,
                        <&rcc ETH1CK_K>;
+                nvmem-cell-names = "mac-address";
+                nvmem-cells = <&ethernet_mac1_address>;

It should not be defined in soc dtsi file but rather in board file. OTP are provisioned by the end customer not by ST. If you order a SoC to ST it will not be provisioned OTP MAC addr will be set to 0.

That's right, but at least the MAC address will be in the same locations in OTP, and if the MAC from OTP is all zeroes, than it wouldn't be considered a valid MAC address.

In any case, I'll do board specific V2 shortly.