4633a2c431153542b41e9cb9ae88f04bf310b92c
[platform/kernel/linux-starfive.git] / arch / riscv / boot / dts / starfive / jh7110-starfive-visionfive-2.dtsi
1 // SPDX-License-Identifier: GPL-2.0 OR MIT
2 /*
3  * Copyright (C) 2022 StarFive Technology Co., Ltd.
4  * Copyright (C) 2022 Emil Renner Berthing <kernel@esmil.dk>
5  */
6
7 /dts-v1/;
8 #include "jh7110.dtsi"
9 #include "jh7110-pinfunc.h"
10 #include <dt-bindings/gpio/gpio.h>
11
12 / {
13         aliases {
14                 i2c0 = &i2c0;
15                 i2c2 = &i2c2;
16                 i2c5 = &i2c5;
17                 i2c6 = &i2c6;
18                 serial0 = &uart0;
19         };
20
21         chosen {
22                 stdout-path = "serial0:115200n8";
23         };
24
25         cpus {
26                 timebase-frequency = <4000000>;
27         };
28
29         memory@40000000 {
30                 device_type = "memory";
31                 reg = <0x0 0x40000000 0x1 0x0>;
32         };
33
34         gpio-restart {
35                 compatible = "gpio-restart";
36                 gpios = <&sysgpio 35 GPIO_ACTIVE_HIGH>;
37                 priority = <224>;
38         };
39 };
40
41 &dvp_clk {
42         clock-frequency = <74250000>;
43 };
44
45 &gmac0_rgmii_rxin {
46         clock-frequency = <125000000>;
47 };
48
49 &gmac0_rmii_refin {
50         clock-frequency = <50000000>;
51 };
52
53 &gmac1_rgmii_rxin {
54         clock-frequency = <125000000>;
55 };
56
57 &gmac1_rmii_refin {
58         clock-frequency = <50000000>;
59 };
60
61 &hdmitx0_pixelclk {
62         clock-frequency = <297000000>;
63 };
64
65 &i2srx_bclk_ext {
66         clock-frequency = <12288000>;
67 };
68
69 &i2srx_lrck_ext {
70         clock-frequency = <192000>;
71 };
72
73 &i2stx_bclk_ext {
74         clock-frequency = <12288000>;
75 };
76
77 &i2stx_lrck_ext {
78         clock-frequency = <192000>;
79 };
80
81 &mclk_ext {
82         clock-frequency = <12288000>;
83 };
84
85 &osc {
86         clock-frequency = <24000000>;
87 };
88
89 &rtc_osc {
90         clock-frequency = <32768>;
91 };
92
93 &tdm_ext {
94         clock-frequency = <49152000>;
95 };
96
97 &i2c0 {
98         clock-frequency = <100000>;
99         i2c-sda-hold-time-ns = <300>;
100         i2c-sda-falling-time-ns = <510>;
101         i2c-scl-falling-time-ns = <510>;
102         pinctrl-names = "default";
103         pinctrl-0 = <&i2c0_pins>;
104         status = "okay";
105 };
106
107 &i2c2 {
108         clock-frequency = <100000>;
109         i2c-sda-hold-time-ns = <300>;
110         i2c-sda-falling-time-ns = <510>;
111         i2c-scl-falling-time-ns = <510>;
112         pinctrl-names = "default";
113         pinctrl-0 = <&i2c2_pins>;
114         status = "okay";
115 };
116
117 &i2c5 {
118         clock-frequency = <100000>;
119         i2c-sda-hold-time-ns = <300>;
120         i2c-sda-falling-time-ns = <510>;
121         i2c-scl-falling-time-ns = <510>;
122         pinctrl-names = "default";
123         pinctrl-0 = <&i2c5_pins>;
124         status = "okay";
125 };
126
127 &i2c6 {
128         clock-frequency = <100000>;
129         i2c-sda-hold-time-ns = <300>;
130         i2c-sda-falling-time-ns = <510>;
131         i2c-scl-falling-time-ns = <510>;
132         pinctrl-names = "default";
133         pinctrl-0 = <&i2c6_pins>;
134         status = "okay";
135 };
136
137 &mmc0 {
138         max-frequency = <100000000>;
139         bus-width = <8>;
140         cap-mmc-highspeed;
141         mmc-ddr-1_8v;
142         mmc-hs200-1_8v;
143         non-removable;
144         cap-mmc-hw-reset;
145         post-power-on-delay-ms = <200>;
146         status = "okay";
147 };
148
149 &mmc1 {
150         max-frequency = <100000000>;
151         bus-width = <4>;
152         no-sdio;
153         no-mmc;
154         broken-cd;
155         cap-sd-highspeed;
156         post-power-on-delay-ms = <200>;
157         status = "okay";
158 };
159
160 &ptc {
161         pinctrl-names = "default";
162         pinctrl-0 = <&pwm_pins>;
163         status = "okay";
164 };
165
166 &sysgpio {
167         i2c0_pins: i2c0-0 {
168                 i2c-pins {
169                         pinmux = <GPIOMUX(57, GPOUT_LOW,
170                                               GPOEN_SYS_I2C0_CLK,
171                                               GPI_SYS_I2C0_CLK)>,
172                                  <GPIOMUX(58, GPOUT_LOW,
173                                               GPOEN_SYS_I2C0_DATA,
174                                               GPI_SYS_I2C0_DATA)>;
175                         bias-disable; /* external pull-up */
176                         input-enable;
177                         input-schmitt-enable;
178                 };
179         };
180
181         i2c2_pins: i2c2-0 {
182                 i2c-pins {
183                         pinmux = <GPIOMUX(3, GPOUT_LOW,
184                                              GPOEN_SYS_I2C2_CLK,
185                                              GPI_SYS_I2C2_CLK)>,
186                                  <GPIOMUX(2, GPOUT_LOW,
187                                              GPOEN_SYS_I2C2_DATA,
188                                              GPI_SYS_I2C2_DATA)>;
189                         bias-disable; /* external pull-up */
190                         input-enable;
191                         input-schmitt-enable;
192                 };
193         };
194
195         i2c5_pins: i2c5-0 {
196                 i2c-pins {
197                         pinmux = <GPIOMUX(19, GPOUT_LOW,
198                                               GPOEN_SYS_I2C5_CLK,
199                                               GPI_SYS_I2C5_CLK)>,
200                                  <GPIOMUX(20, GPOUT_LOW,
201                                               GPOEN_SYS_I2C5_DATA,
202                                               GPI_SYS_I2C5_DATA)>;
203                         bias-disable; /* external pull-up */
204                         input-enable;
205                         input-schmitt-enable;
206                 };
207         };
208
209         i2c6_pins: i2c6-0 {
210                 i2c-pins {
211                         pinmux = <GPIOMUX(16, GPOUT_LOW,
212                                               GPOEN_SYS_I2C6_CLK,
213                                               GPI_SYS_I2C6_CLK)>,
214                                  <GPIOMUX(17, GPOUT_LOW,
215                                               GPOEN_SYS_I2C6_DATA,
216                                               GPI_SYS_I2C6_DATA)>;
217                         bias-disable; /* external pull-up */
218                         input-enable;
219                         input-schmitt-enable;
220                 };
221         };
222
223         pwm_pins: pwm-0 {
224                 pwm-pins {
225                         pinmux = <GPIOMUX(46, GPOUT_SYS_PWM_CHANNEL0,
226                                         GPOEN_SYS_PWM0_CHANNEL0, GPI_NONE)>,
227                                         <GPIOMUX(59, GPOUT_SYS_PWM_CHANNEL1,
228                                         GPOEN_SYS_PWM0_CHANNEL1, GPI_NONE)>;
229                         bias-disable;
230                         drive-strength = <12>;
231                         input-disable;
232                         input-schmitt-disable;
233                         slew-rate = <0>;
234                 };
235         };
236
237         uart0_pins: uart0-0 {
238                 tx-pins {
239                         pinmux = <GPIOMUX(5, GPOUT_SYS_UART0_TX,
240                                              GPOEN_ENABLE,
241                                              GPI_NONE)>;
242                         bias-disable;
243                         drive-strength = <12>;
244                         input-disable;
245                         input-schmitt-disable;
246                         slew-rate = <0>;
247                 };
248
249                 rx-pins {
250                         pinmux = <GPIOMUX(6, GPOUT_LOW,
251                                              GPOEN_DISABLE,
252                                              GPI_SYS_UART0_RX)>;
253                         bias-disable; /* external pull-up */
254                         drive-strength = <2>;
255                         input-enable;
256                         input-schmitt-enable;
257                         slew-rate = <0>;
258                 };
259         };
260 };
261
262 &uart0 {
263         pinctrl-names = "default";
264         pinctrl-0 = <&uart0_pins>;
265         status = "okay";
266 };