ARM: sunxi: dt: add EMAC aliases
Subsystems (2)
PATCH 1/1 ARM: sunxi: dt: add EMAC aliases
U-Boot uses the ethernet0 alias to locate the right node to fill in the MAC address of the first ethernet interface. This patch adds the alias on all the sunxi boards with EMAC and an ethernet port. In this way, people using ethernet in U-Boot (eg, for tftp) can keep a consistent address on both U-Boot and Linux with no additional effort.
---
Hi everyone,
I have tested this on a cubieboard2 and found it to work as intended, and I don't see why it wouldn't work on the other boards, given that the U-Boot codebase is shared. It may be worth submitting this for 3.13-rc0, but I'm not the one that has to make that call :)
Cheers,
Emilio
arch/arm/boot/dts/sun4i-a10-a1000.dts | 1 + arch/arm/boot/dts/sun4i-a10-cubieboard.dts | 1 + arch/arm/boot/dts/sun4i-a10-hackberry.dts | 4 ++++ arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts | 4 ++++ arch/arm/boot/dts/sun7i-a20-cubieboard2.dts | 4 ++++ arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | 4 ++++ 6 files changed, 18 insertions(+)
arch/arm/boot/dts/sun4i-a10-a1000.dts +1 -0
@@ -20,6 +20,7 @@ aliases { serial0 = &uart0; + ethernet0 = &emac; }; soc at 01c00000 {
arch/arm/boot/dts/sun4i-a10-cubieboard.dts +1 -0
@@ -20,6 +20,7 @@ aliases { serial0 = &uart0; serial1 = &uart1; + ethernet0 = &emac; }; chosen {
arch/arm/boot/dts/sun4i-a10-hackberry.dts +4 -0
@@ -18,6 +18,10 @@ model = "Miniand Hackberry"; compatible = "miniand,hackberry", "allwinner,sun4i-a10"; + aliases { + ethernet0 = &emac; + }; + chosen { bootargs = "earlyprintk console=ttyS0,115200"; };
arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts +4 -0
@@ -18,6 +18,10 @@ model = "Olimex A10s-Olinuxino Micro"; compatible = "olimex,a10s-olinuxino-micro", "allwinner,sun5i-a10s"; + aliases { + ethernet0 = &emac; + }; + soc at 01c00000 { emac: ethernet at 01c0b000 { pinctrl-names = "default";
arch/arm/boot/dts/sun7i-a20-cubieboard2.dts +4 -0
@@ -18,6 +18,10 @@ model = "Cubietech Cubieboard2"; compatible = "cubietech,cubieboard2", "allwinner,sun7i-a20"; + aliases { + ethernet0 = &emac; + }; + soc at 01c00000 { emac: ethernet at 01c0b000 { pinctrl-names = "default";
arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts +4 -0
@@ -18,6 +18,10 @@ model = "Olimex A20-Olinuxino Micro"; compatible = "olimex,a20-olinuxino-micro", "allwinner,sun7i-a20"; + aliases { + ethernet0 = &emac; + }; + soc at 01c00000 { emac: ethernet at 01c0b000 { pinctrl-names = "default";
Signature · 1 line
1.8.4.2
PATCH 1/1 ARM: sunxi: dt: add EMAC aliases
Hi Emilio,
Quoted 20 lines · Emilio L?pez
U-Boot uses the ethernet0 alias to locate the right node to fill in the MAC address of the first ethernet interface. This patch adds the alias on all the sunxi boards with EMAC and an ethernet port. In this way, people using ethernet in U-Boot (eg, for tftp) can keep a consistent address on both U-Boot and Linux with no additional effort.
Signed-off-by Emilio L?pez <[email protected]>---
Hi everyone,
I have tested this on a cubieboard2 and found it to work as intended, and I don't see why it wouldn't work on the other boards, given that the U-Boot codebase is shared. It may be worth submitting this for 3.13-rc0, but I'm not the one that has to make that call :)
Cheers,
Emilio
Quoted 7 lines
arch/arm/boot/dts/sun4i-a10-a1000.dts | 1 + arch/arm/boot/dts/sun4i-a10-cubieboard.dts | 1 + arch/arm/boot/dts/sun4i-a10-hackberry.dts | 4 ++++ arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts | 4 ++++ arch/arm/boot/dts/sun7i-a20-cubieboard2.dts | 4 ++++ arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | 4 ++++ 6 files changed, 18 insertions(+)
I think it would make more sense to add it to the dtsi.
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131116/aeaed47a/attachment.sig>
PATCH v2 1/1 ARM: sunxi: dt: add EMAC aliases
In reply to Emilio LópezU-Boot uses the ethernet0 alias to locate the right node to fill in the MAC address of the first ethernet interface. This patch adds the alias on all the sunxi SoCs with EMAC. In this way, people using ethernet in U-Boot (eg, for tftp) can keep a consistent address on both U-Boot and Linux with no additional effort.
---
v1->v2:
add to dtsi instead of dts as suggested by Maxime; it's easier to maintain on the long run.
arch/arm/boot/dts/sun4i-a10.dtsi | 4 ++++ arch/arm/boot/dts/sun5i-a10s.dtsi | 4 ++++ arch/arm/boot/dts/sun7i-a20.dtsi | 4 ++++ 3 files changed, 12 insertions(+)
arch/arm/boot/dts/sun4i-a10.dtsi +4 -0
@@ -15,6 +15,10 @@ / { interrupt-parent = <&intc>; + aliases { + ethernet0 = &emac; + }; + cpus { #address-cells = <1>; #size-cells = <0>;
arch/arm/boot/dts/sun5i-a10s.dtsi +4 -0
@@ -16,6 +16,10 @@ / { interrupt-parent = <&intc>; + aliases { + ethernet0 = &emac; + }; + cpus { cpu at 0 { compatible = "arm,cortex-a8";
arch/arm/boot/dts/sun7i-a20.dtsi +4 -0
@@ -16,6 +16,10 @@ / { interrupt-parent = <&gic>; + aliases { + ethernet0 = &emac; + }; + cpus { #address-cells = <1>; #size-cells = <0>;
Signature · 1 line
1.8.4.2
PATCH v2 1/1 ARM: sunxi: dt: add EMAC aliases
Unfortunately,
a20 has two Ethernets so you can't alias both to ethernet0.
This has to be done on a per-board basis.
Thanks
Michal
Quoted 66 lines · Emilio L?pez
U-Boot uses the ethernet0 alias to locate the right node to fill in the MAC address of the first ethernet interface. This patch adds the alias on all the sunxi SoCs with EMAC. In this way, people using ethernet in U-Boot (eg, for tftp) can keep a consistent address on both U-Boot and Linux with no additional effort.
Signed-off-by Emilio L?pez <[email protected]>---
v1->v2:
add to dtsi instead of dts as suggested by Maxime; it's easier to maintain on the long run.arch/arm/boot/dts/sun4i-a10.dtsi | 4 ++++ arch/arm/boot/dts/sun5i-a10s.dtsi | 4 ++++ arch/arm/boot/dts/sun7i-a20.dtsi | 4 ++++ 3 files changed, 12 insertions(+)arch/arm/boot/dts/sun4i-a10.dtsi +4
-0@@ -15,6 +15,10 @@ / { interrupt-parent = <&intc>; + aliases { + ethernet0 = &emac; + }; + cpus { #address-cells = <1>; #size-cells = <0>;arch/arm/boot/dts/sun5i-a10s.dtsi +4
-0@@ -16,6 +16,10 @@ / { interrupt-parent = <&intc>; + aliases { + ethernet0 = &emac; + }; + cpus { cpu at 0 { compatible = "arm,cortex-a8";arch/arm/boot/dts/sun7i-a20.dtsi +4
-1@@ -16,6 +16,10 @@ / { interrupt-parent = <&gic>; + aliases { + ethernet0 = &emac; + }; + cpus { #address-cells = <1>; #size-cells = <0>; --1.8.4.2
PATCH v2 1/1 ARM: sunxi: dt: add EMAC aliases
Hi,
El 16/11/13 20:37, Michal Suchanek escribi?:
Quoted 6 lines
Unfortunately,
a20 has two Ethernets so you can't alias both to ethernet0.
This has to be done on a per-board basis.
That was my first thought, and partly why I did it per-board on v1 (the other part being that some boards do not have a phy, so having an ethernet0 alias felt "wrong"). But after some quick testing, it appears that aliases are overridable, so we could just add ethernet0 = &gmac; on qualifying boards when the gmac support is ready.
Cheers,
Emilio
PATCH v2 1/1 ARM: sunxi: dt: add EMAC aliases
Hi,
Quoted 7 lines · Emilio L?pez
Hi,
El 16/11/13 20:37, Michal Suchanek escribi?:
Quoted 4 lines
Unfortunately,
a20 has two Ethernets so you can't alias both to ethernet0.
Quoted 8 lines
Quoted 2 lines
This has to be done on a per-board basis.
That was my first thought, and partly why I did it per-board on v1 (the other part being that some boards do not have a phy, so having an ethernet0 alias felt "wrong"). But after some quick testing, it appears that aliases are overridable, so we could just add ethernet0 = &gmac; on qualifying boards when the gmac support is ready.
Or we will just add it as ethernet1. U-boot is able to put the mac-address in the DT for every ethernet* nodes for as much ethernet nodes as you need.
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131117/ffd0ff45/attachment.sig>
PATCH v2 1/1 ARM: sunxi: dt: add EMAC aliases
Quoted 19 lines · Maxime Ripard
Hi,
Quoted 7 lines · Emilio L?pez
Hi,
El 16/11/13 20:37, Michal Suchanek escribi?:
Quoted 4 lines
Unfortunately,
a20 has two Ethernets so you can't alias both to ethernet0.
Quoted 8 lines
Quoted 2 lines
This has to be done on a per-board basis.
That was my first thought, and partly why I did it per-board on v1 (the other part being that some boards do not have a phy, so having an ethernet0 alias felt "wrong"). But after some quick testing, it appears that aliases are overridable, so we could just add ethernet0 = &gmac; on qualifying boards when the gmac support is ready.
Quoted 3 lines
Or we will just add it as ethernet1. U-boot is able to put the mac-address in the DT for every ethernet* nodes for as much ethernet nodes as you need.
I guess that would be fine for CT and CB2 which can have only one physical ethernet (unless there are pins for adding another PHY) but if there is ever board with two ethernets you want only one of them to
get the mac address from u-boot.
Thanks
Michal
PATCH v2 1/1 ARM: sunxi: dt: add EMAC aliases
Quoted 6 lines · Michal Suchanek
Quoted 6 lines
Quoted 5 lines
That was my first thought, and partly why I did it per-board on v1 (the other part being that some boards do not have a phy, so having an ethernet0 alias felt "wrong"). But after some quick testing, it appears that aliases are overridable, so we could just add ethernet0 = &gmac; on qualifying boards when the gmac support is ready.
Quoted 8 lines
Quoted 3 lines
Or we will just add it as ethernet1. U-boot is able to put the mac-address in the DT for every ethernet* nodes for as much ethernet nodes as you need.
I guess that would be fine for CT and CB2 which can have only one physical ethernet (unless there are pins for adding another PHY) but if there is ever board with two ethernets you want only one of them to
get the mac address from u-boot.
I'm not sure to get why. ethernet0 would get ethaddr, ethernet1 would get eth1addr. How is that an issue?
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131118/6e37df2d/attachment.sig>
Maxime Ripard
AppliedPATCH v2 1/1 ARM: sunxi: dt: add EMAC aliases
In reply to Emilio LópezQuoted 7 lines · Emilio L?pez
U-Boot uses the ethernet0 alias to locate the right node to fill in the MAC address of the first ethernet interface. This patch adds the alias on all the sunxi SoCs with EMAC. In this way, people using ethernet in U-Boot (eg, for tftp) can keep a consistent address on both U-Boot and Linux with no additional effort.
Signed-off-by Emilio L?pez <[email protected]>
Applied to my sunxi/dt-for-3.14 branch.
Thanks!
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131117/346dec6e/attachment.sig>