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&gmac0_rgmii_rxin {
42	clock-frequency = <125000000>;
43};
44
45&gmac0_rmii_refin {
46	clock-frequency = <50000000>;
47};
48
49&gmac1_rgmii_rxin {
50	clock-frequency = <125000000>;
51};
52
53&gmac1_rmii_refin {
54	clock-frequency = <50000000>;
55};
56
57&i2srx_bclk_ext {
58	clock-frequency = <12288000>;
59};
60
61&i2srx_lrck_ext {
62	clock-frequency = <192000>;
63};
64
65&i2stx_bclk_ext {
66	clock-frequency = <12288000>;
67};
68
69&i2stx_lrck_ext {
70	clock-frequency = <192000>;
71};
72
73&mclk_ext {
74	clock-frequency = <12288000>;
75};
76
77&osc {
78	clock-frequency = <24000000>;
79};
80
81&rtc_osc {
82	clock-frequency = <32768>;
83};
84
85&tdm_ext {
86	clock-frequency = <49152000>;
87};
88
89&i2c0 {
90	clock-frequency = <100000>;
91	i2c-sda-hold-time-ns = <300>;
92	i2c-sda-falling-time-ns = <510>;
93	i2c-scl-falling-time-ns = <510>;
94	pinctrl-names = "default";
95	pinctrl-0 = <&i2c0_pins>;
96	status = "okay";
97};
98
99&i2c2 {
100	clock-frequency = <100000>;
101	i2c-sda-hold-time-ns = <300>;
102	i2c-sda-falling-time-ns = <510>;
103	i2c-scl-falling-time-ns = <510>;
104	pinctrl-names = "default";
105	pinctrl-0 = <&i2c2_pins>;
106	status = "okay";
107};
108
109&i2c5 {
110	clock-frequency = <100000>;
111	i2c-sda-hold-time-ns = <300>;
112	i2c-sda-falling-time-ns = <510>;
113	i2c-scl-falling-time-ns = <510>;
114	pinctrl-names = "default";
115	pinctrl-0 = <&i2c5_pins>;
116	status = "okay";
117};
118
119&i2c6 {
120	clock-frequency = <100000>;
121	i2c-sda-hold-time-ns = <300>;
122	i2c-sda-falling-time-ns = <510>;
123	i2c-scl-falling-time-ns = <510>;
124	pinctrl-names = "default";
125	pinctrl-0 = <&i2c6_pins>;
126	status = "okay";
127};
128
129&sysgpio {
130	i2c0_pins: i2c0-0 {
131		i2c-pins {
132			pinmux = <GPIOMUX(57, GPOUT_LOW,
133					      GPOEN_SYS_I2C0_CLK,
134					      GPI_SYS_I2C0_CLK)>,
135				 <GPIOMUX(58, GPOUT_LOW,
136					      GPOEN_SYS_I2C0_DATA,
137					      GPI_SYS_I2C0_DATA)>;
138			bias-disable; /* external pull-up */
139			input-enable;
140			input-schmitt-enable;
141		};
142	};
143
144	i2c2_pins: i2c2-0 {
145		i2c-pins {
146			pinmux = <GPIOMUX(3, GPOUT_LOW,
147					     GPOEN_SYS_I2C2_CLK,
148					     GPI_SYS_I2C2_CLK)>,
149				 <GPIOMUX(2, GPOUT_LOW,
150					     GPOEN_SYS_I2C2_DATA,
151					     GPI_SYS_I2C2_DATA)>;
152			bias-disable; /* external pull-up */
153			input-enable;
154			input-schmitt-enable;
155		};
156	};
157
158	i2c5_pins: i2c5-0 {
159		i2c-pins {
160			pinmux = <GPIOMUX(19, GPOUT_LOW,
161					      GPOEN_SYS_I2C5_CLK,
162					      GPI_SYS_I2C5_CLK)>,
163				 <GPIOMUX(20, GPOUT_LOW,
164					      GPOEN_SYS_I2C5_DATA,
165					      GPI_SYS_I2C5_DATA)>;
166			bias-disable; /* external pull-up */
167			input-enable;
168			input-schmitt-enable;
169		};
170	};
171
172	i2c6_pins: i2c6-0 {
173		i2c-pins {
174			pinmux = <GPIOMUX(16, GPOUT_LOW,
175					      GPOEN_SYS_I2C6_CLK,
176					      GPI_SYS_I2C6_CLK)>,
177				 <GPIOMUX(17, GPOUT_LOW,
178					      GPOEN_SYS_I2C6_DATA,
179					      GPI_SYS_I2C6_DATA)>;
180			bias-disable; /* external pull-up */
181			input-enable;
182			input-schmitt-enable;
183		};
184	};
185
186	uart0_pins: uart0-0 {
187		tx-pins {
188			pinmux = <GPIOMUX(5, GPOUT_SYS_UART0_TX,
189					     GPOEN_ENABLE,
190					     GPI_NONE)>;
191			bias-disable;
192			drive-strength = <12>;
193			input-disable;
194			input-schmitt-disable;
195			slew-rate = <0>;
196		};
197
198		rx-pins {
199			pinmux = <GPIOMUX(6, GPOUT_LOW,
200					     GPOEN_DISABLE,
201					     GPI_SYS_UART0_RX)>;
202			bias-disable; /* external pull-up */
203			drive-strength = <2>;
204			input-enable;
205			input-schmitt-enable;
206			slew-rate = <0>;
207		};
208	};
209};
210
211&uart0 {
212	pinctrl-names = "default";
213	pinctrl-0 = <&uart0_pins>;
214	status = "okay";
215};
216