1*4882a593Smuzhiyun# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2*4882a593Smuzhiyun# Copyright 2019 BayLibre, SAS 3*4882a593Smuzhiyun%YAML 1.2 4*4882a593Smuzhiyun--- 5*4882a593Smuzhiyun$id: "http://devicetree.org/schemas/net/amlogic,meson-dwmac.yaml#" 6*4882a593Smuzhiyun$schema: "http://devicetree.org/meta-schemas/core.yaml#" 7*4882a593Smuzhiyun 8*4882a593Smuzhiyuntitle: Amlogic Meson DWMAC Ethernet controller 9*4882a593Smuzhiyun 10*4882a593Smuzhiyunmaintainers: 11*4882a593Smuzhiyun - Neil Armstrong <narmstrong@baylibre.com> 12*4882a593Smuzhiyun - Martin Blumenstingl <martin.blumenstingl@googlemail.com> 13*4882a593Smuzhiyun 14*4882a593Smuzhiyun# We need a select here so we don't match all nodes with 'snps,dwmac' 15*4882a593Smuzhiyunselect: 16*4882a593Smuzhiyun properties: 17*4882a593Smuzhiyun compatible: 18*4882a593Smuzhiyun contains: 19*4882a593Smuzhiyun enum: 20*4882a593Smuzhiyun - amlogic,meson6-dwmac 21*4882a593Smuzhiyun - amlogic,meson8b-dwmac 22*4882a593Smuzhiyun - amlogic,meson8m2-dwmac 23*4882a593Smuzhiyun - amlogic,meson-gxbb-dwmac 24*4882a593Smuzhiyun - amlogic,meson-axg-dwmac 25*4882a593Smuzhiyun - amlogic,meson-g12a-dwmac 26*4882a593Smuzhiyun required: 27*4882a593Smuzhiyun - compatible 28*4882a593Smuzhiyun 29*4882a593SmuzhiyunallOf: 30*4882a593Smuzhiyun - $ref: "snps,dwmac.yaml#" 31*4882a593Smuzhiyun - if: 32*4882a593Smuzhiyun properties: 33*4882a593Smuzhiyun compatible: 34*4882a593Smuzhiyun contains: 35*4882a593Smuzhiyun enum: 36*4882a593Smuzhiyun - amlogic,meson8b-dwmac 37*4882a593Smuzhiyun - amlogic,meson8m2-dwmac 38*4882a593Smuzhiyun - amlogic,meson-gxbb-dwmac 39*4882a593Smuzhiyun - amlogic,meson-axg-dwmac 40*4882a593Smuzhiyun - amlogic,meson-g12a-dwmac 41*4882a593Smuzhiyun 42*4882a593Smuzhiyun then: 43*4882a593Smuzhiyun properties: 44*4882a593Smuzhiyun clocks: 45*4882a593Smuzhiyun minItems: 3 46*4882a593Smuzhiyun maxItems: 4 47*4882a593Smuzhiyun items: 48*4882a593Smuzhiyun - description: GMAC main clock 49*4882a593Smuzhiyun - description: First parent clock of the internal mux 50*4882a593Smuzhiyun - description: Second parent clock of the internal mux 51*4882a593Smuzhiyun - description: The clock which drives the timing adjustment logic 52*4882a593Smuzhiyun 53*4882a593Smuzhiyun clock-names: 54*4882a593Smuzhiyun minItems: 3 55*4882a593Smuzhiyun maxItems: 4 56*4882a593Smuzhiyun items: 57*4882a593Smuzhiyun - const: stmmaceth 58*4882a593Smuzhiyun - const: clkin0 59*4882a593Smuzhiyun - const: clkin1 60*4882a593Smuzhiyun - const: timing-adjustment 61*4882a593Smuzhiyun 62*4882a593Smuzhiyun amlogic,tx-delay-ns: 63*4882a593Smuzhiyun $ref: /schemas/types.yaml#definitions/uint32 64*4882a593Smuzhiyun description: 65*4882a593Smuzhiyun The internal RGMII TX clock delay (provided by this driver) in 66*4882a593Smuzhiyun nanoseconds. Allowed values are 0ns, 2ns, 4ns, 6ns. 67*4882a593Smuzhiyun When phy-mode is set to "rgmii" then the TX delay should be 68*4882a593Smuzhiyun explicitly configured. When not configured a fallback of 2ns is 69*4882a593Smuzhiyun used. When the phy-mode is set to either "rgmii-id" or "rgmii-txid" 70*4882a593Smuzhiyun the TX clock delay is already provided by the PHY. In that case 71*4882a593Smuzhiyun this property should be set to 0ns (which disables the TX clock 72*4882a593Smuzhiyun delay in the MAC to prevent the clock from going off because both 73*4882a593Smuzhiyun PHY and MAC are adding a delay). 74*4882a593Smuzhiyun Any configuration is ignored when the phy-mode is set to "rmii". 75*4882a593Smuzhiyun 76*4882a593Smuzhiyun amlogic,rx-delay-ns: 77*4882a593Smuzhiyun enum: 78*4882a593Smuzhiyun - 0 79*4882a593Smuzhiyun - 2 80*4882a593Smuzhiyun default: 0 81*4882a593Smuzhiyun description: 82*4882a593Smuzhiyun The internal RGMII RX clock delay (provided by this IP block) in 83*4882a593Smuzhiyun nanoseconds. When phy-mode is set to "rgmii" then the RX delay 84*4882a593Smuzhiyun should be explicitly configured. When the phy-mode is set to 85*4882a593Smuzhiyun either "rgmii-id" or "rgmii-rxid" the RX clock delay is already 86*4882a593Smuzhiyun provided by the PHY. Any configuration is ignored when the 87*4882a593Smuzhiyun phy-mode is set to "rmii". 88*4882a593Smuzhiyun 89*4882a593Smuzhiyunproperties: 90*4882a593Smuzhiyun compatible: 91*4882a593Smuzhiyun additionalItems: true 92*4882a593Smuzhiyun maxItems: 3 93*4882a593Smuzhiyun items: 94*4882a593Smuzhiyun - enum: 95*4882a593Smuzhiyun - amlogic,meson6-dwmac 96*4882a593Smuzhiyun - amlogic,meson8b-dwmac 97*4882a593Smuzhiyun - amlogic,meson8m2-dwmac 98*4882a593Smuzhiyun - amlogic,meson-gxbb-dwmac 99*4882a593Smuzhiyun - amlogic,meson-axg-dwmac 100*4882a593Smuzhiyun - amlogic,meson-g12a-dwmac 101*4882a593Smuzhiyun contains: 102*4882a593Smuzhiyun enum: 103*4882a593Smuzhiyun - snps,dwmac-3.70a 104*4882a593Smuzhiyun - snps,dwmac 105*4882a593Smuzhiyun 106*4882a593Smuzhiyun reg: 107*4882a593Smuzhiyun items: 108*4882a593Smuzhiyun - description: 109*4882a593Smuzhiyun The first register range should be the one of the DWMAC controller 110*4882a593Smuzhiyun - description: 111*4882a593Smuzhiyun The second range is is for the Amlogic specific configuration 112*4882a593Smuzhiyun (for example the PRG_ETHERNET register range on Meson8b and newer) 113*4882a593Smuzhiyun 114*4882a593Smuzhiyunrequired: 115*4882a593Smuzhiyun - compatible 116*4882a593Smuzhiyun - reg 117*4882a593Smuzhiyun - interrupts 118*4882a593Smuzhiyun - interrupt-names 119*4882a593Smuzhiyun - clocks 120*4882a593Smuzhiyun - clock-names 121*4882a593Smuzhiyun - phy-mode 122*4882a593Smuzhiyun 123*4882a593SmuzhiyununevaluatedProperties: false 124*4882a593Smuzhiyun 125*4882a593Smuzhiyunexamples: 126*4882a593Smuzhiyun - | 127*4882a593Smuzhiyun ethmac: ethernet@c9410000 { 128*4882a593Smuzhiyun compatible = "amlogic,meson-gxbb-dwmac", "snps,dwmac"; 129*4882a593Smuzhiyun reg = <0xc9410000 0x10000>, <0xc8834540 0x8>; 130*4882a593Smuzhiyun interrupts = <8>; 131*4882a593Smuzhiyun interrupt-names = "macirq"; 132*4882a593Smuzhiyun clocks = <&clk_eth>, <&clk_fclk_div2>, <&clk_mpll2>, <&clk_fclk_div2>; 133*4882a593Smuzhiyun clock-names = "stmmaceth", "clkin0", "clkin1", "timing-adjustment"; 134*4882a593Smuzhiyun phy-mode = "rgmii"; 135*4882a593Smuzhiyun }; 136