net: use the same alias stem for ethernet as linux
Subsystems (2)
PATCH 1/1 net: use the same alias stem for ethernet as linux
Linux uses the prefix "ethernet" whereas u-boot uses "eth". This is from the linux tree:
$ grep "eth[0-9].*=.*&" arch/**/*dts{,i}|wc -l
0
$ grep "ethernet[0-9].*=.*&" arch/**/*dts{,i}|wc -l
633In u-boot device trees both prefixes are used. Until recently the only user of the ethernet alias was the sandbox test device tree. This changed with commit fc054d563bfb ("net: Introduce DSA class for Ethernet switches"). There, the MAC addresses are inherited based on the devices sequence IDs which is in turn given by the device tree.
Before there are more users in u-boot and both worlds will differ even more, rename the alias prefix to "ethernet" to match the linux ones. Also adapt the test cases and rename any old aliases in the u-boot device trees.
---
Vladimir, I didn't do another patch to rename any ethernet aliases to "eth". Though kontron boards contain "ethernetN" aliases, all in tree variants don't make use of it. So there is nothing to be fixed.
arch/arm/dts/fsl-ls1028a-rdb.dts | 12 ++++++------ arch/sandbox/dts/test.dts | 10 +++++----- net/eth-uclass.c | 4 ++-- test/dm/ofnode.c | 2 +- test/dm/test-fdt.c | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-)
arch/arm/dts/fsl-ls1028a-rdb.dts +6 -6
@@ -15,12 +15,12 @@ compatible = "fsl,ls1028a-rdb", "fsl,ls1028a"; aliases { spi0 = &fspi; - eth0 = &enetc0; - eth1 = &enetc2; - eth2 = &mscc_felix_port0; - eth3 = &mscc_felix_port1; - eth4 = &mscc_felix_port2; - eth5 = &mscc_felix_port3; + ethernet0 = &enetc0; + ethernet1 = &enetc2; + ethernet2 = &mscc_felix_port0; + ethernet3 = &mscc_felix_port1; + ethernet4 = &mscc_felix_port2; + ethernet5 = &mscc_felix_port3; }; };
arch/sandbox/dts/test.dts +5 -5
@@ -14,11 +14,11 @@ aliases { console = &uart0; - eth0 = "/eth at 10002000"; - eth2 = &swp_0; - eth3 = ð_3; - eth4 = &dsa_eth0; - eth5 = ð_5; + ethernet0 = "/eth at 10002000"; + ethernet2 = &swp_0; + ethernet3 = ð_3; + ethernet4 = &dsa_eth0; + ethernet5 = ð_5; gpio1 = &gpio_a; gpio2 = &gpio_b; gpio3 = &gpio_c;
net/eth-uclass.c +2 -2
@@ -605,8 +605,8 @@ static int eth_pre_remove(struct udevice *dev)return 0 ; } -UCLASS_DRIVER (eth) = { - .name ="eth" , +UCLASS_DRIVER (ethernet) = { + .name ="ethernet" , .id =UCLASS_ETH , .post_bind = eth_post_bind, .pre_unbind = eth_pre_unbind,
test/dm/ofnode.c +1 -1
@@ -213,7 +213,7 @@ static int dm_test_ofnode_read_aliases(struct unit_test_state *uts)ofnode node;int size; - node =ofnode_get_aliases_node ("eth3" ); + node =ofnode_get_aliases_node ("ethernet3" );ut_assert (ofnode_valid (node));ut_asserteq_str ("sbe5" ,ofnode_get_name (node));
test/dm/test-fdt.c +1 -1
@@ -183,7 +183,7 @@ static int dm_test_alias_highest_id(struct unit_test_state *uts) {int ret; - ret =dev_read_alias_highest_id ("eth" ); + ret =dev_read_alias_highest_id ("ethernet" );ut_asserteq (5 , ret); ret =dev_read_alias_highest_id ("gpio" );
Signature · 1 line
2.20.1
PATCH 1/1 net: use the same alias stem for ethernet as linux
Hi Michael,
Quoted 15 lines · Michael Walle
Linux uses the prefix "ethernet" whereas u-boot uses "eth". This is from the linux tree:
$ grep "eth[0-9].*=.*&" arch/**/*dts{,i}|wc -l 0 $ grep "ethernet[0-9].*=.*&" arch/**/*dts{,i}|wc -l 633In u-boot device trees both prefixes are used. Until recently the only user of the ethernet alias was the sandbox test device tree. This changed with commit
fc054d563bfb("net: Introduce DSA class for Ethernet switches"). There, the MAC addresses are inherited based on the devices sequence IDs which is in turn given by the device tree.
Quoted 7 lines
Before there are more users in u-boot and both worlds will differ even more, rename the alias prefix to "ethernet" to match the linux ones. Also adapt the test cases and rename any old aliases in the u-boot device trees.
Cc David Wu <[email protected]>Signed-off-by Michael Walle <[email protected]>
Yes, this is the preferred node naming as per the Devicetree Specification:
PATCH 1/1 net: use the same alias stem for ethernet as linux
Quoted 24 lines · Fabio Estevam
Hi Michael,
Quoted 20 lines · Michael Walle
Linux uses the prefix "ethernet" whereas u-boot uses "eth". This is from the linux tree:
$ grep "eth[0-9].*=.*&" arch/**/*dts{,i}|wc -l 0 $ grep "ethernet[0-9].*=.*&" arch/**/*dts{,i}|wc -l 633In u-boot device trees both prefixes are used. Until recently the only user of the ethernet alias was the sandbox test device tree. This changed with commit
fc054d563bfb("net: Introduce DSA class for Ethernet switches"). There, the MAC addresses are inherited based on the devices sequence IDs which is in turn given by the device tree.Before there are more users in u-boot and both worlds will differ even more, rename the alias prefix to "ethernet" to match the linux ones. Also adapt the test cases and rename any old aliases in the u-boot device trees.
Quoted 6 lines
Quoted 2 lines
Cc David Wu <[email protected]>Signed-off-by Michael Walle <[email protected]>Yes, this is the preferred node naming as per the Devicetree Specification:
Reviewed-by Fabio Estevam <[email protected]>
PATCH 1/1 net: use the same alias stem for ethernet as linux
In reply to Michael WalleHi Michael,
Thank you for your patch, good complement.
? 2021/2/25 ??11:51, Michael Walle ??:
Quoted 119 lines
Linux uses the prefix "ethernet" whereas u-boot uses "eth". This is from the linux tree:
$ grep "eth[0-9].*=.*&" arch/**/*dts{,i}|wc -l 0 $ grep "ethernet[0-9].*=.*&" arch/**/*dts{,i}|wc -l 633In u-boot device trees both prefixes are used. Until recently the only user of the ethernet alias was the sandbox test device tree. This changed with commit
fc054d563bfb("net: Introduce DSA class for Ethernet switches"). There, the MAC addresses are inherited based on the devices sequence IDs which is in turn given by the device tree.Before there are more users in u-boot and both worlds will differ even more, rename the alias prefix to "ethernet" to match the linux ones. Also adapt the test cases and rename any old aliases in the u-boot device trees.
Cc David Wu <[email protected]>Signed-off-by Michael Walle <[email protected]>---
Vladimir, I didn't do another patch to rename any ethernet aliases to "eth". Though kontron boards contain "ethernetN" aliases, all in tree variants don't make use of it. So there is nothing to be fixed.arch/arm/dts/fsl-ls1028a-rdb.dts | 12 ++++++------ arch/sandbox/dts/test.dts | 10 +++++----- net/eth-uclass.c | 4 ++-- test/dm/ofnode.c | 2 +- test/dm/test-fdt.c | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-)arch/arm/dts/fsl-ls1028a-rdb.dts +6
-6@@ -15,12 +15,12 @@ compatible = "fsl,ls1028a-rdb", "fsl,ls1028a"; aliases { spi0 = &fspi; - eth0 = &enetc0; - eth1 = &enetc2; - eth2 = &mscc_felix_port0; - eth3 = &mscc_felix_port1; - eth4 = &mscc_felix_port2; - eth5 = &mscc_felix_port3; + ethernet0 = &enetc0; + ethernet1 = &enetc2; + ethernet2 = &mscc_felix_port0; + ethernet3 = &mscc_felix_port1; + ethernet4 = &mscc_felix_port2; + ethernet5 = &mscc_felix_port3; }; };arch/sandbox/dts/test.dts +5
-5@@ -14,11 +14,11 @@ aliases { console = &uart0; - eth0 = "/eth at 10002000"; - eth2 = &swp_0; - eth3 = ð_3; - eth4 = &dsa_eth0; - eth5 = ð_5; + ethernet0 = "/eth at 10002000"; + ethernet2 = &swp_0; + ethernet3 = ð_3; + ethernet4 = &dsa_eth0; + ethernet5 = ð_5; gpio1 = &gpio_a; gpio2 = &gpio_b; gpio3 = &gpio_c;net/eth-uclass.c +2
-2@@ -605,8 +605,8 @@ static int eth_pre_remove(struct udevice *dev)return 0 ; } -UCLASS_DRIVER (eth) = { - .name ="eth" , +UCLASS_DRIVER (ethernet) = { + .name ="ethernet" , .id =UCLASS_ETH , .post_bind = eth_post_bind, .pre_unbind = eth_pre_unbind,test/dm/ofnode.c +1
-1@@ -213,7 +213,7 @@ static int dm_test_ofnode_read_aliases(struct unit_test_state *uts)ofnode node;int size; - node =ofnode_get_aliases_node ("eth3" ); + node =ofnode_get_aliases_node ("ethernet3" );ut_assert (ofnode_valid (node));ut_asserteq_str ("sbe5" ,ofnode_get_name (node));test/dm/test-fdt.c +1
-1@@ -183,7 +183,7 @@ static int dm_test_alias_highest_id(struct unit_test_state *uts) {int ret; - ret =dev_read_alias_highest_id ("eth" ); + ret =dev_read_alias_highest_id ("ethernet" );ut_asserteq (5 , ret); ret =dev_read_alias_highest_id ("gpio" );
PATCH 1/1 net: use the same alias stem for ethernet as linux
In reply to Michael WalleAm 2021-02-25 16:51, schrieb Michael Walle:
Quoted 21 lines
Linux uses the prefix "ethernet" whereas u-boot uses "eth". This is from
the linux tree:$ grep "eth[0-9].*=.*&" arch/**/*dts{,i}|wc -l 0 $ grep "ethernet[0-9].*=.*&" arch/**/*dts{,i}|wc -l 633In u-boot device trees both prefixes are used. Until recently the only user of the ethernet alias was the sandbox test device tree. This changed with commit
fc054d563bfb("net: Introduce DSA class for Ethernet
switches"). There, the MAC addresses are inherited based on the devices sequence IDs which is in turn given by the device tree.Before there are more users in u-boot and both worlds will differ even more, rename the alias prefix to "ethernet" to match the linux ones. Also adapt the test cases and rename any old aliases in the u-boot device trees.
Quoted 6 lines
Cc David Wu <[email protected]>Signed-off-by Michael Walle <[email protected]>---
Vladimir, I didn't do another patch to rename any ethernet aliases to "eth". Though kontron boards contain "ethernetN" aliases, all in tree variants don't make use of it. So there is nothing to be fixed.
ping :)
-michael
PATCH 1/1 net: use the same alias stem for ethernet as linux
In reply to Michael WalleQuoted 27 lines · Michael Walle
Linux uses the prefix "ethernet" whereas u-boot uses "eth". This is from the linux tree:
$ grep "eth[0-9].*=.*&" arch/**/*dts{,i}|wc -l 0 $ grep "ethernet[0-9].*=.*&" arch/**/*dts{,i}|wc -l 633In u-boot device trees both prefixes are used. Until recently the only user of the ethernet alias was the sandbox test device tree. This changed with commit
fc054d563bfb("net: Introduce DSA class for Ethernet switches"). There, the MAC addresses are inherited based on the devices sequence IDs which is in turn given by the device tree.Before there are more users in u-boot and both worlds will differ even more, rename the alias prefix to "ethernet" to match the linux ones. Also adapt the test cases and rename any old aliases in the u-boot device trees.
Cc David Wu <[email protected]>Signed-off-by Michael Walle <[email protected]>---
Vladimir, I didn't do another patch to rename any ethernet aliases to "eth". Though kontron boards contain "ethernetN" aliases, all in tree variants don't make use of it. So there is nothing to be fixed.
Quoted 6 lines
arch/arm/dts/fsl-ls1028a-rdb.dts | 12 ++++++------ arch/sandbox/dts/test.dts | 10 +++++----- net/eth-uclass.c | 4 ++-- test/dm/ofnode.c | 2 +- test/dm/test-fdt.c | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-)
Quoted 29 lines · Simon Glass
Quoted 27 lines · Michael Walle
Linux uses the prefix "ethernet" whereas u-boot uses "eth". This is from the linux tree:
$ grep "eth[0-9].*=.*&" arch/**/*dts{,i}|wc -l 0 $ grep "ethernet[0-9].*=.*&" arch/**/*dts{,i}|wc -l 633In u-boot device trees both prefixes are used. Until recently the only user of the ethernet alias was the sandbox test device tree. This changed with commit
fc054d563bfb("net: Introduce DSA class for Ethernet switches"). There, the MAC addresses are inherited based on the devices sequence IDs which is in turn given by the device tree.Before there are more users in u-boot and both worlds will differ even more, rename the alias prefix to "ethernet" to match the linux ones. Also adapt the test cases and rename any old aliases in the u-boot device trees.
Cc David Wu <[email protected]>Signed-off-by Michael Walle <[email protected]>---
Vladimir, I didn't do another patch to rename any ethernet aliases to "eth". Though kontron boards contain "ethernetN" aliases, all in tree variants don't make use of it. So there is nothing to be fixed.
Quoted 8 lines
Quoted 6 lines
arch/arm/dts/fsl-ls1028a-rdb.dts | 12 ++++++------ arch/sandbox/dts/test.dts | 10 +++++----- net/eth-uclass.c | 4 ++-- test/dm/ofnode.c | 2 +- test/dm/test-fdt.c | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-)Reviewed-by Simon Glass <[email protected]>
Applied to u-boot-net/master, thanks!
Best regards,
Ramon Fried