All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree
@ 2016-11-30 17:58 Laurent Pinchart
       [not found] ` <1480528685-26259-1-git-send-email-laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Laurent Pinchart @ 2016-11-30 17:58 UTC (permalink / raw)
  To: linux-omap-u79uwXL29TY76Z2rM5mHXA
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Tony Lindgren, Benoît Cousson

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.

Signed-off-by: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
---
 arch/arm/boot/dts/omap3-beagle-xm.dts | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts
index 85e297ed0ea1..75ac56cdf954 100644
--- a/arch/arm/boot/dts/omap3-beagle-xm.dts
+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
@@ -27,6 +27,7 @@
 	aliases {
 		display0 = &dvi0;
 		display1 = &tv0;
+		ethernet = &ethernet;
 	};
 
 	leds {
@@ -348,6 +349,21 @@
 
 &usbhsehci {
 	phys = <0 &hsusb2_phy>;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	usb2@2 {
+		compatible = "usb424,9514";
+		reg = <2>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ethernet: usbether@1 {
+			compatible = "usb424,ec00";
+			reg = <1>;
+		};
+	};
 };
 
 &vaux2 {
-- 
Regards,

Laurent Pinchart

--
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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree
       [not found] ` <1480528685-26259-1-git-send-email-laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
@ 2016-12-01 21:12   ` Tony Lindgren
       [not found]     ` <20161201211234.GA3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
  2016-12-02  1:18   ` Tony Lindgren
  1 sibling, 1 reply; 15+ messages in thread
From: Tony Lindgren @ 2016-12-01 21:12 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Benoît Cousson

* Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161130 09:58]:
> 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.

Regards,

Tony
--
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree
       [not found]     ` <20161201211234.GA3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
@ 2016-12-01 21:33       ` Tom Rini
  2016-12-01 21:35       ` Tony Lindgren
  2016-12-01 21:37       ` Laurent Pinchart
  2 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2016-12-01 21:33 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Laurent Pinchart, linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Benoît Cousson

[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]

On Thu, Dec 01, 2016 at 01:12:34PM -0800, Tony Lindgren wrote:
> * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161130 09:58]:
> > 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.

Yes, it seems like something else must be going on as well as
"usbethaddr" which U-Boot will populate with a MAC based on the OMAP DIE
ID doesn't get populated into the DT only ethaddr.  And the follow-up is
that it would be nice if someone would go and patch the last driver in
U-Boot that uses usbethaddr to use ethaddr like all of the rest do.

-- 
Tom

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree
       [not found]     ` <20161201211234.GA3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
  2016-12-01 21:33       ` Tom Rini
@ 2016-12-01 21:35       ` Tony Lindgren
       [not found]         ` <20161201213515.GB3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
  2016-12-01 21:37       ` Laurent Pinchart
  2 siblings, 1 reply; 15+ messages in thread
From: Tony Lindgren @ 2016-12-01 21:35 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Benoît Cousson

* Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> [161201 13:14]:
> * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161130 09:58]:
> > 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.

Looks like my u-boot only has usbethaddr in the environment. After doing
setenv ethaddr it's now working :)

Regards,

Tony

--
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree
       [not found]     ` <20161201211234.GA3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
  2016-12-01 21:33       ` Tom Rini
  2016-12-01 21:35       ` Tony Lindgren
@ 2016-12-01 21:37       ` Laurent Pinchart
  2016-12-01 21:44         ` Tony Lindgren
  2 siblings, 1 reply; 15+ messages in thread
From: Laurent Pinchart @ 2016-12-01 21:37 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Benoît Cousson

Hi Tony,

On Thursday 01 Dec 2016 13:12:34 Tony Lindgren wrote:
> * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161130 09:58]:
> > 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]"

-- 
Regards,

Laurent Pinchart

--
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree
       [not found]         ` <20161201213515.GB3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
@ 2016-12-01 21:37           ` Laurent Pinchart
  2016-12-01 21:41             ` Tom Rini
  0 siblings, 1 reply; 15+ messages in thread
From: Laurent Pinchart @ 2016-12-01 21:37 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Benoît Cousson

On Thursday 01 Dec 2016 13:35:16 Tony Lindgren wrote:
> * Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> [161201 13:14]:
> > * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161130 09:58]:
> > > 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.
> 
> Looks like my u-boot only has usbethaddr in the environment. After doing
> setenv ethaddr it's now working :)

