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		stdout-path = "serial0:921600n8";
25	};
26
27	keys {
28		compatible = "gpio-keys";
29
30		pinctrl-0 = <&keys_pins>;
31		pinctrl-names = "default";
32
33		key-1 {
34			gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
35			linux,code = <KEY_1>;
36			label = "SW47";
37			wakeup-source;
38			debounce-interval = <20>;
39		};
40
41		key-2 {
42			gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
43			linux,code = <KEY_2>;
44			label = "SW48";
45			wakeup-source;
46			debounce-interval = <20>;
47		};
48
49		key-3 {
50			gpios = <&gpio5 2 GPIO_ACTIVE_LOW>;
51			linux,code = <KEY_3>;
52			label = "SW49";
53			wakeup-source;
54			debounce-interval = <20>;
55		};
56	};
57
58	leds {
59		compatible = "gpio-leds";
60
61		led-1 {
62			gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>;
63			color = <LED_COLOR_ID_GREEN>;
64			function = LED_FUNCTION_INDICATOR;
65			function-enumerator = <1>;
66		};
67
68		led-2 {
69			gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>;
70			color = <LED_COLOR_ID_GREEN>;
71			function = LED_FUNCTION_INDICATOR;
72			function-enumerator = <2>;
73		};
74
75		led-3 {
76			gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
77			color = <LED_COLOR_ID_GREEN>;
78			function = LED_FUNCTION_INDICATOR;
79			function-enumerator = <3>;
80		};
81	};
82
83	memory@48000000 {
84		device_type = "memory";
85		/* first 128MB is reserved for secure area. */
86		reg = <0x0 0x48000000 0x0 0x78000000>;
87	};
88
89	memory@480000000 {
90		device_type = "memory";
91		reg = <0x4 0x80000000 0x0 0x80000000>;
92	};
93
94	memory@600000000 {
95		device_type = "memory";
96		reg = <0x6 0x00000000 0x1 0x00000000>;
97	};
98};
99
100&avb0 {
101	pinctrl-0 = <&avb0_pins>;
102	pinctrl-names = "default";
103	phy-handle = <&phy0>;
104	tx-internal-delay-ps = <2000>;
105	status = "okay";
106
107	phy0: ethernet-phy@0 {
108		compatible = "ethernet-phy-id0022.1622",
109			     "ethernet-phy-ieee802.3-c22";
110		rxc-skew-ps = <1500>;
111		reg = <0>;
112		interrupt-parent = <&gpio7>;
113		interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
114		reset-gpios = <&gpio7 10 GPIO_ACTIVE_LOW>;
115	};
116};
117
118&extal_clk {
119	clock-frequency = <16666666>;
120};
121
122&extalr_clk {
123	clock-frequency = <32768>;
124};
125
126&hscif0 {
127	status = "okay";
128};
129
130&i2c0 {
131	pinctrl-0 = <&i2c0_pins>;
132	pinctrl-names = "default";
133
134	status = "okay";
135	clock-frequency = <400000>;
136
137	eeprom@50 {
138		compatible = "rohm,br24g01", "atmel,24c01";
139		label = "cpu-board";
140		reg = <0x50>;
141		pagesize = <8>;
142	};
143};
144
145&pfc {
146	pinctrl-0 = <&scif_clk_pins>;
147	pinctrl-names = "default";
148
149	avb0_pins: avb0 {
150		mux {
151			groups = "avb0_link", "avb0_mdio", "avb0_rgmii",
152				 "avb0_txcrefclk";
153			function = "avb0";
154		};
155
156		pins_mdio {
157			groups = "avb0_mdio";
158			drive-strength = <21>;
159		};
160
161		pins_mii {
162			groups = "avb0_rgmii";
163			drive-strength = <21>;
164		};
165
166	};
167	hscif0_pins: hscif0 {
168		groups = "hscif0_data";
169		function = "hscif0";
170	};
171
172	i2c0_pins: i2c0 {
173		groups = "i2c0";
174		function = "i2c0";
175	};
176
177	keys_pins: keys {
178		pins = "GP_5_0", "GP_5_1", "GP_5_2";
179		bias-pull-up;
180	};
181
182	scif_clk_pins: scif_clk {
183		groups = "scif_clk";
184		function = "scif_clk";
185	};
186};
187
188&scif_clk {
189	clock-frequency = <24000000>;
190};
191
192&rwdt {
193	timeout-sec = <60>;
194	status = "okay";
195};
196