2017-07-22 02:29:07

by Icenowy Zheng

[permalink] [raw]
Subject: [PATCH 0/3] Add ethernet0 alias for several A64 boards

Allwinner A64 SoC has an EMAC which is used to provide Ethernet
function on several boards.

The EMAC itself doesn't have a fixed MAC address, but the sunxi
mainline U-Boot have the ability to generate one based on the eFUSE
SID in the chip, and add the generated MAC address to the device
tree when booting.

The MAC address setting step is based on the device tree's aliases,
and device tree nodes prefixed "ethernet" will get the MAC address
added. However, in several A64 boards' device tree, the alias is not
set up, so that the U-Boot won't set the MAC address.

Add the ethernet0 aliases to these boards.

I hope this patchset can be queued in 4.13, otherwise 4.13 kernels
won't get non-volatile MAC addresses, and will use random ones
instead, which is annoying to many users.

Icenowy Zheng (3):
arm64: allwinner: a64: add ethernet0 alias for BPi M64 EMAC node
arm64: allwinner: a64: add ethernet0 alias for Pine64 EMAC node
arm64: allwinner: a64: add ethernet0 alias for SoPine EMAC node

arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts | 1 +
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 1 +
arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts | 1 +
3 files changed, 3 insertions(+)

--
2.13.0


2017-07-22 02:29:14

by Icenowy Zheng

[permalink] [raw]
Subject: [PATCH 1/3] arm64: allwinner: a64: add ethernet0 alias for BPi M64 EMAC node

The Banana Pi M64 board uses the A64 chip's EMAC to provide Ethernet
link.

Add the ethernet0 alias in the device tree, in order to let U-Boot
generate a MAC address from the chip's SID.

Signed-off-by: Icenowy Zheng <[email protected]>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
index 0d1f026d831a..ba2fde2909f9 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
@@ -51,6 +51,7 @@
compatible = "sinovoip,bananapi-m64", "allwinner,sun50i-a64";

aliases {
+ ethernet0 = &emac;
serial0 = &uart0;
serial1 = &uart1;
};
--
2.13.0

2017-07-22 02:29:26

by Icenowy Zheng

[permalink] [raw]
Subject: [PATCH 2/3] arm64: allwinner: a64: add ethernet0 alias for Pine64 EMAC node

The Pine64 (including the Plus models) board uses the A64 chip's
EMAC to provide Ethernet link.

Add the ethernet0 alias in the device tree, in order to let U-Boot
generate a MAC address from the chip's SID.

Signed-off-by: Icenowy Zheng <[email protected]>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
index 64cce0d68cae..7a450dcb7a08 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
@@ -51,6 +51,7 @@
compatible = "pine64,pine64", "allwinner,sun50i-a64";

aliases {
+ ethernet0 = &emac;
serial0 = &uart0;
serial1 = &uart1;
serial2 = &uart2;
--
2.13.0

2017-07-22 02:29:30

by Icenowy Zheng

[permalink] [raw]
Subject: [PATCH 3/3] arm64: allwinner: a64: add ethernet0 alias for SoPine EMAC node

The SoPine official baseboard uses the A64 chip's EMAC to provide an
Ethernet link.

Add the ethernet0 alias in the device tree, in order to let U-Boot
generate a MAC address from the chip's SID.

Signed-off-by: Icenowy Zheng <[email protected]>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts
index 17eb1cc5bf6b..216e3a5dafae 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts
@@ -53,6 +53,7 @@
"allwinner,sun50i-a64";

aliases {
+ ethernet0 = &emac;
serial0 = &uart0;
};

--
2.13.0

2017-07-24 07:58:42

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH 0/3] Add ethernet0 alias for several A64 boards

