* [PATCH v3 1/8] dt-bindings: net: amlogic,meson-dwmac: list the compatible combinations
2026-10-10 10:58 [PATCH v3 0/8] Add ethernet support for the Amlogic T7 Lucas Tanure
@ 2026-10-10 10:58 ` Lucas Tanure
2026-10-10 22:04 ` Martin Blumenstingl
2026-10-10 10:58 ` [PATCH v3 2/8] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac Lucas Tanure
` (6 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Lucas Tanure @ 2026-10-10 10:58 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 related [flat|nested] 15+ messages in thread* Re: [PATCH v3 1/8] dt-bindings: net: amlogic,meson-dwmac: list the compatible combinations
2026-10-10 10:58 ` [PATCH v3 1/8] dt-bindings: net: amlogic,meson-dwmac: list the compatible combinations Lucas Tanure
@ 2026-10-10 22:04 ` Martin Blumenstingl
0 siblings, 0 replies; 15+ messages in thread
From: Martin Blumenstingl @ 2026-10-10 22:04 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,
Maxime Chevallier, Maxime Coquelin, Alexandre Torgue, netdev,
devicetree, linux-arm-kernel, linux-amlogic, linux-kernel,
Conor Dooley
Hi Lucas and Conor,
On Sat, Oct 10, 2026 at 12:59 PM Lucas Tanure <tanure@linux.com> wrote:
[...]
> + - 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
Meson8m2 dwmac reports: User ID: 0x10, Synopsys ID: 0x37
In case it helps I can submit a patch to change the Meson8m2 .dtsi to
use "amlogic,meson8m2-dwmac", "snps,dwmac-3.70a", "snps,dwmac" - then
we could move it here too.
That leaves only Meson6 with a single fallback compatible. I don't
have any Meson6 boards, so it'll have to stay that way.
Best regards,
Martin
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 2/8] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac
2026-10-10 10:58 [PATCH v3 0/8] Add ethernet support for the Amlogic T7 Lucas Tanure
2026-10-10 10:58 ` [PATCH v3 1/8] dt-bindings: net: amlogic,meson-dwmac: list the compatible combinations Lucas Tanure
@ 2026-10-10 10:58 ` Lucas Tanure
2026-10-10 22:14 ` Martin Blumenstingl
2026-10-10 10:58 ` [PATCH v3 3/8] net: stmmac: dwmac-meson8b: add support for the Amlogic T7 Lucas Tanure
` (5 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Lucas Tanure @ 2026-10-10 10:58 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 needs two clocks of
its own. The controller reaches memory through a pipeline stage with a
gate of its own; nothing else claims it, so it is switched off as
unused and the port can no longer finish a transfer. The glue registers
sit in a block clocked together with the MDIO multiplexer, which only
probes after the controller has programmed them: with the clock still
off those writes are lost, and the port keeps whatever delays the
bootloader left behind.
So the T7 gets its own clock list, without the timing adjustment clock
it never uses. The delays follow ethernet-controller.yaml, so the
vendor properties are not valid here.
Assisted-by: LLM
Signed-off-by: Lucas Tanure <tanure@linux.com>
---
.../bindings/net/amlogic,meson-dwmac.yaml | 56 +++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml b/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
index 90ef79161ab1..2353dd9181ed 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,56 @@ allOf:
- const: clkin1
- const: timing-adjustment
+ - 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.
+ - description:
+ clock of the register block holding PRG_ETH0 and PRG_ETH1.
+ Without it, the block reads as zero and ignores writes.
+
+ clock-names:
+ items:
+ - const: stmmaceth
+ - const: clkin0
+ - const: clkin1
+ - const: pipeline
+ - const: pclk
+
+ # The TX delay is a quarter of the RGMII clock period per step,
+ # which is 2ns at 1Gbit/s.
+ tx-internal-delay-ps:
+ enum: [0, 2000, 4000, 6000]
+ default: 0
+
+ rx-internal-delay-ps:
+ default: 0
+
+ # Delay definitions for Meson8b and newer
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - amlogic,meson8b-dwmac
+ - amlogic,meson8m2-dwmac
+ - amlogic,meson-gxbb-dwmac
+ - amlogic,meson-axg-dwmac
+ - amlogic,meson-g12a-dwmac
+ then:
+ properties:
amlogic,tx-delay-ns:
enum: [0, 2, 4, 6]
default: 2
@@ -106,6 +157,7 @@ allOf:
contains:
enum:
- amlogic,meson-g12a-dwmac
+ - amlogic,t7-dwmac
then:
properties:
rx-internal-delay-ps:
@@ -143,6 +195,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 related [flat|nested] 15+ messages in thread* Re: [PATCH v3 2/8] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac
2026-10-10 10:58 ` [PATCH v3 2/8] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac Lucas Tanure
@ 2026-10-10 22:14 ` Martin Blumenstingl
0 siblings, 0 replies; 15+ messages in thread
From: Martin Blumenstingl @ 2026-10-10 22:14 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,
Maxime Chevallier, Maxime Coquelin, Alexandre Torgue, netdev,
devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
Hi Lucas,
On Sat, Oct 10, 2026 at 12:59 PM Lucas Tanure <tanure@linux.com> wrote:
[...]
> + # The TX delay is a quarter of the RGMII clock period per step,
> + # which is 2ns at 1Gbit/s.
> + tx-internal-delay-ps:
> + enum: [0, 2000, 4000, 6000]
> + default: 0
Is 0 a valid value? Let's say we have:
phy-mode = "rgmii-id";
tx-internal-delay-ps = <0>
rx-internal-delay-ps = <0>;
According to patch 8 this means: MAC is responsible for adding the
delays - but it doesn't add any delays.
I'm not sure if this patch (removing 0 from the enum) or patch 8 need updating.
Best regards,
Martin
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 3/8] net: stmmac: dwmac-meson8b: add support for the Amlogic T7
2026-10-10 10:58 [PATCH v3 0/8] Add ethernet support for the Amlogic T7 Lucas Tanure
2026-10-10 10:58 ` [PATCH v3 1/8] dt-bindings: net: amlogic,meson-dwmac: list the compatible combinations Lucas Tanure
2026-10-10 10:58 ` [PATCH v3 2/8] dt-bindings: net: amlogic,meson-dwmac: add amlogic,t7-dwmac Lucas Tanure
@ 2026-10-10 10:58 ` Lucas Tanure
2026-10-10 22:40 ` Martin Blumenstingl
2026-10-10 10:58 ` [PATCH v3 4/8] net: stmmac: dwmac-meson8b: apply the RGMII delays the T7 way Lucas Tanure
` (4 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Lucas Tanure @ 2026-10-10 10:58 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>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.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 e4d5c41294f4..450f7b4b29a6 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.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v3 3/8] net: stmmac: dwmac-meson8b: add support for the Amlogic T7
2026-10-10 10:58 ` [PATCH v3 3/8] net: stmmac: dwmac-meson8b: add support for the Amlogic T7 Lucas Tanure
@ 2026-10-10 22:40 ` Martin Blumenstingl
0 siblings, 0 replies; 15+ messages in thread
From: Martin Blumenstingl @ 2026-10-10 22:40 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,
Maxime Chevallier, Maxime Coquelin, Alexandre Torgue, netdev,
devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
On Sat, Oct 10, 2026 at 12:59 PM Lucas Tanure <tanure@linux.com> 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>
> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> Signed-off-by: Lucas Tanure <tanure@linux.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 4/8] net: stmmac: dwmac-meson8b: apply the RGMII delays the T7 way
2026-10-10 10:58 [PATCH v3 0/8] Add ethernet support for the Amlogic T7 Lucas Tanure
` (2 preceding siblings ...)
2026-10-10 10:58 ` [PATCH v3 3/8] net: stmmac: dwmac-meson8b: add support for the Amlogic T7 Lucas Tanure
@ 2026-10-10 10:58 ` Lucas Tanure
2026-10-10 21:49 ` Martin Blumenstingl
2026-10-10 10:58 ` [PATCH v3 5/8] arm64: dts: amlogic: t7: add the ethernet pinctrl nodes Lucas Tanure
` (3 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Lucas Tanure @ 2026-10-10 10:58 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. phy-mode says whether
the board provides them with longer traces, and the generic
tx-internal-delay-ps and rx-internal-delay-ps properties say this
controller provides them. Whatever is left is the PHY's job.
The existing code reads phy-mode as naming the chip that adds the
delay, which is the opposite, and it ignores both properties. Changing
it would change every board already relying on it, so the T7 gets a
path of its own and the rest stays as it is.
Assisted-by: LLM
Signed-off-by: Lucas Tanure <tanure@linux.com>
---
.../ethernet/stmicro/stmmac/dwmac-meson8b.c | 103 +++++++++++++-----
1 file changed, 76 insertions(+), 27 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
index 450f7b4b29a6..1861a0d45b2d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
@@ -82,6 +82,7 @@ struct meson8b_dwmac_data {
int (*set_phy_mode)(struct meson8b_dwmac *dwmac);
bool has_prg_eth1_rgmii_rx_delay;
bool has_pipeline_clk;
+ bool mac_applies_dt_delays;
};
struct meson8b_dwmac {
@@ -272,6 +273,49 @@ static int meson8b_devm_clk_prepare_enable(struct meson8b_dwmac *dwmac,
meson8b_clk_disable_unprepare, clk);
}
+static int meson_dwmac_init_dt_delays(struct meson8b_dwmac *dwmac,
+ struct plat_stmmacenet_data *plat_dat)
+{
+ struct device_node *np = dwmac->dev->of_node;
+ u32 tx_delay_ps = 0, rx_delay_ps = 0;
+ phy_interface_t phy_mode;
+ bool mac_tx, mac_rx;
+
+ mac_tx = !of_property_read_u32(np, "tx-internal-delay-ps", &tx_delay_ps);
+ mac_rx = !of_property_read_u32(np, "rx-internal-delay-ps", &rx_delay_ps);
+
+ /* one step is a quarter of the RGMII clock period, 2ns at 1Gbit/s */
+ if (tx_delay_ps > 6000 || tx_delay_ps % 2000)
+ return dev_err_probe(dwmac->dev, -EINVAL,
+ "The RGMII TX delay must be 0, 2000, 4000 or 6000ps\n");
+
+ /* the RX delay line moves in 200ps steps and reaches 3000ps */
+ if (rx_delay_ps > 3000 || rx_delay_ps % 200)
+ return dev_err_probe(dwmac->dev, -EINVAL,
+ "The RGMII RX delay range is 0..3000ps in 200ps steps\n");
+
+ phy_mode = phy_fix_phy_mode_for_mac_delays(dwmac->phy_mode, mac_tx,
+ mac_rx);
+ if (phy_mode == PHY_INTERFACE_MODE_NA)
+ return dev_err_probe(dwmac->dev, -EINVAL,
+ "Cannot provide the delays %s asks for\n",
+ phy_modes(dwmac->phy_mode));
+
+ plat_dat->phy_interface = phy_mode;
+
+ 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,
+ FIELD_PREP(PRG_ETH0_TXDLY_MASK,
+ tx_delay_ps / 2000));
+
+ meson8b_dwmac_mask_bits(dwmac, PRG_ETH1, PRG_ETH1_CFG_RXCLK_DLY,
+ FIELD_PREP(PRG_ETH1_CFG_RXCLK_DLY,
+ rx_delay_ps / 200));
+
+ return 0;
+}
+
static int meson8b_init_rgmii_delays(struct meson8b_dwmac *dwmac)
{
u32 tx_dly_config, rx_adj_config, cfg_rxclk_dly, delay_config;
@@ -411,32 +455,34 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
dwmac->dev = &pdev->dev;
dwmac->phy_mode = plat_dat->phy_interface;
- /* 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))
- dwmac->tx_delay_ns = 2;
-
- /* RX delay defaults to 0ps since this is what many boards use */
- if (of_property_read_u32(pdev->dev.of_node, "rx-internal-delay-ps",
- &dwmac->rx_delay_ps)) {
- if (!of_property_read_u32(pdev->dev.of_node,
- "amlogic,rx-delay-ns",
- &dwmac->rx_delay_ps))
- /* convert ns to ps */
- dwmac->rx_delay_ps *= 1000;
- }
-
- if (dwmac->data->has_prg_eth1_rgmii_rx_delay) {
- if (dwmac->rx_delay_ps > 3000 || dwmac->rx_delay_ps % 200) {
- dev_err(dwmac->dev,
- "The RGMII RX delay range is 0..3000ps in 200ps steps");
- return -EINVAL;
+ if (!dwmac->data->mac_applies_dt_delays) {
+ /* 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))
+ dwmac->tx_delay_ns = 2;
+
+ /* RX delay defaults to 0ps since this is what many boards use */
+ if (of_property_read_u32(pdev->dev.of_node, "rx-internal-delay-ps",
+ &dwmac->rx_delay_ps)) {
+ if (!of_property_read_u32(pdev->dev.of_node,
+ "amlogic,rx-delay-ns",
+ &dwmac->rx_delay_ps))
+ /* convert ns to ps */
+ dwmac->rx_delay_ps *= 1000;
}
- } else {
- if (dwmac->rx_delay_ps != 0 && dwmac->rx_delay_ps != 2000) {
- dev_err(dwmac->dev,
- "The only allowed RGMII RX delays values are: 0ps, 2000ps");
- return -EINVAL;
+
+ if (dwmac->data->has_prg_eth1_rgmii_rx_delay) {
+ if (dwmac->rx_delay_ps > 3000 || dwmac->rx_delay_ps % 200) {
+ dev_err(dwmac->dev,
+ "The RGMII RX delay range is 0..3000ps in 200ps steps");
+ return -EINVAL;
+ }
+ } else {
+ if (dwmac->rx_delay_ps != 0 && dwmac->rx_delay_ps != 2000) {
+ dev_err(dwmac->dev,
+ "The only allowed RGMII RX delays values are: 0ps, 2000ps");
+ return -EINVAL;
+ }
}
}
@@ -452,7 +498,10 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
"missing pipeline clock\n");
}
- ret = meson8b_init_rgmii_delays(dwmac);
+ if (dwmac->data->mac_applies_dt_delays)
+ ret = meson_dwmac_init_dt_delays(dwmac, plat_dat);
+ else
+ ret = meson8b_init_rgmii_delays(dwmac);
if (ret)
return ret;
@@ -490,8 +539,8 @@ static const struct meson8b_dwmac_data meson_g12a_dwmac_data = {
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,
+ .mac_applies_dt_delays = true,
};
static const struct of_device_id meson8b_dwmac_match[] = {
--
2.56.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v3 4/8] net: stmmac: dwmac-meson8b: apply the RGMII delays the T7 way
2026-10-10 10:58 ` [PATCH v3 4/8] net: stmmac: dwmac-meson8b: apply the RGMII delays the T7 way Lucas Tanure
@ 2026-10-10 21:49 ` Martin Blumenstingl
0 siblings, 0 replies; 15+ messages in thread
From: Martin Blumenstingl @ 2026-10-10 21:49 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,
Maxime Chevallier, Maxime Coquelin, Alexandre Torgue, netdev,
devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
Hi Lucas,
$subject caught my eye because I didn't understand why there's a "T7
way" for adding RGMII delays since we should be following a standard.
Patch 8/8 in this series documents the standard. Can you please find a
more suitable $subject for this patch?
On Sat, Oct 10, 2026 at 12:59 PM Lucas Tanure <tanure@linux.com> wrote:
[...]
> static int meson8b_init_rgmii_delays(struct meson8b_dwmac *dwmac)
> {
> u32 tx_dly_config, rx_adj_config, cfg_rxclk_dly, delay_config;
> @@ -411,32 +455,34 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
> dwmac->dev = &pdev->dev;
> dwmac->phy_mode = plat_dat->phy_interface;
>
> - /* 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))
> - dwmac->tx_delay_ns = 2;
The 2ns default value in case "amlogic,tx-delay-ns" is absent hasn't
been necessary since commit 093d23db4fff ("ARM64: dts: amlogic: add
the ethernet TX delay configuration").
That commit is part of v4.12. So boards using RGMII and a .dtb without
that property haven't been updated in more than 9 years.
[...]
> - ret = meson8b_init_rgmii_delays(dwmac);
> + if (dwmac->data->mac_applies_dt_delays)
> + ret = meson_dwmac_init_dt_delays(dwmac, plat_dat);
> + else
> + ret = meson8b_init_rgmii_delays(dwmac);
From the discussion in v2 I couldn't understand the overall way forward.
I get that new compatible strings should not rely on old, incorrect
behavior. But what's the path forward for the other SoCs?
[...]
> 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,
> + .mac_applies_dt_delays = true,
This should be a callback function pointer (apply_delays or similar,
to match set_phy_mode) unless there's a way to make older SoCs also
follow the "correct" RGMII delay specification.
Best regards,
Martin
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 5/8] arm64: dts: amlogic: t7: add the ethernet pinctrl nodes
2026-10-10 10:58 [PATCH v3 0/8] Add ethernet support for the Amlogic T7 Lucas Tanure
` (3 preceding siblings ...)
2026-10-10 10:58 ` [PATCH v3 4/8] net: stmmac: dwmac-meson8b: apply the RGMII delays the T7 way Lucas Tanure
@ 2026-10-10 10:58 ` Lucas Tanure
2026-10-10 10:58 ` [PATCH v3 6/8] arm64: dts: amlogic: t7: add the ethernet controller Lucas Tanure
` (2 subsequent siblings)
7 siblings, 0 replies; 15+ messages in thread
From: Lucas Tanure @ 2026-10-10 10:58 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 related [flat|nested] 15+ messages in thread* [PATCH v3 6/8] arm64: dts: amlogic: t7: add the ethernet controller
2026-10-10 10:58 [PATCH v3 0/8] Add ethernet support for the Amlogic T7 Lucas Tanure
` (4 preceding siblings ...)
2026-10-10 10:58 ` [PATCH v3 5/8] arm64: dts: amlogic: t7: add the ethernet pinctrl nodes Lucas Tanure
@ 2026-10-10 10:58 ` Lucas Tanure
2026-10-10 10:58 ` [PATCH v3 7/8] arm64: dts: amlogic: t7: khadas-vim4: enable the ethernet port Lucas Tanure
2026-10-10 10:59 ` [PATCH v3 8/8] dt-bindings: net: ethernet-controller: tabulate who adds the RGMII delays Lucas Tanure
7 siblings, 0 replies; 15+ messages in thread
From: Lucas Tanure @ 2026-10-10 10:58 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, 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 its own
gate that nothing else claims, so it is switched off as unused.
The glue registers share a clock with the multiplexer, which probes
only after the controller has programmed them: unless the controller
holds that clock itself, the writes are lost and the port keeps the
bootloader's delays.
The on-chip PHY follows the G12A; no board in tree uses it, so it is
untested. It stays disabled for boards to enable.
Assisted-by: LLM
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..94ea22514501 100644
--- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
+++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
@@ -250,6 +250,33 @@ 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>,
+ <&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 +672,37 @@ 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>;
+ };
+ };
+ };
+
uart_a: serial@78000 {
compatible = "amlogic,t7-uart", "amlogic,meson-s4-uart";
reg = <0x0 0x78000 0x0 0x18>;
--
2.56.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v3 7/8] arm64: dts: amlogic: t7: khadas-vim4: enable the ethernet port
2026-10-10 10:58 [PATCH v3 0/8] Add ethernet support for the Amlogic T7 Lucas Tanure
` (5 preceding siblings ...)
2026-10-10 10:58 ` [PATCH v3 6/8] arm64: dts: amlogic: t7: add the ethernet controller Lucas Tanure
@ 2026-10-10 10:58 ` Lucas Tanure
2026-10-10 22:00 ` Martin Blumenstingl
2026-10-10 10:59 ` [PATCH v3 8/8] dt-bindings: net: ethernet-controller: tabulate who adds the RGMII delays Lucas Tanure
7 siblings, 1 reply; 15+ messages in thread
From: Lucas Tanure @ 2026-10-10 10:58 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 traces. 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 | 20 +++++++++++++++++++
1 file changed, 20 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..c18bde02ac40 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,25 @@ 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>;
+
+ 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.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v3 7/8] arm64: dts: amlogic: t7: khadas-vim4: enable the ethernet port
2026-10-10 10:58 ` [PATCH v3 7/8] arm64: dts: amlogic: t7: khadas-vim4: enable the ethernet port Lucas Tanure
@ 2026-10-10 22:00 ` Martin Blumenstingl
0 siblings, 0 replies; 15+ messages in thread
From: Martin Blumenstingl @ 2026-10-10 22:00 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,
Maxime Chevallier, Maxime Coquelin, Alexandre Torgue, netdev,
devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
On Sat, Oct 10, 2026 at 12:59 PM Lucas Tanure <tanure@linux.com> wrote:
[...]
> RGMII needs a delay on each of its two clocks, and on this board
> both come from inside the chips, not from the board traces. The PHY
> adds the one on receive. Its transmit delay does not work here, so the
> controller adds that one.
[...]
> +ðmac {
> + status = "okay";
> + pinctrl-0 = <ð_pins>, <ð_rgmii_pins>;
> + pinctrl-names = "default";
> + phy-mode = "rgmii-id";
> + phy-handle = <&external_phy>;
> + tx-internal-delay-ps = <2000>;
You're stating that RTL8211F's TX delay doesn't work but not explaining why.
I haven't come across this behavior before and I'm worried that that's
an issue with a batch of RTL8211F.
What if the previous/next batch of RTL8211F will have working TX delay
again - wouldn't that mean 4ns delay in total unless the RTL8211F
driver is changed?
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v3 8/8] dt-bindings: net: ethernet-controller: tabulate who adds the RGMII delays
2026-10-10 10:58 [PATCH v3 0/8] Add ethernet support for the Amlogic T7 Lucas Tanure
` (6 preceding siblings ...)
2026-10-10 10:58 ` [PATCH v3 7/8] arm64: dts: amlogic: t7: khadas-vim4: enable the ethernet port Lucas Tanure
@ 2026-10-10 10:59 ` Lucas Tanure
2026-10-10 22:37 ` Martin Blumenstingl
7 siblings, 1 reply; 15+ messages in thread
From: Lucas Tanure @ 2026-10-10 10:59 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 informative section explains in prose how phy-mode, the delay
properties in the MAC node and the mode handed to the PHY fit together,
and says itself that developers often get this wrong. A reader has to
work through several paragraphs before answering the one question they
usually have: for this phy-mode and these properties, which part adds
which delay.
Add a table that answers it at a glance, with one row for every
combination the properties allow.
Assisted-by: LLM
Signed-off-by: Lucas Tanure <tanure@linux.com>
---
.../bindings/net/ethernet-controller.yaml | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
index 1bafd687dcb1..bba27a9feb61 100644
--- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
+++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
@@ -339,6 +339,24 @@ additionalProperties: true
# has added. Failure to remove the delay will result in a
# non-functioning link.
#
+# Put together, with the two properties in the MAC node, this is who
+# adds each delay:
+#
+# phy-mode tx-internal-delay-ps rx-internal-delay-ps TX delay RX delay
+# rgmii - - PCB trace PCB trace
+# rgmii-id - - PHY PHY
+# rgmii-id present - MAC PHY
+# rgmii-id - present PHY MAC
+# rgmii-id present present MAC MAC
+# rgmii-txid - - PHY PCB trace
+# rgmii-txid present - MAC PCB trace
+# rgmii-rxid - - PCB trace PHY
+# rgmii-rxid - present PCB trace MAC
+#
+# A property for a clock the PCB already delays is not in this table.
+# It is either the fine tuning described next, or a mistake the MAC
+# should report as a fatal error.
+#
# Sometimes there is a need to fine tune the delays. Often the MAC or
# PHY can perform this fine tuning. In the MAC node, the Device Tree
# properties 'rx-internal-delay-ps' and 'tx-internal-delay-ps' should
--
2.56.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v3 8/8] dt-bindings: net: ethernet-controller: tabulate who adds the RGMII delays
2026-10-10 10:59 ` [PATCH v3 8/8] dt-bindings: net: ethernet-controller: tabulate who adds the RGMII delays Lucas Tanure
@ 2026-10-10 22:37 ` Martin Blumenstingl
0 siblings, 0 replies; 15+ messages in thread
From: Martin Blumenstingl @ 2026-10-10 22:37 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,
Maxime Chevallier, Maxime Coquelin, Alexandre Torgue, netdev,
devicetree, linux-arm-kernel, linux-amlogic, linux-kernel
Hi Andrew, Hi Lucas,
On Sat, Oct 10, 2026 at 12:59 PM Lucas Tanure <tanure@linux.com> wrote:
[...]
> +# phy-mode tx-internal-delay-ps rx-internal-delay-ps TX delay RX delay
> +# rgmii - - PCB trace PCB trace
> +# rgmii-id - - PHY PHY
> +# rgmii-id present - MAC PHY
> +# rgmii-id - present PHY MAC
> +# rgmii-id present present MAC MAC
> +# rgmii-txid - - PHY PCB trace
> +# rgmii-txid present - MAC PCB trace
> +# rgmii-rxid - - PCB trace PHY
> +# rgmii-rxid - present PCB trace MAC
We have some boards where the PCB traces result in part (1200ps) of
the delay needed for RGMII (2000ps).
The remainder (800ps) has to be added by either PHY or MAC: the
(RTL8211F) PHY can only generate 0 or 2000ps delay so the MAC has to
take over.
For the three boards I have in mind, please see $ git grep
rx-internal-delay-ps arch/arm64/boot/dts/amlogic/
> +# A property for a clock the PCB already delays is not in this table.
Can you please explain this sentence (I'm not a native English speaker)?
How I interpret the sentence: The PCB may add delays but those are
implicit and not part of the {rx,tx}-internal-delay-ps properties. If
the delays added by the PCB don't cover the full 2ns requirement then
either MAC or PHY need to add the remainder, see fine-tuning below.
> +# It is either the fine tuning described next, or a mistake the MAC
> +# should report as a fatal error.
How can I differentiate between "fine tuning" and "mistake"?
Best regards,
Martin
^ permalink raw reply [flat|nested] 15+ messages in thread