* [PATCH v2 0/2] Set the Raspberry Pi Ethernet MAC address
@ 2016-02-04 7:36 Lubomir Rintel
[not found] ` <1454571364-24708-1-git-send-email-lkundrak-NGH9Lh4a5iE@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Lubomir Rintel @ 2016-02-04 7:36 UTC (permalink / raw)
To: linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Peter Chen, Olivier Blin,
Stephen Warren, popcornmix
Hi,
an updated patch pair addressing the feedback. Originally submitted
in [1]. Still not ready for merge as it needs the usb core [2] change
and an U-Boot change [3] to work properly.
[1] [PATCH 0/2] Set the Raspberry Pi Ethernet MAC address
http://lists.infradead.org/pipermail/linux-rpi-kernel/2016-February/003207.html
[2] USB: core: let USB device know device node
https://patchwork.ozlabs.org/patch/572621/
[3] [U-Boot] [PATCH] rpi: set ethaddr as well
http://lists.denx.de/pipermail/u-boot/2016-February/244663.html
Regards,
Lubo
--
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] 12+ messages in thread
* [PATCH v2 1/2] ARM: bcm2835: dt: Add the ethernet to the device trees
[not found] ` <1454571364-24708-1-git-send-email-lkundrak-NGH9Lh4a5iE@public.gmane.org>
@ 2016-02-04 7:36 ` Lubomir Rintel
[not found] ` <1454571364-24708-2-git-send-email-lkundrak-NGH9Lh4a5iE@public.gmane.org>
2016-02-04 7:36 ` [PATCH 2/2] net/smscx5xx: use the device tree for mac address Lubomir Rintel
1 sibling, 1 reply; 12+ messages in thread
From: Lubomir Rintel @ 2016-02-04 7:36 UTC (permalink / raw)
To: linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Peter Chen, Olivier Blin,
Stephen Warren, popcornmix, 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.
Model B rev2 and Model B+ entries were verified by me, the hierarchy and
pid/vid pair for the Version 2 was provided by Olivier Blin. Original
Model B is a blind short, though very likely correct.
Signed-off-by: Lubomir Rintel <lkundrak-NGH9Lh4a5iE@public.gmane.org>
---
Changes since v1:
- s/@01/@1/ for ethernet and the hub
- Corrected the vid/pid pairs for hub and ethernet
- Added Model B rev2 and version 2 board changes
- Fixed a missing semicolon typo
arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 18 ++++++++++++++++++
arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts | 18 ++++++++++++++++++
arch/arm/boot/dts/bcm2835-rpi-b.dts | 18 ++++++++++++++++++
arch/arm/boot/dts/bcm2836-rpi-2-b.dts | 18 ++++++++++++++++++
arch/arm/boot/dts/bcm283x.dtsi | 4 +++-
5 files changed, 75 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..983353f 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 = ðernet;
+ };
+
leds {
act {
gpios = <&gpio 47 0>;
@@ -29,3 +33,17 @@
brcm,function = <BCM2835_FSEL_ALT0>;
};
};
+
+&usb {
+ usb1@1 {
+ compatible = "usb0424,9514";
+ reg = <01>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ ethernet: usbether@1 {
+ compatible = "usb0424,ec00";
+ reg = <01>;
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
index 86f1f2f..4b695a0 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
@@ -6,6 +6,10 @@
compatible = "raspberrypi,model-b-rev2", "brcm,bcm2835";
model = "Raspberry Pi Model B rev2";
+ aliases {
+ ethernet = ðernet;
+ };
+
leds {
act {
gpios = <&gpio 16 1>;
@@ -22,3 +26,17 @@
brcm,function = <BCM2835_FSEL_ALT2>;
};
};
+
+&usb {
+ usb1@1 {
+ compatible = "usb0424,9512";
+ reg = <01>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ ethernet: usbether@1 {
+ compatible = "usb0424,ec00";
+ reg = <01>;
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b.dts b/arch/arm/boot/dts/bcm2835-rpi-b.dts
index 4859e9d..749648e 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-b.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts
@@ -6,6 +6,10 @@
compatible = "raspberrypi,model-b", "brcm,bcm2835";
model = "Raspberry Pi Model B";
+ aliases {
+ ethernet = ðernet;
+ };
+
leds {
act {
gpios = <&gpio 16 1>;
@@ -16,3 +20,17 @@
&gpio {
pinctrl-0 = <&gpioout &alt0 &alt3>;
};
+
+&usb {
+ usb1@1 {
+ compatible = "usb0424,9512";
+ reg = <01>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ ethernet: usbether@1 {
+ compatible = "usb0424,ec00";
+ reg = <01>;
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
index ff94666..2bc1a96 100644
--- a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
+++ b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
@@ -10,6 +10,10 @@
reg = <0 0x40000000>;
};
+ aliases {
+ ethernet = ðernet;
+ };
+
leds {
act {
gpios = <&gpio 47 0>;
@@ -33,3 +37,17 @@
brcm,function = <BCM2835_FSEL_ALT0>;
};
};
+
+&usb {
+ usb1@1 {
+ compatible = "usb0424,9514";
+ reg = <01>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ ethernet: usbether@1 {
+ compatible = "usb0424,ec00";
+ 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@7e980000 {
+ usb: usb@7e980000 {
compatible = "brcm,bcm2835-usb";
reg = <0x7e980000 0x10000>;
interrupts = <1 9>;
+ #address-cells = <1>;
+ #size-cells = <0>;
};
};
--
2.5.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 related [flat|nested] 12+ messages in thread
* [PATCH 2/2] net/smscx5xx: use the device tree for mac address
[not found] ` <1454571364-24708-1-git-send-email-lkundrak-NGH9Lh4a5iE@public.gmane.org>
2016-02-04 7:36 ` [PATCH v2 1/2] ARM: bcm2835: dt: Add the ethernet to the device trees Lubomir Rintel
@ 2016-02-04 7:36 ` Lubomir Rintel
2016-02-04 8:24 ` Arnd Bergmann
1 sibling, 1 reply; 12+ messages in thread
From: Lubomir Rintel @ 2016-02-04 7:36 UTC (permalink / raw)
To: linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Peter Chen, Olivier Blin,
Stephen Warren, popcornmix
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
This takes the MAC address for smsc75xx/smsc95xx USB network devices
from a the device tree. This is required to get a usable persistent
address on the popular beagleboard, whose hardware designers
accidentally forgot that an ethernet device really requires an a
MAC address to be functional.
The Raspberry Pi also ships smsc9514 without a serial EEPROM, stores the MAC
address in ROM accessible via VC4 firmware.
The smsc75xx and smsc95xx drivers are just two copies of the
same code, so better fix both.
[lkundrak-NGH9Lh4a5iE@public.gmane.org: updated to use of_get_property() as per suggestion from Arnd,
reworded the message and comments a bit]
Tested-by: Lubomir Rintel <lkundrak-NGH9Lh4a5iE@public.gmane.org>
Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
---
Changes since v1:
- Made use of_get_property()
- Amended comments/commit message a bit
drivers/net/usb/smsc75xx.c | 12 +++++++++++-
drivers/net/usb/smsc95xx.c | 12 +++++++++++-
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index 30033db..8266e27 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -29,6 +29,7 @@
#include <linux/crc32.h>
#include <linux/usb/usbnet.h>
#include <linux/slab.h>
+#include <linux/of_net.h>
#include "smsc75xx.h"
#define SMSC_CHIPNAME "smsc75xx"
@@ -761,6 +762,8 @@ static int smsc75xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
static void smsc75xx_init_mac_address(struct usbnet *dev)
{
+ const u8 *mac_addr;
+
/* try reading mac address from EEPROM */
if (smsc75xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN,
dev->net->dev_addr) == 0) {
@@ -772,7 +775,14 @@ static void smsc75xx_init_mac_address(struct usbnet *dev)
}
}
- /* no eeprom, or eeprom values are invalid. generate random MAC */
+ /* maybe the boot loader passed the MAC address in devicetree */
+ mac_addr = of_get_mac_address (dev->udev->dev.of_node);
+ if (mac_addr) {
+ memcpy(dev->net->dev_addr, mac_addr, ETH_ALEN);
+ return;
+ }
+
+ /* no useful static MAC address found. generate a random one */
eth_hw_addr_random(dev->net);
netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n");
}
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 66b3ab9..623bb2e 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -29,6 +29,7 @@
#include <linux/crc32.h>
#include <linux/usb/usbnet.h>
#include <linux/slab.h>
+#include <linux/of_net.h>
#include "smsc95xx.h"
#define SMSC_CHIPNAME "smsc95xx"
@@ -765,6 +766,8 @@ static int smsc95xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
static void smsc95xx_init_mac_address(struct usbnet *dev)
{
+ const u8 *mac_addr;
+
/* try reading mac address from EEPROM */
if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN,
dev->net->dev_addr) == 0) {
@@ -775,7 +778,14 @@ static void smsc95xx_init_mac_address(struct usbnet *dev)
}
}
- /* no eeprom, or eeprom values are invalid. generate random MAC */
+ /* maybe the boot loader passed the MAC address in devicetree */
+ mac_addr = of_get_mac_address (dev->udev->dev.of_node);
+ if (mac_addr) {
+ memcpy(dev->net->dev_addr, mac_addr, ETH_ALEN);
+ return;
+ }
+
+ /* no useful static MAC address found. generate a random one */
eth_hw_addr_random(dev->net);
netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n");
}
--
2.5.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 related [flat|nested] 12+ messages in thread
* RE: [PATCH v2 1/2] ARM: bcm2835: dt: Add the ethernet to the device trees
[not found] ` <1454571364-24708-2-git-send-email-lkundrak-NGH9Lh4a5iE@public.gmane.org>
@ 2016-02-04 8:22 ` Peter Chen
2016-02-05 14:25 ` Olivier Blin
2016-02-06 4:13 ` Stephen Warren
2 siblings, 0 replies; 12+ messages in thread
From: Peter Chen @ 2016-02-04 8:22 UTC (permalink / raw)
To: Lubomir Rintel,
linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Arnd Bergmann,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Peter Chen,
Olivier Blin, Stephen Warren, popcornmix
>
> 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.
>
> Model B rev2 and Model B+ entries were verified by me, the hierarchy and
> pid/vid pair for the Version 2 was provided by Olivier Blin. Original Model B is a
> blind short, though very likely correct.
>
> Signed-off-by: Lubomir Rintel <lkundrak-NGH9Lh4a5iE@public.gmane.org>
> ---
> Changes since v1:
> - s/@01/@1/ for ethernet and the hub
> - Corrected the vid/pid pairs for hub and ethernet
> - Added Model B rev2 and version 2 board changes
> - Fixed a missing semicolon typo
>
> arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 18 ++++++++++++++++++
> arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts | 18 ++++++++++++++++++
> arch/arm/boot/dts/bcm2835-rpi-b.dts | 18 ++++++++++++++++++
> arch/arm/boot/dts/bcm2836-rpi-2-b.dts | 18 ++++++++++++++++++
> arch/arm/boot/dts/bcm283x.dtsi | 4 +++-
> 5 files changed, 75 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..983353f 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 = ðernet;
> + };
> +
> leds {
> act {
> gpios = <&gpio 47 0>;
> @@ -29,3 +33,17 @@
> brcm,function = <BCM2835_FSEL_ALT0>;
> };
> };
> +
> +&usb {
> + usb1@1 {
> + compatible = "usb0424,9514";
> + reg = <01>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + ethernet: usbether@1 {
> + compatible = "usb0424,ec00";
> + reg = <01>;
According to binding-doc [1], the value of reg should be
" lower case hexadecimal with leading zeroes suppressed", I have
updated it at linux binding-doc in my patch.
Besides, you may have a dtsi for common parts for board and its derived
board, in that case, you only need to change one file next time, surely,
it is not related to this patch.
[1] http://www.firmware.org/1275/bindings/usb/usb-1_0.ps
Peter
> + };
> + };
> +};
> diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
> b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
> index 86f1f2f..4b695a0 100644
> --- a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
> +++ b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
> @@ -6,6 +6,10 @@
> compatible = "raspberrypi,model-b-rev2", "brcm,bcm2835";
> model = "Raspberry Pi Model B rev2";
>
> + aliases {
> + ethernet = ðernet;
> + };
> +
> leds {
> act {
> gpios = <&gpio 16 1>;
> @@ -22,3 +26,17 @@
> brcm,function = <BCM2835_FSEL_ALT2>;
> };
> };
> +
> +&usb {
> + usb1@1 {
> + compatible = "usb0424,9512";
> + reg = <01>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + ethernet: usbether@1 {
> + compatible = "usb0424,ec00";
> + reg = <01>;
> + };
> + };
> +};
> diff --git a/arch/arm/boot/dts/bcm2835-rpi-b.dts
> b/arch/arm/boot/dts/bcm2835-rpi-b.dts
> index 4859e9d..749648e 100644
> --- a/arch/arm/boot/dts/bcm2835-rpi-b.dts
> +++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts
> @@ -6,6 +6,10 @@
> compatible = "raspberrypi,model-b", "brcm,bcm2835";
> model = "Raspberry Pi Model B";
>
> + aliases {
> + ethernet = ðernet;
> + };
> +
> leds {
> act {
> gpios = <&gpio 16 1>;
> @@ -16,3 +20,17 @@
> &gpio {
> pinctrl-0 = <&gpioout &alt0 &alt3>;
> };
> +
> +&usb {
> + usb1@1 {
> + compatible = "usb0424,9512";
> + reg = <01>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + ethernet: usbether@1 {
> + compatible = "usb0424,ec00";
> + reg = <01>;
> + };
> + };
> +};
> diff --git a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
> b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
> index ff94666..2bc1a96 100644
> --- a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
> +++ b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
> @@ -10,6 +10,10 @@
> reg = <0 0x40000000>;
> };
>
> + aliases {
> + ethernet = ðernet;
> + };
> +
> leds {
> act {
> gpios = <&gpio 47 0>;
> @@ -33,3 +37,17 @@
> brcm,function = <BCM2835_FSEL_ALT0>;
> };
> };
> +
> +&usb {
> + usb1@1 {
> + compatible = "usb0424,9514";
> + reg = <01>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + ethernet: usbether@1 {
> + compatible = "usb0424,ec00";
> + 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@7e980000 {
> + usb: usb@7e980000 {
> compatible = "brcm,bcm2835-usb";
> reg = <0x7e980000 0x10000>;
> interrupts = <1 9>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> };
> };
>
> --
> 2.5.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] 12+ messages in thread
* Re: [PATCH 2/2] net/smscx5xx: use the device tree for mac address
2016-02-04 7:36 ` [PATCH 2/2] net/smscx5xx: use the device tree for mac address Lubomir Rintel
@ 2016-02-04 8:24 ` Arnd Bergmann
0 siblings, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2016-02-04 8:24 UTC (permalink / raw)
To: Lubomir Rintel
Cc: linux-rpi-kernel, devicetree, linux-kernel, Peter Chen,
Olivier Blin, Stephen Warren, popcornmix
On Thursday 04 February 2016 08:36:04 Lubomir Rintel wrote:
>
> [lkundrak@v3.sk: updated to use of_get_property() as per suggestion from Arnd,
> reworded the message and comments a bit]
>
> Tested-by: Lubomir Rintel <lkundrak@v3.sk>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>
Looks good to me now. We could debate which MAC address should
be used when both EEPROM and DT exist. The current version prefers
the EEPROM address, and I think some other drivers do the opposite,
but I don't really know which is best.
Arnd
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 1/2] ARM: bcm2835: dt: Add the ethernet to the device trees
[not found] ` <1454571364-24708-2-git-send-email-lkundrak-NGH9Lh4a5iE@public.gmane.org>
2016-02-04 8:22 ` Peter Chen
@ 2016-02-05 14:25 ` Olivier Blin
[not found] ` <m3fux76xqa.fsf-sb2orAewljU5LtT840wCHw@public.gmane.org>
2016-02-06 4:13 ` Stephen Warren
2 siblings, 1 reply; 12+ messages in thread
From: Olivier Blin @ 2016-02-05 14:25 UTC (permalink / raw)
To: Lubomir Rintel
Cc: linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Peter Chen, Stephen Warren,
popcornmix
Lubomir Rintel <lkundrak-NGH9Lh4a5iE@public.gmane.org> writes:
> diff --git a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
[...]
> @@ -33,3 +37,17 @@
> brcm,function = <BCM2835_FSEL_ALT0>;
> };
> };
> +
> +&usb {
> + usb1@1 {
> + compatible = "usb0424,9514";
> + reg = <01>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + ethernet: usbether@1 {
> + compatible = "usb0424,ec00";
> + reg = <01>;
> + };
> + };
> +};
Hi,
This works for me, after making sure that your u-boot patch gets a
chance to be run (unset usbethaddr from u-boot).
Though, I am not really DT-literate, but shouldn't the ethernet block
use the PID from the ethernet device?
The usbether device is 9514 on RPi2, while ec00 is the hub.
Your patch works, but this works as well after swapping the PIDs.
Thanks
--
Olivier Blin - blino
--
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] 12+ messages in thread
* Re: [PATCH v2 1/2] ARM: bcm2835: dt: Add the ethernet to the device trees
[not found] ` <m3fux76xqa.fsf-sb2orAewljU5LtT840wCHw@public.gmane.org>
@ 2016-02-05 14:55 ` Lubomir Rintel
[not found] ` <1454684126.2779.2.camel-NGH9Lh4a5iE@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Lubomir Rintel @ 2016-02-05 14:55 UTC (permalink / raw)
To: Olivier Blin
Cc: linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Peter Chen, Stephen Warren,
popcornmix
Hi Olivier,
On Fri, 2016-02-05 at 15:25 +0100, Olivier Blin wrote:
> Lubomir Rintel <lkundrak-NGH9Lh4a5iE@public.gmane.org> writes:
>
> > diff --git a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
> > b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
> [...]
> > @@ -33,3 +37,17 @@
> > brcm,function = <BCM2835_FSEL_ALT0>;
> > };
> > };
> > +
> > +&usb {
> > + usb1@1 {
> > + compatible = "usb0424,9514";
> > + reg = <01>;
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + ethernet: usbether@1 {
> > + compatible = "usb0424,ec00";
> > + reg = <01>;
> > + };
> > + };
> > +};
>
> Hi,
>
> This works for me, after making sure that your u-boot patch gets a
> chance to be run (unset usbethaddr from u-boot).
Thanks for that.
> Though, I am not really DT-literate, but shouldn't the ethernet block
> use the PID from the ethernet device?
> The usbether device is 9514 on RPi2, while ec00 is the hub.
Are you sure? I didn't check on RPi2, but I check the Models B and B+
and the ethernet device was 0xec00 on both. The driver attaches to that
product ID:
[lkundrak@odvarok linux]$ modinfo smsc95xx |grep EC
alias: usb:v0424pEC00d*dc*dsc*dp*ic*isc*ip*in*
[lkundrak@odvarok linux]$ modinfo smsc95xx |grep 9514
[lkundrak@odvarok linux]$
> Your patch works, but this works as well after swapping the PIDs.
>
> Thanks
Take care
Lubo
--
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] 12+ messages in thread
* Re: [PATCH v2 1/2] ARM: bcm2835: dt: Add the ethernet to the device trees
[not found] ` <1454684126.2779.2.camel-NGH9Lh4a5iE@public.gmane.org>
@ 2016-02-05 15:07 ` Olivier Blin
0 siblings, 0 replies; 12+ messages in thread
From: Olivier Blin @ 2016-02-05 15:07 UTC (permalink / raw)
To: Lubomir Rintel
Cc: linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Peter Chen, Stephen Warren,
popcornmix
Lubomir Rintel <lkundrak-NGH9Lh4a5iE@public.gmane.org> writes:
>> Though, I am not really DT-literate, but shouldn't the ethernet block
>> use the PID from the ethernet device?
>> The usbether device is 9514 on RPi2, while ec00 is the hub.
>
> Are you sure? I didn't check on RPi2, but I check the Models B and B+
> and the ethernet device was 0xec00 on both. The driver attaches to that
> product ID:
>
> [lkundrak@odvarok linux]$ modinfo smsc95xx |grep EC
> alias: usb:v0424pEC00d*dc*dsc*dp*ic*isc*ip*in*
> [lkundrak@odvarok linux]$ modinfo smsc95xx |grep 9514
> [lkundrak@odvarok linux]$
My mistake, I am not sure how I mixed that.
Sorry for the noise.
Tested-by: Olivier Blin <dev-RZzICDNEOQ/YtjvyW6yDsg@public.gmane.org>
Thanks
--
Olivier Blin - blino
--
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] 12+ messages in thread
* Re: [PATCH v2 1/2] ARM: bcm2835: dt: Add the ethernet to the device trees
[not found] ` <1454571364-24708-2-git-send-email-lkundrak-NGH9Lh4a5iE@public.gmane.org>
2016-02-04 8:22 ` Peter Chen
2016-02-05 14:25 ` Olivier Blin
@ 2016-02-06 4:13 ` Stephen Warren
[not found] ` <56B572D8.9030701-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2 siblings, 1 reply; 12+ messages in thread
From: Stephen Warren @ 2016-02-06 4:13 UTC (permalink / raw)
To: Lubomir Rintel
Cc: linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Peter Chen, Olivier Blin,
popcornmix
On 02/04/2016 12:36 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.
>
> Model B rev2 and Model B+ entries were verified by me, the hierarchy and
> pid/vid pair for the Version 2 was provided by Olivier Blin. Original
> Model B is a blind short, though very likely correct.
The series,
Tested-by: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
A few nits though...
> arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 18 ++++++++++++++++++
> arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts | 18 ++++++++++++++++++
> arch/arm/boot/dts/bcm2835-rpi-b.dts | 18 ++++++++++++++++++
> arch/arm/boot/dts/bcm2836-rpi-2-b.dts | 18 ++++++++++++++++++
> arch/arm/boot/dts/bcm283x.dtsi | 4 +++-
Rather than cut/paste everything, can't we share the duplicate content
using a *.dtsi file? IIRC some dtsi files already exist. Perhaps there
could be a bcm283x-rpi-smsc9512.dtsi and bcm283x-rpi-smsc9514.dtsi, and
even a bcm283x-rpi-smsc-eth.dtsi since 99% of those two are common?
Hopefully that doesn't sound like busy work/bike-shedding too much.
> diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> +&usb {
> + usb1@1 {
> + compatible = "usb0424,9514";
> + reg = <01>;
Here and ...
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + ethernet: usbether@1 {
> + compatible = "usb0424,ec00";
> + reg = <01>;
... here, reg should be "1" not "01". Same in all the files.
> diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
> +&usb {
> + usb1@1 {
> + compatible = "usb0424,9512";
I don't think that ID is correct. On my systems, I have:
RPi B (original, rev 1, 2 USB ports): 9512
RPi B (rev 2 w/ P5, 2 USB ports): 9512
RPi B+ (4 USB ports): 9514
RPi 2 (4 USB ports): 9514
--
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] 12+ messages in thread
* Re: [PATCH v2 1/2] ARM: bcm2835: dt: Add the ethernet to the device trees
[not found] ` <56B572D8.9030701-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2016-04-28 12:52 ` Olivier Blin
[not found] ` <m3wpnhrj42.fsf-sb2orAewljU5LtT840wCHw@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Olivier Blin @ 2016-04-28 12:52 UTC (permalink / raw)
To: Lubomir Rintel, eric-WhKQ6XTQaPysTnJN9+BGXg
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Peter Chen,
linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> writes:
> On 02/04/2016 12:36 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.
>>
>> Model B rev2 and Model B+ entries were verified by me, the hierarchy and
>> pid/vid pair for the Version 2 was provided by Olivier Blin. Original
>> Model B is a blind short, though very likely correct.
>
> The series,
> Tested-by: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
>
> A few nits though...
[...]
Is this still being queued in some tree?
Or does it need more fixes and a resubmit?
Without this, Raspberry Pi devices boot with a random MAC address.
--
Olivier Blin - blino
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 1/2] ARM: bcm2835: dt: Add the ethernet to the device trees
[not found] ` <m3wpnhrj42.fsf-sb2orAewljU5LtT840wCHw@public.gmane.org>
@ 2016-04-28 16:26 ` Stefan Wahren
2016-04-28 16:29 ` Lubomir Rintel
0 siblings, 1 reply; 12+ messages in thread
From: Stefan Wahren @ 2016-04-28 16:26 UTC (permalink / raw)
To: Olivier Blin, Lubomir Rintel, eric-WhKQ6XTQaPysTnJN9+BGXg
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Peter Chen,
linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Hi Olivier
Am 28.04.2016 um 14:52 schrieb Olivier Blin:
> Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> writes:
>
>> On 02/04/2016 12:36 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.
>>>
>>> Model B rev2 and Model B+ entries were verified by me, the hierarchy and
>>> pid/vid pair for the Version 2 was provided by Olivier Blin. Original
>>> Model B is a blind short, though very likely correct.
>> The series,
>> Tested-by: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
>>
>> A few nits though...
> [...]
>
> Is this still being queued in some tree?
> Or does it need more fixes and a resubmit?
Yes, a V3 should address the comments from Peter and Stephen.
Regards
Stefan
>
> Without this, Raspberry Pi devices boot with a random MAC address.
>
--
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] 12+ messages in thread
* Re: [PATCH v2 1/2] ARM: bcm2835: dt: Add the ethernet to the device trees
2016-04-28 16:26 ` Stefan Wahren
@ 2016-04-28 16:29 ` Lubomir Rintel
0 siblings, 0 replies; 12+ messages in thread
From: Lubomir Rintel @ 2016-04-28 16:29 UTC (permalink / raw)
To: Stefan Wahren, Olivier Blin, eric
Cc: devicetree, Arnd Bergmann, linux-kernel, Peter Chen,
linux-rpi-kernel
On Thu, 2016-04-28 at 18:26 +0200, Stefan Wahren wrote:
> Hi Olivier
>
> Am 28.04.2016 um 14:52 schrieb Olivier Blin:
> >
> > Stephen Warren <swarren@wwwdotorg.org> writes:
> >
> > >
> > > On 02/04/2016 12:36 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.
> > > >
> > > > Model B rev2 and Model B+ entries were verified by me, the
> > > > hierarchy and
> > > > pid/vid pair for the Version 2 was provided by Olivier Blin.
> > > > Original
> > > > Model B is a blind short, though very likely correct.
> > > The series,
> > > Tested-by: Stephen Warren <swarren@wwwdotorg.org>
> > >
> > > A few nits though...
> > [...]
> >
> > Is this still being queued in some tree?
> > Or does it need more fixes and a resubmit?
> Yes, a V3 should address the comments from Peter and Stephen.
I'll follow up with an updated patch set.
Sorry for the delay.
>
> Regards
> Stefan
>
> >
> >
> > Without this, Raspberry Pi devices boot with a random MAC address.
> >
>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2016-04-28 16:29 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-04 7:36 [PATCH v2 0/2] Set the Raspberry Pi Ethernet MAC address Lubomir Rintel
[not found] ` <1454571364-24708-1-git-send-email-lkundrak-NGH9Lh4a5iE@public.gmane.org>
2016-02-04 7:36 ` [PATCH v2 1/2] ARM: bcm2835: dt: Add the ethernet to the device trees Lubomir Rintel
[not found] ` <1454571364-24708-2-git-send-email-lkundrak-NGH9Lh4a5iE@public.gmane.org>
2016-02-04 8:22 ` Peter Chen
2016-02-05 14:25 ` Olivier Blin
[not found] ` <m3fux76xqa.fsf-sb2orAewljU5LtT840wCHw@public.gmane.org>
2016-02-05 14:55 ` Lubomir Rintel
[not found] ` <1454684126.2779.2.camel-NGH9Lh4a5iE@public.gmane.org>
2016-02-05 15:07 ` Olivier Blin
2016-02-06 4:13 ` Stephen Warren
[not found] ` <56B572D8.9030701-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2016-04-28 12:52 ` Olivier Blin
[not found] ` <m3wpnhrj42.fsf-sb2orAewljU5LtT840wCHw@public.gmane.org>
2016-04-28 16:26 ` Stefan Wahren
2016-04-28 16:29 ` Lubomir Rintel
2016-02-04 7:36 ` [PATCH 2/2] net/smscx5xx: use the device tree for mac address Lubomir Rintel
2016-02-04 8:24 ` Arnd Bergmann
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).