Re: [PATCH 2/2] ARM: bcm2835: dt: Add the ethernet to the device tree

2016-02-07 Thread kbuild test robot
Hi Lubomir,

[auto build test ERROR on net-next/master]
[also build test ERROR on v4.5-rc2 next-20160205]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improving the system]

url:
https://github.com/0day-ci/linux/commits/Lubomir-Rintel/Set-the-Raspberry-Pi-Ethernet-MAC-address/20160203-231826
config: arm-arm67 (attached as .config)
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm 

All errors (new ones prefixed by >>):

>> Error: arch/arm/boot/dts/bcm2835-rpi-b-plus.dts:13.2-6 syntax error
   FATAL ERROR: Unable to parse input tree

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


Re: [PATCH 2/2] ARM: bcm2835: dt: Add the ethernet to the device tree

2016-02-07 Thread kbuild test robot
Hi Lubomir,

[auto build test ERROR on net-next/master]
[also build test ERROR on v4.5-rc2 next-20160205]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improving the system]

url:
https://github.com/0day-ci/linux/commits/Lubomir-Rintel/Set-the-Raspberry-Pi-Ethernet-MAC-address/20160203-231826
config: arm-arm67 (attached as .config)
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm 

All errors (new ones prefixed by >>):

>> Error: arch/arm/boot/dts/bcm2835-rpi-b-plus.dts:13.2-6 syntax error
   FATAL ERROR: Unable to parse input tree

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


RE: [PATCH 2/2] ARM: bcm2835: dt: Add the ethernet to the device tree

2016-02-04 Thread Peter Chen
 
> Lubomir Rintel  writes:
> 
> > diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> > b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> > index ef54050..32bbd2a 100644
> > --- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> > +++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> 
> Hi,
> 
> Shouldn't this be common to all RPi1 B and RPi2 models, instead of being
> specific to just RPi B+?
> 
> > + {
> > +   usb1@01 {
> > +   compatible = "usb1d6b,0002";
> > +   reg = <01>;
> > +   #address-cells = <1>;
> > +   #size-cells = <0>;
> > +
> > +   ethernet: usbether@01 {
> > +   compatible = "usb0424,9514";
> > +   reg = <01>;
> > +   };
> > +   };
> > +};
> 
> For reference, on RPi2:

Using "lsusb -t" you may get bus topology.

> Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 
> Fast Ethernet Adapter

It is the ethernet device, you may need to change vid/pid in dts. 

> Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub

It is the hub device, you may need to change vid/pid in dts.

> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> 
 
It is root hub, it doesn't need to be described at dts.

Best regards,
Peter


RE: [PATCH 2/2] ARM: bcm2835: dt: Add the ethernet to the device tree

2016-02-04 Thread Peter Chen
 
> Lubomir Rintel  writes:
> 
> > diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> > b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> > index ef54050..32bbd2a 100644
> > --- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> > +++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> 
> Hi,
> 
> Shouldn't this be common to all RPi1 B and RPi2 models, instead of being
> specific to just RPi B+?
> 
> > + {
> > +   usb1@01 {
> > +   compatible = "usb1d6b,0002";
> > +   reg = <01>;
> > +   #address-cells = <1>;
> > +   #size-cells = <0>;
> > +
> > +   ethernet: usbether@01 {
> > +   compatible = "usb0424,9514";
> > +   reg = <01>;
> > +   };
> > +   };
> > +};
> 
> For reference, on RPi2:

Using "lsusb -t" you may get bus topology.

> Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 
> Fast Ethernet Adapter

It is the ethernet device, you may need to change vid/pid in dts. 

> Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub

It is the hub device, you may need to change vid/pid in dts.

> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> 
 
It is root hub, it doesn't need to be described at dts.

Best regards,
Peter


Re: [PATCH 2/2] ARM: bcm2835: dt: Add the ethernet to the device tree

