allwinner: a523: Rename emac0 to gmac0
Chen-Yu Tsai
maintainercover allwinner: a523: Rename emac0 to gmac0
From: Chen-Yu Tsai <[email protected]>
Hi folks,
This small series aims to align the name of the first ethernet controller found on the Allwinner A523 SoC family with the name found in the datasheets. It renames the compatible string and any other references from "emac0" to "gmac0".
When support of the hardware was introduced, the name chosen was "EMAC", which followed previous generations. However the datasheets use the name "GMAC" instead, likely because there is another "GMAC" based on a newer DWMAC IP.
The first patch fixes the compatible string entry in the device tree binding.
The second patch fixes all references in the existing device trees.
Since this was introduced in v6.16-rc1, I hope to land this for v6.16 as well.
There's a small conflict in patch one around the patch context with
dt-bindings: net: sun8i-emac: Add A100 EMAC compatible
that just landed in net-next today. I will leave this patch to the net mainainers to merge to avoid making a bigger mess. Once that is landed I will merge the second patch through the sunxi tree.
Thanks
ChenYu
Chen-Yu Tsai (2):
dt-bindings: net: sun8i-emac: Rename A523 EMAC0 to GMAC0
arm64: dts: allwinner: a523: Rename emac0 to gmac0
.../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml | 2 +- arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 6 +++--- arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts | 4 ++-- arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)
Signature · 1 line
2.39.5
Chen-Yu Tsai
maintainerPATCH 1/2 dt-bindings: net: sun8i-emac: Rename A523 EMAC0 to GMAC0
From: Chen-Yu Tsai <[email protected]>
The datasheets refer to the first Ethernet controller as GMAC0, not EMAC0.
Rename the compatible string to align with the datasheets. A fix for the device trees will be sent separately.
--- .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml +1 -1
@@ -23,7 +23,7 @@ properties: - allwinner,sun20i-d1-emac - allwinner,sun50i-h6-emac - allwinner,sun50i-h616-emac0 - - allwinner,sun55i-a523-emac0 + - allwinner,sun55i-a523-gmac0 - const: allwinner,sun50i-a64-emac reg:
Signature · 1 line
2.39.5
Re: [PATCH net 1/2] dt-bindings: net: sun8i-emac: Rename A523 EMAC0 to GMAC0
Quoted 5 lines · Chen-Yu Tsai
From: Chen-Yu Tsai <[email protected]>
The datasheets refer to the first Ethernet controller as GMAC0, not EMAC0.
Quoted 9 lines
Rename the compatible string to align with the datasheets. A fix for the device trees will be sent separately.
Fixes 0454b9057e98 ("dt-bindings: net: sun8i-emac: Add A523 EMAC0 compatible")Signed-off-by Chen-Yu Tsai <[email protected]>--- .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Chen-Yu Tsai
maintainerPATCH 2/2 arm64: dts: allwinner: a523: Rename emac0 to gmac0
In reply to Chen-Yu TsaiFrom: Chen-Yu Tsai <[email protected]>
The datasheets refer to the first Ethernet controller as GMAC0, not EMAC0.
Fix the compatible string, node label and pinmux function name to match what the datasheets use. A change to the device tree binding is sent separately.
--- arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 6 +++--- arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts | 4 ++-- arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-)
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +3 -3
@@ -131,7 +131,7 @@ rgmii0_pins: rgmii0-pins { "PH5", "PH6", "PH7", "PH9", "PH10", "PH14", "PH15", "PH16", "PH17", "PH18"; allwinner,pinmux = <5>; - function = "emac0"; + function = "gmac0"; drive-strength = <40>; bias-disable; };
@@ -540,8 +540,8 @@ ohci1: usb@4200400 { status = "disabled"; }; - emac0: ethernet@4500000 { - compatible = "allwinner,sun55i-a523-emac0", + gmac0: ethernet@4500000 { + compatible = "allwinner,sun55i-a523-gmac0", "allwinner,sun50i-a64-emac"; reg = <0x04500000 0x10000>; clocks = <&ccu CLK_BUS_EMAC0>;
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +2 -2
@@ -12,7 +12,7 @@ / { compatible = "radxa,cubie-a5e", "allwinner,sun55i-a527"; aliases { - ethernet0 = &emac0; + ethernet0 = &gmac0; serial0 = &uart0; };
@@ -55,7 +55,7 @@ &ehci1 { status = "okay"; }; -&emac0 { +&gmac0 { phy-mode = "rgmii-id"; phy-handle = <&ext_rgmii_phy>; phy-supply = <®_cldo3>;
arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts +2 -2
@@ -12,7 +12,7 @@ / { compatible = "yuzukihd,avaota-a1", "allwinner,sun55i-t527"; aliases { - ethernet0 = &emac0; + ethernet0 = &gmac0; serial0 = &uart0; };
@@ -65,7 +65,7 @@ &ehci1 { status = "okay"; }; -&emac0 { +&gmac0 { phy-mode = "rgmii-id"; phy-handle = <&ext_rgmii_phy>; phy-supply = <®_dcdc4>;
Signature · 1 line
2.39.5
On Sat, 28 Jun 2025 13:44:36 +0800
Chen-Yu Tsai <[email protected]> wrote:
Hi,
Quoted 8 lines
From: Chen-Yu Tsai <[email protected]>
Hi folks,
This small series aims to align the name of the first ethernet controller found on the Allwinner A523 SoC family with the name found in the datasheets. It renames the compatible string and any other references from "emac0" to "gmac0".
To be honest I am not a big fan of those cosmetic renames when it touches DT files. It seems to not break compatibility in this case, since we don't use the specific compatible string, but leaves a bitter taste anyway. Also I pick DT patches out of -rc releases for U-Boot, and did so internally already, so it's not without churns.
So is this really necessary, and what is the purpose of this patch? I am fine with using GMAC for the GMAC200 part in the SoC, but the A64, H6, H616, A133 all use the same IP - as the fallback compatible proves - and they call it all EMAC.
That's not a NAK, but just wanted to bring this up.
Cheers,
Andre.
Quoted 36 lines
When support of the hardware was introduced, the name chosen was "EMAC", which followed previous generations. However the datasheets use the name "GMAC" instead, likely because there is another "GMAC" based on a newer DWMAC IP.
The first patch fixes the compatible string entry in the device tree binding.
The second patch fixes all references in the existing device trees.
Since this was introduced in v6.16-rc1, I hope to land this for v6.16 as well.
There's a small conflict in patch one around the patch context with
dt-bindings: net: sun8i-emac: Add A100 EMAC compatible
that just landed in net-next today. I will leave this patch to the net mainainers to merge to avoid making a bigger mess. Once that is landed I will merge the second patch through the sunxi tree.
Thanks
ChenYuChen-Yu Tsai (2):
dt-bindings: net: sun8i-emac: Rename A523 EMAC0 to GMAC0
arm64: dts: allwinner: a523: Rename emac0 to gmac0.../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml | 2 +- arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 6 +++--- arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts | 4 ++-- arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)
Chen-Yu Tsai
maintainerQuoted 15 lines · Andre Przywara
On Sat, 28 Jun 2025 13:44:36 +0800
Chen-Yu Tsai <[email protected]> wrote:Hi,
Quoted 8 lines
From: Chen-Yu Tsai <[email protected]>
Hi folks,
This small series aims to align the name of the first ethernet controller found on the Allwinner A523 SoC family with the name found in the datasheets. It renames the compatible string and any other references from "emac0" to "gmac0".
Quoted 5 lines
To be honest I am not a big fan of those cosmetic renames when it touches DT files. It seems to not break compatibility in this case, since we don't use the specific compatible string, but leaves a bitter taste anyway. Also I pick DT patches out of -rc releases for U-Boot, and did so internally already, so it's not without churns.
I'd say that new stuff shouldn't really be considered stable until it is actually released, hence why I wanted to get this series merged now. Picking from an -rc release is a tradeoff of getting new stuff faster vs having something changed or reverted during the -rc process. I'm sorry that it went the other way this time.
Quoted 1 line
So is this really necessary, and what is the purpose of this patch?
It's really about aligning the names used throughout the kernel with the ones seen in the datasheet.
Quoted 3 lines
I am fine with using GMAC for the GMAC200 part in the SoC, but the A64, H6, H616, A133 all use the same IP - as the fallback compatible proves - and they call it all EMAC.
There's also an EMAC in the A10 and A20 that only does up to 100 Mbps, and there's no lineage there. Also, not all datasheets for SoCs with this gigabit-capable EMAC call it the EMAC. Off the top of my head, I believe the R40 calls it the GMAC. And the R40's compatible string in this binding even uses the string "gmac".
So it's really whatever Allwinner wants to call it. I would rather have the names follow the datasheet than us making some scheme up. We just have to remember that this funky gigabit-capable Ethernet controller is this piece of hardware.
Hope that explains things.
Thanks
ChenYu
Quoted 42 lines
That's not a NAK, but just wanted to bring this up.
Cheers,
Andre.Quoted 36 lines
When support of the hardware was introduced, the name chosen was "EMAC", which followed previous generations. However the datasheets use the name "GMAC" instead, likely because there is another "GMAC" based on a newer DWMAC IP.
The first patch fixes the compatible string entry in the device tree binding.
The second patch fixes all references in the existing device trees.
Since this was introduced in v6.16-rc1, I hope to land this for v6.16 as well.
There's a small conflict in patch one around the patch context with
dt-bindings: net: sun8i-emac: Add A100 EMAC compatible
that just landed in net-next today. I will leave this patch to the net mainainers to merge to avoid making a bigger mess. Once that is landed I will merge the second patch through the sunxi tree.
Thanks
ChenYuChen-Yu Tsai (2):
dt-bindings: net: sun8i-emac: Rename A523 EMAC0 to GMAC0
arm64: dts: allwinner: a523: Rename emac0 to gmac0.../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml | 2 +- arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 6 +++--- arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts | 4 ++-- arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)
Quoted 2 lines
So it's really whatever Allwinner wants to call it. I would rather have the names follow the datasheet than us making some scheme up.
Are the datasheets publicly available?
Andrew
On Sat, 5 Jul 2025 17:53:17 +0200
Andrew Lunn <[email protected]> wrote:
Hi Andrew,
Quoted 4 lines
Quoted 2 lines
So it's really whatever Allwinner wants to call it. I would rather have the names follow the datasheet than us making some scheme up.
Are the datasheets publicly available?
We collect them in the sunxi wiki (see the links below), but just to make sure:
I am not disputing that GMAC is the name mentioned in the A523 manual, and would have probably been the right name to use originally - even though it's not very consistent, as the same IP is called EMAC in the older SoCs' manuals. I am also not against renaming identifiers or even (internal) DT labels. But the problem here is that the renaming affects the DT compatible string and the pinctrl function name, both of which are used as an interface between the devicetree and its users, which is not only the Linux kernel, but also U-Boot and other OSes like the BSDs.
In this particular case we would probably get away with it, because it's indeed very early in the development cycle for this SoC, but for instance the "emac0" function name is already used in some U-Boot patch series on the list:
https://lore.kernel.org/linux-sunxi/[email protected]/
If we REALLY need to rename this, it wouldn't be the end of the world, but would create some churn on the U-Boot side.
I just wanted to point out that any changes to the DT bindings have some impact to other projects, even if they are proposed as a coherent series on the Linux side. Hence my question if this is really necessary.
Cheers,
Andre
https://linux-sunxi.org/A64#Documentation
https://linux-sunxi.org/H616#Documentation
https://linux-sunxi.org/A523#Documentation
Quoted 5 lines · Andre Przywara
On Sat, 5 Jul 2025 17:53:17 +0200
Andrew Lunn <[email protected]> wrote:Hi Andrew,
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
So it's really whatever Allwinner wants to call it. I would rather have the names follow the datasheet than us making some scheme up.
Are the datasheets publicly available?
We collect them in the sunxi wiki (see the links below), but just to make sure:
O.K. The point i was trying to make is that some vendors datasheets are not public, or very restricted, and so names don't matter, since nobody has the datasheets. But if they are open, names are more relevant.
I do agree that stuff can be changed when it is in an -rcX kernel. However, it needs to be well justified, ABI related, or very broken.
Since this is ABI, it could be changed. But i don't want to make the decision of if it should be changed.
Andrew
Chen-Yu Tsai
maintainerQuoted 11 lines · Andre Przywara
On Sat, 5 Jul 2025 17:53:17 +0200
Andrew Lunn <[email protected]> wrote:Hi Andrew,
Quoted 4 lines
Quoted 2 lines
So it's really whatever Allwinner wants to call it. I would rather have the names follow the datasheet than us making some scheme up.
Are the datasheets publicly available?
Quoted 10 lines
We collect them in the sunxi wiki (see the links below), but just to make sure:
I am not disputing that GMAC is the name mentioned in the A523 manual, and would have probably been the right name to use originally - even though it's not very consistent, as the same IP is called EMAC in the older SoCs' manuals. I am also not against renaming identifiers or even (internal) DT labels. But the problem here is that the renaming affects the DT compatible string and the pinctrl function name, both of which are used as an interface between the devicetree and its users, which is not only the Linux kernel, but also U-Boot and other OSes like the BSDs.
I reiterate my position: they are not stable until they actually hit a release. This provides some time to fix mistakes before they are set in stone.
Quoted 6 lines
In this particular case we would probably get away with it, because it's indeed very early in the development cycle for this SoC, but for instance the "emac0" function name is already used in some U-Boot patch series on the list:
https://lore.kernel.org/linux-sunxi/[email protected]/
Quoted 6 lines
If we REALLY need to rename this, it wouldn't be the end of the world, but would create some churn on the U-Boot side.
I just wanted to point out that any changes to the DT bindings have some impact to other projects, even if they are proposed as a coherent series on the Linux side. Hence my question if this is really necessary.
For the compatible string, I can live with having a comment in the binding stating the name used in the datasheet for reference.
For the pinctrl stuff, which is the contentious bit here, I thought the whole idea of the newer pinctrl bindings is that the driver uses "allwinner,pinmux" instead of "function". I think having both being valid is confusing, and likely to cause conflicts later on. If we're going to use the hardware register values in the device tree, I'd really like them to be the only source of truth. The commit message for the binding also sort of suggests that "allwinner,pinmux" is the part that matters.
ChenYu
On Sun, 6 Jul 2025 21:14:09 +0800
Chen-Yu Tsai <[email protected]> wrote:
Hi,
Quoted 36 lines · Andre Przywara
Quoted 11 lines
On Sat, 5 Jul 2025 17:53:17 +0200
Andrew Lunn <[email protected]> wrote:Hi Andrew,
Quoted 4 lines
Quoted 2 lines
So it's really whatever Allwinner wants to call it. I would rather have the names follow the datasheet than us making some scheme up.
Are the datasheets publicly available?
Quoted 10 lines
We collect them in the sunxi wiki (see the links below), but just to make sure:
I am not disputing that GMAC is the name mentioned in the A523 manual, and would have probably been the right name to use originally - even though it's not very consistent, as the same IP is called EMAC in the older SoCs' manuals. I am also not against renaming identifiers or even (internal) DT labels. But the problem here is that the renaming affects the DT compatible string and the pinctrl function name, both of which are used as an interface between the devicetree and its users, which is not only the Linux kernel, but also U-Boot and other OSes like the BSDs.I reiterate my position: they are not stable until they actually hit a release. This provides some time to fix mistakes before they are set in stone.
Quoted 9 lines
In this particular case we would probably get away with it, because it's indeed very early in the development cycle for this SoC, but for instance the "emac0" function name is already used in some U-Boot patch series on the list:
https://lore.kernel.org/linux-sunxi/[email protected]/If we REALLY need to rename this, it wouldn't be the end of the world, but would create some churn on the U-Boot side.
Quoted 6 lines
Quoted 3 lines
I just wanted to point out that any changes to the DT bindings have some impact to other projects, even if they are proposed as a coherent series on the Linux side. Hence my question if this is really necessary.
For the compatible string, I can live with having a comment in the binding stating the name used in the datasheet for reference.
For the compatible string going with a fallback name, I can live with renaming it ;-)
Quoted 7 lines
For the pinctrl stuff, which is the contentious bit here, I thought the whole idea of the newer pinctrl bindings is that the driver uses "allwinner,pinmux" instead of "function". I think having both being valid is confusing, and likely to cause conflicts later on. If we're going to use the hardware register values in the device tree, I'd really like them to be the only source of truth. The commit message for the binding also sort of suggests that "allwinner,pinmux" is the part that matters.
Yes, it should be, but it turns out to be convenient for U-Boot to continue using the old method - until someone writes a driver for the new schema. And a function name is still mandatory, it's just mostly for reference now (so would indeed be fine to rename).
So if you really insist on this: please go ahead and merge it, so that the 6.16 release contains the new name.
But please note my silent protest about those cosmetic name changes in the DT realm, which establishes an interface reaching beyond just the Linux kernel. When it comes to new boards, the U-Boot DT sync process is rather slow, so I really am eager to cherry-pick -rc1 DTs already, instead of waiting another 7 weeks - which bites me in this case. It's not merged yet, so is fine in this case, but I would really like to avoid similar hiccups in the future.
Cheers,
Andre.
Chen-Yu Tsai
maintainerQuoted 60 lines · Andre Przywara
On Sun, 6 Jul 2025 21:14:09 +0800
Chen-Yu Tsai <[email protected]> wrote:Hi,
Quoted 36 lines · Andre Przywara
Quoted 11 lines
On Sat, 5 Jul 2025 17:53:17 +0200
Andrew Lunn <[email protected]> wrote:Hi Andrew,
Quoted 4 lines
Quoted 2 lines
So it's really whatever Allwinner wants to call it. I would rather have the names follow the datasheet than us making some scheme up.
Are the datasheets publicly available?
Quoted 10 lines
We collect them in the sunxi wiki (see the links below), but just to make sure:
I am not disputing that GMAC is the name mentioned in the A523 manual, and would have probably been the right name to use originally - even though it's not very consistent, as the same IP is called EMAC in the older SoCs' manuals. I am also not against renaming identifiers or even (internal) DT labels. But the problem here is that the renaming affects the DT compatible string and the pinctrl function name, both of which are used as an interface between the devicetree and its users, which is not only the Linux kernel, but also U-Boot and other OSes like the BSDs.I reiterate my position: they are not stable until they actually hit a release. This provides some time to fix mistakes before they are set in stone.
Quoted 9 lines
In this particular case we would probably get away with it, because it's indeed very early in the development cycle for this SoC, but for instance the "emac0" function name is already used in some U-Boot patch series on the list:
https://lore.kernel.org/linux-sunxi/[email protected]/If we REALLY need to rename this, it wouldn't be the end of the world, but would create some churn on the U-Boot side.
Quoted 6 lines
Quoted 3 lines
I just wanted to point out that any changes to the DT bindings have some impact to other projects, even if they are proposed as a coherent series on the Linux side. Hence my question if this is really necessary.
For the compatible string, I can live with having a comment in the binding stating the name used in the datasheet for reference.
For the compatible string going with a fallback name, I can live with renaming it ;-)
Quoted 7 lines
For the pinctrl stuff, which is the contentious bit here, I thought the whole idea of the newer pinctrl bindings is that the driver uses "allwinner,pinmux" instead of "function". I think having both being valid is confusing, and likely to cause conflicts later on. If we're going to use the hardware register values in the device tree, I'd really like them to be the only source of truth. The commit message for the binding also sort of suggests that "allwinner,pinmux" is the part that matters.
Quoted 4 lines
Yes, it should be, but it turns out to be convenient for U-Boot to continue using the old method - until someone writes a driver for the new schema. And a function name is still mandatory, it's just mostly for reference now (so would indeed be fine to rename).
Hmm. Could we somehow make it clear in the binding that the function name is for reference only?
Quoted 2 lines
So if you really insist on this: please go ahead and merge it, so that the 6.16 release contains the new name.
I'm afraid I insist.
I think we still need an ack from the DT maintainers though, and then the binding change would go through the net tree?
Quoted 7 lines
But please note my silent protest about those cosmetic name changes in the DT realm, which establishes an interface reaching beyond just the Linux kernel. When it comes to new boards, the U-Boot DT sync process is rather slow, so I really am eager to cherry-pick -rc1 DTs already, instead of waiting another 7 weeks - which bites me in this case. It's not merged yet, so is fine in this case, but I would really like to avoid similar hiccups in the future.
Noted. I will try to be more vigilant during the review process.
Thanks
ChenYu
Paolo Abeni
maintainerQuoted 8 lines · Chen-Yu Tsai
Quoted 2 lines · Andre Przywara
So if you really insist on this: please go ahead and merge it, so that the 6.16 release contains the new name.
I'm afraid I insist.
I think we still need an ack from the DT maintainers though, and then the binding change would go through the net tree?
Note that such ack could require a bit of time more, as there are a few patches in the DT backlog.
/P
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Sat, 28 Jun 2025 13:44:36 +0800 you wrote:
From: Chen-Yu Tsai <[email protected]>
Hi folks,
This small series aims to align the name of the first ethernet controller found on the Allwinner A523 SoC family with the name found in the datasheets. It renames the compatible string and any other references from "emac0" to "gmac0".
[...]
Here is the summary with links:
- [net,1/2] dt-bindings: net: sun8i-emac: Rename A523 EMAC0 to GMAC0
https://git.kernel.org/netdev/net/c/b3603c0466a8
- [net,2/2] arm64: dts: allwinner: a523: Rename emac0 to gmac0 (no matching commit)
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Re: (subset) [PATCH net 0/2] allwinner: a523: Rename emac0 to gmac0
In reply to Chen-Yu TsaiQuoted 10 lines · Chen-Yu Tsai
From: Chen-Yu Tsai <[email protected]>
Hi folks,
This small series aims to align the name of the first ethernet controller found on the Allwinner A523 SoC family with the name found in the datasheets. It renames the compatible string and any other references from "emac0" to "gmac0".
[...]
Applied to sunxi/fixes-for-6.16 in local tree, thanks!
[2/2] arm64: dts: allwinner: a523: Rename emac0 to gmac0
commit: a46b4822bed08d15a856966357a4b12273751cd3
Best regards,
Signature · 1 line
Chen-Yu Tsai <[email protected]>