]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: use the same alias stem for ethernet as linux
authorMichael Walle <michael@walle.cc>
Thu, 25 Feb 2021 15:51:11 +0000 (16:51 +0100)
committerRamon Fried <rfried.dev@gmail.com>
Fri, 18 Jun 2021 08:29:17 +0000 (11:29 +0300)
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
633

In 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 <david.wu@rock-chips.com>
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/arm/dts/fsl-ls1028a-rdb.dts
arch/sandbox/dts/test.dts
net/eth-uclass.c
test/dm/ofnode.c
test/dm/test-fdt.c

index 3432fca35269ae5884673b9771011e3347ecaf3e..82a8c0a0cdec52e8faa18a2ed608abe5b12690c5 100644 (file)
        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;
        };
 };
 
index 5ca3bc502a43842e3d84611100837c8d3b9694bb..8e7eaf2d1504a8af1874b0df61f0483312b0d0e2 100644 (file)
 
        aliases {
                console = &uart0;
-               eth0 = "/eth@10002000";
-               eth2 = &swp_0;
-               eth3 = &eth_3;
-               eth4 = &dsa_eth0;
-               eth5 = &eth_5;
+               ethernet0 = "/eth@10002000";
+               ethernet2 = &swp_0;
+               ethernet3 = &eth_3;
+               ethernet4 = &dsa_eth0;
+               ethernet5 = &eth_5;
                gpio1 = &gpio_a;
                gpio2 = &gpio_b;
                gpio3 = &gpio_c;
index 0b4260dc5be0fc5b11b1e383692052b318d8ec23..5146bd6666c13afa3ad16d9f2ee38dc320ce8593 100644 (file)
@@ -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,
index e0b525eeb185eb819948e2f2ac1ff9529c9a79c4..de895773b55c00c4106428890430e9e767f8a107 100644 (file)
@@ -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));
 
index d273e2185306623471d8275f1ae6a47cd1aea564..8866d4d959dd85c22e1cedb8eedcfb338850fc49 100644 (file)
@@ -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");