Nice to know, thanks for the tip :-)

-- 
Regards,

Laurent Pinchart

--
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree
  2016-12-01 21:37           ` Laurent Pinchart
@ 2016-12-01 21:41             ` Tom Rini
  0 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2016-12-01 21:41 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Tony Lindgren, linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Benoît Cousson

[-- Attachment #1: Type: text/plain, Size: 1390 bytes --]

On Thu, Dec 01, 2016 at 11:37:53PM +0200, Laurent Pinchart wrote:
> On Thursday 01 Dec 2016 13:35:16 Tony Lindgren wrote:
> > * Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> [161201 13:14]:
> > > * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161130 09:58]:
> > > > 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.
> > 
> > Looks like my u-boot only has usbethaddr in the environment. After doing
> > setenv ethaddr it's now working :)
> 
> Nice to know, thanks for the tip :-)

To tag onto my other email, it should be just a little work to get this
to work for everyone out of the box :)

-- 
Tom

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree
  2016-12-01 21:37       ` Laurent Pinchart
@ 2016-12-01 21:44         ` Tony Lindgren
       [not found]           ` <20161201214457.GC3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Tony Lindgren @ 2016-12-01 21:44 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Benoît Cousson

* Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161201 13:37]:
> Hi Tony,
> 
> On Thursday 01 Dec 2016 13:12:34 Tony Lindgren wrote:
> > * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161130 09:58]:
> > > 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..

Tony
--
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree
       [not found]           ` <20161201214457.GC3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
@ 2016-12-02  0:29             ` Tony Lindgren
       [not found]               ` <20161202002921.GD3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Tony Lindgren @ 2016-12-02  0:29 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Benoît Cousson

* Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> [161201 13:45]:
> * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161201 13:37]:
> > Hi Tony,
> > 
> > On Thursday 01 Dec 2016 13:12:34 Tony Lindgren wrote:
> > > * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161130 09:58]:
> > > > 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.

Regards,

Tony

8< ---------------------
>From tony Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
Date: Thu, 1 Dec 2016 12:57:24 -0800
Subject: [PATCH] ARM: dts: omap5-uevm: Allow bootloader to configure USB
 Ethernet MAC

Note that with 9730 the wiring is different compared to 9514 found on
beagleboard xm for example.

On beagleboard xm we have:

/sys/bus/usb/devices/1-2	hub
/sys/bus/usb/devices/1-2.1	9514

While on omap5-uevm we have:

/sys/bus/usb/devices/1-2	hub
/sys/bus/usb/devices/1-3	9730

Signed-off-by: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
---
 arch/arm/boot/dts/omap5-uevm.dts | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts
--- a/arch/arm/boot/dts/omap5-uevm.dts
+++ b/arch/arm/boot/dts/omap5-uevm.dts
@@ -18,6 +18,10 @@
 		reg = <0 0x80000000 0 0x7f000000>; /* 2032 MB */
 	};
 
+	aliases {
+		ethernet = &ethernet;
+	};
+
 	leds {
 		compatible = "gpio-leds";
 		led1 {
@@ -164,6 +168,23 @@
 	>;
 };
 
+&usbhsehci {
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	usb2@2 {
+		compatible = "usb424,3503";
+		reg = <2>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	ethernet: usbether@3 {
+		compatible = "usb424,9730";
+		reg = <3>;
+	};
+};
+
 &wlcore {
 	compatible = "ti,wl1837";
 };
-- 
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree
       [not found]               ` <20161202002921.GD3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
@ 2016-12-02  0:50                 ` Tony Lindgren
  0 siblings, 0 replies; 15+ messages in thread
From: Tony Lindgren @ 2016-12-02  0:50 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Benoît Cousson

* Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> [161201 16:29]:
> * Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> [161201 13:45]:
> > * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161201 13:37]:
> > > Hi Tony,
> > > 
> > > On Thursday 01 Dec 2016 13:12:34 Tony Lindgren wrote:
> > > > * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161130 09:58]:
> > > > > 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 <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
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
<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>, similar patch also works for
pandaboard. The only difference is that the hub is address 1 instead
of 2.

Signed-off-by: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
---
 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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree
       [not found] ` <1480528685-26259-1-git-send-email-laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
  2016-12-01 21:12   ` Tony Lindgren
