1// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2/*
3 * Device Tree Source for the White Hawk CPU board
4 *
5 * Copyright (C) 2022 Renesas Electronics Corp.
6 */
7
8#include "r8a779g0.dtsi"
9
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/input/input.h>
12#include <dt-bindings/leds/common.h>
13
14/ {
15	model = "Renesas White Hawk CPU board";
16	compatible = "renesas,white-hawk-cpu", "renesas,r8a779g0";
17
18	aliases {
19		ethernet0 = &avb0;
20		serial0 = &hscif0;
21	};
22
23	chosen {
24		bootargs = "ignore_loglevel rw root=/dev/nfs ip=on";
25		stdout-path = "serial0:921600n8";
26	};
27
28	keys {
29		compatible = "gpio-keys";
30
31		pinctrl-0 = <&keys_pins>;
32		pinctrl-names = "default";
33
34		key-1 {
35			gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
36			linux,code = <KEY_1>;
37			label = "SW47";
38			wakeup-source;
39			debounce-interval = <20>;
40		};
41
42		key-2 {
43			gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
44			linux,code = <KEY_2>;
45			label = "SW48";
46			wakeup-source;
47			debounce-interval = <20>;
48		};
49
50		key-3 {
51			gpios = <&gpio5 2 GPIO_ACTIVE_LOW>;
52			linux,code = <KEY_3>;
53			label = "SW49";
54			wakeup-source;
55			debounce-interval = <20>;
56		};
57	};
58
59	leds {
60		compatible = "gpio-leds";
61
62		led-1 {
63			gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>;
64			color = <LED_COLOR_ID_GREEN>;
65			function = LED_FUNCTION_INDICATOR;
66			function-enumerator = <1>;
67		};
68
69		led-2 {
70			gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>;
71			color = <LED_COLOR_ID_GREEN>;
72			function = LED_FUNCTION_INDICATOR;
73			function-enumerator = <2>;
74		};
75
76		led-3 {
77			gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
78			color = <LED_COLOR_ID_GREEN>;
79			function = LED_FUNCTION_INDICATOR;
80			function-enumerator = <3>;
81		};
82	};
83
84	memory@48000000 {
85		device_type = "memory";
86		/* first 128MB is reserved for secure area. */
87		reg = <0x0 0x48000000 0x0 0x78000000>;
88	};
89
90	memory@480000000 {
91		device_type = "memory";
92		reg = <0x4 0x80000000 0x0 0x80000000>;
93	};
94
95	memory@600000000 {
96		device_type = "memory";
97		reg = <0x6 0x00000000 0x1 0x00000000>;
98	};
99
100	reg_1p8v: regulator-1p8v {
101		compatible = "regulator-fixed";
102		regulator-name = "fixed-1.8V";
103		regulator-min-microvolt = <1800000>;
104		regulator-max-microvolt = <1800000>;
105		regulator-boot-on;
106		regulator-always-on;
107	};
108
109	reg_3p3v: regulator-3p3v {
110		compatible = "regulator-fixed";
111		regulator-name = "fixed-3.3V";
112		regulator-min-microvolt = <3300000>;
113		regulator-max-microvolt = <3300000>;
114		regulator-boot-on;
115		regulator-always-on;
116	};
117};
118
119&avb0 {
120	pinctrl-0 = <&avb0_pins>;
121	pinctrl-names = "default";
122	phy-handle = <&phy0>;
123	tx-internal-delay-ps = <2000>;
124	status = "okay";
125
126	phy0: ethernet-phy@0 {
127		compatible = "ethernet-phy-id0022.1622",
128			     "ethernet-phy-ieee802.3-c22";
129		rxc-skew-ps = <1500>;
130		reg = <0>;
131		interrupt-parent = <&gpio7>;
132		interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
133		reset-gpios = <&gpio7 10 GPIO_ACTIVE_LOW>;
134	};
135};
136
137&extal_clk {
138	clock-frequency = <16666666>;
139};
140
141&extalr_clk {
142	clock-frequency = <32768>;
143};
144
145&hscif0 {
146	status = "okay";
147};
148
149&i2c0 {
150	pinctrl-0 = <&i2c0_pins>;
151	pinctrl-names = "default";
152
153	status = "okay";
154	clock-frequency = <400000>;
155
156	io_expander_a: gpio@20 {
157		compatible = "onnn,pca9654";
158		reg = <0x20>;
159		interrupt-parent = <&gpio0>;
160		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
161		gpio-controller;
162		#gpio-cells = <2>;
163		interrupt-controller;
164		#interrupt-cells = <2>;
165	};
166
167	eeprom@50 {
168		compatible = "rohm,br24g01", "atmel,24c01";
169		label = "cpu-board";
170		reg = <0x50>;
171		pagesize = <8>;
172	};
173};
174
175&mmc0 {
176	pinctrl-0 = <&mmc_pins>;
177	pinctrl-1 = <&mmc_pins>;
178	pinctrl-names = "default", "state_uhs";
179
180	vmmc-supply = <&reg_3p3v>;
181	vqmmc-supply = <&reg_1p8v>;
182	mmc-hs200-1_8v;
183	mmc-hs400-1_8v;
184	bus-width = <8>;
185	no-sd;
186	no-sdio;
187	non-removable;
188	full-pwr-cycle-in-suspend;
189	status = "okay";
190};
191
192&pfc {
193	pinctrl-0 = <&scif_clk_pins>;
194	pinctrl-names = "default";
195
196	avb0_pins: avb0 {
197		mux {
198			groups = "avb0_link", "avb0_mdio", "avb0_rgmii",
199				 "avb0_txcrefclk";
200			function = "avb0";
201		};
202
203		pins_mdio {
204			groups = "avb0_mdio";
205			drive-strength = <21>;
206		};
207
208		pins_mii {
209			groups = "avb0_rgmii";
210			drive-strength = <21>;
211		};
212
213	};
214	hscif0_pins: hscif0 {
215		groups = "hscif0_data";
216		function = "hscif0";
217	};
218
219	i2c0_pins: i2c0 {
220		groups = "i2c0";
221		function = "i2c0";
222	};
223
224	keys_pins: keys {
225		pins = "GP_5_0", "GP_5_1", "GP_5_2";
226		bias-pull-up;
227	};
228
229	mmc_pins: mmc {
230		groups = "mmc_data8", "mmc_ctrl", "mmc_ds";
231		function = "mmc";
232		power-source = <1800>;
233	};
234
235	qspi0_pins: qspi0 {
236		groups = "qspi0_ctrl", "qspi0_data4";
237		function = "qspi0";
238	};
239
240	scif_clk_pins: scif_clk {
241		groups = "scif_clk";
242		function = "scif_clk";
243	};
244};
245
246&rpc {
247	pinctrl-0 = <&qspi0_pins>;
248	pinctrl-names = "default";
249
250	status = "okay";
251
252	flash@0 {
253		compatible = "spansion,s25fs512s", "jedec,spi-nor";
254		reg = <0>;
255		spi-max-frequency = <40000000>;
256		spi-rx-bus-width = <4>;
257
258		partitions {
259			compatible = "fixed-partitions";
260			#address-cells = <1>;
261			#size-cells = <1>;
262
263			boot@0 {
264				reg = <0x0 0x1200000>;
265				read-only;
266			};
267			user@1200000 {
268				reg = <0x1200000 0x2e00000>;
269			};
270		};
271	};
272};
273
274&rwdt {
275	timeout-sec = <60>;
276	status = "okay";
277};
278
279&scif_clk {
280	clock-frequency = <24000000>;
281};
282