MediaTek Frame Engine Ethernet controller
Schema identifier ($id): "http://devicetree.org/schemas/net/mediatek,net.yaml#"
Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"
Maintainers (maintainers): "Lorenzo Bianconi <lorenzo@kernel.org>", "Felix Fietkau <nbd@nbd.name>"
The frame engine ethernet controller can be found on MediaTek SoCs. These SoCs have dual GMAC ports.
Properties and child nodes (properties) #
compatible — required here #
Allowed values (enum): "mediatek,mt2701-eth", "mediatek,mt7623-eth", "mediatek,mt7621-eth", "mediatek,mt7622-eth", "mediatek,mt7629-eth", "mediatek,mt7981-eth", "mediatek,mt7986-eth", "mediatek,mt7988-eth", "ralink,rt5350-eth"
reg — required here #
Maximum number of items (maxItems): 1
clocks — required here #
Minimum number of items (minItems): 2
Maximum number of items (maxItems): 24
clock-names — required here #
Minimum number of items (minItems): 2
Maximum number of items (maxItems): 24
interrupts — required here #
Minimum number of items (minItems): 1
Maximum number of items (maxItems): 8
interrupt-names — not listed as required here #
Minimum number of items (minItems): 1
Array item rules (items) #
Item 1
Exact value (
const):"fe0"
Item 2
Exact value (
const):"fe1"
Item 3
Exact value (
const):"fe2"
Item 4
Exact value (
const):"fe3"
Item 5
Exact value (
const):"pdma0"
Item 6
Exact value (
const):"pdma1"
Item 7
Exact value (
const):"pdma2"
Item 8
Exact value (
const):"pdma3"
power-domains — not listed as required here #
Maximum number of items (maxItems): 1
resets — not listed as required here #
Maximum number of items (maxItems): 3
reset-names — not listed as required here #
Array item rules (items) #
Item 1
Exact value (
const):"fe"
Item 2
Exact value (
const):"gmac"
Item 3
Exact value (
const):"ppe"
sram — not listed as required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle
phandle to mmio SRAM
mediatek,ethsys — required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle
Phandle to the syscon node that handles the port setup.
cci-control-port — not listed as required here #
true — No constraints added by this property rule.
mediatek,hifsys — not listed as required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle
Phandle to the mediatek hifsys controller used to provide various clocks and reset to the system.
mediatek,infracfg — not listed as required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle
Phandle to the syscon node that handles the path from GMAC to PHY variants.
mediatek,pcie-mirror — not listed as required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle
Phandle to the mediatek pcie-mirror controller.
mediatek,pctl — not listed as required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle
Phandle to the syscon node that handles the ports slew rate and driver current.
mediatek,sgmiisys — not listed as required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle-array
Minimum number of items (minItems): 1
Maximum number of items (maxItems): 2
Array item rules (items) #
Maximum number of items (
maxItems):1
A list of phandle to the syscon node that handles the SGMII setup which is required for those SoCs equipped with SGMII.
mediatek,wed — not listed as required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle-array
Minimum number of items (minItems): 1
Maximum number of items (maxItems): 2
Array item rules (items) #
Maximum number of items (
maxItems):1
List of phandles to wireless ethernet dispatch nodes.
mediatek,wed-pcie — not listed as required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle
Phandle to the mediatek wed-pcie controller.
dma-coherent — not listed as required here #
true — No constraints added by this property rule.
mdio-bus — not listed as required here #
Shared schema rule ($ref): mdio.yaml#
Properties not evaluated by applicable rules (unevaluatedProperties) #
false
Not allowed by this rule.
#address-cells — not listed as required here #
Exact value (const): 1
#size-cells — not listed as required here #
Exact value (const): 0
All of these rules must match (allOf) #
Rule 1 #
Shared schema rule (
$ref):ethernet-controller.yaml#
Rule 2 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)Allowed values (
enum):"mediatek,mt2701-eth","mediatek,mt7623-eth"When the condition matches (
then) #Properties and child nodes (
properties)
interrupts— not listed as required hereMinimum number of items (
minItems):3Maximum number of items (
maxItems):3
interrupt-names— not listed as required hereMinimum number of items (
minItems):3Maximum number of items (
maxItems):3
clocks— not listed as required hereMinimum number of items (
minItems):4Maximum number of items (
maxItems):4
clock-names— not listed as required hereArray item rules (
items)Item 1
Exact value (
const):"ethif"Item 2
Exact value (
const):"esw"Item 3
Exact value (
const):"gp1"Item 4
Exact value (
const):"gp2"
sram— not listed as required here
false— Not permitted by this property rule.
mediatek,infracfg— not listed as required here
false— Not permitted by this property rule.
mediatek,wed— not listed as required here
false— Not permitted by this property rule.
mediatek,wed-pcie— not listed as required here
false— Not permitted by this property rule.When the condition does not match (
else) #Properties and child nodes (
properties)
mediatek,pctl— not listed as required here
false— Not permitted by this property rule.
Rule 3 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)When the condition matches (
then) #Properties and child nodes (
properties)
interrupts— not listed as required hereMaximum number of items (
maxItems):1
interrupt-names— not listed as required hereMaximum number of items (
maxItems):1
clocks— not listed as required hereMinimum number of items (
minItems):2Maximum number of items (
maxItems):2
clock-names— not listed as required hereArray item rules (
items)Item 1
Exact value (
const):"ethif"Item 2
Exact value (
const):"fe"
sram— not listed as required here
false— Not permitted by this property rule.
mediatek,infracfg— not listed as required here
false— Not permitted by this property rule.
mediatek,wed— not listed as required here
false— Not permitted by this property rule.
mediatek,wed-pcie— not listed as required here
false— Not permitted by this property rule.
Rule 4 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)Exact value (
const):"mediatek,mt7622-eth"When the condition matches (
then) #Properties and child nodes (
properties)
interrupts— not listed as required hereMinimum number of items (
minItems):3Maximum number of items (
maxItems):3
interrupt-names— not listed as required hereMinimum number of items (
minItems):3Maximum number of items (
maxItems):3
clocks— not listed as required hereMinimum number of items (
minItems):11Maximum number of items (
maxItems):11
clock-names— not listed as required hereArray item rules (
items)Item 1
Exact value (
const):"ethif"Item 2
Exact value (
const):"esw"Item 3
Exact value (
const):"gp0"Item 4
Exact value (
const):"gp1"Item 5
Exact value (
const):"gp2"Item 6
Exact value (
const):"sgmii_tx250m"Item 7
Exact value (
const):"sgmii_rx250m"Item 8
Exact value (
const):"sgmii_cdr_ref"Item 9
Exact value (
const):"sgmii_cdr_fb"Item 10
Exact value (
const):"sgmii_ck"Item 11
Exact value (
const):"eth2pll"
sram— not listed as required here
false— Not permitted by this property rule.
mediatek,infracfg— not listed as required here
false— Not permitted by this property rule.
mediatek,sgmiisys— not listed as required hereMinimum number of items (
minItems):1Maximum number of items (
maxItems):1
mediatek,wed— not listed as required hereMinimum number of items (
minItems):2
mediatek,wed-pcie— not listed as required here
false— Not permitted by this property rule.When the condition does not match (
else) #Properties and child nodes (
properties)
mediatek,pcie-mirror— not listed as required here
false— Not permitted by this property rule.
Rule 5 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)Exact value (
const):"mediatek,mt7629-eth"When the condition matches (
then) #Properties and child nodes (
properties)
interrupts— not listed as required hereMinimum number of items (
minItems):3Maximum number of items (
maxItems):3
interrupt-names— not listed as required hereMinimum number of items (
minItems):3Maximum number of items (
maxItems):3
clocks— not listed as required hereMinimum number of items (
minItems):17Maximum number of items (
maxItems):17
clock-names— not listed as required hereArray item rules (
items)Item 1
Exact value (
const):"ethif"Item 2
Exact value (
const):"sgmiitop"Item 3
Exact value (
const):"esw"Item 4
Exact value (
const):"gp0"Item 5
Exact value (
const):"gp1"Item 6
Exact value (
const):"gp2"Item 7
Exact value (
const):"fe"Item 8
Exact value (
const):"sgmii_tx250m"Item 9
Exact value (
const):"sgmii_rx250m"Item 10
Exact value (
const):"sgmii_cdr_ref"Item 11
Exact value (
const):"sgmii_cdr_fb"Item 12
Exact value (
const):"sgmii2_tx250m"Item 13
Exact value (
const):"sgmii2_rx250m"Item 14
Exact value (
const):"sgmii2_cdr_ref"Item 15
Exact value (
const):"sgmii2_cdr_fb"Item 16
Exact value (
const):"sgmii_ck"Item 17
Exact value (
const):"eth2pll"
sram— not listed as required here
false— Not permitted by this property rule.
mediatek,sgmiisys— not listed as required hereMinimum number of items (
minItems):2Maximum number of items (
maxItems):2
mediatek,wed— not listed as required here
false— Not permitted by this property rule.
mediatek,wed-pcie— not listed as required here
false— Not permitted by this property rule.
Rule 6 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)Exact value (
const):"mediatek,mt7981-eth"When the condition matches (
then) #Properties and child nodes (
properties)
interrupts— not listed as required hereMinimum number of items (
minItems):8
interrupt-names— not listed as required hereMinimum number of items (
minItems):8
clocks— not listed as required hereMinimum number of items (
minItems):15Maximum number of items (
maxItems):15
clock-names— not listed as required hereArray item rules (
items)Item 1
Exact value (
const):"fe"Item 2
Exact value (
const):"gp2"Item 3
Exact value (
const):"gp1"Item 4
Exact value (
const):"wocpu0"Item 5
Exact value (
const):"sgmii_ck"Item 6
Exact value (
const):"sgmii_tx250m"Item 7
Exact value (
const):"sgmii_rx250m"Item 8
Exact value (
const):"sgmii_cdr_ref"Item 9
Exact value (
const):"sgmii_cdr_fb"Item 10
Exact value (
const):"sgmii2_tx250m"Item 11
Exact value (
const):"sgmii2_rx250m"Item 12
Exact value (
const):"sgmii2_cdr_ref"Item 13
Exact value (
const):"sgmii2_cdr_fb"Item 14
Exact value (
const):"netsys0"Item 15
Exact value (
const):"netsys1"
mediatek,sgmiisys— not listed as required hereMinimum number of items (
minItems):2Maximum number of items (
maxItems):2
mediatek,wed— not listed as required hereMaximum number of items (
maxItems):1
Rule 7 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)Exact value (
const):"mediatek,mt7986-eth"When the condition matches (
then) #Properties and child nodes (
properties)
interrupts— not listed as required hereMinimum number of items (
minItems):8
interrupt-names— not listed as required hereMinimum number of items (
minItems):8
clocks— not listed as required hereMinimum number of items (
minItems):15Maximum number of items (
maxItems):15
clock-names— not listed as required hereArray item rules (
items)Item 1
Exact value (
const):"fe"Item 2
Exact value (
const):"gp2"Item 3
Exact value (
const):"gp1"Item 4
Exact value (
const):"wocpu1"Item 5
Exact value (
const):"wocpu0"Item 6
Exact value (
const):"sgmii_tx250m"Item 7
Exact value (
const):"sgmii_rx250m"Item 8
Exact value (
const):"sgmii_cdr_ref"Item 9
Exact value (
const):"sgmii_cdr_fb"Item 10
Exact value (
const):"sgmii2_tx250m"Item 11
Exact value (
const):"sgmii2_rx250m"Item 12
Exact value (
const):"sgmii2_cdr_ref"Item 13
Exact value (
const):"sgmii2_cdr_fb"Item 14
Exact value (
const):"netsys0"Item 15
Exact value (
const):"netsys1"
mediatek,infracfg— not listed as required here
false— Not permitted by this property rule.
mediatek,sgmiisys— not listed as required hereMinimum number of items (
minItems):2Maximum number of items (
maxItems):2
mediatek,wed— not listed as required hereMinimum number of items (
minItems):2
Rule 8 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)Exact value (
const):"mediatek,mt7988-eth"When the condition matches (
then) #Properties and child nodes (
properties)
interrupts— not listed as required hereMinimum number of items (
minItems):8
interrupt-names— not listed as required hereMinimum number of items (
minItems):8
clocks— not listed as required hereMinimum number of items (
minItems):24Maximum number of items (
maxItems):24
clock-names— not listed as required hereArray item rules (
items)Item 1
Exact value (
const):"crypto"Item 2
Exact value (
const):"fe"Item 3
Exact value (
const):"gp2"Item 4
Exact value (
const):"gp1"Item 5
Exact value (
const):"gp3"Item 6
Exact value (
const):"ethwarp_wocpu2"Item 7
Exact value (
const):"ethwarp_wocpu1"Item 8
Exact value (
const):"ethwarp_wocpu0"Item 9
Exact value (
const):"esw"Item 10
Exact value (
const):"top_eth_gmii_sel"Item 11
Exact value (
const):"top_eth_refck_50m_sel"Item 12
Exact value (
const):"top_eth_sys_200m_sel"Item 13
Exact value (
const):"top_eth_sys_sel"Item 14
Exact value (
const):"top_eth_xgmii_sel"Item 15
Exact value (
const):"top_eth_mii_sel"Item 16
Exact value (
const):"top_netsys_sel"Item 17
Exact value (
const):"top_netsys_500m_sel"Item 18
Exact value (
const):"top_netsys_pao_2x_sel"Item 19
Exact value (
const):"top_netsys_sync_250m_sel"Item 20
Exact value (
const):"top_netsys_ppefb_250m_sel"Item 21
Exact value (
const):"top_netsys_warp_sel"Item 22
Exact value (
const):"xgp1"Item 23
Exact value (
const):"xgp2"Item 24
Exact value (
const):"xgp3"
mediatek,wed— not listed as required hereMinimum number of items (
minItems):2
Rule 9 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)Exact value (
const):"ralink,rt5350-eth"When the condition matches (
then) #Properties and child nodes (
properties)
mediatek,wed— not listed as required hereMinimum number of items (
minItems):2
Properties matching a name pattern (patternProperties) #
^mac@[0-2]$ — name matches this regular expression #
Value type (type): "object"
Properties not evaluated by applicable rules (unevaluatedProperties) #
false
Not allowed by this rule.
All of these rules must match (allOf) #
Rule 1
Shared schema rule (
$ref):ethernet-controller.yaml#
Ethernet MAC node
Properties and child nodes (properties) #
compatible — required here
Exact value (const): "mediatek,eth-mac"
reg — required here
Maximum number of items (maxItems): 1
Required in this object (required): "reg", "compatible"
Required in this object (required): "compatible", "reg", "interrupts", "clocks", "clock-names", "mediatek,ethsys"
Properties not evaluated by applicable rules (unevaluatedProperties) #
false
Not allowed by this rule.
Examples (examples) #
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/clock/mt7622-clk.h>
#include <dt-bindings/power/mt7622-power.h>
soc {
#address-cells = <2>;
#size-cells = <2>;
ethernet: ethernet@1b100000 {
compatible = "mediatek,mt7622-eth";
reg = <0 0x1b100000 0 0x20000>;
interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_LOW>,
<GIC_SPI 224 IRQ_TYPE_LEVEL_LOW>,
<GIC_SPI 225 IRQ_TYPE_LEVEL_LOW>;
clocks = <&topckgen CLK_TOP_ETH_SEL>,
<ðsys CLK_ETH_ESW_EN>,
<ðsys CLK_ETH_GP0_EN>,
<ðsys CLK_ETH_GP1_EN>,
<ðsys CLK_ETH_GP2_EN>,
<&sgmiisys CLK_SGMII_TX250M_EN>,
<&sgmiisys CLK_SGMII_RX250M_EN>,
<&sgmiisys CLK_SGMII_CDR_REF>,
<&sgmiisys CLK_SGMII_CDR_FB>,
<&topckgen CLK_TOP_SGMIIPLL>,
<&apmixedsys CLK_APMIXED_ETH2PLL>;
clock-names = "ethif", "esw", "gp0", "gp1", "gp2",
"sgmii_tx250m", "sgmii_rx250m",
"sgmii_cdr_ref", "sgmii_cdr_fb", "sgmii_ck",
"eth2pll";
power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>;
mediatek,ethsys = <ðsys>;
mediatek,sgmiisys = <&sgmiisys>;
cci-control-port = <&cci_control2>;
mediatek,pcie-mirror = <&pcie_mirror>;
mediatek,hifsys = <&hifsys>;
dma-coherent;
#address-cells = <1>;
#size-cells = <0>;
mdio0: mdio-bus {
#address-cells = <1>;
#size-cells = <0>;
phy0: ethernet-phy@0 {
reg = <0>;
};
phy1: ethernet-phy@1 {
reg = <1>;
};
};
gmac0: mac@0 {
compatible = "mediatek,eth-mac";
phy-mode = "rgmii";
phy-handle = <&phy0>;
reg = <0>;
};
gmac1: mac@1 {
compatible = "mediatek,eth-mac";
phy-mode = "rgmii";
phy-handle = <&phy1>;
reg = <1>;
};
};
};
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/clock/mt7622-clk.h>
soc {
#address-cells = <2>;
#size-cells = <2>;
eth: ethernet@15100000 {
#define CLK_ETH_FE_EN 0
#define CLK_ETH_WOCPU1_EN 3
#define CLK_ETH_WOCPU0_EN 4
#define CLK_TOP_NETSYS_SEL 43
#define CLK_TOP_NETSYS_500M_SEL 44
#define CLK_TOP_NETSYS_2X_SEL 46
#define CLK_TOP_SGM_325M_SEL 47
#define CLK_APMIXED_NET2PLL 1
#define CLK_APMIXED_SGMPLL 3
compatible = "mediatek,mt7986-eth";
reg = <0 0x15100000 0 0x80000>;
interrupts = <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 191 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>;
clocks = <ðsys CLK_ETH_FE_EN>,
<ðsys CLK_ETH_GP2_EN>,
<ðsys CLK_ETH_GP1_EN>,
<ðsys CLK_ETH_WOCPU1_EN>,
<ðsys CLK_ETH_WOCPU0_EN>,
<&sgmiisys0 CLK_SGMII_TX250M_EN>,
<&sgmiisys0 CLK_SGMII_RX250M_EN>,
<&sgmiisys0 CLK_SGMII_CDR_REF>,
<&sgmiisys0 CLK_SGMII_CDR_FB>,
<&sgmiisys1 CLK_SGMII_TX250M_EN>,
<&sgmiisys1 CLK_SGMII_RX250M_EN>,
<&sgmiisys1 CLK_SGMII_CDR_REF>,
<&sgmiisys1 CLK_SGMII_CDR_FB>,
<&topckgen CLK_TOP_NETSYS_SEL>,
<&topckgen CLK_TOP_NETSYS_SEL>;
clock-names = "fe", "gp2", "gp1", "wocpu1", "wocpu0",
"sgmii_tx250m", "sgmii_rx250m",
"sgmii_cdr_ref", "sgmii_cdr_fb",
"sgmii2_tx250m", "sgmii2_rx250m",
"sgmii2_cdr_ref", "sgmii2_cdr_fb",
"netsys0", "netsys1";
mediatek,ethsys = <ðsys>;
mediatek,sgmiisys = <&sgmiisys0>, <&sgmiisys1>;
assigned-clocks = <&topckgen CLK_TOP_NETSYS_2X_SEL>,
<&topckgen CLK_TOP_SGM_325M_SEL>;
assigned-clock-parents = <&apmixedsys CLK_APMIXED_NET2PLL>,
<&apmixedsys CLK_APMIXED_SGMPLL>;
#address-cells = <1>;
#size-cells = <0>;
mdio: mdio-bus {
#address-cells = <1>;
#size-cells = <0>;
phy5: ethernet-phy@0 {
compatible = "ethernet-phy-id67c9.de0a";
phy-mode = "2500base-x";
reset-gpios = <&pio 6 1>;
reset-deassert-us = <20000>;
reg = <5>;
};
phy6: ethernet-phy@1 {
compatible = "ethernet-phy-id67c9.de0a";
phy-mode = "2500base-x";
reg = <6>;
};
};
mac0: mac@0 {
compatible = "mediatek,eth-mac";
phy-mode = "2500base-x";
phy-handle = <&phy5>;
reg = <0>;
};
mac1: mac@1 {
compatible = "mediatek,eth-mac";
phy-mode = "2500base-x";
phy-handle = <&phy6>;
reg = <1>;
};
};
};
Source notes #
Annotations retained from the schema source
Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)