[PATCH stblinux] arm64: dts: broadcom: bcm4908: add Ethernet MAC addr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Rafał Miłecki <rafal@xxxxxxxxxx>

On most BCM4908 devices MAC address can be read from the bootloader
binary section containing device settings. Use NVMEM to describe that.

Signed-off-by: Rafał Miłecki <rafal@xxxxxxxxxx>
---
Related Ethernet bindings fixes:
https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20210329140317.23343-1-zajec5@xxxxxxxxx/
https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20210329153328.28493-1-zajec5@xxxxxxxxx/

This commit will introduce a new warning / error:
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dt.yaml: partitions: partition@0:compatible:0: 'brcm,bcm4908-firmware' was expected
        From schema: Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml

Binding fix avoiding above is in progress, see:
[PATCH RFC] dt-bindings: mtd: allow NVMEM cells in BCM4908 partitions
https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20210329150723.26584-1-zajec5@xxxxxxxxx/
---
 .../broadcom/bcm4908/bcm4906-netgear-r8000p.dts    | 14 ++++++++++++++
 .../broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts    | 14 ++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts
index 41e8fbf095c6..2dd028438c22 100644
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-netgear-r8000p.dts
@@ -74,6 +74,11 @@ led-wifi {
 	};
 };
 
+&enet {
+	nvmem-cells = <&base_mac_addr>;
+	nvmem-cell-names = "mac-address";
+};
+
 &usb_phy {
 	brcm,ioc = <1>;
 	status = "okay";
@@ -130,8 +135,17 @@ partitions {
 		#size-cells = <1>;
 
 		partition@0 {
+			compatible = "nvmem-cells";
 			label = "cferom";
 			reg = <0x0 0x100000>;
+
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0 0x0 0x100000>;
+
+			base_mac_addr: mac@106a0 {
+				reg = <0x106a0 0x6>;
+			};
 		};
 
 		partition@100000 {
diff --git a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
index b049a12a4133..169fbb7cfd34 100644
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
@@ -44,6 +44,11 @@ brightness {
 	};
 };
 
+&enet {
+	nvmem-cells = <&base_mac_addr>;
+	nvmem-cell-names = "mac-address";
+};
+
 &usb_phy {
 	brcm,ioc = <1>;
 	status = "okay";
@@ -128,8 +133,17 @@ partitions {
 		#size-cells = <1>;
 
 		partition@0 {
+			compatible = "nvmem-cells";
 			label = "cferom";
 			reg = <0x0 0x100000>;
+
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0 0x0 0x100000>;
+
+			base_mac_addr: mac@106a0 {
+				reg = <0x106a0 0x6>;
+			};
 		};
 
 		partition@100000 {
-- 
2.26.2




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux