diff mbox

ARM: omap3: beagleboard-xm: dt: Add ethernet to the device tree

Message ID 20161202165323.GC4705@atomide.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tony Lindgren Dec. 2, 2016, 4:53 p.m. UTC
* Laurent Pinchart <laurent.pinchart@ideasonboard.com> [161202 05:38]:
> Hi Tony,
> 
> On Thursday 01 Dec 2016 17:18:08 Tony Lindgren wrote:
> > * Laurent Pinchart <laurent.pinchart@ideasonboard.com> [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@atomide.com>
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@atomide.com>
---
 arch/arm/boot/dts/omap5-igep0050.dts | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

Comments

Laurent Pinchart Dec. 2, 2016, 6:39 p.m. UTC | #1
Hi Tony,

On Friday 02 Dec 2016 08:53:24 Tony Lindgren wrote:
> * Laurent Pinchart <laurent.pinchart@ideasonboard.com> [161202 05:38]:
> > On Thursday 01 Dec 2016 17:18:08 Tony Lindgren wrote:
> >> * Laurent Pinchart <laurent.pinchart@ideasonboard.com> [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@atomide.com>
> 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@atomide.com>
> ---
>  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>;
> +		};
> +	};
> +};
Tony Lindgren Dec. 2, 2016, 6:50 p.m. UTC | #2
* Laurent Pinchart <laurent.pinchart@ideasonboard.com> [161202 10:39]:
> Hi Tony,
> 
> On Friday 02 Dec 2016 08:53:24 Tony Lindgren wrote:
> > * Laurent Pinchart <laurent.pinchart@ideasonboard.com> [161202 05:38]:
> > > On Thursday 01 Dec 2016 17:18:08 Tony Lindgren wrote:
> > >> * Laurent Pinchart <laurent.pinchart@ideasonboard.com> [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 linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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>;
+		};
+	};
+};