* [PATCH net-next v2 0/2] net: stmmac: add Allwinner H616 EMAC1 support
@ 2026-09-16 3:07 James Hilliard
2026-09-16 3:07 ` [PATCH net-next v2 1/2] dt-bindings: net: allwinner: add H616 EMAC1 James Hilliard
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: James Hilliard @ 2026-09-16 3:07 UTC (permalink / raw)
To: Richard Genoud, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Alexandre Torgue, Giuseppe Cavallaro, Jose Abreu,
Maxime Chevallier, Maxime Coquelin
Cc: Maxime Ripard, netdev, devicetree, linux-arm-kernel, linux-sunxi,
linux-kernel, linux-stm32, James Hilliard
The H616 secondary EMAC supports RMII at 10/100 Mbps and uses a separate
system-control clock register at offset 0x34. Add its binding and a
sun8i stmmac variant using that register. A distinct compatible without
an older fallback prevents the driver from using EMAC0's clock register.
EMAC1 connects internally to the co-packaged AC200 or AC300 EPHY and has
no external PHY pins. Leave PHY initialization to the PHY driver instead
of using the H3 internal-PHY controls. The RMII-only variant does not
expose the RGMII clock-delay properties.
The AC200/AC300 EPHY driver and package bindings are already in
net-next. This series separates the H616 EMAC1 MAC driver and binding
support from the earlier combined series. PWM, MFD and device-tree
enablement are being handled separately.
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
Changes in v2:
- Drop EMAC1 TX/RX clock-delay property support and keep the existing
RGMII-only delay descriptions unchanged, as requested by Maxime Ripard.
- Clarify that EMAC1 connects internally to a co-packaged PHY, not an
external PHY or the H3-style internal-PHY controls.
- Rebase onto current net-next.
- Link to v1: https://patch.msgid.link/20260915-submit-h616-emac1-v1-v1-0-195de0bb1f8a@gmail.com
---
James Hilliard (2):
dt-bindings: net: allwinner: add H616 EMAC1
net: stmmac: sun8i: add support for Allwinner H616 EMAC1
.../bindings/net/allwinner,sun8i-a83t-emac.yaml | 13 +++++++++++++
Documentation/devicetree/bindings/net/snps,dwmac.yaml | 2 ++
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 16 ++++++++++++++++
3 files changed, 31 insertions(+)
---
base-commit: 87b80c2f6b05cad9f0ff9136709c62a0f59923e3
change-id: 20260914-submit-h616-emac1-v1-143703842abb
Best regards,
--
James Hilliard <james.hilliard1@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH net-next v2 1/2] dt-bindings: net: allwinner: add H616 EMAC1 2026-09-16 3:07 [PATCH net-next v2 0/2] net: stmmac: add Allwinner H616 EMAC1 support James Hilliard @ 2026-09-16 3:07 ` James Hilliard 2026-09-16 7:25 ` Andre Przywara 2026-09-16 3:07 ` [PATCH net-next v2 2/2] net: stmmac: sun8i: add support for Allwinner " James Hilliard 2026-09-16 7:59 ` [PATCH net-next v2 0/2] net: stmmac: add Allwinner H616 EMAC1 support Maxime Chevallier 2 siblings, 1 reply; 6+ messages in thread From: James Hilliard @ 2026-09-16 3:07 UTC (permalink / raw) To: Richard Genoud, Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Alexandre Torgue, Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier, Maxime Coquelin Cc: Maxime Ripard, netdev, devicetree, linux-arm-kernel, linux-sunxi, linux-kernel, linux-stm32, James Hilliard The H616 secondary EMAC uses a separate system-control clock register and supports only RMII at 10/100 Mbps. Add its distinct compatible without an older fallback, since using the primary EMAC clock register would not work. Constrain the PHY interface mode to RMII, matching the hardware. Signed-off-by: Richard Genoud <richard.genoud@bootlin.com> Signed-off-by: James Hilliard <james.hilliard1@gmail.com> --- .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml | 13 +++++++++++++ Documentation/devicetree/bindings/net/snps,dwmac.yaml | 2 ++ 2 files changed, 15 insertions(+) diff --git a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml index 323a669fa982..2cae0133b3cd 100644 --- a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml +++ b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml @@ -21,6 +21,7 @@ select: - allwinner,sun8i-r40-gmac - allwinner,sun8i-v3s-emac - allwinner,sun50i-a64-emac + - allwinner,sun50i-h616-emac1 - allwinner,sun55i-a523-gmac200 required: - compatible @@ -33,6 +34,7 @@ properties: - const: allwinner,sun8i-r40-gmac - const: allwinner,sun8i-v3s-emac - const: allwinner,sun50i-a64-emac + - const: allwinner,sun50i-h616-emac1 - items: - enum: - allwinner,sun20i-d1-emac @@ -91,6 +93,17 @@ required: allOf: - $ref: snps,dwmac.yaml# + - if: + properties: + compatible: + contains: + const: allwinner,sun50i-h616-emac1 + + then: + properties: + phy-mode: + const: rmii + - if: properties: compatible: diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 2ed4564ae99d..b20149c3e850 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -57,6 +57,7 @@ properties: - allwinner,sun8i-r40-gmac - allwinner,sun8i-v3s-emac - allwinner,sun50i-a64-emac + - allwinner,sun50i-h616-emac1 - amlogic,meson6-dwmac - amlogic,meson8b-dwmac - amlogic,meson8m2-dwmac @@ -623,6 +624,7 @@ allOf: - allwinner,sun8i-r40-gmac - allwinner,sun8i-v3s-emac - allwinner,sun50i-a64-emac + - allwinner,sun50i-h616-emac1 - loongson,ls2k-dwmac - loongson,ls7a-dwmac - ingenic,jz4775-mac -- 2.53.0 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2 1/2] dt-bindings: net: allwinner: add H616 EMAC1 2026-09-16 3:07 ` [PATCH net-next v2 1/2] dt-bindings: net: allwinner: add H616 EMAC1 James Hilliard @ 2026-09-16 7:25 ` Andre Przywara 2026-09-16 7:36 ` James Hilliard 0 siblings, 1 reply; 6+ messages in thread From: Andre Przywara @ 2026-09-16 7:25 UTC (permalink / raw) To: James Hilliard, Richard Genoud, Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Alexandre Torgue, Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier, Maxime Coquelin Cc: Maxime Ripard, netdev, devicetree, linux-arm-kernel, linux-sunxi, linux-kernel, linux-stm32 Hi, On 9/16/26 05:07, James Hilliard wrote: > The H616 secondary EMAC uses a separate system-control clock register > and supports only RMII at 10/100 Mbps. Add its distinct compatible > without an older fallback, since using the primary EMAC clock register > would not work. > > Constrain the PHY interface mode to RMII, matching the hardware. > > Signed-off-by: Richard Genoud <richard.genoud@bootlin.com> Where does this come from? If Richard is the author, then please reflect this in the patch (git commit --amend --author ...), so a From: line appears in the body of the email. If not, it's unclear why this line is here. The actual patch looks good to me: Reviewed-by: Andre Przywara <andre.przywara@arm.com> Cheers, Andre > Signed-off-by: James Hilliard <james.hilliard1@gmail.com> > --- > .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml | 13 +++++++++++++ > Documentation/devicetree/bindings/net/snps,dwmac.yaml | 2 ++ > 2 files changed, 15 insertions(+) > > diff --git a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml > index 323a669fa982..2cae0133b3cd 100644 > --- a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml > +++ b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml > @@ -21,6 +21,7 @@ select: > - allwinner,sun8i-r40-gmac > - allwinner,sun8i-v3s-emac > - allwinner,sun50i-a64-emac > + - allwinner,sun50i-h616-emac1 > - allwinner,sun55i-a523-gmac200 > required: > - compatible > @@ -33,6 +34,7 @@ properties: > - const: allwinner,sun8i-r40-gmac > - const: allwinner,sun8i-v3s-emac > - const: allwinner,sun50i-a64-emac > + - const: allwinner,sun50i-h616-emac1 > - items: > - enum: > - allwinner,sun20i-d1-emac > @@ -91,6 +93,17 @@ required: > > allOf: > - $ref: snps,dwmac.yaml# > + - if: > + properties: > + compatible: > + contains: > + const: allwinner,sun50i-h616-emac1 > + > + then: > + properties: > + phy-mode: > + const: rmii > + > - if: > properties: > compatible: > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml > index 2ed4564ae99d..b20149c3e850 100644 > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml > @@ -57,6 +57,7 @@ properties: > - allwinner,sun8i-r40-gmac > - allwinner,sun8i-v3s-emac > - allwinner,sun50i-a64-emac > + - allwinner,sun50i-h616-emac1 > - amlogic,meson6-dwmac > - amlogic,meson8b-dwmac > - amlogic,meson8m2-dwmac > @@ -623,6 +624,7 @@ allOf: > - allwinner,sun8i-r40-gmac > - allwinner,sun8i-v3s-emac > - allwinner,sun50i-a64-emac > + - allwinner,sun50i-h616-emac1 > - loongson,ls2k-dwmac > - loongson,ls7a-dwmac > - ingenic,jz4775-mac > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2 1/2] dt-bindings: net: allwinner: add H616 EMAC1 2026-09-16 7:25 ` Andre Przywara @ 2026-09-16 7:36 ` James Hilliard 0 siblings, 0 replies; 6+ messages in thread From: James Hilliard @ 2026-09-16 7:36 UTC (permalink / raw) To: Andre Przywara Cc: Richard Genoud, Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Alexandre Torgue, Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier, Maxime Coquelin, Maxime Ripard, netdev, devicetree, linux-arm-kernel, linux-sunxi, linux-kernel, linux-stm32 On Wed, Sep 16, 2026 at 1:26 AM Andre Przywara <andre.przywara@arm.com> wrote: > > Hi, > > On 9/16/26 05:07, James Hilliard wrote: > > The H616 secondary EMAC uses a separate system-control clock register > > and supports only RMII at 10/100 Mbps. Add its distinct compatible > > without an older fallback, since using the primary EMAC clock register > > would not work. > > > > Constrain the PHY interface mode to RMII, matching the hardware. > > > > Signed-off-by: Richard Genoud <richard.genoud@bootlin.com> > > Where does this come from? If Richard is the author, then please reflect > this in the patch (git commit --amend --author ...), so a From: line > appears in the body of the email. > If not, it's unclear why this line is here. This was loosely based off of a patch he wrote I guess, although it has diverged a good bit so maybe should just drop it, idk. > > The actual patch looks good to me: > > Reviewed-by: Andre Przywara <andre.przywara@arm.com> > > Cheers, > Andre > > > Signed-off-by: James Hilliard <james.hilliard1@gmail.com> > > --- > > .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml | 13 +++++++++++++ > > Documentation/devicetree/bindings/net/snps,dwmac.yaml | 2 ++ > > 2 files changed, 15 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml > > index 323a669fa982..2cae0133b3cd 100644 > > --- a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml > > +++ b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml > > @@ -21,6 +21,7 @@ select: > > - allwinner,sun8i-r40-gmac > > - allwinner,sun8i-v3s-emac > > - allwinner,sun50i-a64-emac > > + - allwinner,sun50i-h616-emac1 > > - allwinner,sun55i-a523-gmac200 > > required: > > - compatible > > @@ -33,6 +34,7 @@ properties: > > - const: allwinner,sun8i-r40-gmac > > - const: allwinner,sun8i-v3s-emac > > - const: allwinner,sun50i-a64-emac > > + - const: allwinner,sun50i-h616-emac1 > > - items: > > - enum: > > - allwinner,sun20i-d1-emac > > @@ -91,6 +93,17 @@ required: > > > > allOf: > > - $ref: snps,dwmac.yaml# > > + - if: > > + properties: > > + compatible: > > + contains: > > + const: allwinner,sun50i-h616-emac1 > > + > > + then: > > + properties: > > + phy-mode: > > + const: rmii > > + > > - if: > > properties: > > compatible: > > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml > > index 2ed4564ae99d..b20149c3e850 100644 > > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml > > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml > > @@ -57,6 +57,7 @@ properties: > > - allwinner,sun8i-r40-gmac > > - allwinner,sun8i-v3s-emac > > - allwinner,sun50i-a64-emac > > + - allwinner,sun50i-h616-emac1 > > - amlogic,meson6-dwmac > > - amlogic,meson8b-dwmac > > - amlogic,meson8m2-dwmac > > @@ -623,6 +624,7 @@ allOf: > > - allwinner,sun8i-r40-gmac > > - allwinner,sun8i-v3s-emac > > - allwinner,sun50i-a64-emac > > + - allwinner,sun50i-h616-emac1 > > - loongson,ls2k-dwmac > > - loongson,ls7a-dwmac > > - ingenic,jz4775-mac > > > ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next v2 2/2] net: stmmac: sun8i: add support for Allwinner H616 EMAC1 2026-09-16 3:07 [PATCH net-next v2 0/2] net: stmmac: add Allwinner H616 EMAC1 support James Hilliard 2026-09-16 3:07 ` [PATCH net-next v2 1/2] dt-bindings: net: allwinner: add H616 EMAC1 James Hilliard @ 2026-09-16 3:07 ` James Hilliard 2026-09-16 7:59 ` [PATCH net-next v2 0/2] net: stmmac: add Allwinner H616 EMAC1 support Maxime Chevallier 2 siblings, 0 replies; 6+ messages in thread From: James Hilliard @ 2026-09-16 3:07 UTC (permalink / raw) To: Richard Genoud, Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Alexandre Torgue, Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier, Maxime Coquelin Cc: Maxime Ripard, netdev, devicetree, linux-arm-kernel, linux-sunxi, linux-kernel, linux-stm32, James Hilliard The H616 secondary EMAC uses a separate system-control clock register and supports only RMII at 10/100 Mbps. It connects internally to the co-packaged AC200 or AC300 EPHY and has no external PHY pins. Add an EMAC1 variant using the dedicated register and enable only RMII. Leave PHY initialization to the PHY driver instead of using the H3 internal-PHY controls. No RX or TX clock delays are configured for this RMII-only variant. Co-developed-by: Richard Genoud <richard.genoud@bootlin.com> Signed-off-by: Richard Genoud <richard.genoud@bootlin.com> Signed-off-by: James Hilliard <james.hilliard1@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 48c52eb96233..e8f86df50060 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -81,6 +81,13 @@ static const struct reg_field sun8i_syscon_reg_field = { .msb = 31, }; +/* EMAC1 clock register @ 0x34 in the "system control" address range */ +static const struct reg_field sun8i_syscon_reg_field_emac1 = { + .reg = 0x34, + .lsb = 0, + .msb = 31, +}; + /* EMAC clock register @ 0x164 in the CCU address range */ static const struct reg_field sun8i_ccu_reg_field = { .reg = 0x164, @@ -143,6 +150,13 @@ static const struct emac_variant emac_variant_h6 = { .tx_delay_max = 7, }; +static const struct emac_variant emac_variant_h616_emac1 = { + .syscon_field = &sun8i_syscon_reg_field_emac1, + /* The co-packaged AC200/AC300 PHY does not use the H3 PHY controls. */ + .soc_has_internal_phy = false, + .support_rmii = true, +}; + #define EMAC_BASIC_CTL0 0x00 #define EMAC_BASIC_CTL1 0x04 #define EMAC_INT_STA 0x08 @@ -1278,6 +1292,8 @@ static const struct of_device_id sun8i_dwmac_match[] = { .data = &emac_variant_a64 }, { .compatible = "allwinner,sun50i-h6-emac", .data = &emac_variant_h6 }, + { .compatible = "allwinner,sun50i-h616-emac1", + .data = &emac_variant_h616_emac1 }, { } }; MODULE_DEVICE_TABLE(of, sun8i_dwmac_match); -- 2.53.0 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2 0/2] net: stmmac: add Allwinner H616 EMAC1 support 2026-09-16 3:07 [PATCH net-next v2 0/2] net: stmmac: add Allwinner H616 EMAC1 support James Hilliard 2026-09-16 3:07 ` [PATCH net-next v2 1/2] dt-bindings: net: allwinner: add H616 EMAC1 James Hilliard 2026-09-16 3:07 ` [PATCH net-next v2 2/2] net: stmmac: sun8i: add support for Allwinner " James Hilliard @ 2026-09-16 7:59 ` Maxime Chevallier 2 siblings, 0 replies; 6+ messages in thread From: Maxime Chevallier @ 2026-09-16 7:59 UTC (permalink / raw) To: James Hilliard, Richard Genoud, Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Alexandre Torgue, Giuseppe Cavallaro, Jose Abreu, Maxime Coquelin, Alastair D'Silva Cc: Maxime Ripard, netdev, devicetree, linux-arm-kernel, linux-sunxi, linux-kernel, linux-stm32 Hi, On 9/16/26 05:07, James Hilliard wrote: > The H616 secondary EMAC supports RMII at 10/100 Mbps and uses a separate > system-control clock register at offset 0x34. Add its binding and a > sun8i stmmac variant using that register. A distinct compatible without > an older fallback prevents the driver from using EMAC0's clock register. > > EMAC1 connects internally to the co-packaged AC200 or AC300 EPHY and has > no external PHY pins. Leave PHY initialization to the PHY driver instead > of using the H3 internal-PHY controls. The RMII-only variant does not > expose the RGMII clock-delay properties. > > The AC200/AC300 EPHY driver and package bindings are already in > net-next. This series separates the H616 EMAC1 MAC driver and binding > support from the earlier combined series. PWM, MFD and device-tree > enablement are being handled separately. > > Signed-off-by: James Hilliard <james.hilliard1@gmail.com> > --- > Changes in v2: > - Drop EMAC1 TX/RX clock-delay property support and keep the existing > RGMII-only delay descriptions unchanged, as requested by Maxime Ripard. > - Clarify that EMAC1 connects internally to a co-packaged PHY, not an > external PHY or the H3-style internal-PHY controls. > - Rebase onto current net-next. > - Link to v1: https://patch.msgid.link/20260915-submit-h616-emac1-v1-v1-0-195de0bb1f8a@gmail.com I didn't see that V2, but in all fairness you're not supposed to iterate this fast. 24 hours between submissions, please : https://docs.kernel.org/process/maintainer-netdev.html There were discussions on Alastair's submission too, the MUX, clock, reset part. Adding Alastair so that he can test it on his board, and see what's missing. Maxime ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-09-16 7:59 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-09-16 3:07 [PATCH net-next v2 0/2] net: stmmac: add Allwinner H616 EMAC1 support James Hilliard 2026-09-16 3:07 ` [PATCH net-next v2 1/2] dt-bindings: net: allwinner: add H616 EMAC1 James Hilliard 2026-09-16 7:25 ` Andre Przywara 2026-09-16 7:36 ` James Hilliard 2026-09-16 3:07 ` [PATCH net-next v2 2/2] net: stmmac: sun8i: add support for Allwinner " James Hilliard 2026-09-16 7:59 ` [PATCH net-next v2 0/2] net: stmmac: add Allwinner H616 EMAC1 support Maxime Chevallier
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®