On Sat, Jul 22, 2017 at 10:28:49AM +0800, Icenowy Zheng wrote:
> Allwinner A64 SoC has an EMAC which is used to provide Ethernet
> function on several boards.
>
> The EMAC itself doesn't have a fixed MAC address, but the sunxi
> mainline U-Boot have the ability to generate one based on the eFUSE
> SID in the chip, and add the generated MAC address to the device
> tree when booting.
>
> The MAC address setting step is based on the device tree's aliases,
> and device tree nodes prefixed "ethernet" will get the MAC address
> added. However, in several A64 boards' device tree, the alias is not
> set up, so that the U-Boot won't set the MAC address.
>
> Add the ethernet0 aliases to these boards.
>
> I hope this patchset can be queued in 4.13, otherwise 4.13 kernels
> won't get non-volatile MAC addresses, and will use random ones
> instead, which is annoying to many users.
>
> Icenowy Zheng (3):
> arm64: allwinner: a64: add ethernet0 alias for BPi M64 EMAC node
> arm64: allwinner: a64: add ethernet0 alias for Pine64 EMAC node
> arm64: allwinner: a64: add ethernet0 alias for SoPine EMAC node

Applied all three, thanks!
Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


Attachments:
(No filename) (1.22 kB)
signature.asc (801.00 B)
Download all attachments

2017-07-25 03:04:40

by Icenowy Zheng

[permalink] [raw]
Subject: Re: [PATCH 0/3] Add ethernet0 alias for several A64 boards

在 2017-07-24 15:58,Maxime Ripard 写道:
> On Sat, Jul 22, 2017 at 10:28:49AM +0800, Icenowy Zheng wrote:
>> Allwinner A64 SoC has an EMAC which is used to provide Ethernet
>> function on several boards.
>>
>> The EMAC itself doesn't have a fixed MAC address, but the sunxi
>> mainline U-Boot have the ability to generate one based on the eFUSE
>> SID in the chip, and add the generated MAC address to the device
>> tree when booting.
>>
>> The MAC address setting step is based on the device tree's aliases,
>> and device tree nodes prefixed "ethernet" will get the MAC address
>> added. However, in several A64 boards' device tree, the alias is not
>> set up, so that the U-Boot won't set the MAC address.
>>
>> Add the ethernet0 aliases to these boards.
>>
>> I hope this patchset can be queued in 4.13, otherwise 4.13 kernels
>> won't get non-volatile MAC addresses, and will use random ones
>> instead, which is annoying to many users.
>>
>> Icenowy Zheng (3):
>> arm64: allwinner: a64: add ethernet0 alias for BPi M64 EMAC node
>> arm64: allwinner: a64: add ethernet0 alias for Pine64 EMAC node
>> arm64: allwinner: a64: add ethernet0 alias for SoPine EMAC node
>
> Applied all three, thanks!

Sorry, but could you queue them to 4.13?

Otherwise 4.13 kernel release will have annoying random MAC problem,
which heavily affects headless usages.

> Maxime
>
> _______________________________________________
> linux-arm-kernel mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

2017-07-25 03:19:10

by Adam Borowski

[permalink] [raw]
Subject: Re: [PATCH 0/3] Add ethernet0 alias for several A64 boards

On Tue, Jul 25, 2017 at 11:04:24AM +0800, [email protected] wrote:
> 在 2017-07-24 15:58,Maxime Ripard 写道:
> > On Sat, Jul 22, 2017 at 10:28:49AM +0800, Icenowy Zheng wrote:
> > > Allwinner A64 SoC has an EMAC which is used to provide Ethernet
> > > function on several boards.
> > >
> > > The EMAC itself doesn't have a fixed MAC address, but the sunxi
> > > mainline U-Boot have the ability to generate one based on the eFUSE
> > > SID in the chip, and add the generated MAC address to the device
> > > tree when booting.
> > >
> > > The MAC address setting step is based on the device tree's aliases,
> > > and device tree nodes prefixed "ethernet" will get the MAC address
> > > added. However, in several A64 boards' device tree, the alias is not
> > > set up, so that the U-Boot won't set the MAC address.
> > >
> > > Add the ethernet0 aliases to these boards.
> > >
> > > I hope this patchset can be queued in 4.13, otherwise 4.13 kernels
> > > won't get non-volatile MAC addresses, and will use random ones
> > > instead, which is annoying to many users.
> > >
> > > Icenowy Zheng (3):
> > > arm64: allwinner: a64: add ethernet0 alias for BPi M64 EMAC node
> > > arm64: allwinner: a64: add ethernet0 alias for Pine64 EMAC node
> > > arm64: allwinner: a64: add ethernet0 alias for SoPine EMAC node
> >
> > Applied all three, thanks!
>
> Sorry, but could you queue them to 4.13?
>
> Otherwise 4.13 kernel release will have annoying random MAC problem,
> which heavily affects headless usages.

