devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: "Rob Herring" <robh+dt@kernel.org>,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	bcm-kernel-feedback-list@broadcom.com,
	"Rafał Miłecki" <rafal@milecki.pl>
Subject: [PATCH stblinux] arm64: dts: broadcom: bcm4908: add Ethernet MAC addr
Date: Mon, 29 Mar 2021 17:45:14 +0200	[thread overview]
Message-ID: <20210329154514.29510-1-zajec5@gmail.com> (raw)

From: Rafał Miłecki <rafal@milecki.pl>

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@milecki.pl>
---
Related Ethernet bindings fixes:
https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20210329140317.23343-1-zajec5@gmail.com/
https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20210329153328.28493-1-zajec5@gmail.com/

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@gmail.com/
---
 .../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


             reply	other threads:[~2021-03-29 15:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 15:45 Rafał Miłecki [this message]
2021-03-29 18:44 ` [PATCH stblinux] arm64: dts: broadcom: bcm4908: add Ethernet MAC addr Florian Fainelli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210329154514.29510-1-zajec5@gmail.com \
    --to=zajec5@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=rafal@milecki.pl \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).