STMicroelectronics STM32 / MCU DWMAC glue layer controller
Schema identifier ($id): "http://devicetree.org/schemas/net/stm32-dwmac.yaml#"
Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"
Maintainers (maintainers): "Alexandre Torgue <alexandre.torgue@foss.st.com>", "Christophe Roullier <christophe.roullier@foss.st.com>"
This file documents platform glue layer for stmmac.
Automatic schema selection (select) #
Properties and child nodes (
properties) #
compatible— required here #Rule for matching array elements (
contains)Allowed values (
enum):"st,stm32-dwmac","st,stm32mp1-dwmac","st,stm32mp13-dwmac","st,stm32mp25-dwmac"
Properties and child nodes (properties) #
compatible — required here #
Exactly one of these rules must match (oneOf) #
Rule 1
Array item rules (
items)Item 1
Item 2
Exact value (
const):"snps,dwmac-5.20"
Rule 2
Array item rules (
items)Item 1
Allowed values (
enum):"st,stm32mp1-dwmac","st,stm32mp13-dwmac"Item 2
Exact value (
const):"snps,dwmac-4.20a"
Rule 3
Array item rules (
items)Item 1
Item 2
Exact value (
const):"snps,dwmac-4.10a"
Rule 4
Array item rules (
items)Item 1
Item 2
Exact value (
const):"snps,dwmac-3.50a"
reg — not listed as required here #
true — No constraints added by this property rule.
reg-names — not listed as required here #
Array item rules (items) #
Item 1
Exact value (
const):"stmmaceth"
interrupts — not listed as required here #
Minimum number of items (minItems): 1
Maximum number of items (maxItems): 2
interrupt-names — not listed as required here #
Minimum number of items (minItems): 1
Array item rules (items) #
Item 1
Exact value (
const):"macirq"
Item 2
Exact value (
const):"eth_wake_irq"
clocks — required here #
Minimum number of items (minItems): 3
Array item rules (items) #
Item 1
GMAC main clock
Item 2
MAC TX clock
Item 3
MAC RX clock
Item 4
For MPU family, used for power mode
Item 5
For MPU family, used for PHY without quartz
Item 6
PTP clock
clock-names — required here #
Minimum number of items (minItems): 3
Maximum number of items (maxItems): 6
Rule for matching array elements (contains) #
Allowed values (
enum):"stmmaceth","mac-clk-tx","mac-clk-rx","ethstp","eth-ck","ptp_ref"
st,syscon — required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle-array
Array item rules (items) #
Item 1
Minimum number of items (
minItems):2Array item rules (
items)Item 1
phandle to the syscon node which encompases the glue register
Item 2
offset of the control register
Item 3
field to set mask in register
Should be phandle/offset pair. The phandle to the syscon node which encompases the glue register, the offset of the control register and the mask to set bitfield in control register
st,ext-phyclk — not listed as required here #
set this property in RMII mode when you have PHY without crystal 50MHz and want to select RCC clock instead of ETH_REF_CLK. OR in RGMII mode when you want to select RCC clock instead of ETH_CLK125.
Value type (type): "boolean"
st,eth-clk-sel — not listed as required here #
set this property in RGMII PHY when you want to select RCC clock instead of ETH_CLK125.
Value type (type): "boolean"
st,eth-ref-clk-sel — not listed as required here #
set this property in RMII mode when you have PHY without crystal 50MHz and want to select RCC clock instead of ETH_REF_CLK.
Value type (type): "boolean"
access-controllers — not listed as required here #
Minimum number of items (minItems): 1
Maximum number of items (maxItems): 2
Required in this object (required): "compatible", "clocks", "clock-names", "st,syscon"
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):snps,dwmac.yaml#
Rule 2 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereRule for matching array elements (
contains)Allowed values (
enum):"st,stm32-dwmac","st,stm32mp1-dwmac","st,stm32mp25-dwmac"When the condition matches (
then) #Properties and child nodes (
properties)
st,syscon— not listed as required hereArray item rules (
items)Minimum number of items (
minItems):2Maximum number of items (
maxItems):2
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)
st,syscon— not listed as required hereArray item rules (
items)Minimum number of items (
minItems):3Maximum number of items (
maxItems):3
Examples (examples) #
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
//Example 1
ethernet0: ethernet@5800a000 {
compatible = "st,stm32mp1-dwmac", "snps,dwmac-4.20a";
reg = <0x5800a000 0x2000>;
reg-names = "stmmaceth";
interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq";
clock-names = "stmmaceth",
"mac-clk-tx",
"mac-clk-rx",
"ethstp",
"eth-ck";
clocks = <&rcc ETHMAC>,
<&rcc ETHTX>,
<&rcc ETHRX>,
<&rcc ETHSTP>,
<&rcc ETHCK_K>;
st,syscon = <&syscfg 0x4>;
snps,pbl = <2>;
snps,axi-config = <&stmmac_axi_config_0>;
snps,tso;
phy-mode = "rgmii";
};
//Example 2 (MCU example)
ethernet1: ethernet@40028000 {
compatible = "st,stm32-dwmac", "snps,dwmac-3.50a";
reg = <0x40028000 0x8000>;
reg-names = "stmmaceth";
interrupts = <0 61 0>, <0 62 0>;
interrupt-names = "macirq", "eth_wake_irq";
clock-names = "stmmaceth", "mac-clk-tx", "mac-clk-rx";
clocks = <&rcc 0 25>, <&rcc 0 26>, <&rcc 0 27>;
st,syscon = <&syscfg 0x4>;
snps,pbl = <8>;
snps,mixed-burst;
phy-mode = "mii";
};
//Example 3
ethernet2: ethernet@40027000 {
compatible = "st,stm32-dwmac", "snps,dwmac-4.10a";
reg = <0x40028000 0x8000>;
reg-names = "stmmaceth";
interrupts = <61>;
interrupt-names = "macirq";
clock-names = "stmmaceth", "mac-clk-tx", "mac-clk-rx";
clocks = <&rcc 62>, <&rcc 61>, <&rcc 60>;
st,syscon = <&syscfg 0x4>;
snps,pbl = <8>;
phy-mode = "mii";
};
Source notes #
Annotations retained from the schema source
Line 1: SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
Line 2: Copyright 2019 BayLibre, SAS
Line 17: We need a select here so we don't match all nodes with 'snps,dwmac'