diff mbox series

[devicetree] arm64: dts: ls1028a-rdb: add more ethernet aliases

Message ID 20220905212458.1549179-1-vladimir.oltean@nxp.com
State New
Headers show
Series [devicetree] arm64: dts: ls1028a-rdb: add more ethernet aliases | expand

Commit Message

Vladimir Oltean Sept. 5, 2022, 9:24 p.m. UTC
Commit "arm64: dts: ls1028a: enable swp5 and eno3 for all boards" which
Shawn declared as applied, but for which I can't find a sha1sum, has
enabled a new Ethernet port on the LS1028A-RDB (&enetc_port3), but
U-Boot, which passes a MAC address to Linux' device tree through the
/aliases node, fails to do this for this newly enabled port.

Fix that by adding more ethernet aliases in the only
backwards-compatible way possible: at the end of the current list.

And since it is possible to very easily convert either swp4 or swp5 to
DSA user ports now (which have a MAC address of their own), using these
U-Boot commands:

=> fdt addr $fdt_addr_r
=> fdt rm /soc/pcie@1f0000000/ethernet-switch@0,5/ports/port@4 ethernet

it would be good if those DSA user ports (swp4, swp5) gained a valid MAC
address from U-Boot as well. In order for that to work properly,
provision two more ethernet aliases for &mscc_felix_port{4,5} as well.

The resulting ordering is slightly unusual, but to me looks more natural
than eno0, eno2, swp0, swp1, swp2, swp3, eno3, swp4, swp5.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts | 3 +++
 1 file changed, 3 insertions(+)

Comments

Vladimir Oltean Sept. 7, 2022, 1:07 p.m. UTC | #1
On Wed, Sep 07, 2022 at 10:56:37AM +0200, Michael Walle wrote:
> > > I think we are on the same track here. I was ignoring any VFs for now.
> > > So I guess, what I'm still missing here is why enet#2 and enet#3 (or
> > > even swp4 and swp5) would need a non-random MAC address. Except from
> > > your example above. Considering the usecase where swp0..3 is one bridge
> > > with eno2 and eno3 being the CPU ports. Then I'd only need a unique
> > > MAC address for eno0, eno1 and swp0, correct?
> > 
> > Don't say "unique MAC address for swp0", since swp0's MAC address is not
> > unique, you probably mean to say "a MAC address which will be shared by
> > swp0-swp3".
> 
> That I actually don't understand. I have the following addresses after
> booting:
> 
> # ip link
> ..
> 4: gbe0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group
> default qlen 1000
>     link/ether 00:a0:a5:5c:6b:62 brd ff:ff:ff:ff:ff:ff
>     inet 172.16.1.2/24 scope global gbe0
>        valid_lft forever preferred_lft forever
>     inet6 fe80::2a0:a5ff:fe5c:6b62/64 scope link
>        valid_lft forever preferred_lft forever
> 5: gbe1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default
> qlen 1000
>     link/ether 00:a0:a5:5c:6b:63 brd ff:ff:ff:ff:ff:ff
> 6: eno2: <BROADCAST,MULTICAST> mtu 1504 qdisc noop state DOWN group default
> qlen 1000
>     link/ether 8e:6c:20:8a:ab:52 brd ff:ff:ff:ff:ff:ff
> 7: eno3: <BROADCAST,MULTICAST> mtu 1504 qdisc noop state DOWN group default
> qlen 1000
>     link/ether c6:fd:b1:88:3c:36 brd ff:ff:ff:ff:ff:ff
> 8: swp0@eno2: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN
> group default qlen 1000
>     link/ether 00:a0:a5:5c:6b:66 brd ff:ff:ff:ff:ff:ff
> 9: swp1@eno2: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN
> group default qlen 1000
>     link/ether 00:a0:a5:5c:6b:67 brd ff:ff:ff:ff:ff:ff
> 10: swp2@eno2: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN
> group default qlen 1000
>     link/ether 00:a0:a5:5c:6b:68 brd ff:ff:ff:ff:ff:ff
> 11: swp3@eno2: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN
> group default qlen 1000
>     link/ether 00:a0:a5:5c:6b:69 brd ff:ff:ff:ff:ff:ff
> 
> gbe0 is eno0 and gbe1 is eno1. So in my case they are unique.
> 
> When adding all the ports to a bridge, the bridge gets the lowest MAC.
> 
> # ip link add name br0 type bridge
> # ip link set swp0 master br0
> # ip link set swp1 master br0
> # ip link set swp2 master br0
> # ip link set swp3 master br0
> 
> 12: br0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT
> group default qlen 1000
>     link/ether 00:a0:a5:5c:6b:66 brd ff:ff:ff:ff:ff:ff
> 
> Is that what you mean with "a MAC address which will be shared by
> swp0-swp3"?

No, what I'm trying is only to reformulate what you've said, "Then I'd
only need a unique MAC address for eno0, eno1 and swp0". My understanding
of what you mean by "unique address for swp0" is that the addresses for
swp1-swp3 don't matter (hence they can be set to the same address as swp0)
since there will be a bridge that serves as the IP termination point,
with its own MAC address, inherited from the first bridge port, swp0.
But this makes it improper to call it a "unique address for swp0".
Shawn Guo Sept. 12, 2022, 9:26 a.m. UTC | #2
On Tue, Sep 06, 2022 at 12:24:58AM +0300, Vladimir Oltean wrote:
> Commit "arm64: dts: ls1028a: enable swp5 and eno3 for all boards" which
> Shawn declared as applied, but for which I can't find a sha1sum, has
> enabled a new Ethernet port on the LS1028A-RDB (&enetc_port3), but
> U-Boot, which passes a MAC address to Linux' device tree through the
> /aliases node, fails to do this for this newly enabled port.
> 
> Fix that by adding more ethernet aliases in the only
> backwards-compatible way possible: at the end of the current list.
> 
> And since it is possible to very easily convert either swp4 or swp5 to
> DSA user ports now (which have a MAC address of their own), using these
> U-Boot commands:
> 
> => fdt addr $fdt_addr_r
> => fdt rm /soc/pcie@1f0000000/ethernet-switch@0,5/ports/port@4 ethernet
> 
> it would be good if those DSA user ports (swp4, swp5) gained a valid MAC
> address from U-Boot as well. In order for that to work properly,
> provision two more ethernet aliases for &mscc_felix_port{4,5} as well.
> 
> The resulting ordering is slightly unusual, but to me looks more natural
> than eno0, eno2, swp0, swp1, swp2, swp3, eno3, swp4, swp5.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Applied, thanks!
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
index e33725c60169..ecd2c1ea177f 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
@@ -29,6 +29,9 @@  aliases {
 		ethernet3 = &mscc_felix_port1;
 		ethernet4 = &mscc_felix_port2;
 		ethernet5 = &mscc_felix_port3;
+		ethernet6 = &mscc_felix_port4;
+		ethernet7 = &mscc_felix_port5;
+		ethernet8 = &enetc_port3;
 	};
 
 	chosen {