Thread (1 message) 1 message, 1 author, 2016-12-02

Re: [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree

From: Tony Lindgren <hidden>
Date: 2016-12-02 00:50:51
Also in: linux-omap
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

* Tony Lindgren [off-list ref] [161201 16:29]:
* Tony Lindgren [off-list ref] [161201 13:45]:
quoted
* Laurent Pinchart [off-list ref] [161201 13:37]:
quoted
Hi Tony,

On Thursday 01 Dec 2016 13:12:34 Tony Lindgren wrote:
quoted
* Laurent Pinchart [off-list ref] [161130 09:58]:
quoted
The Beagleboard-xM has a LAN9514 USB hub and ethernet controller,
connected to port 2 of the OMAP EHCI controller. The board however has
no EEPROM to store the ethernet MAC address, which is programmed by the
boot loader.

To allow Linux to use the same MAC address as the boot loader (or for
that matter any fixed MAC address), we need a node in the device tree
for the ethernet controller that the boot loader can update at runtime
with a local-mac-address property. Add it, along with an alias for the
ethernet controller to let the boot loader locate it easily.
Does not seem to work here.. Do I need to set something in u-boot?
I'm using U-Boot 2016.09-00004-g26bb688.
Some versions (possibly forked by vendors) might set the MAC address
automatically in DT, but in my case I have the following in my boot script:

tftp 0x80800000 beagle/omap3-beagle-xm.dtb
fdt addr ${fileaddr} ${filesize}
fdt resize
fdt set /ocp@68000000/usbhshost@48064000/ehci@48064800/usb2@2/usbether@1 local-mac-address "[7a d2 a0 00 d1 f0]"
OK. I just added setenv ethaddr ${usbethaddr} to my bootcmd..
Here's a similar patch for omap5-uevm. Somehow u-boot does not populate the
local-mac-address on it though although set in the environment.

So I had to manually do the fdt set /ocp/usbhshost@4a064000/ehci@4a064c00/usbether@3
command.
And here's one for pandaboard. That gets configured fine if ethaddr is
set.

Regards,

Tony

8< ------------------
From tony Mon Sep 17 00:00:00 2001
From: Tony Lindgren <redacted>
Date: Thu, 1 Dec 2016 16:33:20 -0800
Subject: [PATCH] ARM: dts: pandaboard: Allow bootloader to configure USB
 Ethernet MAC

Inspired by a patch for beagleboard xm by Laurent Pinchart
[off-list ref], similar patch also works for
pandaboard. The only difference is that the hub is address 1 instead
of 2.

Signed-off-by: Tony Lindgren <redacted>
---
 arch/arm/boot/dts/omap4-panda-common.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi
--- a/arch/arm/boot/dts/omap4-panda-common.dtsi
+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
@@ -16,6 +16,7 @@
 	aliases {
 		display0 = &dvi0;
 		display1 = &hdmi0;
+		ethernet = &ethernet;
 	};
 
 	leds: leds {
@@ -520,6 +521,21 @@
 
 &usbhsehci {
 	phys = <&hsusb1_phy>;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	usb2@1 {
+		compatible = "usb424,9514";
+		reg = <1>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ethernet: usbether@1 {
+			compatible = "usb424,ec00";
+			reg = <1>;
+		};
+	};
 };
 
 &dss {
-- 
2.11.0
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help