Perhaps it would be better to reword the commit subject as "fix missing
ethernet0 alias ..."? That'd convey that the previous behaviour is a defect
that needs these patches as a fix.


Meow!
--
// If you believe in so-called "intellectual property", please immediately
// cease using counterfeit alphabets. Instead, contact the nearest temple
// of Amon, whose priests will provide you with scribal services for all
// your writing needs, for Reasonable and Non-Discriminatory prices.

2017-07-25 14:31:31

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH 0/3] Add ethernet0 alias for several A64 boards

On Tue, Jul 25, 2017 at 05:18:19AM +0200, Adam Borowski wrote:
> On Tue, Jul 25, 2017 at 11:04:24AM +0800, [email protected] wrote:
> > 在 2017-07-24 15:58,Maxime Ripard 写道:
> > > On Sat, Jul 22, 2017 at 10:28:49AM +0800, Icenowy Zheng wrote:
> > > > Allwinner A64 SoC has an EMAC which is used to provide Ethernet
> > > > function on several boards.
> > > >
> > > > The EMAC itself doesn't have a fixed MAC address, but the sunxi
> > > > mainline U-Boot have the ability to generate one based on the eFUSE
> > > > SID in the chip, and add the generated MAC address to the device
> > > > tree when booting.
> > > >
> > > > The MAC address setting step is based on the device tree's aliases,
> > > > and device tree nodes prefixed "ethernet" will get the MAC address
> > > > added. However, in several A64 boards' device tree, the alias is not
> > > > set up, so that the U-Boot won't set the MAC address.
> > > >
> > > > Add the ethernet0 aliases to these boards.
> > > >
> > > > I hope this patchset can be queued in 4.13, otherwise 4.13 kernels
> > > > won't get non-volatile MAC addresses, and will use random ones
> > > > instead, which is annoying to many users.
> > > >
> > > > Icenowy Zheng (3):
> > > > arm64: allwinner: a64: add ethernet0 alias for BPi M64 EMAC node
> > > > arm64: allwinner: a64: add ethernet0 alias for Pine64 EMAC node
> > > > arm64: allwinner: a64: add ethernet0 alias for SoPine EMAC node
> > >
> > > Applied all three, thanks!
> >
> > Sorry, but could you queue them to 4.13?
> >
> > Otherwise 4.13 kernel release will have annoying random MAC problem,
> > which heavily affects headless usages.
>
> Perhaps it would be better to reword the commit subject as "fix missing
> ethernet0 alias ..."? That'd convey that the previous behaviour is a defect
> that needs these patches as a fix.

Yes, definitely.

That and having a fixes: tag.

Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


Attachments:
(No filename) (1.95 kB)
signature.asc (801.00 B)
Download all attachments

2017-07-25 23:54:43

by Icenowy Zheng

[permalink] [raw]
Subject: Re: [PATCH 0/3] Add ethernet0 alias for several A64 boards



