* [PATCH v7 1/7] dt-bindings: net: amlogic,meson-dwmac: list the compatible combinations
2026-11-13 12:18 [PATCH v7 0/7] Add ethernet support for the Amlogic T7 Lucas Tanure
@ 2026-11-13 12:18 ` Lucas Tanure
2026-11-13 12:18 ` [PATCH v7 2/7] dt-bindings: net: add amlogic,t7-dwmac Lucas Tanure
` (5 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Lucas Tanure @ 2026-11-13 12:18 UTC (permalink / raw)
To: xianwei.zhao, Andrew Lunn, davem, 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 use: Meson6 falls back to
"snps,dwmac" alone, the others also name the 3.70a core. The Meson8m2
reports a 3.70a core too, so it joins that list; its dtsi gets the
missing entry in a separate patch. The example used a two-entry form no
device tree has, so give it the Meson GXBB combination.
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 | 29 +++++++++----------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
index 9c9cc3ef384d..e769c9bb70d8 100644
--- a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
@@ -129,20 +129,19 @@ 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,meson8m2-dwmac
+ - amlogic,meson-gxbb-dwmac
+ - amlogic,meson-axg-dwmac
+ - amlogic,meson-g12a-dwmac
+ - const: snps,dwmac-3.70a
+ - const: snps,dwmac
+ - items:
+ - const: amlogic,meson6-dwmac
+ - const: snps,dwmac
reg:
items:
@@ -175,7 +174,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.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v7 2/7] dt-bindings: net: add amlogic,t7-dwmac
2026-11-13 12:18 [PATCH v7 0/7] Add ethernet support for the Amlogic T7 Lucas Tanure
2026-11-13 12:18 ` [PATCH v7 1/7] dt-bindings: net: amlogic,meson-dwmac: list the compatible combinations Lucas Tanure
@ 2026-11-13 12:18 ` Lucas Tanure
2026-11-13 17:14 ` Conor Dooley
2026-11-13 12:18 ` [PATCH v7 3/7] net: stmmac: dwmac-meson8b: add support for the Amlogic T7 Lucas Tanure
` (4 subsequent siblings)
6 siblings, 1 reply; 9+ messages in thread
From: Lucas Tanure @ 2026-11-13 12:18 UTC (permalink / raw)
To: xianwei.zhao, Andrew Lunn, davem, 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 needs two clocks of
its own. The controller reaches memory through a pipeline stage with
its own gate; nothing else claims it, so it is switched off as unused
and transfers never finish. The glue registers share a gate with the
MDIO multiplexer, which probes after the controller has programmed
them: the writes are lost and the port keeps the bootloader's delays.
With a newer core, a clock list of its own and delays that follow
ethernet-controller.yaml, the T7 gets a binding of its own: the PHY
adds the 2ns, and only the receive delay line offers fine tuning, so
only rx-internal-delay-ps is valid here.
Signed-off-by: Lucas Tanure <tanure@linux.com>
---
.../bindings/net/amlogic,t7-dwmac.yaml | 112 ++++++++++++++++++
1 file changed, 112 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/amlogic,t7-dwmac.yaml
diff --git a/Documentation/devicetree/bindings/net/amlogic,t7-dwmac.yaml b/Documentation/devicetree/bindings/net/amlogic,t7-dwmac.yaml
new file mode 100644
index 000000000000..9b7c3864cd29
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/amlogic,t7-dwmac.yaml
@@ -0,0 +1,112 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/amlogic,t7-dwmac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic T7 DWMAC Ethernet controller
+
+maintainers:
+ - Lucas Tanure <tanure@linux.com>
+
+# The select keeps this schema from matching every "snps,dwmac-5.10a" node.
+select:
+ properties:
+ compatible:
+ contains:
+ const: amlogic,t7-dwmac
+ required:
+ - compatible
+
+allOf:
+ - $ref: snps,dwmac.yaml#
+
+properties:
+ compatible:
+ items:
+ - const: amlogic,t7-dwmac
+ - const: snps,dwmac-5.10a
+
+ reg:
+ items:
+ - description: registers of the DWMAC controller
+ - description: the glue registers PRG_ETH0 and PRG_ETH1
+
+ interrupts:
+ maxItems: 1
+
+ interrupt-names:
+ const: macirq
+
+ 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.
+ - description:
+ APB clock of the glue registers PRG_ETH0 and PRG_ETH1.
+ Without it, they read as zero and ignore writes.
+
+ clock-names:
+ items:
+ - const: stmmaceth
+ - const: clkin0
+ - const: clkin1
+ - const: pipeline
+ - const: pclk
+
+ power-domains:
+ maxItems: 1
+
+ rx-internal-delay-ps:
+ description:
+ Fine tuning of the RX clock, added on top of the delays that
+ phy-mode describes. The PHY adds the 2ns RGMII delays, see
+ ethernet-controller.yaml.
+ default: 0
+ maximum: 3000
+ multipleOf: 200
+
+ # The TX clock has no fine tuning, its only step is a quarter of the
+ # clock period, the full 2ns at 1Gbit/s. The PHY adds the TX delay, so
+ # the property is not accepted.
+ tx-internal-delay-ps: false
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - interrupt-names
+ - clocks
+ - clock-names
+ - phy-mode
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+ #include <dt-bindings/clock/amlogic,t7-peripherals-clkc.h>
+ #include <dt-bindings/clock/amlogic,t7-pll-clkc.h>
+ #include <dt-bindings/clock/amlogic,t7-scmi.h>
+ #include <dt-bindings/power/amlogic,t7-pwrc.h>
+
+ ethernet@fdc00000 {
+ compatible = "amlogic,t7-dwmac", "snps,dwmac-5.10a";
+ reg = <0xfdc00000 0x10000>, <0xfe024000 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>,
+ <&clkc_periphs CLKID_SYS_ETHPHY>;
+ clock-names = "stmmaceth", "clkin0", "clkin1", "pipeline", "pclk";
+ power-domains = <&pwrc PWRC_T7_ETH_ID>;
+ phy-mode = "rgmii-id";
+ };
--
2.56.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v7 2/7] dt-bindings: net: add amlogic,t7-dwmac
2026-11-13 12:18 ` [PATCH v7 2/7] dt-bindings: net: add amlogic,t7-dwmac Lucas Tanure
@ 2026-11-13 17:14 ` Conor Dooley
0 siblings, 0 replies; 9+ messages in thread
From: Conor Dooley @ 2026-11-13 17:14 UTC (permalink / raw)
To: Lucas Tanure
Cc: xianwei.zhao, Andrew Lunn, davem, 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: 75 bytes --]
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] 9+ messages in thread
* [PATCH v7 3/7] net: stmmac: dwmac-meson8b: add support for the Amlogic T7
2026-11-13 12:18 [PATCH v7 0/7] Add ethernet support for the Amlogic T7 Lucas Tanure
2026-11-13 12:18 ` [PATCH v7 1/7] dt-bindings: net: amlogic,meson-dwmac: list the compatible combinations Lucas Tanure
2026-11-13 12:18 ` [PATCH v7 2/7] dt-bindings: net: add amlogic,t7-dwmac Lucas Tanure
@ 2026-11-13 12:18 ` Lucas Tanure
2026-11-13 12:18 ` [PATCH v7 4/7] net: stmmac: dwmac-meson8b: follow the generic RGMII delay rules on the T7 Lucas Tanure
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Lucas Tanure @ 2026-11-13 12:18 UTC (permalink / raw)
To: xianwei.zhao, Andrew Lunn, davem, 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.
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
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 2ad70f0dc4a3..ad30730db57f 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 {
@@ -384,6 +385,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;
int ret;
ret = stmmac_get_platform_resources(pdev, &stmmac_res);
@@ -443,6 +445,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;
@@ -479,6 +488,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",
@@ -500,6 +515,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.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v7 4/7] net: stmmac: dwmac-meson8b: follow the generic RGMII delay rules on the T7
2026-11-13 12:18 [PATCH v7 0/7] Add ethernet support for the Amlogic T7 Lucas Tanure
` (2 preceding siblings ...)
2026-11-13 12:18 ` [PATCH v7 3/7] net: stmmac: dwmac-meson8b: add support for the Amlogic T7 Lucas Tanure
@ 2026-11-13 12:18 ` Lucas Tanure
2026-11-13 12:18 ` [PATCH v7 5/7] arm64: dts: amlogic: t7: add the ethernet pinctrl nodes Lucas Tanure
` (2 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Lucas Tanure @ 2026-11-13 12:18 UTC (permalink / raw)
To: xianwei.zhao, Andrew Lunn, davem, 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,
Andrew Lunn
The delay code reads phy-mode as the list of delays this glue has to
add, falls back to a 2ns transmit delay when no property asks for one,
and takes the vendor delay properties. ethernet-controller.yaml says
the opposite: the PHY adds the 2ns delays, and the MAC properties only
hold small fine tuning added on top. Every board in the tree depends on
the old reading, so it stays as it is.
No T7 board uses this glue yet, so the T7 gets a path of its own that
follows the generic rules: the receive delay line is fine tuning in
200ps steps, and the transmit side, a quarter-period phase step, offers
none, so the transmit property is refused.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Lucas Tanure <tanure@linux.com>
---
.../ethernet/stmicro/stmmac/dwmac-meson8b.c | 42 ++++++++++++++++++-
1 file changed, 41 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
index ad30730db57f..d8c23b280b59 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
@@ -80,6 +80,7 @@ struct meson8b_dwmac;
struct meson8b_dwmac_data {
int (*set_phy_mode)(struct meson8b_dwmac *dwmac);
+ int (*init_delays)(struct meson8b_dwmac *dwmac);
bool has_prg_eth1_rgmii_rx_delay;
bool has_pipeline_clk;
};
@@ -338,6 +339,41 @@ static int meson8b_init_rgmii_delays(struct meson8b_dwmac *dwmac)
return 0;
}
+/*
+ * The T7 follows ethernet-controller.yaml: the PHY adds the 2ns RGMII
+ * delays and this glue only fine tunes the RX clock on top of what
+ * phy-mode describes. Its TX clock has no fine tuning, the only step is
+ * a quarter of the clock period, so the TX property is refused, and so
+ * are the vendor properties of the older SoCs.
+ */
+static int meson_t7_init_delays(struct meson8b_dwmac *dwmac)
+{
+ struct device_node *np = dwmac->dev->of_node;
+ u32 cfg_rxclk_dly = 0;
+
+ if (of_property_present(np, "tx-internal-delay-ps") ||
+ of_property_present(np, "amlogic,tx-delay-ns") ||
+ of_property_present(np, "amlogic,rx-delay-ns"))
+ return dev_err_probe(dwmac->dev, -EINVAL,
+ "only rx-internal-delay-ps is supported, the PHY adds the RGMII delays\n");
+
+ if (phy_interface_mode_is_rgmii(dwmac->phy_mode))
+ cfg_rxclk_dly = FIELD_PREP(PRG_ETH1_CFG_RXCLK_DLY,
+ dwmac->rx_delay_ps / 200);
+ else if (dwmac->rx_delay_ps)
+ return dev_err_probe(dwmac->dev, -EINVAL,
+ "rx-internal-delay-ps needs an RGMII phy-mode\n");
+
+ meson8b_dwmac_mask_bits(dwmac, PRG_ETH0, PRG_ETH0_TXDLY_MASK |
+ PRG_ETH0_ADJ_ENABLE | PRG_ETH0_ADJ_SETUP |
+ PRG_ETH0_ADJ_DELAY | PRG_ETH0_ADJ_SKEW, 0);
+
+ meson8b_dwmac_mask_bits(dwmac, PRG_ETH1, PRG_ETH1_CFG_RXCLK_DLY,
+ cfg_rxclk_dly);
+
+ return 0;
+}
+
static int meson8b_init_prg_eth(struct meson8b_dwmac *dwmac)
{
int ret;
@@ -452,7 +488,7 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
"missing pipeline clock\n");
}
- ret = meson8b_init_rgmii_delays(dwmac);
+ ret = dwmac->data->init_delays(dwmac);
if (ret)
return ret;
@@ -475,21 +511,25 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
static const struct meson8b_dwmac_data meson8b_dwmac_data = {
.set_phy_mode = meson8b_set_phy_mode,
+ .init_delays = meson8b_init_rgmii_delays,
.has_prg_eth1_rgmii_rx_delay = false,
};
static const struct meson8b_dwmac_data meson_axg_dwmac_data = {
.set_phy_mode = meson_axg_set_phy_mode,
+ .init_delays = meson8b_init_rgmii_delays,
.has_prg_eth1_rgmii_rx_delay = false,
};
static const struct meson8b_dwmac_data meson_g12a_dwmac_data = {
.set_phy_mode = meson_axg_set_phy_mode,
+ .init_delays = meson8b_init_rgmii_delays,
.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,
+ .init_delays = meson_t7_init_delays,
.has_prg_eth1_rgmii_rx_delay = true,
.has_pipeline_clk = true,
};
--
2.56.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v7 5/7] arm64: dts: amlogic: t7: add the ethernet pinctrl nodes
2026-11-13 12:18 [PATCH v7 0/7] Add ethernet support for the Amlogic T7 Lucas Tanure
` (3 preceding siblings ...)
2026-11-13 12:18 ` [PATCH v7 4/7] net: stmmac: dwmac-meson8b: follow the generic RGMII delay rules on the T7 Lucas Tanure
@ 2026-11-13 12:18 ` Lucas Tanure
2026-11-13 12:18 ` [PATCH v7 6/7] arm64: dts: amlogic: t7: add the ethernet controller Lucas Tanure
2026-11-13 12:18 ` [PATCH v7 7/7] arm64: dts: amlogic: t7: khadas-vim4: enable the ethernet port Lucas Tanure
6 siblings, 0 replies; 9+ messages in thread
From: Lucas Tanure @ 2026-11-13 12:18 UTC (permalink / raw)
To: xianwei.zhao, Andrew Lunn, davem, 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.
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.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v7 6/7] arm64: dts: amlogic: t7: add the ethernet controller
2026-11-13 12:18 [PATCH v7 0/7] Add ethernet support for the Amlogic T7 Lucas Tanure
` (4 preceding siblings ...)
2026-11-13 12:18 ` [PATCH v7 5/7] arm64: dts: amlogic: t7: add the ethernet pinctrl nodes Lucas Tanure
@ 2026-11-13 12:18 ` Lucas Tanure
2026-11-13 12:18 ` [PATCH v7 7/7] arm64: dts: amlogic: t7: khadas-vim4: enable the ethernet port Lucas Tanure
6 siblings, 0 replies; 9+ messages in thread
From: Lucas Tanure @ 2026-11-13 12:18 UTC (permalink / raw)
To: xianwei.zhao, Andrew Lunn, davem, 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, glue registers for the interface
type and 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.
The controller reaches memory through a pipeline stage with a gate
nothing else claims, so it is switched off as unused. The
glue registers share a clock with the multiplexer, which probes after
the controller has programmed them: unless the controller holds that
clock, the writes are lost and the port keeps the
bootloader's delays.
The multiplexer and the on-chip PHY bus start disabled: a board enables
the multiplexer with the controller, and the on-chip bus only when it
uses that PHY.
Signed-off-by: Lucas Tanure <tanure@linux.com>
---
arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 58 +++++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
index 7bd53ec16607..c6797688805b 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";
+ 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>,
+ <&clkc_periphs CLKID_SYS_ETHPHY>;
+ clock-names = "stmmaceth", "clkin0", "clkin1", "pipeline",
+ "pclk";
+ 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,39 @@ 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>;
+ status = "disabled";
+
+ ext_mdio: mdio@0 {
+ reg = <0>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+
+ int_mdio: mdio@1 {
+ reg = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+
+ 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>;
+ };
+ };
+ };
+
uart_a: serial@78000 {
compatible = "amlogic,t7-uart", "amlogic,meson-s4-uart";
reg = <0x0 0x78000 0x0 0x18>;
--
2.56.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v7 7/7] arm64: dts: amlogic: t7: khadas-vim4: enable the ethernet port
2026-11-13 12:18 [PATCH v7 0/7] Add ethernet support for the Amlogic T7 Lucas Tanure
` (5 preceding siblings ...)
2026-11-13 12:18 ` [PATCH v7 6/7] arm64: dts: amlogic: t7: add the ethernet controller Lucas Tanure
@ 2026-11-13 12:18 ` Lucas Tanure
6 siblings, 0 replies; 9+ messages in thread
From: Lucas Tanure @ 2026-11-13 12:18 UTC (permalink / raw)
To: xianwei.zhao, Andrew Lunn, davem, 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 and the management bus multiplexer, hand the
controller the ethernet pins and point it at the PHY on the external
bus. RGMII needs a delay on each of its two clocks. The board traces
add none, so the PHY adds both, which is what rgmii-id asks of it.
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.
Signed-off-by: Lucas Tanure <tanure@linux.com>
---
.../amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 23 +++++++++++++++++++
1 file changed, 23 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..93327b993d39 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,28 @@ xtal: xtal-clk {
};
};
+ðmac {
+ status = "okay";
+ pinctrl-0 = <ð_pins>, <ð_rgmii_pins>;
+ pinctrl-names = "default";
+ phy-mode = "rgmii-id";
+ phy-handle = <&external_phy>;
+};
+
+ð_phy {
+ status = "okay";
+};
+
+&ext_mdio {
+ external_phy: ethernet-phy@0 {
+ /* Realtek RTL8211FD-CG */
+ reg = <0>;
+
+ interrupt-parent = <&gpio_intc>;
+ interrupts = <GPIOH_6 IRQ_TYPE_LEVEL_LOW>;
+ };
+};
+
&i2c_m_ao_a {
status = "okay";
pinctrl-0 = <&i2c0_ao_d_pins>;
--
2.56.1
^ permalink raw reply related [flat|nested] 9+ messages in thread