2016-02-03 Thread Lubomir Rintel
On Thu, 2016-02-04 at 06:28 +, Peter Chen wrote:
>  
> > Lubomir Rintel  writes:
> > 
> > > diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> > > b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> > > index ef54050..32bbd2a 100644
> > > --- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> > > +++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> > 
> > Hi,
> > 
> > Shouldn't this be common to all RPi1 B and RPi2 models, instead of
> > being
> > specific to just RPi B+?
> > 
> > > + {
> > > + usb1@01 {
> > > + compatible = "usb1d6b,0002";
> > > + reg = <01>;
> > > + #address-cells = <1>;
> > > + #size-cells = <0>;
> > > +
> > > + ethernet: usbether@01 {
> > > + compatible = "usb0424,9514";
> > > + reg = <01>;
> > > + };
> > > + };
> > > +};
> > 
> > For reference, on RPi2:
> 
> Using "lsusb -t" you may get bus topology.
> 
> > Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
> > SMSC9512/9514 Fast Ethernet Adapter
> 
> It is the ethernet device, you may need to change vid/pid in dts. 
> 
> > Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
> > SMC9514 Hub
> 
> It is the hub device, you may need to change vid/pid in dts.
> 
> > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> > 
>  
> It is root hub, it doesn't need to be described at dts.

Thank you; neither of the vid/pid pairs in the original submission is
okay. I'll follow up with an updated version.

I've also checked this on RPi B rev2; and I'll be including that one,
and the RPI2 too.

I can't find my rev1 RPi B; but maybe I can just do the same for the
same board. It would likely work, but I may get the vid/pid wrong if
it's different from rev2. 

> Best regards,
> Peter

Thanks
Lubo


Re: [PATCH 2/2] ARM: bcm2835: dt: Add the ethernet to the device tree

2016-02-03 Thread Olivier Blin
Lubomir Rintel  writes:

> diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts 
> b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> index ef54050..32bbd2a 100644
> --- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> +++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts

Hi,

Shouldn't this be common to all RPi1 B and RPi2 models, instead of being
specific to just RPi B+?

> + {
> + usb1@01 {
> + compatible = "usb1d6b,0002";
> + reg = <01>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + ethernet: usbether@01 {
> + compatible = "usb0424,9514";
> + reg = <01>;
> + };
> + };
> +};

For reference, on RPi2:
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast 
Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Thanks

-- 
Olivier Blin - blino


Re: [PATCH 2/2] ARM: bcm2835: dt: Add the ethernet to the device tree

2016-02-03 Thread Lubomir Rintel
On Wed, 2016-02-03 at 09:11 -0700, Stephen Warren wrote:
> On 02/03/2016 08:02 AM, Lubomir Rintel wrote:
> > The hub and the ethernet in its port 1 are hardwired on the board.
> > 
> > Compared to the adapters that can be plugged into the USB ports,
> > this
> > one has no serial EEPROM to store its MAC. Nevertheless, the
> > Raspberry Pi
> > has the MAC address for this adapter in its ROM, accessible from
> > its
> > firmware.
> > 
> > U-Boot can read out the address and set the local-mac-address
> > property of the
> > node with "ethernet" alias. Let's add the node so that U-Boot can
> > do its
> > business.
> 
> Good to see we're getting a standard for this.
> 
> Have you talked to the RPi Foundation about updating their binary 
> bootloader to follow this protocol?

Not really. Adding Dom Cobley to the Cc list now.

They seem to be passing the MAC address on command line now and even
evaluating it before attempting a read out from the EEPROM. That sounds
like it would break if someone plugged another smsc95xx adapter into
one of the USB ports.

> I'll certainly ack changes to make 
> this work for U-Boot, provided the USB core patch this relies upon
> is 
> accepted.

Dom, if the changes mentioned in [1] get merged, you may want to add
the Ethernet device to your device trees too and drop the cmdline hack.

[1] 
http://lists.infradead.org/pipermail/linux-rpi-kernel/2016-February/003207.html