于 2017年7月25日 GMT+08:00 下午10:31:27, Maxime Ripard <[email protected]> 写到:
>On Tue, Jul 25, 2017 at 05:18:19AM +0200, Adam Borowski wrote:
>> On Tue, Jul 25, 2017 at 11:04:24AM +0800, [email protected] wrote:
>> > 在 2017-07-24 15:58,Maxime Ripard 写道:
>> > > On Sat, Jul 22, 2017 at 10:28:49AM +0800, Icenowy Zheng wrote:
>> > > > Allwinner A64 SoC has an EMAC which is used to provide Ethernet
>> > > > function on several boards.
>> > > >
>> > > > The EMAC itself doesn't have a fixed MAC address, but the sunxi
>> > > > mainline U-Boot have the ability to generate one based on the
>eFUSE
>> > > > SID in the chip, and add the generated MAC address to the
>device
>> > > > tree when booting.
>> > > >
>> > > > The MAC address setting step is based on the device tree's
>aliases,
>> > > > and device tree nodes prefixed "ethernet" will get the MAC
>address
>> > > > added. However, in several A64 boards' device tree, the alias
>is not
>> > > > set up, so that the U-Boot won't set the MAC address.
>> > > >
>> > > > Add the ethernet0 aliases to these boards.
>> > > >
>> > > > I hope this patchset can be queued in 4.13, otherwise 4.13
>kernels
>> > > > won't get non-volatile MAC addresses, and will use random ones
>> > > > instead, which is annoying to many users.
>> > > >
>> > > > Icenowy Zheng (3):
>> > > > arm64: allwinner: a64: add ethernet0 alias for BPi M64 EMAC
>node
>> > > > arm64: allwinner: a64: add ethernet0 alias for Pine64 EMAC
>node
>> > > > arm64: allwinner: a64: add ethernet0 alias for SoPine EMAC
>node
>> > >
>> > > Applied all three, thanks!
>> >
>> > Sorry, but could you queue them to 4.13?
>> >
>> > Otherwise 4.13 kernel release will have annoying random MAC
>problem,
>> > which heavily affects headless usages.
>>
>> Perhaps it would be better to reword the commit subject as "fix
>missing
>> ethernet0 alias ..."? That'd convey that the previous behaviour is a
>defect
>> that needs these patches as a fix.
>
>Yes, definitely.
>
>That and having a fixes: tag.

Should I resend them with different commit message?

>
>Maxime

2017-07-26 04:12:48

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [linux-sunxi] Re: [PATCH 0/3] Add ethernet0 alias for several A64 boards

On Wed, Jul 26, 2017 at 7:54 AM, Icenowy Zheng <[email protected]> wrote:
>
>
> 于 2017年7月25日 GMT+08:00 下午10:31:27, Maxime Ripard <[email protected]> 写到:
>>On Tue, Jul 25, 2017 at 05:18:19AM +0200, Adam Borowski wrote:
>>> On Tue, Jul 25, 2017 at 11:04:24AM +0800, [email protected] wrote:
>>> > 在 2017-07-24 15:58,Maxime Ripard 写道:
>>> > > On Sat, Jul 22, 2017 at 10:28:49AM +0800, Icenowy Zheng wrote:
>>> > > > Allwinner A64 SoC has an EMAC which is used to provide Ethernet
>>> > > > function on several boards.
>>> > > >
>>> > > > The EMAC itself doesn't have a fixed MAC address, but the sunxi
>>> > > > mainline U-Boot have the ability to generate one based on the
>>eFUSE
>>> > > > SID in the chip, and add the generated MAC address to the
>>device
>>> > > > tree when booting.
>>> > > >
>>> > > > The MAC address setting step is based on the device tree's
>>aliases,
>>> > > > and device tree nodes prefixed "ethernet" will get the MAC
>>address
>>> > > > added. However, in several A64 boards' device tree, the alias
>>is not
>>> > > > set up, so that the U-Boot won't set the MAC address.
>>> > > >
>>> > > > Add the ethernet0 aliases to these boards.
>>> > > >
>>> > > > I hope this patchset can be queued in 4.13, otherwise 4.13
>>kernels
>>> > > > won't get non-volatile MAC addresses, and will use random ones
>>> > > > instead, which is annoying to many users.
>>> > > >
>>> > > > Icenowy Zheng (3):
>>> > > > arm64: allwinner: a64: add ethernet0 alias for BPi M64 EMAC
>>node
>>> > > > arm64: allwinner: a64: add ethernet0 alias for Pine64 EMAC
>>node
>>> > > > arm64: allwinner: a64: add ethernet0 alias for SoPine EMAC
>>node
>>> > >
>>> > > Applied all three, thanks!
>>> >
>>> > Sorry, but could you queue them to 4.13?
>>> >
>>> > Otherwise 4.13 kernel release will have annoying random MAC
>>problem,
>>> > which heavily affects headless usages.
>>>
>>> Perhaps it would be better to reword the commit subject as "fix
>>missing
>>> ethernet0 alias ..."? That'd convey that the previous behaviour is a
>>defect
>>> that needs these patches as a fix.
>>
>>Yes, definitely.
>>
>>That and having a fixes: tag.
>
> Should I resend them with different commit message?

