Re: [PATCH] net: use the same alias stem for ethernet as linux

2021-06-14 Thread Ramon Fried
On Thu, Apr 29, 2021 at 7:10 PM Simon Glass  wrote:
>
> On Thu, 25 Feb 2021 at 07:51, Michael Walle  wrote:
> >
> > 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 
> > Signed-off-by: Michael Walle 
> > ---
> > 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(-)
>
> Reviewed-by: Simon Glass 
Applied to u-boot-net/master, thanks!

Best regards,
Ramon Fried


Re: [PATCH] net: use the same alias stem for ethernet as linux

2021-04-29 Thread Simon Glass
On Thu, 25 Feb 2021 at 07:51, Michael Walle  wrote:
>
> 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 
> Signed-off-by: Michael Walle 
> ---
> 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(-)

Reviewed-by: Simon Glass 


Re: [PATCH] net: use the same alias stem for ethernet as linux

2021-04-24 Thread Michael Walle

Am 2021-02-25 16:51, schrieb 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
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 
Signed-off-by: Michael Walle 
---
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


Re: [PATCH] net: use the same alias stem for ethernet as linux

2021-03-03 Thread David Wu

Hi Michael,

Thank you for your patch, good complement.

在 2021/2/25 下午11:51, 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
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 
Signed-off-by: Michael Walle 
---
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(-)

diff --git a/arch/arm/dts/fsl-ls1028a-rdb.dts b/arch/arm/dts/fsl-ls1028a-rdb.dts
index 3432fca352..82a8c0a0cd 100644
--- a/arch/arm/dts/fsl-ls1028a-rdb.dts
+++ b/arch/arm/dts/fsl-ls1028a-rdb.dts
@@ -15,12 +15,12 @@
compatible = "fsl,ls1028a-rdb", "fsl,ls1028a";
aliases {
spi0 = 
-   eth0 = 
-   eth1 = 
-   eth2 = _felix_port0;
-   eth3 = _felix_port1;
-   eth4 = _felix_port2;
-   eth5 = _felix_port3;
+   ethernet0 = 
+   ethernet1 = 
+   ethernet2 = _felix_port0;
+   ethernet3 = _felix_port1;
+   ethernet4 = _felix_port2;
+   ethernet5 = _felix_port3;
};
  };
  
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts

index 3ef3ba0b17..7a5d4aa71d 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -14,11 +14,11 @@
  
  	aliases {

console = 
-   eth0 = "/eth@10002000";
-   eth2 = _0;
-   eth3 = _3;
-   eth4 = _eth0;
-   eth5 = _5;
+   ethernet0 = "/eth@10002000";
+   ethernet2 = _0;
+   ethernet3 = _3;
+   ethernet4 = _eth0;
+   ethernet5 = _5;
gpio1 = _a;
gpio2 = _b;
gpio3 = _c;
diff --git a/net/eth-uclass.c b/net/eth-uclass.c
index 0b4260dc5b..5146bd 100644
--- a/net/eth-uclass.c
+++ b/net/eth-uclass.c
@@ -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,
diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c
index c539134296..3b708b63eb 100644
--- a/test/dm/ofnode.c
+++ b/test/dm/ofnode.c
@@ -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));
  
diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c

index 6e83aeecd9..98972665f2 100644
--- a/test/dm/test-fdt.c
+++ b/test/dm/test-fdt.c
@@ -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");







Re: [PATCH] net: use the same alias stem for ethernet as linux

2021-02-25 Thread Ramon Fried
On Thu, Feb 25, 2021 at 5:58 PM Fabio Estevam  wrote:
>
> Hi Michael,
>
> On Thu, Feb 25, 2021 at 12:51 PM Michael Walle  wrote:
> >
> > 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 
> > Signed-off-by: Michael Walle 
>
> Yes, this is the preferred node naming as per the Devicetree Specification:
>
> Reviewed-by: Fabio Estevam 
Ack-by: Ramon Fried 


Re: [PATCH] net: use the same alias stem for ethernet as linux

2021-02-25 Thread Fabio Estevam
Hi Michael,

On Thu, Feb 25, 2021 at 12:51 PM Michael Walle  wrote:
>
> 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 
> Signed-off-by: Michael Walle 

Yes, this is the preferred node naming as per the Devicetree Specification:

Reviewed-by: Fabio Estevam 


[PATCH] net: use the same alias stem for ethernet as linux

2021-02-25 Thread 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
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 
Signed-off-by: Michael Walle 
---
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(-)

diff --git a/arch/arm/dts/fsl-ls1028a-rdb.dts b/arch/arm/dts/fsl-ls1028a-rdb.dts
index 3432fca352..82a8c0a0cd 100644
--- a/arch/arm/dts/fsl-ls1028a-rdb.dts
+++ b/arch/arm/dts/fsl-ls1028a-rdb.dts
@@ -15,12 +15,12 @@
compatible = "fsl,ls1028a-rdb", "fsl,ls1028a";
aliases {
spi0 = 
-   eth0 = 
-   eth1 = 
-   eth2 = _felix_port0;
-   eth3 = _felix_port1;
-   eth4 = _felix_port2;
-   eth5 = _felix_port3;
+   ethernet0 = 
+   ethernet1 = 
+   ethernet2 = _felix_port0;
+   ethernet3 = _felix_port1;
+   ethernet4 = _felix_port2;
+   ethernet5 = _felix_port3;
};
 };
 
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 3ef3ba0b17..7a5d4aa71d 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -14,11 +14,11 @@
 
aliases {
console = 
-   eth0 = "/eth@10002000";
-   eth2 = _0;
-   eth3 = _3;
-   eth4 = _eth0;
-   eth5 = _5;
+   ethernet0 = "/eth@10002000";
+   ethernet2 = _0;
+   ethernet3 = _3;
+   ethernet4 = _eth0;
+   ethernet5 = _5;
gpio1 = _a;
gpio2 = _b;
gpio3 = _c;
diff --git a/net/eth-uclass.c b/net/eth-uclass.c
index 0b4260dc5b..5146bd 100644
--- a/net/eth-uclass.c
+++ b/net/eth-uclass.c
@@ -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,
diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c
index c539134296..3b708b63eb 100644
--- a/test/dm/ofnode.c
+++ b/test/dm/ofnode.c
@@ -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));
 
diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
index 6e83aeecd9..98972665f2 100644
--- a/test/dm/test-fdt.c
+++ b/test/dm/test-fdt.c
@@ -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");
-- 
2.20.1