927670d8b3009bf5a67f4410154d7f2b9afac037
[openwrt/staging/mkresin.git] / target / linux / mvebu / patches-5.4 / 027-arm64-dts-marvell-espressobin-Add-ethernet-switch-al.patch
1 From b64d814257b027e29a474bcd660f6372490138c7 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
3 Date: Mon, 7 Sep 2020 13:27:17 +0200
4 Subject: [PATCH] arm64: dts: marvell: espressobin: Add ethernet switch aliases
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Espressobin boards have 3 ethernet ports and some of them got assigned more
10 then one MAC address. MAC addresses are stored in U-Boot environment.
11
12 Since commit a2c7023f7075c ("net: dsa: read mac address from DT for slave
13 device") kernel can use MAC addresses from DT for particular DSA port.
14
15 Currently Espressobin DTS file contains alias just for ethernet0.
16
17 This patch defines additional ethernet aliases in Espressobin DTS files, so
18 bootloader can fill correct MAC address for DSA switch ports if more MAC
19 addresses were specified.
20
21 DT alias ethernet1 is used for wan port, DT aliases ethernet2 and ethernet3
22 are used for lan ports for both Espressobin revisions (V5 and V7).
23
24 Fixes: 5253cb8c00a6f ("arm64: dts: marvell: espressobin: add ethernet alias")
25 Cc: <stable@vger.kernel.org> # a2c7023f7075c: dsa: read mac address
26 Signed-off-by: Pali Rohár <pali@kernel.org>
27 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
28 Reviewed-by: Andre Heider <a.heider@gmail.com>
29 Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
30 ---
31 .../dts/marvell/armada-3720-espressobin-v7-emmc.dts | 10 ++++++++--
32 .../boot/dts/marvell/armada-3720-espressobin-v7.dts | 10 ++++++++--
33 3 files changed, 24 insertions(+), 8 deletions(-)
34
35 --- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts
36 +++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts
37 @@ -15,16 +15,22 @@
38 compatible = "globalscale,espressobin-v7-emmc", "globalscale,espressobin-v7",
39 "globalscale,espressobin", "marvell,armada3720",
40 "marvell,armada3710";
41 +
42 + aliases {
43 + /* ethernet1 is wan port */
44 + ethernet1 = &switch0port3;
45 + ethernet3 = &switch0port1;
46 + };
47 };
48
49 &ports {
50 - port@1 {
51 + switch0port1: port@1 {
52 reg = <1>;
53 label = "lan1";
54 phy-handle = <&switch0phy0>;
55 };
56
57 - port@3 {
58 + switch0port3: port@3 {
59 reg = <3>;
60 label = "wan";
61 phy-handle = <&switch0phy2>;
62 --- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts
63 +++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts
64 @@ -14,16 +14,22 @@
65 model = "Globalscale Marvell ESPRESSOBin Board V7";
66 compatible = "globalscale,espressobin-v7", "globalscale,espressobin",
67 "marvell,armada3720", "marvell,armada3710";
68 +
69 + aliases {
70 + /* ethernet1 is wan port */
71 + ethernet1 = &switch0port3;
72 + ethernet3 = &switch0port1;
73 + };
74 };
75
76 &ports {
77 - port@1 {
78 + switch0port1: port@1 {
79 reg = <1>;
80 label = "lan1";
81 phy-handle = <&switch0phy0>;
82 };
83
84 - port@3 {
85 + switch0port3: port@3 {
86 reg = <3>;
87 label = "wan";
88 phy-handle = <&switch0phy2>;