* [PATCH v8 1/4] dt-bindings: net: amlogic,g12a-mdio-mux: add the T7 compatible
2026-11-21 21:30 [PATCH v8 0/4] Add ethernet support for the Amlogic T7 Lucas Tanure
@ 2026-11-21 21:30 ` Lucas Tanure
2026-11-21 21:31 ` [PATCH v8 2/4] arm64: dts: amlogic: t7: add the ethernet pinctrl nodes Lucas Tanure
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Lucas Tanure @ 2026-11-21 21:30 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 management bus multiplexer as the G12A, in front
of the same on-chip 100M PHY, and the G12A driver runs it unchanged.
But a device tree that names only the G12A string leaves no way to
tell the two apart later: if a difference between the two blocks
turns up, every T7 board would have to change its compatible to get
the fix.
Give the T7 a compatible of its own with the G12A one as fallback, so
the existing driver keeps binding and a T7-specific match can be added
without touching the boards.
Signed-off-by: Lucas Tanure <tanure@linux.com>
---
.../devicetree/bindings/net/amlogic,g12a-mdio-mux.yaml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/net/amlogic,g12a-mdio-mux.yaml b/Documentation/devicetree/bindings/net/amlogic,g12a-mdio-mux.yaml
index ec5c038ce6a0..ad95562d1f3b 100644
--- a/Documentation/devicetree/bindings/net/amlogic,g12a-mdio-mux.yaml
+++ b/Documentation/devicetree/bindings/net/amlogic,g12a-mdio-mux.yaml
@@ -19,7 +19,11 @@ allOf:
properties:
compatible:
- const: amlogic,g12a-mdio-mux
+ oneOf:
+ - const: amlogic,g12a-mdio-mux
+ - items:
+ - const: amlogic,t7-mdio-mux
+ - const: amlogic,g12a-mdio-mux
reg:
maxItems: 1
--
2.56.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH v8 2/4] arm64: dts: amlogic: t7: add the ethernet pinctrl nodes
2026-11-21 21:30 [PATCH v8 0/4] Add ethernet support for the Amlogic T7 Lucas Tanure
2026-11-21 21:30 ` [PATCH v8 1/4] dt-bindings: net: amlogic,g12a-mdio-mux: add the T7 compatible Lucas Tanure
@ 2026-11-21 21:31 ` Lucas Tanure
2026-11-21 21:31 ` [PATCH v8 3/4] arm64: dts: amlogic: t7: add the ethernet controller Lucas Tanure
2026-11-21 21:31 ` [PATCH v8 4/4] arm64: dts: amlogic: t7: khadas-vim4: enable the ethernet port Lucas Tanure
3 siblings, 0 replies; 5+ messages in thread
From: Lucas Tanure @ 2026-11-21 21:31 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>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
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 @@
};
};
+ 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] 5+ messages in thread* [PATCH v8 3/4] arm64: dts: amlogic: t7: add the ethernet controller
2026-11-21 21:30 [PATCH v8 0/4] Add ethernet support for the Amlogic T7 Lucas Tanure
2026-11-21 21:30 ` [PATCH v8 1/4] dt-bindings: net: amlogic,g12a-mdio-mux: add the T7 compatible Lucas Tanure
2026-11-21 21:31 ` [PATCH v8 2/4] arm64: dts: amlogic: t7: add the ethernet pinctrl nodes Lucas Tanure
@ 2026-11-21 21:31 ` Lucas Tanure
2026-11-21 21:31 ` [PATCH v8 4/4] arm64: dts: amlogic: t7: khadas-vim4: enable the ethernet port Lucas Tanure
3 siblings, 0 replies; 5+ messages in thread
From: Lucas Tanure @ 2026-11-21 21:31 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..eb7f46c98b0b 100644
--- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
+++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
@@ -250,6 +250,31 @@
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 @@
<10 11 12 13 14 15 16 17 18 19 20 21>;
};
+ eth_phy: mdio-multiplexer@28000 {
+ compatible = "amlogic,t7-mdio-mux", "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] 5+ messages in thread* [PATCH v8 4/4] arm64: dts: amlogic: t7: khadas-vim4: enable the ethernet port
2026-11-21 21:30 [PATCH v8 0/4] Add ethernet support for the Amlogic T7 Lucas Tanure
` (2 preceding siblings ...)
2026-11-21 21:31 ` [PATCH v8 3/4] arm64: dts: amlogic: t7: add the ethernet controller Lucas Tanure
@ 2026-11-21 21:31 ` Lucas Tanure
3 siblings, 0 replies; 5+ messages in thread
From: Lucas Tanure @ 2026-11-21 21:31 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. Its address pins
strap it to 1; it also answers on 0, the RTL8211F broadcast address,
so the vendor tree lists 0.
Enable the controller and the management bus multiplexer, hand the
controller the ethernet pins and point it at the PHY. 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 is on GPIOH_6, so link changes are reported, not
polled. The reset is an RC network on the board, not a SoC pin: no
reset line.
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..7b86ab2579aa 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 @@
};
};
+ð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@1 {
+ /* Realtek RTL8211FD-CG */
+ reg = <1>;
+
+ 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] 5+ messages in thread