All of lore.kernel.org
 help / color / mirror / Atom feed
From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: mvebu: change order of ethernet DT nodes on Armada 38x
Date: Wed, 27 Jan 2016 16:08:19 +0100	[thread overview]
Message-ID: <1453907300-28283-2-git-send-email-thomas.petazzoni@free-electrons.com> (raw)
In-Reply-To: <1453907300-28283-1-git-send-email-thomas.petazzoni@free-electrons.com>

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 <thomas.petazzoni@free-electrons.com>
---
 arch/arm/boot/dts/armada-38x.dtsi | 30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/arch/arm/boot/dts/armada-38x.dtsi b/arch/arm/boot/dts/armada-38x.dtsi
index e8b7f67..b50784d 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 at 70000 {
+				compatible = "marvell,armada-370-neta";
+				reg = <0x70000 0x4000>;
+				interrupts-extended = <&mpic 8>;
+				clocks = <&gateclk 4>;
+				tx-csum-limit = <9800>;
+				status = "disabled";
+			};
+
 			eth1: ethernet at 30000 {
 				compatible = "marvell,armada-370-neta";
 				reg = <0x30000 0x4000>;
@@ -493,15 +514,6 @@
 				};
 			};
 
-			eth0: ethernet at 70000 {
-				compatible = "marvell,armada-370-neta";
-				reg = <0x70000 0x4000>;
-				interrupts-extended = <&mpic 8>;
-				clocks = <&gateclk 4>;
-				tx-csum-limit = <9800>;
-				status = "disabled";
-			};
-
 			mdio: mdio at 72004 {
 				#address-cells = <1>;
 				#size-cells = <0>;
-- 
2.6.4

  reply	other threads:[~2016-01-27 15:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27 15:08 [PATCH 0/2] ARM: mvebu: network interface naming Thomas Petazzoni
2016-01-27 15:08 ` Thomas Petazzoni [this message]
2016-01-27 19:31   ` [PATCH 1/2] ARM: mvebu: change order of ethernet DT nodes on Armada 38x Russell King - ARM Linux
2016-01-27 19:45     ` Willy Tarreau
2016-01-29 11:48       ` Russell King - ARM Linux
2016-02-03 14:56         ` Thomas Petazzoni
2016-02-24 18:41         ` Willy Tarreau
2016-02-24 19:02           ` Imre Kaloz
2016-02-24 19:07             ` Willy Tarreau
2016-02-25 10:32             ` Thomas Petazzoni
2016-02-24 22:33           ` Russell King - ARM Linux
2016-02-24 22:56             ` Willy Tarreau
2016-02-25 10:36             ` Thomas Petazzoni
2016-02-25 13:48               ` Imre Kaloz
2016-02-25 10:31           ` Thomas Petazzoni
2016-02-25 10:40             ` Willy Tarreau
2016-01-27 15:08 ` [PATCH 2/2] ARM: mvebu: add reference to ETH connectors for A385-AP Thomas Petazzoni
2016-02-08 14:48 ` [PATCH 0/2] ARM: mvebu: network interface naming Gregory CLEMENT

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453907300-28283-2-git-send-email-thomas.petazzoni@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.