starfive: add new target for StarFive JH7100/7110 SoC
[openwrt/staging/981213.git] / target / linux / starfive / patches-6.1 / 0025-riscv-dts-starfive-Add-common-DT-for-JH7100-based-bo.patch
1 From 2101233d71b74e33de33e4cc292c6a8cf5da9d42 Mon Sep 17 00:00:00 2001
2 From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
3 Date: Tue, 18 Oct 2022 00:05:41 +0300
4 Subject: [PATCH 025/122] riscv: dts: starfive: Add common DT for JH7100 based
5 boards
6
7 In preparation for adding initial device tree support for the StarFive
8 VisionFive board, which is similar with BeagleV Starlight, move most
9 of the content from jh7100-beaglev-starlight.dts to a new file, to be
10 shared between the two boards.
11
12 Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
13 Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
14 Reviewed-by: Matthias Brugger <mbrugger@suse.com>
15 Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
16 ---
17 .../dts/starfive/jh7100-beaglev-starlight.dts | 153 +----------------
18 .../boot/dts/starfive/jh7100-common.dtsi | 161 ++++++++++++++++++
19 2 files changed, 162 insertions(+), 152 deletions(-)
20 create mode 100644 arch/riscv/boot/dts/starfive/jh7100-common.dtsi
21
22 --- a/arch/riscv/boot/dts/starfive/jh7100-beaglev-starlight.dts
23 +++ b/arch/riscv/boot/dts/starfive/jh7100-beaglev-starlight.dts
24 @@ -5,160 +5,9 @@
25 */
26
27 /dts-v1/;
28 -#include "jh7100.dtsi"
29 -#include <dt-bindings/gpio/gpio.h>
30 -#include <dt-bindings/leds/common.h>
31 -#include <dt-bindings/pinctrl/pinctrl-starfive-jh7100.h>
32 +#include "jh7100-common.dtsi"
33
34 / {
35 model = "BeagleV Starlight Beta";
36 compatible = "beagle,beaglev-starlight-jh7100-r0", "starfive,jh7100";
37 -
38 - aliases {
39 - serial0 = &uart3;
40 - };
41 -
42 - chosen {
43 - stdout-path = "serial0:115200n8";
44 - };
45 -
46 - cpus {
47 - timebase-frequency = <6250000>;
48 - };
49 -
50 - memory@80000000 {
51 - device_type = "memory";
52 - reg = <0x0 0x80000000 0x2 0x0>;
53 - };
54 -
55 - leds {
56 - compatible = "gpio-leds";
57 -
58 - led-ack {
59 - gpios = <&gpio 43 GPIO_ACTIVE_HIGH>;
60 - color = <LED_COLOR_ID_GREEN>;
61 - function = LED_FUNCTION_HEARTBEAT;
62 - linux,default-trigger = "heartbeat";
63 - label = "ack";
64 - };
65 - };
66 -};
67 -
68 -&gpio {
69 - i2c0_pins: i2c0-0 {
70 - i2c-pins {
71 - pinmux = <GPIOMUX(62, GPO_LOW,
72 - GPO_I2C0_PAD_SCK_OEN,
73 - GPI_I2C0_PAD_SCK_IN)>,
74 - <GPIOMUX(61, GPO_LOW,
75 - GPO_I2C0_PAD_SDA_OEN,
76 - GPI_I2C0_PAD_SDA_IN)>;
77 - bias-disable; /* external pull-up */
78 - input-enable;
79 - input-schmitt-enable;
80 - };
81 - };
82 -
83 - i2c1_pins: i2c1-0 {
84 - i2c-pins {
85 - pinmux = <GPIOMUX(47, GPO_LOW,
86 - GPO_I2C1_PAD_SCK_OEN,
87 - GPI_I2C1_PAD_SCK_IN)>,
88 - <GPIOMUX(48, GPO_LOW,
89 - GPO_I2C1_PAD_SDA_OEN,
90 - GPI_I2C1_PAD_SDA_IN)>;
91 - bias-pull-up;
92 - input-enable;
93 - input-schmitt-enable;
94 - };
95 - };
96 -
97 - i2c2_pins: i2c2-0 {
98 - i2c-pins {
99 - pinmux = <GPIOMUX(60, GPO_LOW,
100 - GPO_I2C2_PAD_SCK_OEN,
101 - GPI_I2C2_PAD_SCK_IN)>,
102 - <GPIOMUX(59, GPO_LOW,
103 - GPO_I2C2_PAD_SDA_OEN,
104 - GPI_I2C2_PAD_SDA_IN)>;
105 - bias-disable; /* external pull-up */
106 - input-enable;
107 - input-schmitt-enable;
108 - };
109 - };
110 -
111 - uart3_pins: uart3-0 {
112 - rx-pins {
113 - pinmux = <GPIOMUX(13, GPO_LOW, GPO_DISABLE,
114 - GPI_UART3_PAD_SIN)>;
115 - bias-pull-up;
116 - drive-strength = <14>;
117 - input-enable;
118 - input-schmitt-enable;
119 - slew-rate = <0>;
120 - };
121 - tx-pins {
122 - pinmux = <GPIOMUX(14, GPO_UART3_PAD_SOUT,
123 - GPO_ENABLE, GPI_NONE)>;
124 - bias-disable;
125 - drive-strength = <35>;
126 - input-disable;
127 - input-schmitt-disable;
128 - slew-rate = <0>;
129 - };
130 - };
131 -};
132 -
133 -&i2c0 {
134 - clock-frequency = <100000>;
135 - i2c-sda-hold-time-ns = <300>;
136 - i2c-sda-falling-time-ns = <500>;
137 - i2c-scl-falling-time-ns = <500>;
138 - pinctrl-names = "default";
139 - pinctrl-0 = <&i2c0_pins>;
140 - status = "okay";
141 -
142 - pmic@5e {
143 - compatible = "ti,tps65086";
144 - reg = <0x5e>;
145 - gpio-controller;
146 - #gpio-cells = <2>;
147 -
148 - regulators {
149 - };
150 - };
151 -};
152 -
153 -&i2c1 {
154 - clock-frequency = <400000>;
155 - i2c-sda-hold-time-ns = <300>;
156 - i2c-sda-falling-time-ns = <100>;
157 - i2c-scl-falling-time-ns = <100>;
158 - pinctrl-names = "default";
159 - pinctrl-0 = <&i2c1_pins>;
160 - status = "okay";
161 -};
162 -
163 -&i2c2 {
164 - clock-frequency = <100000>;
165 - i2c-sda-hold-time-ns = <300>;
166 - i2c-sda-falling-time-ns = <500>;
167 - i2c-scl-falling-time-ns = <500>;
168 - pinctrl-names = "default";
169 - pinctrl-0 = <&i2c2_pins>;
170 - status = "okay";
171 -};
172 -
173 -&osc_sys {
174 - clock-frequency = <25000000>;
175 -};
176 -
177 -&osc_aud {
178 - clock-frequency = <27000000>;
179 -};
180 -
181 -&uart3 {
182 - pinctrl-names = "default";
183 - pinctrl-0 = <&uart3_pins>;
184 - status = "okay";
185 };
186 --- /dev/null
187 +++ b/arch/riscv/boot/dts/starfive/jh7100-common.dtsi
188 @@ -0,0 +1,161 @@
189 +// SPDX-License-Identifier: GPL-2.0 OR MIT
190 +/*
191 + * Copyright (C) 2021 StarFive Technology Co., Ltd.
192 + * Copyright (C) 2021 Emil Renner Berthing <kernel@esmil.dk>
193 + */
194 +
195 +/dts-v1/;
196 +#include "jh7100.dtsi"
197 +#include <dt-bindings/gpio/gpio.h>
198 +#include <dt-bindings/leds/common.h>
199 +#include <dt-bindings/pinctrl/pinctrl-starfive-jh7100.h>
200 +
201 +/ {
202 + aliases {
203 + serial0 = &uart3;
204 + };
205 +
206 + chosen {
207 + stdout-path = "serial0:115200n8";
208 + };
209 +
210 + cpus {
211 + timebase-frequency = <6250000>;
212 + };
213 +
214 + memory@80000000 {
215 + device_type = "memory";
216 + reg = <0x0 0x80000000 0x2 0x0>;
217 + };
218 +
219 + leds {
220 + compatible = "gpio-leds";
221 +
222 + led-ack {
223 + gpios = <&gpio 43 GPIO_ACTIVE_HIGH>;
224 + color = <LED_COLOR_ID_GREEN>;
225 + function = LED_FUNCTION_HEARTBEAT;
226 + linux,default-trigger = "heartbeat";
227 + label = "ack";
228 + };
229 + };
230 +};
231 +
232 +&gpio {
233 + i2c0_pins: i2c0-0 {
234 + i2c-pins {
235 + pinmux = <GPIOMUX(62, GPO_LOW,
236 + GPO_I2C0_PAD_SCK_OEN,
237 + GPI_I2C0_PAD_SCK_IN)>,
238 + <GPIOMUX(61, GPO_LOW,
239 + GPO_I2C0_PAD_SDA_OEN,
240 + GPI_I2C0_PAD_SDA_IN)>;
241 + bias-disable; /* external pull-up */
242 + input-enable;
243 + input-schmitt-enable;
244 + };
245 + };
246 +
247 + i2c1_pins: i2c1-0 {
248 + i2c-pins {
249 + pinmux = <GPIOMUX(47, GPO_LOW,
250 + GPO_I2C1_PAD_SCK_OEN,
251 + GPI_I2C1_PAD_SCK_IN)>,
252 + <GPIOMUX(48, GPO_LOW,
253 + GPO_I2C1_PAD_SDA_OEN,
254 + GPI_I2C1_PAD_SDA_IN)>;
255 + bias-pull-up;
256 + input-enable;
257 + input-schmitt-enable;
258 + };
259 + };
260 +
261 + i2c2_pins: i2c2-0 {
262 + i2c-pins {
263 + pinmux = <GPIOMUX(60, GPO_LOW,
264 + GPO_I2C2_PAD_SCK_OEN,
265 + GPI_I2C2_PAD_SCK_IN)>,
266 + <GPIOMUX(59, GPO_LOW,
267 + GPO_I2C2_PAD_SDA_OEN,
268 + GPI_I2C2_PAD_SDA_IN)>;
269 + bias-disable; /* external pull-up */
270 + input-enable;
271 + input-schmitt-enable;
272 + };
273 + };
274 +
275 + uart3_pins: uart3-0 {
276 + rx-pins {
277 + pinmux = <GPIOMUX(13, GPO_LOW, GPO_DISABLE,
278 + GPI_UART3_PAD_SIN)>;
279 + bias-pull-up;
280 + drive-strength = <14>;
281 + input-enable;
282 + input-schmitt-enable;
283 + slew-rate = <0>;
284 + };
285 + tx-pins {
286 + pinmux = <GPIOMUX(14, GPO_UART3_PAD_SOUT,
287 + GPO_ENABLE, GPI_NONE)>;
288 + bias-disable;
289 + drive-strength = <35>;
290 + input-disable;
291 + input-schmitt-disable;
292 + slew-rate = <0>;
293 + };
294 + };
295 +};
296 +
297 +&i2c0 {
298 + clock-frequency = <100000>;
299 + i2c-sda-hold-time-ns = <300>;
300 + i2c-sda-falling-time-ns = <500>;
301 + i2c-scl-falling-time-ns = <500>;
302 + pinctrl-names = "default";
303 + pinctrl-0 = <&i2c0_pins>;
304 + status = "okay";
305 +
306 + pmic@5e {
307 + compatible = "ti,tps65086";
308 + reg = <0x5e>;
309 + gpio-controller;
310 + #gpio-cells = <2>;
311 +
312 + regulators {
313 + };
314 + };
315 +};
316 +
317 +&i2c1 {
318 + clock-frequency = <400000>;
319 + i2c-sda-hold-time-ns = <300>;
320 + i2c-sda-falling-time-ns = <100>;
321 + i2c-scl-falling-time-ns = <100>;
322 + pinctrl-names = "default";
323 + pinctrl-0 = <&i2c1_pins>;
324 + status = "okay";
325 +};
326 +
327 +&i2c2 {
328 + clock-frequency = <100000>;
329 + i2c-sda-hold-time-ns = <300>;
330 + i2c-sda-falling-time-ns = <500>;
331 + i2c-scl-falling-time-ns = <500>;
332 + pinctrl-names = "default";
333 + pinctrl-0 = <&i2c2_pins>;
334 + status = "okay";
335 +};
336 +
337 +&osc_sys {
338 + clock-frequency = <25000000>;
339 +};
340 +
341 +&osc_aud {
342 + clock-frequency = <27000000>;
343 +};
344 +
345 +&uart3 {
346 + pinctrl-names = "default";
347 + pinctrl-0 = <&uart3_pins>;
348 + status = "okay";
349 +};