From: Thomas Petazzoni Date: Wed, 27 Jan 2016 15:08:19 +0000 (+0100) Subject: ARM: dts: armada-38x: change order of ethernet DT nodes on Armada 38x X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cb4f71c4298853db0c6751b1209e4535956f136c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ARM: dts: armada-38x: change order of ethernet DT nodes on Armada 38x On Armada 38x, the available network interfaces are: - port 0, at 0x70000 - port 1, at 0x30000 - port 2, at 0x34000 Due to the rule saying that DT nodes should be ordered by register addresses, the network interfaces are probed in this order: - port 1, at 0x30000, which gets named eth0 - port 2, at 0x34000, which gets named eth1 - port 0, at 0x70000, which gets named eth2 (if all three ports are enabled at the board level) Unfortunately, the network subsystem doesn't provide any way to rename network interfaces from the kernel (it can only be done from userspace). So, the default naming of the network interfaces is very confusing as it doesn't match the datasheet, nor the naming of the interfaces in the bootloader, nor the naming of the interfaces on labels printed on the board. For example, on the Armada 388 GP, the board has two ports, labelled GE0 and GE1. One has to know that GE0 is eth1 and GE1 is eth0, which isn't really obvious. In order to solve this, this patch proposes to exceptionaly violate the rule of "order DT nodes by register address", and put the 0x70000 node before the 0x30000 node, so that network interfaces get named in a more natural way. Signed-off-by: Thomas Petazzoni Signed-off-by: Gregory CLEMENT --- diff --git a/arch/arm/boot/dts/armada-38x.dtsi b/arch/arm/boot/dts/armada-38x.dtsi index e8b7f6726772..b50784de86e8 100644 --- a/arch/arm/boot/dts/armada-38x.dtsi +++ b/arch/arm/boot/dts/armada-38x.dtsi @@ -429,6 +429,27 @@ reg = <0x22000 0x1000>; }; + /* + * As a special exception to the "order by + * register address" rule, the eth0 node is + * placed here to ensure that it gets + * registered as the first interface, since + * the network subsystem doesn't allow naming + * interfaces using DT aliases. Without this, + * the ordering of interfaces is different + * from the one used in U-Boot and the + * labeling of interfaces on the boards, which + * is very confusing for users. + */ + eth0: ethernet@70000 { + compatible = "marvell,armada-370-neta"; + reg = <0x70000 0x4000>; + interrupts-extended = <&mpic 8>; + clocks = <&gateclk 4>; + tx-csum-limit = <9800>; + status = "disabled"; + }; + eth1: ethernet@30000 { compatible = "marvell,armada-370-neta"; reg = <0x30000 0x4000>; @@ -493,15 +514,6 @@ }; }; - eth0: ethernet@70000 { - compatible = "marvell,armada-370-neta"; - reg = <0x70000 0x4000>; - interrupts-extended = <&mpic 8>; - clocks = <&gateclk 4>; - tx-csum-limit = <9800>; - status = "disabled"; - }; - mdio: mdio@72004 { #address-cells = <1>; #size-cells = <0>;