> 
> > diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> > b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> 
> > + {
> > +   usb1@01 {
> > +   compatible = "usb1d6b,0002";
> > +   reg = <01>;
> > +   #address-cells = <1>;
> > +   #size-cells = <0>;
> > +
> > +   ethernet: usbether@01 {
> > +   compatible = "usb0424,9514";
> > +   reg = <01>;
> 
> Ib both unit addresses and both reg properties, I would expect "1"
> not 
> "01" since there's usually no leading 0 fill for those.

Okay, will fix.

> I'm curious why the VID values for the hub and Ethernet device don't 
> match since those are part of the same combo chip. Is there a typo 
> there, or did SMSC really do something odd in HW?

Hm, I think I just did a sysfs walk to see how things are connected.
The ethernet USB id is certainly wrong though.

The 1d6d:2 id is of the root hub. There I either messed up the commit
message or the topology. I can't recheck now, but I'll give it another
look before I send and updated version.

Thanks,
Lubo


Re: [PATCH 2/2] ARM: bcm2835: dt: Add the ethernet to the device tree

2016-02-03 Thread Stephen Warren

On 02/03/2016 08:02 AM, Lubomir Rintel wrote:

The hub and the ethernet in its port 1 are hardwired on the board.

Compared to the adapters that can be plugged into the USB ports, this
one has no serial EEPROM to store its MAC. Nevertheless, the Raspberry Pi
has the MAC address for this adapter in its ROM, accessible from its
firmware.

U-Boot can read out the address and set the local-mac-address property of the
node with "ethernet" alias. Let's add the node so that U-Boot can do its
business.


Good to see we're getting a standard for this.

Have you talked to the RPi Foundation about updating their binary 
bootloader to follow this protocol? I'll certainly ack changes to make 
this work for U-Boot, provided the USB core patch this relies upon is 
accepted.



diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts 
b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts



+ {
+   usb1@01 {
+   compatible = "usb1d6b,0002";
+   reg = <01>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   ethernet: usbether@01 {
+   compatible = "usb0424,9514";
+   reg = <01>;


Ib both unit addresses and both reg properties, I would expect "1" not 
"01" since there's usually no leading 0 fill for those.


I'm curious why the VID values for the hub and Ethernet device don't 
match since those are part of the same combo chip. Is there a typo 
there, or did SMSC really do something odd in HW?


Re: [PATCH 2/2] ARM: bcm2835: dt: Add the ethernet to the device tree

2016-02-03 Thread Lubomir Rintel
On Wed, 2016-02-03 at 16:02 +0100, Lubomir Rintel wrote:
> The hub and the ethernet in its port 1 are hardwired on the board.
> 
> Compared to the adapters that can be plugged into the USB ports, this
> one has no serial EEPROM to store its MAC. Nevertheless, the
> Raspberry Pi
> has the MAC address for this adapter in its ROM, accessible from its
> firmware.
> 
> U-Boot can read out the address and set the local-mac-address
> property of the
> node with "ethernet" alias. Let's add the node so that U-Boot can do
> its
> business.
> 
> Signed-off-by: Lubomir Rintel 
> ---
>  arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 18 ++
>  arch/arm/boot/dts/bcm283x.dtsi   |  4 +++-
>  2 files changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> index ef54050..32bbd2a 100644
> --- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> +++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> @@ -6,6 +6,10 @@
>   compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
>   model = "Raspberry Pi Model B+";
>  
> + aliases {
> + ethernet = 
> + }

I'm missing a semicolon here. I'll follow up with an updated version
once I get some feedback.

> +
>   leds {
>   act {
>   gpios = < 47 0>;
> @@ -29,3 +33,17 @@
>   brcm,function = ;
>   };
>  };
> +
> + {
> + usb1@01 {
> + compatible = "usb1d6b,0002";
> + reg = <01>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + ethernet: usbether@01 {
> + compatible = "usb0424,9514";
> + reg = <01>;
> + };
> + };
> +};
> diff --git a/arch/arm/boot/dts/bcm283x.dtsi
> b/arch/arm/boot/dts/bcm283x.dtsi
> index 971e741..bc5fde1 100644
> --- a/arch/arm/boot/dts/bcm283x.dtsi
> +++ b/arch/arm/boot/dts/bcm283x.dtsi
> @@ -187,10 +187,12 @@
>   status = "disabled";
>   };
>  
> - usb@7e98 {
> + usb: usb@7e98 {
>   compatible = "brcm,bcm2835-usb";
>   reg = <0x7e98 0x1>;
>   interrupts = <1 9>;
> + #address-cells = <1>;
> + #size-cells = <0>;
>   };
>   };
>  


[PATCH 2/2] ARM: bcm2835: dt: Add the ethernet to the device tree

2016-02-03 Thread Lubomir Rintel
The hub and the ethernet in its port 1 are hardwired on the board.

Compared to the adapters that can be plugged into the USB ports, this
one has no serial EEPROM to store its MAC. Nevertheless, the Raspberry Pi
has the MAC address for this adapter in its ROM, accessible from its
firmware.

U-Boot can read out the address and set the local-mac-address property of the
node with "ethernet" alias. Let's add the node so that U-Boot can do its
business.

Signed-off-by: Lubomir Rintel 
---
 arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 18 ++
 arch/arm/boot/dts/bcm283x.dtsi   |  4 +++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts 
b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
index ef54050..32bbd2a 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
@@ -6,6 +6,10 @@
compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
model = "Raspberry Pi Model B+";
 
+   aliases {
+   ethernet = 
+   }
+
leds {
act {
gpios = < 47 0>;
@@ -29,3 +33,17 @@
brcm,function = ;
};
 };
+
+ {
+   usb1@01 {
+   compatible = "usb1d6b,0002";
+   reg = <01>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   ethernet: usbether@01 {
+   compatible = "usb0424,9514";
+   reg = <01>;
+   };
+   };
+};
diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index 971e741..bc5fde1 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -187,10 +187,12 @@
status = "disabled";
};
 
-   usb@7e98 {
+   usb: usb@7e98 {
compatible = "brcm,bcm2835-usb";
reg = <0x7e98 0x1>;
interrupts = <1 9>;
+   #address-cells = <1>;
+   #size-cells = <0>;
};
};
 
-- 
2.5.0



[PATCH 2/2] ARM: bcm2835: dt: Add the ethernet to the device tree

2016-02-03 Thread Lubomir Rintel
The hub and the ethernet in its port 1 are hardwired on the board.

Compared to the adapters that can be plugged into the USB ports, this
one has no serial EEPROM to store its MAC. Nevertheless, the Raspberry Pi
has the MAC address for this adapter in its ROM, accessible from its
firmware.

U-Boot can read out the address and set the local-mac-address property of the
node with "ethernet" alias. Let's add the node so that U-Boot can do its
business.

Signed-off-by: Lubomir Rintel 
---
 arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 18 ++
 arch/arm/boot/dts/bcm283x.dtsi   |  4 +++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts 
b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
index ef54050..32bbd2a 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
@@ -6,6 +6,10 @@
compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
model = "Raspberry Pi Model B+";
 
+   aliases {
+   ethernet = 
+   }
+
leds {
act {
gpios = < 47 0>;
@@ -29,3 +33,17 @@
brcm,function = ;
};
 };
+
+ {
+   usb1@01 {
+   compatible = "usb1d6b,0002";
+   reg = <01>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   ethernet: usbether@01 {
+   compatible = "usb0424,9514";
+   reg = <01>;
+   };
+   };
+};
diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index 971e741..bc5fde1 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -187,10 +187,12 @@
status = "disabled";
};
 
-   usb@7e98 {
+   usb: usb@7e98 {
compatible = "brcm,bcm2835-usb";
reg = <0x7e98 0x1>;
interrupts = <1 9>;
+   #address-cells = <1>;
+   #size-cells = <0>;
};
};
 
-- 
2.5.0



Re: [PATCH 2/2] ARM: bcm2835: dt: Add the ethernet to the device tree

2016-02-03 Thread Lubomir Rintel
On Wed, 2016-02-03 at 16:02 +0100, Lubomir Rintel wrote:
> The hub and the ethernet in its port 1 are hardwired on the board.
> 
> Compared to the adapters that can be plugged into the USB ports, this
> one has no serial EEPROM to store its MAC. Nevertheless, the
> Raspberry Pi
> has the MAC address for this adapter in its ROM, accessible from its
> firmware.
> 
> U-Boot can read out the address and set the local-mac-address
> property of the
> node with "ethernet" alias. Let's add the node so that U-Boot can do
> its
> business.
> 
> Signed-off-by: Lubomir Rintel 
> ---
>  arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 18 ++
>  arch/arm/boot/dts/bcm283x.dtsi   |  4 +++-
>  2 files changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> index ef54050..32bbd2a 100644
> --- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> +++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> @@ -6,6 +6,10 @@
>   compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
>   model = "Raspberry Pi Model B+";
>  
> + aliases {
> + ethernet = 
> + }

I'm missing a semicolon here. I'll follow up with an updated version
once I get some feedback.

> +
>   leds {
>   act {
>   gpios = < 47 0>;
> @@ -29,3 +33,17 @@
>   brcm,function = ;
>   };
>  };
> +
> + {
> + usb1@01 {
> + compatible = "usb1d6b,0002";
> + reg = <01>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + ethernet: usbether@01 {
> + compatible = "usb0424,9514";
> + reg = <01>;
> + };
> + };
> +};
> diff --git a/arch/arm/boot/dts/bcm283x.dtsi
> b/arch/arm/boot/dts/bcm283x.dtsi
> index 971e741..bc5fde1 100644
> --- a/arch/arm/boot/dts/bcm283x.dtsi
> +++ b/arch/arm/boot/dts/bcm283x.dtsi
> @@ -187,10 +187,12 @@
>   status = "disabled";
>   };
>  
> - usb@7e98 {
> + usb: usb@7e98 {
>   compatible = "brcm,bcm2835-usb";
>   reg = <0x7e98 0x1>;
>   interrupts = <1 9>;
> + #address-cells = <1>;
> + #size-cells = <0>;
>   };
>   };
>  


Re: [PATCH 2/2] ARM: bcm2835: dt: Add the ethernet to the device tree

2016-02-03 Thread Olivier Blin
Lubomir Rintel  writes:

> diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts 
> b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> index ef54050..32bbd2a 100644
> --- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> +++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts

Hi,

Shouldn't this be common to all RPi1 B and RPi2 models, instead of being
specific to just RPi B+?

> + {
> + usb1@01 {
> + compatible = "usb1d6b,0002";
> + reg = <01>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + ethernet: usbether@01 {
> + compatible = "usb0424,9514";
> + reg = <01>;
> + };
> + };
> +};

For reference, on RPi2:
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast 
Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Thanks

-- 
Olivier Blin - blino


Re: [PATCH 2/2] ARM: bcm2835: dt: Add the ethernet to the device tree

2016-02-03 Thread Lubomir Rintel
On Wed, 2016-02-03 at 09:11 -0700, Stephen Warren wrote:
> On 02/03/2016 08:02 AM, Lubomir Rintel wrote:
> > The hub and the ethernet in its port 1 are hardwired on the board.
> > 
> > Compared to the adapters that can be plugged into the USB ports,
> > this
> > one has no serial EEPROM to store its MAC. Nevertheless, the
> > Raspberry Pi
> > has the MAC address for this adapter in its ROM, accessible from
> > its
> > firmware.
> > 
> > U-Boot can read out the address and set the local-mac-address
> > property of the
> > node with "ethernet" alias. Let's add the node so that U-Boot can
> > do its
> > business.
> 
> Good to see we're getting a standard for this.
> 
> Have you talked to the RPi Foundation about updating their binary 
> bootloader to follow this protocol?

Not really. Adding Dom Cobley to the Cc list now.

They seem to be passing the MAC address on command line now and even
evaluating it before attempting a read out from the EEPROM. That sounds
like it would break if someone plugged another smsc95xx adapter into
one of the USB ports.

> I'll certainly ack changes to make 
> this work for U-Boot, provided the USB core patch this relies upon
> is 
> accepted.

Dom, if the changes mentioned in [1] get merged, you may want to add
the Ethernet device to your device trees too and drop the cmdline hack.

[1] 
http://lists.infradead.org/pipermail/linux-rpi-kernel/2016-February/003207.html

> 
> > diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> > b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> 
> > + {
> > +   usb1@01 {
> > +   compatible = "usb1d6b,0002";
> > +   reg = <01>;
> > +   #address-cells = <1>;
> > +   #size-cells = <0>;
> > +
> > +   ethernet: usbether@01 {
> > +   compatible = "usb0424,9514";
> > +   reg = <01>;
> 
> Ib both unit addresses and both reg properties, I would expect "1"
> not 
> "01" since there's usually no leading 0 fill for those.

Okay, will fix.

> I'm curious why the VID values for the hub and Ethernet device don't 
> match since those are part of the same combo chip. Is there a typo 
> there, or did SMSC really do something odd in HW?

Hm, I think I just did a sysfs walk to see how things are connected.
The ethernet USB id is certainly wrong though.

The 1d6d:2 id is of the root hub. There I either messed up the commit
message or the topology. I can't recheck now, but I'll give it another
look before I send and updated version.

Thanks,
Lubo


Re: [PATCH 2/2] ARM: bcm2835: dt: Add the ethernet to the device tree

2016-02-03 Thread Stephen Warren

On 02/03/2016 08:02 AM, Lubomir Rintel wrote:

The hub and the ethernet in its port 1 are hardwired on the board.

Compared to the adapters that can be plugged into the USB ports, this
one has no serial EEPROM to store its MAC. Nevertheless, the Raspberry Pi
has the MAC address for this adapter in its ROM, accessible from its
firmware.

U-Boot can read out the address and set the local-mac-address property of the
node with "ethernet" alias. Let's add the node so that U-Boot can do its
business.


Good to see we're getting a standard for this.

Have you talked to the RPi Foundation about updating their binary 
bootloader to follow this protocol? I'll certainly ack changes to make 
this work for U-Boot, provided the USB core patch this relies upon is 
accepted.



diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts 
b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts



+ {
+   usb1@01 {
+   compatible = "usb1d6b,0002";
+   reg = <01>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   ethernet: usbether@01 {
+   compatible = "usb0424,9514";
+   reg = <01>;


Ib both unit addresses and both reg properties, I would expect "1" not 
"01" since there's usually no leading 0 fill for those.


I'm curious why the VID values for the hub and Ethernet device don't 
match since those are part of the same combo chip. Is there a typo 
there, or did SMSC really do something odd in HW?


Re: [PATCH 2/2] ARM: bcm2835: dt: Add the ethernet to the device tree

2016-02-03 Thread Lubomir Rintel
On Thu, 2016-02-04 at 06:28 +, Peter Chen wrote:
>  
> > Lubomir Rintel  writes:
> > 
> > > diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> > > b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> > > index ef54050..32bbd2a 100644
> > > --- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> > > +++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> > 
> > Hi,
> > 
> > Shouldn't this be common to all RPi1 B and RPi2 models, instead of
> > being
> > specific to just RPi B+?
> > 
> > > + {
> > > + usb1@01 {
> > > + compatible = "usb1d6b,0002";
> > > + reg = <01>;
> > > + #address-cells = <1>;
> > > + #size-cells = <0>;
> > > +
> > > + ethernet: usbether@01 {
> > > + compatible = "usb0424,9514";
> > > + reg = <01>;
> > > + };
> > > + };
> > > +};
> > 
> > For reference, on RPi2:
> 
> Using "lsusb -t" you may get bus topology.
> 
> > Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
> > SMSC9512/9514 Fast Ethernet Adapter
> 
> It is the ethernet device, you may need to change vid/pid in dts. 
> 
> > Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
> > SMC9514 Hub
> 
> It is the hub device, you may need to change vid/pid in dts.
> 
> > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> > 
>  
> It is root hub, it doesn't need to be described at dts.

Thank you; neither of the vid/pid pairs in the original submission is
okay. I'll follow up with an updated version.

I've also checked this on RPi B rev2; and I'll be including that one,
and the RPI2 too.

I can't find my rev1 RPi B; but maybe I can just do the same for the
same board. It would likely work, but I may get the vid/pid wrong if
it's different from rev2. 

> Best regards,
> Peter

Thanks
Lubo