Yes please. And add the "Fixes:" tag.

ChenYu

2017-08-10 03:56:28

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [linux-sunxi] [PATCH 1/3] arm64: allwinner: a64: add ethernet0 alias for BPi M64 EMAC node

Hi,

On Sat, Jul 22, 2017 at 10:28 AM, Icenowy Zheng <[email protected]> wrote:
> The Banana Pi M64 board uses the A64 chip's EMAC to provide Ethernet
> link.
>
> Add the ethernet0 alias in the device tree, in order to let U-Boot
> generate a MAC address from the chip's SID.
>
> Signed-off-by: Icenowy Zheng <[email protected]>

As mentioned in the discussion of the cover letter of this series,
we'd really like to move this to fixes for 4.13.

I'd like to move forward on this soon. Can I just do a wholesale
rewrite of the commit message along the lines of the following
example, and move the 3 patches to fixes for 4.13?

arm64: allwinner: a64: bananapi-m64: add missing ethernet0 alias

The EMAC Ethernet controller was enabled, but an accompanying alias
was not added. This results in unstable numbering if other Ethernet
devices, such as a USB dongle, are present. Also, the bootloader uses
the alias to assign a generated stable MAC address to the device node.

Fixes: e7295499903d ("arm64: allwinner: bananapi-m64: Enable dwmac-sun8i")


Thanks
ChenYu

2017-08-10 04:40:48

by Icenowy Zheng

[permalink] [raw]
Subject: Re: [linux-sunxi] [PATCH 1/3] arm64: allwinner: a64: add ethernet0 alias for BPi M64 EMAC node



于 2017年8月10日 GMT+08:00 上午11:56:02, Chen-Yu Tsai <[email protected]> 写到:
>Hi,
>
>On Sat, Jul 22, 2017 at 10:28 AM, Icenowy Zheng <[email protected]>
>wrote:
>> The Banana Pi M64 board uses the A64 chip's EMAC to provide Ethernet
>> link.
>>
>> Add the ethernet0 alias in the device tree, in order to let U-Boot
>> generate a MAC address from the chip's SID.
>>
>> Signed-off-by: Icenowy Zheng <[email protected]>
>
>As mentioned in the discussion of the cover letter of this series,
>we'd really like to move this to fixes for 4.13.
>
>I'd like to move forward on this soon. Can I just do a wholesale
>rewrite of the commit message along the lines of the following
>example, and move the 3 patches to fixes for 4.13?

Yes.

Thanks!

>
>arm64: allwinner: a64: bananapi-m64: add missing ethernet0 alias
>
>The EMAC Ethernet controller was enabled, but an accompanying alias
>was not added. This results in unstable numbering if other Ethernet
>devices, such as a USB dongle, are present. Also, the bootloader uses
>the alias to assign a generated stable MAC address to the device node.
>
>Fixes: e7295499903d ("arm64: allwinner: bananapi-m64: Enable
>dwmac-sun8i")
>
>
>Thanks
>ChenYu

2017-08-10 07:04:42

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [linux-sunxi] [PATCH 1/3] arm64: allwinner: a64: add ethernet0 alias for BPi M64 EMAC node

On Thu, Aug 10, 2017 at 12:40 PM, Icenowy Zheng <[email protected]> wrote:
>
>
> 于 2017年8月10日 GMT+08:00 上午11:56:02, Chen-Yu Tsai <[email protected]> 写到:
>>Hi,
>>
>>On Sat, Jul 22, 2017 at 10:28 AM, Icenowy Zheng <[email protected]>
>>wrote:
>>> The Banana Pi M64 board uses the A64 chip's EMAC to provide Ethernet
>>> link.
>>>
>>> Add the ethernet0 alias in the device tree, in order to let U-Boot
>>> generate a MAC address from the chip's SID.
>>>
>>> Signed-off-by: Icenowy Zheng <[email protected]>
>>
>>As mentioned in the discussion of the cover letter of this series,
>>we'd really like to move this to fixes for 4.13.
>>
>>I'd like to move forward on this soon. Can I just do a wholesale
>>rewrite of the commit message along the lines of the following
>>example, and move the 3 patches to fixes for 4.13?
>
> Yes.

Done.

ChenYu