starfive: refresh patches
[openwrt/staging/981213.git] / target / linux / starfive / patches-6.1 / 0043-dt-bindings-net-Add-support-StarFive-dwmac.patch
1 From 6bef17fa124f20723724e2a9a1d890fd1a9d5eaa Mon Sep 17 00:00:00 2001
2 From: Yanhong Wang <yanhong.wang@starfivetech.com>
3 Date: Mon, 31 Oct 2022 18:08:15 +0800
4 Subject: [PATCH 043/122] dt-bindings: net: Add support StarFive dwmac
5
6 Add documentation to describe StarFive dwmac driver(GMAC).
7
8 Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
9 Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
10 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
11 Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
12 ---
13 .../devicetree/bindings/net/snps,dwmac.yaml | 1 +
14 .../bindings/net/starfive,jh7110-dwmac.yaml | 144 ++++++++++++++++++
15 MAINTAINERS | 6 +
16 3 files changed, 151 insertions(+)
17 create mode 100644 Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
18
19 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
20 +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
21 @@ -91,6 +91,7 @@ properties:
22 - snps,dwmac-5.20
23 - snps,dwxgmac
24 - snps,dwxgmac-2.10
25 + - starfive,jh7110-dwmac
26
27 reg:
28 minItems: 1
29 --- /dev/null
30 +++ b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
31 @@ -0,0 +1,144 @@
32 +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
33 +# Copyright (C) 2022 StarFive Technology Co., Ltd.
34 +%YAML 1.2
35 +---
36 +$id: http://devicetree.org/schemas/net/starfive,jh7110-dwmac.yaml#
37 +$schema: http://devicetree.org/meta-schemas/core.yaml#
38 +
39 +title: StarFive JH7110 DWMAC glue layer
40 +
41 +maintainers:
42 + - Emil Renner Berthing <kernel@esmil.dk>
43 + - Samin Guo <samin.guo@starfivetech.com>
44 +
45 +select:
46 + properties:
47 + compatible:
48 + contains:
49 + enum:
50 + - starfive,jh7110-dwmac
51 + required:
52 + - compatible
53 +
54 +properties:
55 + compatible:
56 + items:
57 + - enum:
58 + - starfive,jh7110-dwmac
59 + - const: snps,dwmac-5.20
60 +
61 + reg:
62 + maxItems: 1
63 +
64 + clocks:
65 + items:
66 + - description: GMAC main clock
67 + - description: GMAC AHB clock
68 + - description: PTP clock
69 + - description: TX clock
70 + - description: GTX clock
71 +
72 + clock-names:
73 + items:
74 + - const: stmmaceth
75 + - const: pclk
76 + - const: ptp_ref
77 + - const: tx
78 + - const: gtx
79 +
80 + interrupts:
81 + minItems: 3
82 + maxItems: 3
83 +
84 + interrupt-names:
85 + minItems: 3
86 + maxItems: 3
87 +
88 + resets:
89 + items:
90 + - description: MAC Reset signal.
91 + - description: AHB Reset signal.
92 +
93 + reset-names:
94 + items:
95 + - const: stmmaceth
96 + - const: ahb
97 +
98 + starfive,tx-use-rgmii-clk:
99 + description:
100 + Tx clock is provided by external rgmii clock.
101 + type: boolean
102 +
103 + starfive,syscon:
104 + $ref: /schemas/types.yaml#/definitions/phandle-array
105 + items:
106 + - items:
107 + - description: phandle to syscon that configures phy mode
108 + - description: Offset of phy mode selection
109 + - description: Shift of phy mode selection
110 + description:
111 + A phandle to syscon with two arguments that configure phy mode.
112 + The argument one is the offset of phy mode selection, the
113 + argument two is the shift of phy mode selection.
114 +
115 +required:
116 + - compatible
117 + - reg
118 + - clocks
119 + - clock-names
120 + - interrupts
121 + - interrupt-names
122 + - resets
123 + - reset-names
124 +
125 +allOf:
126 + - $ref: snps,dwmac.yaml#
127 +
128 +unevaluatedProperties: false
129 +
130 +examples:
131 + - |
132 + ethernet@16030000 {
133 + compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
134 + reg = <0x16030000 0x10000>;
135 + clocks = <&clk 3>, <&clk 2>, <&clk 109>,
136 + <&clk 6>, <&clk 111>;
137 + clock-names = "stmmaceth", "pclk", "ptp_ref",
138 + "tx", "gtx";
139 + resets = <&rst 1>, <&rst 2>;
140 + reset-names = "stmmaceth", "ahb";
141 + interrupts = <7>, <6>, <5>;
142 + interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
143 + phy-mode = "rgmii-id";
144 + snps,multicast-filter-bins = <64>;
145 + snps,perfect-filter-entries = <8>;
146 + rx-fifo-depth = <2048>;
147 + tx-fifo-depth = <2048>;
148 + snps,fixed-burst;
149 + snps,no-pbl-x8;
150 + snps,tso;
151 + snps,force_thresh_dma_mode;
152 + snps,axi-config = <&stmmac_axi_setup>;
153 + snps,en-tx-lpi-clockgating;
154 + snps,txpbl = <16>;
155 + snps,rxpbl = <16>;
156 + starfive,syscon = <&aon_syscon 0xc 0x12>;
157 + phy-handle = <&phy0>;
158 +
159 + mdio {
160 + #address-cells = <1>;
161 + #size-cells = <0>;
162 + compatible = "snps,dwmac-mdio";
163 +
164 + phy0: ethernet-phy@0 {
165 + reg = <0>;
166 + };
167 + };
168 +
169 + stmmac_axi_setup: stmmac-axi-config {
170 + snps,lpi_en;
171 + snps,wr_osr_lmt = <4>;
172 + snps,rd_osr_lmt = <4>;
173 + snps,blen = <256 128 64 32 0 0 0>;
174 + };
175 + };
176 --- a/MAINTAINERS
177 +++ b/MAINTAINERS
178 @@ -19657,6 +19657,12 @@ M: Emil Renner Berthing <kernel@esmil.dk
179 S: Maintained
180 F: arch/riscv/boot/dts/starfive/
181
182 +STARFIVE DWMAC GLUE LAYER
183 +M: Emil Renner Berthing <kernel@esmil.dk>
184 +M: Samin Guo <samin.guo@starfivetech.com>
185 +S: Maintained
186 +F: Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
187 +
188 STARFIVE JH7110 PLL CLOCK DRIVER
189 M: Xingyu Wu <xingyu.wu@starfivetech.com>
190 S: Supported