summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/net/amlogic,meson-dwmac.yaml
blob: 85fefe3a044441dd097b530a0ccff2874f2a768b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright 2019 BayLibre, SAS
%YAML 1.2
---
$id: "http://devicetree.org/schemas/net/amlogic,meson-dwmac.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: Amlogic Meson DWMAC Ethernet controller

maintainers:
  - Neil Armstrong <narmstrong@baylibre.com>
  - Martin Blumenstingl <martin.blumenstingl@googlemail.com>

# We need a select here so we don't match all nodes with 'snps,dwmac'
select:
  properties:
    compatible:
      contains:
        enum:
          - amlogic,meson6-dwmac
          - amlogic,meson8b-dwmac
          - amlogic,meson8m2-dwmac
          - amlogic,meson-gxbb-dwmac
          - amlogic,meson-axg-dwmac
          - amlogic,meson-g12a-dwmac
  required:
    - compatible

allOf:
  - $ref: "snps,dwmac.yaml#"
  - 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:
        clocks:
          minItems: 3
          maxItems: 4
          items:
            - description: GMAC main clock
            - description: First parent clock of the internal mux
            - description: Second parent clock of the internal mux
            - description: The clock which drives the timing adjustment logic

        clock-names:
          minItems: 3
          maxItems: 4
          items:
            - const: stmmaceth
            - const: clkin0
            - const: clkin1
            - const: timing-adjustment

        amlogic,tx-delay-ns:
          $ref: /schemas/types.yaml#definitions/uint32
          description:
            The internal RGMII TX clock delay (provided by this driver) in
            nanoseconds. Allowed values are 0ns, 2ns, 4ns, 6ns.
            When phy-mode is set to "rgmii" then the TX delay should be
            explicitly configured. When not configured a fallback of 2ns is
            used. When the phy-mode is set to either "rgmii-id" or "rgmii-txid"
            the TX clock delay is already provided by the PHY. In that case
            this property should be set to 0ns (which disables the TX clock
            delay in the MAC to prevent the clock from going off because both
            PHY and MAC are adding a delay).
            Any configuration is ignored when the phy-mode is set to "rmii".

        amlogic,rx-delay-ns:
          enum:
            - 0
            - 2
          default: 0
          description:
            The internal RGMII RX clock delay (provided by this IP block) in
            nanoseconds. When phy-mode is set to "rgmii" then the RX delay
            should be explicitly configured. When the phy-mode is set to
            either "rgmii-id" or "rgmii-rxid" the RX clock delay is already
            provided by the PHY. Any configuration is ignored when the
            phy-mode is set to "rmii".

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

  reg:
    items:
      - description:
          The first register range should be the one of the DWMAC controller
      - description:
          The second range is is for the Amlogic specific configuration
          (for example the PRG_ETHERNET register range on Meson8b and newer)

required:
  - compatible
  - reg
  - interrupts
  - interrupt-names
  - clocks
  - clock-names
  - phy-mode

examples:
  - |
    ethmac: ethernet@c9410000 {
         compatible = "amlogic,meson-gxbb-dwmac", "snps,dwmac";
         reg = <0xc9410000 0x10000>, <0xc8834540 0x8>;
         interrupts = <8>;
         interrupt-names = "macirq";
         clocks = <&clk_eth>, <&clk_fclk_div2>, <&clk_mpll2>, <&clk_fclk_div2>;
         clock-names = "stmmaceth", "clkin0", "clkin1", "timing-adjustment";
         phy-mode = "rgmii";
    };