@ 2016-12-02  1:18   ` Tony Lindgren
       [not found]     ` <20161202011807.GF3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
  1 sibling, 1 reply; 15+ messages in thread
From: Tony Lindgren @ 2016-12-02  1:18 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Benoît Cousson

* Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161130 09:58]:
>  &usbhsehci {
>  	phys = <0 &hsusb2_phy>;
> +
> +	#address-cells = <1>;
> +	#size-cells = <0>;
> +
> +	usb2@2 {

I think this should be usb1@2 instead of usb2@2? That's because it's
at /sys/bus/usb/devices/1-2 and not at /sys/bus/usb/devices/2-2?

Or what's the naming standard here?

Regards,

Tony
--
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree
       [not found]     ` <20161202011807.GF3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
@ 2016-12-02 13:38       ` Laurent Pinchart
  2016-12-02 16:53         ` Tony Lindgren
  0 siblings, 1 reply; 15+ messages in thread
From: Laurent Pinchart @ 2016-12-02 13:38 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Benoît Cousson

Hi Tony,

On Thursday 01 Dec 2016 17:18:08 Tony Lindgren wrote:
> * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161130 09:58]:
> >  &usbhsehci {
> >  
> >  	phys = <0 &hsusb2_phy>;
> > 
> > +
> > +	#address-cells = <1>;
> > +	#size-cells = <0>;
> > +
> > +	usb2@2 {
> 
> I think this should be usb1@2 instead of usb2@2? That's because it's
> at /sys/bus/usb/devices/1-2 and not at /sys/bus/usb/devices/2-2?
> 
> Or what's the naming standard here?

Good question. As far as I know, the node name is irrelevant, only the reg 
value is important. Maybe we should call it hub@2 ?

-- 
Regards,

Laurent Pinchart

--
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree
  2016-12-02 13:38       ` Laurent Pinchart
@ 2016-12-02 16:53         ` Tony Lindgren
       [not found]           ` <20161202165323.GC4705-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Tony Lindgren @ 2016-12-02 16:53 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Benoît Cousson

* Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161202 05:38]:
> Hi Tony,
> 
> On Thursday 01 Dec 2016 17:18:08 Tony Lindgren wrote:
> > * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161130 09:58]:
> > >  &usbhsehci {
> > >  
> > >  	phys = <0 &hsusb2_phy>;
> > > 
> > > +
> > > +	#address-cells = <1>;
> > > +	#size-cells = <0>;
> > > +
> > > +	usb2@2 {
> > 
> > I think this should be usb1@2 instead of usb2@2? That's because it's
> > at /sys/bus/usb/devices/1-2 and not at /sys/bus/usb/devices/2-2?
> > 
> > Or what's the naming standard here?
> 
> Good question. As far as I know, the node name is irrelevant, only the reg 
> value is important. Maybe we should call it hub@2 ?

Yeah hub sounds good to me, Rob?

Sohow does the kernel know which instance it is if there
are multiple devices? For example, below is a patch for
igepv5 (not yet using "hub" naming), note how it has things
at 3-2 and 3-2.3. So if it also had something at 1-2 and
1-2.1, how would we name them?

Regards,

Tony

8< ------------------------

>From tony Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
Date: Thu, 1 Dec 2016 17:04:50 -0800
Subject: [PATCH] ARM: dts: omap5-igep0050: Allow bootloader to configure
 USB Ethernet MAC

This is slightly different wiring compared to omap5-uevm or pandaboard:

/sys/bus/usb/devices/3-2	hub
/sys/bus/usb/devices/3-2.3	7500

Signed-off-by: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
---
 arch/arm/boot/dts/omap5-igep0050.dts | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/omap5-igep0050.dts b/arch/arm/boot/dts/omap5-igep0050.dts
--- a/arch/arm/boot/dts/omap5-igep0050.dts
+++ b/arch/arm/boot/dts/omap5-igep0050.dts
@@ -19,6 +19,10 @@
 		reg = <0x0 0x80000000 0 0x7f000000>;	/* 2032 MB */
 	};
 
+	aliases {
+		ethernet = &ethernet;
+	};
+
 	gpio_keys {
 		compatible = "gpio-keys";
 		pinctrl-0 = <&power_button_pin>;
@@ -116,3 +120,20 @@
 		OMAP5_IOPAD(0x1ca, PIN_OUTPUT | MUX_MODE6)	/* perslimbus2_clock.gpio5_145 */
 	>;
 };
+
+&usbhsehci {
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	usb3@2 {
+		compatible = "usb424,3503";
+		reg = <2>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ethernet: usbether@3 {
+			compatible = "usb424,7500";
+			reg = <3>;
+		};
+	};
+};
-- 
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree
       [not found]           ` <20161202165323.GC4705-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
@ 2016-12-02 18:39             ` Laurent Pinchart
  2016-12-02 18:50               ` Tony Lindgren
  0 siblings, 1 reply; 15+ messages in thread
From: Laurent Pinchart @ 2016-12-02 18:39 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Benoît Cousson

Hi Tony,

On Friday 02 Dec 2016 08:53:24 Tony Lindgren wrote:
> * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161202 05:38]:
> > On Thursday 01 Dec 2016 17:18:08 Tony Lindgren wrote:
> >> * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161130 09:58]:
> >>>  &usbhsehci {
> >>>  
> >>>  	phys = <0 &hsusb2_phy>;
> >>> 
> >>> +
> >>> +	#address-cells = <1>;
> >>> +	#size-cells = <0>;
> >>> +
> >>> +	usb2@2 {
> >> 
> >> I think this should be usb1@2 instead of usb2@2? That's because it's
> >> at /sys/bus/usb/devices/1-2 and not at /sys/bus/usb/devices/2-2?
> >> 
> >> Or what's the naming standard here?
> > 
> > Good question. As far as I know, the node name is irrelevant, only the reg
> > value is important. Maybe we should call it hub@2 ?
> 
> Yeah hub sounds good to me, Rob?
> 
> Sohow does the kernel know which instance it is if there
> are multiple devices? For example, below is a patch for
> igepv5 (not yet using "hub" naming), note how it has things
> at 3-2 and 3-2.3. So if it also had something at 1-2 and
> 1-2.1, how would we name them?

Every time I have to deal with USB device names I need to look the naming 
scheme up. The explanation here might not be 100% accurate.

The first number is the bus number, which more or less identifies a host 
controller (and its root hub). That's a dynamically allocated ID that thus 
can't be used by DT, but given that DT USB bindings create node as children of 
a host controller, we don't need the bus number anyway.

The numbers following the dash identify ports on hubs. 3-2 is thus the device 
connected on port 2 of the root hub of bus 3 (which is a hub), and 3-2.3 is 
the device connected on port 3 of the hub connected on port 2 of the root hub 
of bus 3.

If you had 1-2 and 1-2.1 it would mean that device on port 2 of the root hub 
of bus 1 (1-2) is a hub that has device connected on its first port (1-2.1).

> 8< ------------------------
> 
> From tony Mon Sep 17 00:00:00 2001
> From: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
> Date: Thu, 1 Dec 2016 17:04:50 -0800
> Subject: [PATCH] ARM: dts: omap5-igep0050: Allow bootloader to configure
>  USB Ethernet MAC
> 
> This is slightly different wiring compared to omap5-uevm or pandaboard:
> 
> /sys/bus/usb/devices/3-2	hub
> /sys/bus/usb/devices/3-2.3	7500
> 
> Signed-off-by: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
> ---
>  arch/arm/boot/dts/omap5-igep0050.dts | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/omap5-igep0050.dts
> b/arch/arm/boot/dts/omap5-igep0050.dts ---
> a/arch/arm/boot/dts/omap5-igep0050.dts
> +++ b/arch/arm/boot/dts/omap5-igep0050.dts
> @@ -19,6 +19,10 @@
>  		reg = <0x0 0x80000000 0 0x7f000000>;	/* 2032 MB */
>  	};
> 
> +	aliases {
> +		ethernet = &ethernet;
> +	};
> +
>  	gpio_keys {
>  		compatible = "gpio-keys";
>  		pinctrl-0 = <&power_button_pin>;
> @@ -116,3 +120,20 @@
>  		OMAP5_IOPAD(0x1ca, PIN_OUTPUT | MUX_MODE6)	/* 
perslimbus2_clock.gpio5_145
> */
>  	>;
> 
>  };
> +
> +&usbhsehci {
> +	#address-cells = <1>;
> +	#size-cells = <0>;
> +
> +	usb3@2 {
> +		compatible = "usb424,3503";
> +		reg = <2>;
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		ethernet: usbether@3 {
> +			compatible = "usb424,7500";
> +			reg = <3>;
> +		};
> +	};
> +};

-- 
Regards,

Laurent Pinchart

--
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree
  2016-12-02 18:39             ` Laurent Pinchart
@ 2016-12-02 18:50               ` Tony Lindgren
  0 siblings, 0 replies; 15+ messages in thread
From: Tony Lindgren @ 2016-12-02 18:50 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Benoît Cousson

* Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161202 10:39]:
> Hi Tony,
> 
> On Friday 02 Dec 2016 08:53:24 Tony Lindgren wrote:
> > * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161202 05:38]:
> > > On Thursday 01 Dec 2016 17:18:08 Tony Lindgren wrote:
> > >> * Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org> [161130 09:58]:
> > >>>  &usbhsehci {
> > >>>  
> > >>>  	phys = <0 &hsusb2_phy>;
> > >>> 
> > >>> +
> > >>> +	#address-cells = <1>;
> > >>> +	#size-cells = <0>;
> > >>> +
> > >>> +	usb2@2 {
> > >> 
> > >> I think this should be usb1@2 instead of usb2@2? That's because it's
> > >> at /sys/bus/usb/devices/1-2 and not at /sys/bus/usb/devices/2-2?
> > >> 
> > >> Or what's the naming standard here?
> > > 
> > > Good question. As far as I know, the node name is irrelevant, only the reg
> > > value is important. Maybe we should call it hub@2 ?
> > 
> > Yeah hub sounds good to me, Rob?
> > 
> > Sohow does the kernel know which instance it is if there
> > are multiple devices? For example, below is a patch for
> > igepv5 (not yet using "hub" naming), note how it has things
> > at 3-2 and 3-2.3. So if it also had something at 1-2 and
> > 1-2.1, how would we name them?
> 
> Every time I have to deal with USB device names I need to look the naming 
> scheme up. The explanation here might not be 100% accurate.
> 
> The first number is the bus number, which more or less identifies a host 
> controller (and its root hub). That's a dynamically allocated ID that thus 
> can't be used by DT, but given that DT USB bindings create node as children of 
> a host controller, we don't need the bus number anyway.

Oh OK so that must be some deferred probe happening here giving
me the 3-2 numbering instead of 1-2 numbering.

> The numbers following the dash identify ports on hubs. 3-2 is thus the device 
> connected on port 2 of the root hub of bus 3 (which is a hub), and 3-2.3 is 
> the device connected on port 3 of the hub connected on port 2 of the root hub 
> of bus 3.
> 
> If you had 1-2 and 1-2.1 it would mean that device on port 2 of the root hub 
> of bus 1 (1-2) is a hub that has device connected on its first port (1-2.1).

OK so 1-2 and 3-2 are both at the root hub port 2 so no issue there.

BTW, considering the various versions of u-boot, just doing
udevadm info /sys/bus/usb/devices/1-2 can be used for debugging
as if configured properly in the dts it will show the three OF_*
related lines.

Seems like the "hub" naming would be good to use though.

Thanks,

Tony
--
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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-12-02 18:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-30 17:58 [PATCH] ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree Laurent Pinchart
     [not found] ` <1480528685-26259-1-git-send-email-laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2016-12-01 21:12   ` Tony Lindgren
     [not found]     ` <20161201211234.GA3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-12-01 21:33       ` Tom Rini
2016-12-01 21:35       ` Tony Lindgren
     [not found]         ` <20161201213515.GB3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-12-01 21:37           ` Laurent Pinchart
2016-12-01 21:41             ` Tom Rini
2016-12-01 21:37       ` Laurent Pinchart
2016-12-01 21:44         ` Tony Lindgren
     [not found]           ` <20161201214457.GC3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-12-02  0:29             ` Tony Lindgren
     [not found]               ` <20161202002921.GD3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-12-02  0:50                 ` Tony Lindgren
2016-12-02  1:18   ` Tony Lindgren
     [not found]     ` <20161202011807.GF3703-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-12-02 13:38       ` Laurent Pinchart
2016-12-02 16:53         ` Tony Lindgren
     [not found]           ` <20161202165323.GC4705-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-12-02 18:39             ` Laurent Pinchart
2016-12-02 18:50               ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.