* [RFC PATCH v2 1/7] net: stmmac: dwmac-meson8b: let the controller apply the RGMII delays
2026-10-07 8:26 [RFC PATCH v2 0/7] Add ethernet support for the Amlogic T7 Lucas Tanure
@ 2026-10-07 8:26 ` Lucas Tanure
2026-10-07 12:58 ` Andrew Lunn
2026-10-07 8:26 ` [RFC PATCH v2 2/7] dt-bindings: net: amlogic,meson-dwmac: list the compatible combinations Lucas Tanure
` (6 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Lucas Tanure @ 2026-10-07 8:26 UTC (permalink / raw)
To: xianwei.zhao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Chevallier, Maxime Coquelin,
Alexandre Torgue
Cc: netdev, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
RGMII needs a delay on each of its two clocks. A board can get it from
the length of its tracks, from the PHY, or from the controller.
"rgmii-id" in the device tree says the delay is added inside the chips
but not which chip adds it, and the generic tx-internal-delay-ps and
rx-internal-delay-ps properties name the controller.
This driver ignored those properties. In the "-id" modes it switched
its own delays off and left the whole job to the PHY, so a board that
asks the controller for one of them does not get it, and a board whose
PHY cannot supply that delay has no usable link at all.
Boards not using those properties behave as before.
Assisted-by: LLM
Signed-off-by: Lucas Tanure <tanure@linux.com>
---
.../ethernet/stmicro/stmmac/dwmac-meson8b.c | 46 ++++++++++++++++++-
1 file changed, 44 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
index e4d5c41294f4..d73dfd0ac167 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
@@ -92,6 +92,8 @@ struct meson8b_dwmac {
struct clk *rgmii_tx_clk;
u32 tx_delay_ns;
u32 rx_delay_ps;
+ bool mac_tx_delay;
+ bool mac_rx_delay;
struct clk *timing_adj_clk;
};
@@ -299,6 +301,22 @@ static int meson8b_init_rgmii_delays(struct meson8b_dwmac *dwmac)
delay_config = rx_adj_config;
break;
case PHY_INTERFACE_MODE_RGMII_ID:
+ /*
+ * "rgmii-id" only says the delays are internal, not which
+ * side applies them. The *-internal-delay-ps properties say
+ * it is this controller, so leave ours switched on.
+ */
+ if (dwmac->mac_tx_delay || dwmac->mac_rx_delay) {
+ delay_config = 0;
+ if (dwmac->mac_tx_delay)
+ delay_config |= tx_dly_config;
+ if (dwmac->mac_rx_delay)
+ delay_config |= rx_adj_config;
+ else
+ cfg_rxclk_dly = 0;
+ break;
+ }
+ fallthrough;
case PHY_INTERFACE_MODE_RMII:
delay_config = 0;
cfg_rxclk_dly = 0;
@@ -384,6 +402,7 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
struct plat_stmmacenet_data *plat_dat;
struct stmmac_resources stmmac_res;
struct meson8b_dwmac *dwmac;
+ u32 tx_delay_ps;
int ret;
ret = stmmac_get_platform_resources(pdev, &stmmac_res);
@@ -409,9 +428,13 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
dwmac->dev = &pdev->dev;
dwmac->phy_mode = plat_dat->phy_interface;
+ /* the generic property is preferred over the vendor one */
+ if (!of_property_read_u32(pdev->dev.of_node, "tx-internal-delay-ps",
+ &tx_delay_ps))
+ dwmac->tx_delay_ns = tx_delay_ps / 1000;
/* use 2ns as fallback since this value was previously hardcoded */
- if (of_property_read_u32(pdev->dev.of_node, "amlogic,tx-delay-ns",
- &dwmac->tx_delay_ns))
+ else if (of_property_read_u32(pdev->dev.of_node, "amlogic,tx-delay-ns",
+ &dwmac->tx_delay_ns))
dwmac->tx_delay_ns = 2;
/* RX delay defaults to 0ps since this is what many boards use */
@@ -424,6 +447,25 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
dwmac->rx_delay_ps *= 1000;
}
+ /*
+ * Each property names one clock this controller delays itself. The
+ * PHY must be asked for whatever is left, or the two would delay the
+ * same clock and push it past the window.
+ */
+ dwmac->mac_tx_delay = of_property_present(pdev->dev.of_node,
+ "tx-internal-delay-ps");
+ dwmac->mac_rx_delay = of_property_present(pdev->dev.of_node,
+ "rx-internal-delay-ps");
+
+ if (dwmac->phy_mode == PHY_INTERFACE_MODE_RGMII_ID) {
+ if (dwmac->mac_tx_delay && dwmac->mac_rx_delay)
+ plat_dat->phy_interface = PHY_INTERFACE_MODE_RGMII;
+ else if (dwmac->mac_tx_delay)
+ plat_dat->phy_interface = PHY_INTERFACE_MODE_RGMII_RXID;
+ else if (dwmac->mac_rx_delay)
+ plat_dat->phy_interface = PHY_INTERFACE_MODE_RGMII_TXID;
+ }
+
if (dwmac->data->has_prg_eth1_rgmii_rx_delay) {
if (dwmac->rx_delay_ps > 3000 || dwmac->rx_delay_ps % 200) {
dev_err(dwmac->dev,
--
2.56.0
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [RFC PATCH v2 1/7] net: stmmac: dwmac-meson8b: let the controller apply the RGMII delays
2026-10-07 8:26 ` [RFC PATCH v2 1/7] net: stmmac: dwmac-meson8b: let the controller apply the RGMII delays Lucas Tanure
@ 2026-10-07 12:58 ` Andrew Lunn
0 siblings, 0 replies; 19+ messages in thread
From: Andrew Lunn @ 2026-10-07 12:58 UTC (permalink / raw)
To: Lucas Tanure
Cc: xianwei.zhao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Chevallier, Maxime Coquelin,
Alexandre Torgue, netdev, devicetree, linux-arm-kernel,
linux-amlogic, linux-kernel
On Wed, Oct 07, 2026 at 09:26:21AM +0100, Lucas Tanure wrote:
> RGMII needs a delay on each of its two clocks. A board can get it from
> the length of its tracks, from the PHY, or from the controller.
> "rgmii-id" in the device tree says the delay is added inside the chips
> but not which chip adds it, and the generic tx-internal-delay-ps and
> rx-internal-delay-ps properties name the controller.
>
> This driver ignored those properties. In the "-id" modes it switched
> its own delays off and left the whole job to the PHY, so a board that
> asks the controller for one of them does not get it, and a board whose
> PHY cannot supply that delay has no usable link at all.
Linux currently has no PHY device which cannot add delays. So this is
pretty much a non issue.
Andrew
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC PATCH v2 2/7] dt-bindings: net: amlogic,meson-dwmac: list the compatible combinations
2026-10-07 8:26 [RFC PATCH v2 0/7] Add ethernet support for the Amlogic T7 Lucas Tanure
2026-10-07 8:26 ` [RFC PATCH v2 1/7] net: stmmac: dwmac-meson8b: let the controller apply the RGMII delays Lucas Tanure
@ 2026-10-07 8:26 ` Lucas Tanure
2026-10-07 8:26 ` [RFC PATCH v2 3/7] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac Lucas Tanure
` (5 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Lucas Tanure @ 2026-10-07 8:26 UTC (permalink / raw)
To: xianwei.zhao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Chevallier, Maxime Coquelin,
Alexandre Torgue
Cc: netdev, devicetree, linux-arm-kernel, linux-amlogic,
linux-kernel, Conor Dooley
The compatible property only checks that the first entry is an Amlogic
name and that "snps,dwmac" or "snps,dwmac-3.70a" appears somewhere in
the list. It cannot express which fallbacks each SoC takes, so a SoC
built on a different Synopsys core cannot be added without loosening
the check for every other one.
List the combinations the device trees actually use: Meson6 and
Meson8m2 fall back to "snps,dwmac" alone, the others also name the
3.70a core. The example used a two-entry form no device tree has, so
give it the Meson GXBB combination.
Assisted-by: LLM
Suggested-by: Conor Dooley <conor.dooley@microchip.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Lucas Tanure <tanure@linux.com>
---
.../bindings/net/amlogic,meson-dwmac.yaml | 30 +++++++++----------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
index 5c91716d1f21..90ef79161ab1 100644
--- a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
@@ -129,20 +129,20 @@ allOf:
properties:
compatible:
- additionalItems: true
- maxItems: 3
- items:
- - enum:
- - amlogic,meson6-dwmac
- - amlogic,meson8b-dwmac
- - amlogic,meson8m2-dwmac
- - amlogic,meson-gxbb-dwmac
- - amlogic,meson-axg-dwmac
- - amlogic,meson-g12a-dwmac
- contains:
- enum:
- - snps,dwmac-3.70a
- - snps,dwmac
+ oneOf:
+ - items:
+ - enum:
+ - amlogic,meson8b-dwmac
+ - amlogic,meson-gxbb-dwmac
+ - amlogic,meson-axg-dwmac
+ - amlogic,meson-g12a-dwmac
+ - const: snps,dwmac-3.70a
+ - const: snps,dwmac
+ - items:
+ - enum:
+ - amlogic,meson6-dwmac
+ - amlogic,meson8m2-dwmac
+ - const: snps,dwmac
reg:
items:
@@ -172,7 +172,7 @@ unevaluatedProperties: false
examples:
- |
ethmac: ethernet@c9410000 {
- compatible = "amlogic,meson-gxbb-dwmac", "snps,dwmac";
+ compatible = "amlogic,meson-gxbb-dwmac", "snps,dwmac-3.70a", "snps,dwmac";
reg = <0xc9410000 0x10000>, <0xc8834540 0x8>;
interrupts = <8>;
interrupt-names = "macirq";
--
2.56.0
^ permalink raw reply [flat|nested] 19+ messages in thread* [RFC PATCH v2 3/7] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac
2026-10-07 8:26 [RFC PATCH v2 0/7] Add ethernet support for the Amlogic T7 Lucas Tanure
2026-10-07 8:26 ` [RFC PATCH v2 1/7] net: stmmac: dwmac-meson8b: let the controller apply the RGMII delays Lucas Tanure
2026-10-07 8:26 ` [RFC PATCH v2 2/7] dt-bindings: net: amlogic,meson-dwmac: list the compatible combinations Lucas Tanure
@ 2026-10-07 8:26 ` Lucas Tanure
2026-10-07 9:51 ` Conor Dooley
` (2 more replies)
2026-10-07 8:26 ` [RFC PATCH v2 4/7] net: stmmac: dwmac-meson8b: add support for the Amlogic T7 Lucas Tanure
` (4 subsequent siblings)
7 siblings, 3 replies; 19+ messages in thread
From: Lucas Tanure @ 2026-10-07 8:26 UTC (permalink / raw)
To: xianwei.zhao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Chevallier, Maxime Coquelin,
Alexandre Torgue
Cc: netdev, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
The T7 has the same ethernet glue as the G12A, but the controller
reaches memory through a pipeline stage that this SoC inserts in the
bus path. That stage has a gate of its own, which no other member of
the family has, and nothing else in Linux claims it. It is therefore
switched off as unused, and the port can then no longer finish a
transfer.
Describing it needs a fourth clock, and the fourth clock of the
existing list drives the timing adjustment logic, which the T7 never
uses. So the T7 gets a list of its own with the gate in that place,
under the name the SD and eMMC controllers already use.
Assisted-by: LLM
Signed-off-by: Lucas Tanure <tanure@linux.com>
---
.../bindings/net/amlogic,meson-dwmac.yaml | 47 +++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
index 90ef79161ab1..96118b4d1560 100644
--- a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
@@ -23,6 +23,7 @@ select:
- amlogic,meson-gxbb-dwmac
- amlogic,meson-axg-dwmac
- amlogic,meson-g12a-dwmac
+ - amlogic,t7-dwmac
required:
- compatible
@@ -57,6 +58,47 @@ allOf:
- const: clkin1
- const: timing-adjustment
+ # The T7 applies the RGMII RX delay through PRG_ETH1 and never enables the
+ # timing adjustment logic, so it has no timing-adjustment clock. What it does
+ # need is the gate of the pipeline stage the controller reaches DRAM through.
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: amlogic,t7-dwmac
+ then:
+ properties:
+ clocks:
+ items:
+ - description: GMAC main clock
+ - description: First parent clock of the internal mux
+ - description: Second parent clock of the internal mux
+ - description:
+ clock of the pipeline stage inserted in the bus path between
+ the controller and the DRAM. Without it, the controller cannot
+ complete DMA transfers.
+
+ clock-names:
+ items:
+ - const: stmmaceth
+ - const: clkin0
+ - const: clkin1
+ - const: pipeline
+
+ # Delay definitions for Meson8b and newer (including T7)
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - amlogic,meson8b-dwmac
+ - amlogic,meson8m2-dwmac
+ - amlogic,meson-gxbb-dwmac
+ - amlogic,meson-axg-dwmac
+ - amlogic,meson-g12a-dwmac
+ - amlogic,t7-dwmac
+ then:
+ properties:
amlogic,tx-delay-ns:
enum: [0, 2, 4, 6]
default: 2
@@ -106,6 +148,7 @@ allOf:
contains:
enum:
- amlogic,meson-g12a-dwmac
+ - amlogic,t7-dwmac
then:
properties:
rx-internal-delay-ps:
@@ -143,6 +186,10 @@ properties:
- amlogic,meson6-dwmac
- amlogic,meson8m2-dwmac
- const: snps,dwmac
+ - items:
+ - const: amlogic,t7-dwmac
+ - const: snps,dwmac-5.10a
+ - const: snps,dwmac
reg:
items:
--
2.56.0
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [RFC PATCH v2 3/7] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac
2026-10-07 8:26 ` [RFC PATCH v2 3/7] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac Lucas Tanure
@ 2026-10-07 9:51 ` Conor Dooley
2026-10-07 10:34 ` Lucas Tanure
2026-10-07 12:35 ` Neil Armstrong
2026-10-07 13:06 ` Andrew Lunn
2 siblings, 1 reply; 19+ messages in thread
From: Conor Dooley @ 2026-10-07 9:51 UTC (permalink / raw)
To: Lucas Tanure
Cc: xianwei.zhao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Chevallier, Maxime Coquelin,
Alexandre Torgue, netdev, devicetree, linux-arm-kernel,
linux-amlogic, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 3822 bytes --]
On Wed, Oct 07, 2026 at 09:26:23AM +0100, Lucas Tanure wrote:
> The T7 has the same ethernet glue as the G12A, but the controller
> reaches memory through a pipeline stage that this SoC inserts in the
> bus path. That stage has a gate of its own, which no other member of
> the family has, and nothing else in Linux claims it. It is therefore
> switched off as unused, and the port can then no longer finish a
> transfer.
>
> Describing it needs a fourth clock, and the fourth clock of the
> existing list drives the timing adjustment logic, which the T7 never
> uses. So the T7 gets a list of its own with the gate in that place,
> under the name the SD and eMMC controllers already use.
>
> Assisted-by: LLM
> Signed-off-by: Lucas Tanure <tanure@linux.com>
Didn't I ack the previous version?
What changed?
Thanks,
Conor.
> ---
> .../bindings/net/amlogic,meson-dwmac.yaml | 47 +++++++++++++++++++
> 1 file changed, 47 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
> index 90ef79161ab1..96118b4d1560 100644
> --- a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
> @@ -23,6 +23,7 @@ select:
> - amlogic,meson-gxbb-dwmac
> - amlogic,meson-axg-dwmac
> - amlogic,meson-g12a-dwmac
> + - amlogic,t7-dwmac
> required:
> - compatible
>
> @@ -57,6 +58,47 @@ allOf:
> - const: clkin1
> - const: timing-adjustment
>
> + # The T7 applies the RGMII RX delay through PRG_ETH1 and never enables the
> + # timing adjustment logic, so it has no timing-adjustment clock. What it does
> + # need is the gate of the pipeline stage the controller reaches DRAM through.
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: amlogic,t7-dwmac
> + then:
> + properties:
> + clocks:
> + items:
> + - description: GMAC main clock
> + - description: First parent clock of the internal mux
> + - description: Second parent clock of the internal mux
> + - description:
> + clock of the pipeline stage inserted in the bus path between
> + the controller and the DRAM. Without it, the controller cannot
> + complete DMA transfers.
> +
> + clock-names:
> + items:
> + - const: stmmaceth
> + - const: clkin0
> + - const: clkin1
> + - const: pipeline
> +
> + # Delay definitions for Meson8b and newer (including T7)
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - amlogic,meson8b-dwmac
> + - amlogic,meson8m2-dwmac
> + - amlogic,meson-gxbb-dwmac
> + - amlogic,meson-axg-dwmac
> + - amlogic,meson-g12a-dwmac
> + - amlogic,t7-dwmac
> + then:
> + properties:
> amlogic,tx-delay-ns:
> enum: [0, 2, 4, 6]
> default: 2
> @@ -106,6 +148,7 @@ allOf:
> contains:
> enum:
> - amlogic,meson-g12a-dwmac
> + - amlogic,t7-dwmac
> then:
> properties:
> rx-internal-delay-ps:
> @@ -143,6 +186,10 @@ properties:
> - amlogic,meson6-dwmac
> - amlogic,meson8m2-dwmac
> - const: snps,dwmac
> + - items:
> + - const: amlogic,t7-dwmac
> + - const: snps,dwmac-5.10a
> + - const: snps,dwmac
>
> reg:
> items:
> --
> 2.56.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/7] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac
2026-10-07 9:51 ` Conor Dooley
@ 2026-10-07 10:34 ` Lucas Tanure
2026-10-07 12:59 ` Conor Dooley
0 siblings, 1 reply; 19+ messages in thread
From: Lucas Tanure @ 2026-10-07 10:34 UTC (permalink / raw)
To: Conor Dooley
Cc: xianwei.zhao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Chevallier, Maxime Coquelin,
Alexandre Torgue, netdev, devicetree, linux-arm-kernel,
linux-amlogic, linux-kernel
On Wed, Oct 7, 2026 at 10:51 AM Conor Dooley <conor@kernel.org> wrote:
>
> On Wed, Oct 07, 2026 at 09:26:23AM +0100, Lucas Tanure wrote:
> > The T7 has the same ethernet glue as the G12A, but the controller
> > reaches memory through a pipeline stage that this SoC inserts in the
> > bus path. That stage has a gate of its own, which no other member of
> > the family has, and nothing else in Linux claims it. It is therefore
> > switched off as unused, and the port can then no longer finish a
> > transfer.
> >
> > Describing it needs a fourth clock, and the fourth clock of the
> > existing list drives the timing adjustment logic, which the T7 never
> > uses. So the T7 gets a list of its own with the gate in that place,
> > under the name the SD and eMMC controllers already use.
> >
> > Assisted-by: LLM
> > Signed-off-by: Lucas Tanure <tanure@linux.com>
>
> Didn't I ack the previous version?
Sorry, I didn't receive one.
>
> What changed?
Nothing.
>
> Thanks,
> Conor.
>
> > ---
> > .../bindings/net/amlogic,meson-dwmac.yaml | 47 +++++++++++++++++++
> > 1 file changed, 47 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
> > index 90ef79161ab1..96118b4d1560 100644
> > --- a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
> > +++ b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
> > @@ -23,6 +23,7 @@ select:
> > - amlogic,meson-gxbb-dwmac
> > - amlogic,meson-axg-dwmac
> > - amlogic,meson-g12a-dwmac
> > + - amlogic,t7-dwmac
> > required:
> > - compatible
> >
> > @@ -57,6 +58,47 @@ allOf:
> > - const: clkin1
> > - const: timing-adjustment
> >
> > + # The T7 applies the RGMII RX delay through PRG_ETH1 and never enables the
> > + # timing adjustment logic, so it has no timing-adjustment clock. What it does
> > + # need is the gate of the pipeline stage the controller reaches DRAM through.
> > + - if:
> > + properties:
> > + compatible:
> > + contains:
> > + const: amlogic,t7-dwmac
> > + then:
> > + properties:
> > + clocks:
> > + items:
> > + - description: GMAC main clock
> > + - description: First parent clock of the internal mux
> > + - description: Second parent clock of the internal mux
> > + - description:
> > + clock of the pipeline stage inserted in the bus path between
> > + the controller and the DRAM. Without it, the controller cannot
> > + complete DMA transfers.
> > +
> > + clock-names:
> > + items:
> > + - const: stmmaceth
> > + - const: clkin0
> > + - const: clkin1
> > + - const: pipeline
> > +
> > + # Delay definitions for Meson8b and newer (including T7)
> > + - if:
> > + properties:
> > + compatible:
> > + contains:
> > + enum:
> > + - amlogic,meson8b-dwmac
> > + - amlogic,meson8m2-dwmac
> > + - amlogic,meson-gxbb-dwmac
> > + - amlogic,meson-axg-dwmac
> > + - amlogic,meson-g12a-dwmac
> > + - amlogic,t7-dwmac
> > + then:
> > + properties:
> > amlogic,tx-delay-ns:
> > enum: [0, 2, 4, 6]
> > default: 2
> > @@ -106,6 +148,7 @@ allOf:
> > contains:
> > enum:
> > - amlogic,meson-g12a-dwmac
> > + - amlogic,t7-dwmac
> > then:
> > properties:
> > rx-internal-delay-ps:
> > @@ -143,6 +186,10 @@ properties:
> > - amlogic,meson6-dwmac
> > - amlogic,meson8m2-dwmac
> > - const: snps,dwmac
> > + - items:
> > + - const: amlogic,t7-dwmac
> > + - const: snps,dwmac-5.10a
> > + - const: snps,dwmac
> >
> > reg:
> > items:
> > --
> > 2.56.0
> >
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/7] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac
2026-10-07 10:34 ` Lucas Tanure
@ 2026-10-07 12:59 ` Conor Dooley
0 siblings, 0 replies; 19+ messages in thread
From: Conor Dooley @ 2026-10-07 12:59 UTC (permalink / raw)
To: Lucas Tanure
Cc: xianwei.zhao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Chevallier, Maxime Coquelin,
Alexandre Torgue, netdev, devicetree, linux-arm-kernel,
linux-amlogic, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1166 bytes --]
On Wed, Oct 07, 2026 at 11:34:54AM +0100, Lucas Tanure wrote:
> On Wed, Oct 7, 2026 at 10:51 AM Conor Dooley <conor@kernel.org> wrote:
> >
> > On Wed, Oct 07, 2026 at 09:26:23AM +0100, Lucas Tanure wrote:
> > > The T7 has the same ethernet glue as the G12A, but the controller
> > > reaches memory through a pipeline stage that this SoC inserts in the
> > > bus path. That stage has a gate of its own, which no other member of
> > > the family has, and nothing else in Linux claims it. It is therefore
> > > switched off as unused, and the port can then no longer finish a
> > > transfer.
> > >
> > > Describing it needs a fourth clock, and the fourth clock of the
> > > existing list drives the timing adjustment logic, which the T7 never
> > > uses. So the T7 gets a list of its own with the gate in that place,
> > > under the name the SD and eMMC controllers already use.
> > >
> > > Assisted-by: LLM
> > > Signed-off-by: Lucas Tanure <tanure@linux.com>
> >
> > Didn't I ack the previous version?
> Sorry, I didn't receive one.
Hmm, thought I had sent one.
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/7] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac
2026-10-07 8:26 ` [RFC PATCH v2 3/7] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac Lucas Tanure
2026-10-07 9:51 ` Conor Dooley
@ 2026-10-07 12:35 ` Neil Armstrong
2026-10-07 13:07 ` Andrew Lunn
2026-10-07 13:06 ` Andrew Lunn
2 siblings, 1 reply; 19+ messages in thread
From: Neil Armstrong @ 2026-10-07 12:35 UTC (permalink / raw)
To: Lucas Tanure, xianwei.zhao, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Chevallier, Maxime Coquelin,
Alexandre Torgue
Cc: netdev, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
On 10/7/26 10:26, Lucas Tanure wrote:
> The T7 has the same ethernet glue as the G12A, but the controller
> reaches memory through a pipeline stage that this SoC inserts in the
> bus path. That stage has a gate of its own, which no other member of
> the family has, and nothing else in Linux claims it. It is therefore
> switched off as unused, and the port can then no longer finish a
> transfer.
>
> Describing it needs a fourth clock, and the fourth clock of the
> existing list drives the timing adjustment logic, which the T7 never
> uses. So the T7 gets a list of its own with the gate in that place,
> under the name the SD and eMMC controllers already use.
>
> Assisted-by: LLM
> Signed-off-by: Lucas Tanure <tanure@linux.com>
> ---
> .../bindings/net/amlogic,meson-dwmac.yaml | 47 +++++++++++++++++++
> 1 file changed, 47 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
> index 90ef79161ab1..96118b4d1560 100644
> --- a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
> @@ -23,6 +23,7 @@ select:
> - amlogic,meson-gxbb-dwmac
> - amlogic,meson-axg-dwmac
> - amlogic,meson-g12a-dwmac
> + - amlogic,t7-dwmac
> required:
> - compatible
>
> @@ -57,6 +58,47 @@ allOf:
> - const: clkin1
> - const: timing-adjustment
>
> + # The T7 applies the RGMII RX delay through PRG_ETH1 and never enables the
> + # timing adjustment logic, so it has no timing-adjustment clock. What it does
> + # need is the gate of the pipeline stage the controller reaches DRAM through.
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: amlogic,t7-dwmac
> + then:
> + properties:
> + clocks:
> + items:
> + - description: GMAC main clock
> + - description: First parent clock of the internal mux
> + - description: Second parent clock of the internal mux
> + - description:
> + clock of the pipeline stage inserted in the bus path between
> + the controller and the DRAM. Without it, the controller cannot
> + complete DMA transfers.
> +
> + clock-names:
> + items:
> + - const: stmmaceth
> + - const: clkin0
> + - const: clkin1
> + - const: pipeline
> +
> + # Delay definitions for Meson8b and newer (including T7)
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - amlogic,meson8b-dwmac
> + - amlogic,meson8m2-dwmac
> + - amlogic,meson-gxbb-dwmac
> + - amlogic,meson-axg-dwmac
> + - amlogic,meson-g12a-dwmac
> + - amlogic,t7-dwmac
> + then:
> + properties:
> amlogic,tx-delay-ns:
Do we still want to support the vendor property on t7 ?
Neil
> enum: [0, 2, 4, 6]
> default: 2
> @@ -106,6 +148,7 @@ allOf:
> contains:
> enum:
> - amlogic,meson-g12a-dwmac
> + - amlogic,t7-dwmac
> then:
> properties:
> rx-internal-delay-ps:
> @@ -143,6 +186,10 @@ properties:
> - amlogic,meson6-dwmac
> - amlogic,meson8m2-dwmac
> - const: snps,dwmac
> + - items:
> + - const: amlogic,t7-dwmac
> + - const: snps,dwmac-5.10a
> + - const: snps,dwmac
>
> reg:
> items:
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/7] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac
2026-10-07 12:35 ` Neil Armstrong
@ 2026-10-07 13:07 ` Andrew Lunn
0 siblings, 0 replies; 19+ messages in thread
From: Andrew Lunn @ 2026-10-07 13:07 UTC (permalink / raw)
To: Neil Armstrong
Cc: Lucas Tanure, xianwei.zhao, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Chevallier, Maxime Coquelin,
Alexandre Torgue, netdev, devicetree, linux-arm-kernel,
linux-amlogic, linux-kernel
> > + properties:
> > amlogic,tx-delay-ns:
>
> Do we still want to support the vendor property on t7 ?
No. As part of cleaning up the RGMII delays, this can be made invalid
for this device.
Andrew
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/7] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac
2026-10-07 8:26 ` [RFC PATCH v2 3/7] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac Lucas Tanure
2026-10-07 9:51 ` Conor Dooley
2026-10-07 12:35 ` Neil Armstrong
@ 2026-10-07 13:06 ` Andrew Lunn
2 siblings, 0 replies; 19+ messages in thread
From: Andrew Lunn @ 2026-10-07 13:06 UTC (permalink / raw)
To: Lucas Tanure
Cc: xianwei.zhao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Chevallier, Maxime Coquelin,
Alexandre Torgue, netdev, devicetree, linux-arm-kernel,
linux-amlogic, linux-kernel
On Wed, Oct 07, 2026 at 09:26:23AM +0100, Lucas Tanure wrote:
> The T7 has the same ethernet glue as the G12A, but the controller
> reaches memory through a pipeline stage that this SoC inserts in the
> bus path. That stage has a gate of its own, which no other member of
> the family has, and nothing else in Linux claims it. It is therefore
> switched off as unused, and the port can then no longer finish a
> transfer.
>
> Describing it needs a fourth clock, and the fourth clock of the
> existing list drives the timing adjustment logic, which the T7 never
> uses. So the T7 gets a list of its own with the gate in that place,
> under the name the SD and eMMC controllers already use.
>
> Assisted-by: LLM
> Signed-off-by: Lucas Tanure <tanure@linux.com>
> ---
> .../bindings/net/amlogic,meson-dwmac.yaml | 47 +++++++++++++++++++
> 1 file changed, 47 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
> index 90ef79161ab1..96118b4d1560 100644
> --- a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
> @@ -23,6 +23,7 @@ select:
> - amlogic,meson-gxbb-dwmac
> - amlogic,meson-axg-dwmac
> - amlogic,meson-g12a-dwmac
> + - amlogic,t7-dwmac
Since you are adding a new compatible, lets cleanly fix up the RGMII
delay mess for this compatible. Skip all the existing code touching
RGMII delays and add new code which is invoked when this compatible is
seen.
Andrew
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC PATCH v2 4/7] net: stmmac: dwmac-meson8b: add support for the Amlogic T7
2026-10-07 8:26 [RFC PATCH v2 0/7] Add ethernet support for the Amlogic T7 Lucas Tanure
` (2 preceding siblings ...)
2026-10-07 8:26 ` [RFC PATCH v2 3/7] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac Lucas Tanure
@ 2026-10-07 8:26 ` Lucas Tanure
2026-10-07 9:36 ` Maxime Chevallier
2026-10-07 8:26 ` [RFC PATCH v2 5/7] arm64: dts: amlogic: t7: add the ethernet pinctrl nodes Lucas Tanure
` (3 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Lucas Tanure @ 2026-10-07 8:26 UTC (permalink / raw)
To: xianwei.zhao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Chevallier, Maxime Coquelin,
Alexandre Torgue
Cc: netdev, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
The glue registers on the T7 are laid out exactly as the G12A ones, RX
delay field included, so the T7 can reuse the G12A settings.
What it does not share is how the controller reaches memory. That path
runs through a pipeline stage with a gate of its own, and no other
device has any use for that gate. Nothing claims it, so it is switched
off as unused and a transfer that has started can never finish.
Without that gate the controller cannot do DMA at all, so it is
required rather than optional: a clear probe failure beats an
undiagnosable hang later.
Assisted-by: LLM
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Lucas Tanure <tanure@linux.com>
---
.../ethernet/stmicro/stmmac/dwmac-meson8b.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
index d73dfd0ac167..dd10d719ab84 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
@@ -81,6 +81,7 @@ struct meson8b_dwmac;
struct meson8b_dwmac_data {
int (*set_phy_mode)(struct meson8b_dwmac *dwmac);
bool has_prg_eth1_rgmii_rx_delay;
+ bool has_pipeline_clk;
};
struct meson8b_dwmac {
@@ -402,6 +403,7 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
struct plat_stmmacenet_data *plat_dat;
struct stmmac_resources stmmac_res;
struct meson8b_dwmac *dwmac;
+ struct clk *pipeline_clk;
u32 tx_delay_ps;
int ret;
@@ -485,6 +487,13 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
if (IS_ERR(dwmac->timing_adj_clk))
return PTR_ERR(dwmac->timing_adj_clk);
+ if (dwmac->data->has_pipeline_clk) {
+ pipeline_clk = devm_clk_get_enabled(dwmac->dev, "pipeline");
+ if (IS_ERR(pipeline_clk))
+ return dev_err_probe(dwmac->dev, PTR_ERR(pipeline_clk),
+ "missing pipeline clock\n");
+ }
+
ret = meson8b_init_rgmii_delays(dwmac);
if (ret)
return ret;
@@ -521,6 +530,12 @@ static const struct meson8b_dwmac_data meson_g12a_dwmac_data = {
.has_prg_eth1_rgmii_rx_delay = true,
};
+static const struct meson8b_dwmac_data meson_t7_dwmac_data = {
+ .set_phy_mode = meson_axg_set_phy_mode,
+ .has_prg_eth1_rgmii_rx_delay = true,
+ .has_pipeline_clk = true,
+};
+
static const struct of_device_id meson8b_dwmac_match[] = {
{
.compatible = "amlogic,meson8b-dwmac",
@@ -542,6 +557,10 @@ static const struct of_device_id meson8b_dwmac_match[] = {
.compatible = "amlogic,meson-g12a-dwmac",
.data = &meson_g12a_dwmac_data,
},
+ {
+ .compatible = "amlogic,t7-dwmac",
+ .data = &meson_t7_dwmac_data,
+ },
{ }
};
MODULE_DEVICE_TABLE(of, meson8b_dwmac_match);
--
2.56.0
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [RFC PATCH v2 4/7] net: stmmac: dwmac-meson8b: add support for the Amlogic T7
2026-10-07 8:26 ` [RFC PATCH v2 4/7] net: stmmac: dwmac-meson8b: add support for the Amlogic T7 Lucas Tanure
@ 2026-10-07 9:36 ` Maxime Chevallier
0 siblings, 0 replies; 19+ messages in thread
From: Maxime Chevallier @ 2026-10-07 9:36 UTC (permalink / raw)
To: Lucas Tanure, xianwei.zhao, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Neil Armstrong, Kevin Hilman,
Jerome Brunet, Martin Blumenstingl, Maxime Coquelin,
Alexandre Torgue
Cc: netdev, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
Hi,
On 10/7/26 10:26, Lucas Tanure wrote:
> The glue registers on the T7 are laid out exactly as the G12A ones, RX
> delay field included, so the T7 can reuse the G12A settings.
>
> What it does not share is how the controller reaches memory. That path
> runs through a pipeline stage with a gate of its own, and no other
> device has any use for that gate. Nothing claims it, so it is switched
> off as unused and a transfer that has started can never finish.
>
> Without that gate the controller cannot do DMA at all, so it is
> required rather than optional: a clear probe failure beats an
> undiagnosable hang later.
>
> Assisted-by: LLM
> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
> Signed-off-by: Lucas Tanure <tanure@linux.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Maxime
> ---
> .../ethernet/stmicro/stmmac/dwmac-meson8b.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
> index d73dfd0ac167..dd10d719ab84 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
> @@ -81,6 +81,7 @@ struct meson8b_dwmac;
> struct meson8b_dwmac_data {
> int (*set_phy_mode)(struct meson8b_dwmac *dwmac);
> bool has_prg_eth1_rgmii_rx_delay;
> + bool has_pipeline_clk;
> };
>
> struct meson8b_dwmac {
> @@ -402,6 +403,7 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
> struct plat_stmmacenet_data *plat_dat;
> struct stmmac_resources stmmac_res;
> struct meson8b_dwmac *dwmac;
> + struct clk *pipeline_clk;
> u32 tx_delay_ps;
> int ret;
>
> @@ -485,6 +487,13 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
> if (IS_ERR(dwmac->timing_adj_clk))
> return PTR_ERR(dwmac->timing_adj_clk);
>
> + if (dwmac->data->has_pipeline_clk) {
> + pipeline_clk = devm_clk_get_enabled(dwmac->dev, "pipeline");
> + if (IS_ERR(pipeline_clk))
> + return dev_err_probe(dwmac->dev, PTR_ERR(pipeline_clk),
> + "missing pipeline clock\n");
> + }
> +
> ret = meson8b_init_rgmii_delays(dwmac);
> if (ret)
> return ret;
> @@ -521,6 +530,12 @@ static const struct meson8b_dwmac_data meson_g12a_dwmac_data = {
> .has_prg_eth1_rgmii_rx_delay = true,
> };
>
> +static const struct meson8b_dwmac_data meson_t7_dwmac_data = {
> + .set_phy_mode = meson_axg_set_phy_mode,
> + .has_prg_eth1_rgmii_rx_delay = true,
> + .has_pipeline_clk = true,
> +};
> +
> static const struct of_device_id meson8b_dwmac_match[] = {
> {
> .compatible = "amlogic,meson8b-dwmac",
> @@ -542,6 +557,10 @@ static const struct of_device_id meson8b_dwmac_match[] = {
> .compatible = "amlogic,meson-g12a-dwmac",
> .data = &meson_g12a_dwmac_data,
> },
> + {
> + .compatible = "amlogic,t7-dwmac",
> + .data = &meson_t7_dwmac_data,
> + },
> { }
> };
> MODULE_DEVICE_TABLE(of, meson8b_dwmac_match);
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC PATCH v2 5/7] arm64: dts: amlogic: t7: add the ethernet pinctrl nodes
2026-10-07 8:26 [RFC PATCH v2 0/7] Add ethernet support for the Amlogic T7 Lucas Tanure
` (3 preceding siblings ...)
2026-10-07 8:26 ` [RFC PATCH v2 4/7] net: stmmac: dwmac-meson8b: add support for the Amlogic T7 Lucas Tanure
@ 2026-10-07 8:26 ` Lucas Tanure
2026-10-07 8:26 ` [RFC PATCH v2 6/7] arm64: dts: amlogic: t7: add the ethernet controller Lucas Tanure
` (2 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Lucas Tanure @ 2026-10-07 8:26 UTC (permalink / raw)
To: xianwei.zhao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Chevallier, Maxime Coquelin,
Alexandre Torgue
Cc: netdev, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
The SoC brings its ethernet interface out on bank Z, but no pin groups
were described, so a board had no way to hand those pins over to the
MAC.
Describe them as the two sets a board actually needs: the nine pins the
interface always uses, and the five extra ones RGMII adds for its wider
data path.
Assisted-by: LLM
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Lucas Tanure <tanure@linux.com>
---
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 30 +++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
index 6894c06a836b..7bd53ec16607 100644
--- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
+++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
@@ -376,6 +376,36 @@ mux {
};
};
+ eth_pins: eth {
+ mux {
+ groups = "eth_mdio",
+ "eth_mdc",
+ "eth_rgmii_rx_clk",
+ "eth_rx_dv",
+ "eth_rxd0",
+ "eth_rxd1",
+ "eth_txen",
+ "eth_txd0",
+ "eth_txd1";
+ function = "eth";
+ drive-strength-microamp = <4000>;
+ bias-disable;
+ };
+ };
+
+ eth_rgmii_pins: eth-rgmii {
+ mux {
+ groups = "eth_rxd2_rgmii",
+ "eth_rxd3_rgmii",
+ "eth_rgmii_tx_clk",
+ "eth_txd2_rgmii",
+ "eth_txd3_rgmii";
+ function = "eth";
+ drive-strength-microamp = <4000>;
+ bias-disable;
+ };
+ };
+
i2c0_ao_d_pins: i2c0-ao-d {
mux {
groups = "i2c0_ao_sck_d",
--
2.56.0
^ permalink raw reply [flat|nested] 19+ messages in thread* [RFC PATCH v2 6/7] arm64: dts: amlogic: t7: add the ethernet controller
2026-10-07 8:26 [RFC PATCH v2 0/7] Add ethernet support for the Amlogic T7 Lucas Tanure
` (4 preceding siblings ...)
2026-10-07 8:26 ` [RFC PATCH v2 5/7] arm64: dts: amlogic: t7: add the ethernet pinctrl nodes Lucas Tanure
@ 2026-10-07 8:26 ` Lucas Tanure
2026-10-07 13:12 ` Andrew Lunn
2026-10-07 8:26 ` [RFC PATCH v2 7/7] arm64: dts: amlogic: t7: khadas-vim4: enable the ethernet port Lucas Tanure
2026-10-07 13:01 ` [RFC PATCH v2 0/7] Add ethernet support for the Amlogic T7 Andrew Lunn
7 siblings, 1 reply; 19+ messages in thread
From: Lucas Tanure @ 2026-10-07 8:26 UTC (permalink / raw)
To: xianwei.zhao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Chevallier, Maxime Coquelin,
Alexandre Torgue
Cc: netdev, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
The SoC has a Synopsys gigabit MAC, a block of glue registers that
selects the interface type and trims the clock timing, and a
multiplexer that points the management bus at the on-chip 100M PHY or
the external pins. None of it was described, so no board could use its
ethernet port.
The controller reaches memory through a pipeline stage with a gate of
its own. Nothing else claims that gate, so it would be switched off as
unused and leave the port unable to finish a transfer.
The on-chip PHY is described as on the G12A. No board in tree uses it,
so that path is untested. The controller is left disabled for boards
to enable.
Assisted-by: LLM
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Lucas Tanure <tanure@linux.com>
---
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 57 +++++++++++++++++++++
1 file changed, 57 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
index 7bd53ec16607..140f1836f3dd 100644
--- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
+++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
@@ -250,6 +250,31 @@ gic: interrupt-controller@fff01000 {
interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_HIGH)>;
};
+ ethmac: ethernet@fdc00000 {
+ compatible = "amlogic,t7-dwmac",
+ "snps,dwmac-5.10a",
+ "snps,dwmac";
+ reg = <0x0 0xfdc00000 0x0 0x10000>,
+ <0x0 0xfe024000 0x0 0x8>;
+ interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq";
+ clocks = <&clkc_periphs CLKID_SYS_ETH>,
+ <&scmi_clk CLKID_FCLK_DIV2>,
+ <&mpll CLKID_MPLL2>,
+ <&clkc_periphs CLKID_SYS_AMPIPE_ETH>;
+ clock-names = "stmmaceth", "clkin0", "clkin1", "pipeline";
+ power-domains = <&pwrc PWRC_T7_ETH_ID>;
+ rx-fifo-depth = <4096>;
+ tx-fifo-depth = <2048>;
+ status = "disabled";
+
+ mdio0: mdio {
+ compatible = "snps,dwmac-mdio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+ };
+
apb4: bus@fe000000 {
compatible = "simple-bus";
reg = <0x0 0xfe000000 0x0 0x480000>;
@@ -645,6 +670,38 @@ gpio_intc: interrupt-controller@4080 {
<10 11 12 13 14 15 16 17 18 19 20 21>;
};
+ eth_phy: mdio-multiplexer@28000 {
+ compatible = "amlogic,g12a-mdio-mux";
+ reg = <0x0 0x28000 0x0 0xa4>;
+ clocks = <&clkc_periphs CLKID_SYS_ETHPHY>,
+ <&xtal>,
+ <&scmi_clk CLKID_FCLK_50M>;
+ clock-names = "pclk", "clkin0", "clkin1";
+ mdio-parent-bus = <&mdio0>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ ext_mdio: mdio@0 {
+ reg = <0>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+
+ int_mdio: mdio@1 {
+ reg = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ internal_ephy: ethernet-phy@8 {
+ compatible = "ethernet-phy-id0180.3301",
+ "ethernet-phy-ieee802.3-c22";
+ interrupts = <GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH>;
+ reg = <8>;
+ max-speed = <100>;
+ };
+ };
+ };
+
uart_a: serial@78000 {
compatible = "amlogic,t7-uart", "amlogic,meson-s4-uart";
reg = <0x0 0x78000 0x0 0x18>;
--
2.56.0
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [RFC PATCH v2 6/7] arm64: dts: amlogic: t7: add the ethernet controller
2026-10-07 8:26 ` [RFC PATCH v2 6/7] arm64: dts: amlogic: t7: add the ethernet controller Lucas Tanure
@ 2026-10-07 13:12 ` Andrew Lunn
2026-10-07 13:34 ` Maxime Chevallier
0 siblings, 1 reply; 19+ messages in thread
From: Andrew Lunn @ 2026-10-07 13:12 UTC (permalink / raw)
To: Lucas Tanure
Cc: xianwei.zhao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Chevallier, Maxime Coquelin,
Alexandre Torgue, netdev, devicetree, linux-arm-kernel,
linux-amlogic, linux-kernel
On Wed, Oct 07, 2026 at 09:26:26AM +0100, Lucas Tanure wrote:
> The SoC has a Synopsys gigabit MAC, a block of glue registers that
> selects the interface type and trims the clock timing, and a
> multiplexer that points the management bus at the on-chip 100M PHY
> + internal_ephy: ethernet-phy@8 {
> + compatible = "ethernet-phy-id0180.3301",
> + "ethernet-phy-ieee802.3-c22";
> + interrupts = <GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH>;
> + reg = <8>;
> + max-speed = <100>;
It is a 100M PHY. What supported speeds does it report in its
registers?
You should only need max-speed when the PHY is broken, says it can do
more than it actually can do, or when a 1G PHY only has two of the
four pairs connected to the outside world etc.
Andrew
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [RFC PATCH v2 6/7] arm64: dts: amlogic: t7: add the ethernet controller
2026-10-07 13:12 ` Andrew Lunn
@ 2026-10-07 13:34 ` Maxime Chevallier
0 siblings, 0 replies; 19+ messages in thread
From: Maxime Chevallier @ 2026-10-07 13:34 UTC (permalink / raw)
To: Andrew Lunn, Lucas Tanure
Cc: xianwei.zhao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Coquelin, Alexandre Torgue, netdev,
devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
On 10/7/26 15:12, Andrew Lunn wrote:
>
> You should only need max-speed when the PHY is broken, says it can do
> more than it actually can do, or when a 1G PHY only has two of the
> four pairs connected to the outside world etc.
We even have a DT binding for that case :)
There's an example here :
https://elixir.bootlin.com/linux/v7.3-rc5/source/Documentation/devicetree/bindings/net/ethernet-phy.yaml#L348
and the binding is there :
https://elixir.bootlin.com/linux/v7.3-rc5/source/Documentation/devicetree/bindings/net/ethernet-connector.yaml
Maxime
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC PATCH v2 7/7] arm64: dts: amlogic: t7: khadas-vim4: enable the ethernet port
2026-10-07 8:26 [RFC PATCH v2 0/7] Add ethernet support for the Amlogic T7 Lucas Tanure
` (5 preceding siblings ...)
2026-10-07 8:26 ` [RFC PATCH v2 6/7] arm64: dts: amlogic: t7: add the ethernet controller Lucas Tanure
@ 2026-10-07 8:26 ` Lucas Tanure
2026-10-07 13:01 ` [RFC PATCH v2 0/7] Add ethernet support for the Amlogic T7 Andrew Lunn
7 siblings, 0 replies; 19+ messages in thread
From: Lucas Tanure @ 2026-10-07 8:26 UTC (permalink / raw)
To: xianwei.zhao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Chevallier, Maxime Coquelin,
Alexandre Torgue
Cc: netdev, devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
The board carries a Realtek RTL8211F gigabit PHY on the external
management bus, connected to the MAC over RGMII.
Enable the controller, hand it the ethernet pins and point it at the
PHY. RGMII needs a delay on each of its two clocks, and on this board
both come from inside the chips, not from the board tracks. The PHY
adds the one on receive. Its transmit delay does not work here, so the
controller adds that one.
The PHY interrupt output is wired to GPIOH_6, so link changes are
reported instead of polled. The PHY reset is an RC network on the
board, not a SoC pin, so there is no reset line to describe.
Assisted-by: LLM
Signed-off-by: Lucas Tanure <tanure@linux.com>
---
.../amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts
index 0fa83362b417..4a2b0b563655 100644
--- a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts
+++ b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts
@@ -14,6 +14,7 @@ / {
compatible = "khadas,vim4", "amlogic,a311d2", "amlogic,t7";
aliases {
+ ethernet0 = ðmac;
serial0 = &uart_a;
mmc0 = &sd_emmc_c;
mmc1 = &sd_emmc_b;
@@ -256,6 +257,27 @@ xtal: xtal-clk {
};
};
+ðmac {
+ status = "okay";
+ pinctrl-0 = <ð_pins>, <ð_rgmii_pins>;
+ pinctrl-names = "default";
+ phy-mode = "rgmii-id";
+ phy-handle = <&external_phy>;
+ tx-internal-delay-ps = <2000>;
+};
+
+&ext_mdio {
+ external_phy: ethernet-phy@0 {
+ /* Realtek RTL8211FD-CG */
+ reg = <0>;
+ max-speed = <1000>;
+
+ interrupt-parent = <&gpio_intc>;
+ /* RGMII_INT on GPIOH_6 */
+ interrupts = <154 IRQ_TYPE_LEVEL_LOW>;
+ };
+};
+
&i2c_m_ao_a {
status = "okay";
pinctrl-0 = <&i2c0_ao_d_pins>;
--
2.56.0
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [RFC PATCH v2 0/7] Add ethernet support for the Amlogic T7
2026-10-07 8:26 [RFC PATCH v2 0/7] Add ethernet support for the Amlogic T7 Lucas Tanure
` (6 preceding siblings ...)
2026-10-07 8:26 ` [RFC PATCH v2 7/7] arm64: dts: amlogic: t7: khadas-vim4: enable the ethernet port Lucas Tanure
@ 2026-10-07 13:01 ` Andrew Lunn
7 siblings, 0 replies; 19+ messages in thread
From: Andrew Lunn @ 2026-10-07 13:01 UTC (permalink / raw)
To: Lucas Tanure
Cc: xianwei.zhao, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, Maxime Chevallier, Maxime Coquelin,
Alexandre Torgue, netdev, devicetree, linux-arm-kernel,
linux-amlogic, linux-kernel
On Wed, Oct 07, 2026 at 09:26:20AM +0100, Lucas Tanure wrote:
> The T7 pairs a Synopsys gigabit MAC with the same glue registers the
> G12A has, but nothing described it. This adds the binding, the driver
> support and the device tree nodes, and enables the port on the Khadas
> VIM4.
>
> Unlike the G12A, the controller reaches DRAM through a pipeline stage
> with a gate of its own, sys_ampipe_eth. Nothing else claims it, so
> clk_disable_unused switches it off and transfers stop.
>
> v2 changes the RGMII delays, after review. phy-mode describes the
> board, not which chip adds the delay, so this board is rgmii-id.
> dwmac-meson8b did the opposite, and ignored the *-internal-delay-ps
> properties. Patch 1 fixes that. The VIM4 needs it because the RTL8211F
> transmit delay does not work here.
What is special about the RTL8211F?
Andrew
^ permalink raw reply [flat|nested] 19+ messages in thread