2022-03-14 15:57:11 +08:00
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id : http://devicetree.org/schemas/net/mediatek-dwmac.yaml#
$schema : http://devicetree.org/meta-schemas/core.yaml#
title : MediaTek DWMAC glue layer controller
maintainers :
- Biao Huang <biao.huang@mediatek.com>
description :
This file documents platform glue layer for stmmac.
# We need a select here so we don't match all nodes with 'snps,dwmac'
select :
properties :
compatible :
contains :
enum :
- mediatek,mt2712-gmac
2022-09-29 09:47:55 +08:00
- mediatek,mt8188-gmac
2022-03-14 15:57:13 +08:00
- mediatek,mt8195-gmac
2022-03-14 15:57:11 +08:00
required :
- compatible
allOf :
2023-06-09 16:07:12 +02:00
- $ref : snps,dwmac.yaml#
2022-03-14 15:57:11 +08:00
properties :
compatible :
2022-03-14 15:57:13 +08:00
oneOf :
- items :
- enum :
- mediatek,mt2712-gmac
- const : snps,dwmac-4.20a
- items :
- enum :
- mediatek,mt8195-gmac
- const : snps,dwmac-5.10a
2022-09-29 09:47:55 +08:00
- items :
- enum :
- mediatek,mt8188-gmac
- const : mediatek,mt8195-gmac
- const : snps,dwmac-5.10a
2022-03-14 15:57:11 +08:00
clocks :
2022-03-14 15:57:13 +08:00
minItems : 5
2022-03-14 15:57:11 +08:00
items :
- description : AXI clock
- description : APB clock
- description : MAC Main clock
- description : PTP clock
- description : RMII reference clock provided by MAC
2022-03-14 15:57:13 +08:00
- description : MAC clock gate
2022-03-14 15:57:11 +08:00
clock-names :
2022-03-14 15:57:13 +08:00
minItems : 5
2022-03-14 15:57:11 +08:00
items :
- const : axi
- const : apb
- const : mac_main
- const : ptp_ref
- const : rmii_internal
2022-03-14 15:57:13 +08:00
- const : mac_cg
2022-03-14 15:57:11 +08:00
2022-05-25 20:41:48 -05:00
power-domains :
maxItems : 1
2022-03-14 15:57:11 +08:00
mediatek,pericfg :
$ref : /schemas/types.yaml#/definitions/phandle
description :
The phandle to the syscon node that control ethernet
interface and timing delay.
mediatek,tx-delay-ps :
description :
The internal TX clock delay (provided by this driver) in nanoseconds.
For MT2712 RGMII interface, Allowed value need to be a multiple of 170,
or will round down. Range 0~31*170.
For MT2712 RMII/MII interface, Allowed value need to be a multiple of 550,
or will round down. Range 0~31*550.
2022-09-29 09:47:55 +08:00
For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a multiple of 290,
2022-03-14 15:57:13 +08:00
or will round down. Range 0~31*290.
2022-03-14 15:57:11 +08:00
mediatek,rx-delay-ps :
description :
The internal RX clock delay (provided by this driver) in nanoseconds.
For MT2712 RGMII interface, Allowed value need to be a multiple of 170,
or will round down. Range 0~31*170.
For MT2712 RMII/MII interface, Allowed value need to be a multiple of 550,
or will round down. Range 0~31*550.
2022-09-29 09:47:55 +08:00
For MT8188/MT8195 RGMII/RMII/MII interface, Allowed value need to be a multiple
2022-03-14 15:57:13 +08:00
of 290, or will round down. Range 0~31*290.
2022-03-14 15:57:11 +08:00
mediatek,rmii-rxc :
type : boolean
description :
If present, indicates that the RMII reference clock, which is from external
PHYs, is connected to RXC pin. Otherwise, is connected to TXC pin.
mediatek,rmii-clk-from-mac :
type : boolean
description :
If present, indicates that MAC provides the RMII reference clock, which
outputs to TXC pin only.
mediatek,txc-inverse :
type : boolean
description :
If present, indicates that
1 . tx clock will be inversed in MII/RGMII case,
2 . tx clock inside MAC will be inversed relative to reference clock
which is from external PHYs in RMII case, and it rarely happen.
3 . the reference clock, which outputs to TXC pin will be inversed in RMII case
when the reference clock is from MAC.
mediatek,rxc-inverse :
type : boolean
description :
If present, indicates that
1 . rx clock will be inversed in MII/RGMII case.
2 . reference clock will be inversed when arrived at MAC in RMII case, when
the reference clock is from external PHYs.
3 . the inside clock, which be sent to MAC, will be inversed in RMII case when
the reference clock is from MAC.
2022-03-14 15:57:13 +08:00
mediatek,mac-wol :
type : boolean
description :
If present, indicates that MAC supports WOL(Wake-On-LAN), and MAC WOL will be enabled.
Otherwise, PHY WOL is perferred.
2022-03-14 15:57:11 +08:00
required :
- compatible
- reg
- interrupts
- interrupt-names
- clocks
- clock-names
- phy-mode
- mediatek,pericfg
unevaluatedProperties : false
examples :
- |
#include <dt-bindings/clock/mt2712-clk.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/power/mt2712-power.h>
eth : ethernet@1101c000 {
compatible = "mediatek,mt2712-gmac", "snps,dwmac-4.20a";
reg = <0x1101c000 0x1300>;
interrupts = <GIC_SPI 237 IRQ_TYPE_LEVEL_LOW>;
interrupt-names = "macirq";
2023-07-02 20:23:08 +02:00
phy-mode = "rgmii-rxid";
2022-03-14 15:57:11 +08:00
mac-address = [00 55 7b b5 7d f7];
clock-names = "axi",
"apb" ,
"mac_main" ,
"ptp_ref" ,
"rmii_internal" ;
clocks = <&pericfg CLK_PERI_GMAC>,
<&pericfg CLK_PERI_GMAC_PCLK>,
<&topckgen CLK_TOP_ETHER_125M_SEL>,
<&topckgen CLK_TOP_ETHER_50M_SEL>,
<&topckgen CLK_TOP_ETHER_50M_RMII_SEL>;
assigned-clocks = <&topckgen CLK_TOP_ETHER_125M_SEL>,
<&topckgen CLK_TOP_ETHER_50M_SEL>,
<&topckgen CLK_TOP_ETHER_50M_RMII_SEL>;
assigned-clock-parents = <&topckgen CLK_TOP_ETHERPLL_125M>,
<&topckgen CLK_TOP_APLL1_D3>,
<&topckgen CLK_TOP_ETHERPLL_50M>;
power-domains = <&scpsys MT2712_POWER_DOMAIN_AUDIO>;
mediatek,pericfg = <&pericfg>;
mediatek,tx-delay-ps = <1530>;
snps,txpbl = <1>;
snps,rxpbl = <1>;
snps,reset-gpio = <&pio 87 GPIO_ACTIVE_LOW>;
snps,reset-delays-us = <0 10000 10000>;
};