1// SPDX-License-Identifier: GPL-2.0
2/*
3 * WinLink E850-96 board device tree source
4 *
5 * Copyright (C) 2018 Samsung Electronics Co., Ltd.
6 * Copyright (C) 2021 Linaro Ltd.
7 *
8 * Device tree source file for WinLink's E850-96 board which is based on
9 * Samsung Exynos850 SoC.
10 */
11
12/dts-v1/;
13
14#include "exynos850.dtsi"
15#include <dt-bindings/gpio/gpio.h>
16#include <dt-bindings/input/input.h>
17#include <dt-bindings/leds/common.h>
18
19/ {
20	model = "WinLink E850-96 board";
21	compatible = "winlink,e850-96", "samsung,exynos850";
22
23	aliases {
24		mmc0 = &mmc_0;
25		serial0 = &serial_0;
26	};
27
28	chosen {
29		stdout-path = &serial_0;
30	};
31
32	connector {
33		compatible = "gpio-usb-b-connector", "usb-b-connector";
34		label = "micro-USB";
35		type = "micro";
36		vbus-supply = <&reg_usb_host_vbus>;
37		id-gpios = <&gpa0 0 GPIO_ACTIVE_LOW>;
38		pinctrl-names = "default";
39		pinctrl-0 = <&micro_usb_det_pins>;
40
41		port {
42			usb_dr_connector: endpoint {
43				remote-endpoint = <&usb1_drd_sw>;
44			};
45		};
46	};
47
48	memory@80000000 {
49		device_type = "memory";
50		reg = <0x0 0x80000000 0x80000000>,
51		      <0x8 0x80000000 0x80000000>;
52	};
53
54	gpio-keys {
55		compatible = "gpio-keys";
56		pinctrl-names = "default";
57		pinctrl-0 = <&key_voldown_pins &key_volup_pins>;
58
59		volume-down-key {
60			label = "Volume Down";
61			linux,code = <KEY_VOLUMEDOWN>;
62			gpios = <&gpa1 0 GPIO_ACTIVE_LOW>;
63		};
64
65		volume-up-key {
66			label = "Volume Up";
67			linux,code = <KEY_VOLUMEUP>;
68			gpios = <&gpa0 7 GPIO_ACTIVE_LOW>;
69		};
70	};
71
72	leds {
73		compatible = "gpio-leds";
74
75		/* HEART_BEAT_LED */
76		user_led1: led-1 {
77			label = "yellow:user1";
78			gpios = <&gpg2 2 GPIO_ACTIVE_HIGH>;
79			color = <LED_COLOR_ID_YELLOW>;
80			function = LED_FUNCTION_HEARTBEAT;
81			linux,default-trigger = "heartbeat";
82		};
83
84		/* eMMC_LED */
85		user_led2: led-2 {
86			label = "yellow:user2";
87			gpios = <&gpg2 3 GPIO_ACTIVE_HIGH>;
88			color = <LED_COLOR_ID_YELLOW>;
89			linux,default-trigger = "mmc0";
90		};
91
92		/* SD_LED */
93		user_led3: led-3 {
94			label = "white:user3";
95			gpios = <&gpg2 4 GPIO_ACTIVE_HIGH>;
96			color = <LED_COLOR_ID_WHITE>;
97			function = LED_FUNCTION_SD;
98			linux,default-trigger = "mmc2";
99		};
100
101		/* WIFI_LED */
102		wlan_active_led: led-4 {
103			label = "yellow:wlan";
104			gpios = <&gpg2 6 GPIO_ACTIVE_HIGH>;
105			color = <LED_COLOR_ID_YELLOW>;
106			function = LED_FUNCTION_WLAN;
107			linux,default-trigger = "phy0tx";
108			default-state = "off";
109		};
110
111		/* BLUETOOTH_LED */
112		bt_active_led: led-5 {
113			label = "blue:bt";
114			gpios = <&gpg2 7 GPIO_ACTIVE_HIGH>;
115			color = <LED_COLOR_ID_BLUE>;
116			function = LED_FUNCTION_BLUETOOTH;
117			linux,default-trigger = "hci0-power";
118			default-state = "off";
119		};
120	};
121
122	/* TODO: Remove this once PMIC is implemented  */
123	reg_dummy: regulator-0 {
124		compatible = "regulator-fixed";
125		regulator-name = "dummy_reg";
126	};
127
128	reg_usb_host_vbus: regulator-1 {
129		compatible = "regulator-fixed";
130		regulator-name = "usb_host_vbus";
131		regulator-min-microvolt = <5000000>;
132		regulator-max-microvolt = <5000000>;
133		gpio = <&gpa3 5 GPIO_ACTIVE_LOW>;
134	};
135
136	reserved-memory {
137		#address-cells = <2>;
138		#size-cells = <1>;
139		ranges;
140
141		secure_mem: memory@bab00000 {
142			reg = <0x0 0xbab00000 0x5500000>;
143			no-map;
144		};
145
146		ramoops@f0000000 {
147			compatible = "ramoops";
148			reg = <0x0 0xf0000000 0x200000>;
149			record-size = <0x20000>;
150			console-size = <0x20000>;
151			ftrace-size = <0x100000>;
152			pmsg-size = <0x20000>;
153		};
154	};
155
156	/*
157	 * RTC clock (XrtcXTI); external, must be 32.768 kHz.
158	 *
159	 * TODO: Remove this once RTC clock is implemented properly as part of
160	 *       PMIC driver.
161	 */
162	rtcclk: clock-rtcclk {
163		compatible = "fixed-clock";
164		clock-output-names = "rtcclk";
165		#clock-cells = <0>;
166		clock-frequency = <32768>;
167	};
168};
169
170&cmu_hsi {
171	clocks = <&oscclk>, <&rtcclk>,
172		 <&cmu_top CLK_DOUT_HSI_BUS>,
173		 <&cmu_top CLK_DOUT_HSI_MMC_CARD>,
174		 <&cmu_top CLK_DOUT_HSI_USB20DRD>;
175	clock-names = "oscclk", "rtcclk", "dout_hsi_bus",
176		      "dout_hsi_mmc_card", "dout_hsi_usb20drd";
177};
178
179&mmc_0 {
180	status = "okay";
181	mmc-hs200-1_8v;
182	mmc-hs400-1_8v;
183	cap-mmc-highspeed;
184	non-removable;
185	mmc-hs400-enhanced-strobe;
186	card-detect-delay = <200>;
187	clock-frequency = <800000000>;
188	bus-width = <8>;
189	samsung,dw-mshc-ciu-div = <3>;
190	samsung,dw-mshc-sdr-timing = <0 4>;
191	samsung,dw-mshc-ddr-timing = <2 4>;
192	samsung,dw-mshc-hs400-timing = <0 2>;
193
194	pinctrl-names = "default";
195	pinctrl-0 = <&sd0_clk_pins &sd0_cmd_pins &sd0_rdqs_pins &sd0_nreset_pins
196		     &sd0_bus1_pins &sd0_bus4_pins &sd0_bus8_pins>;
197};
198
199&oscclk {
200	clock-frequency = <26000000>;
201};
202
203&pinctrl_alive {
204	key_voldown_pins: key-voldown-pins {
205		samsung,pins = "gpa1-0";
206		samsung,pin-function = <EXYNOS_PIN_FUNC_EINT>;
207		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
208		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
209	};
210
211	key_volup_pins: key-volup-pins {
212		samsung,pins = "gpa0-7";
213		samsung,pin-function = <EXYNOS_PIN_FUNC_EINT>;
214		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
215		samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
216	};
217
218	micro_usb_det_pins: micro-usb-det-pins {
219		samsung,pins = "gpa0-0";
220		samsung,pin-function = <EXYNOS_PIN_FUNC_INPUT>;
221		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
222	};
223};
224
225&rtc {
226	status = "okay";
227	clocks = <&cmu_apm CLK_GOUT_RTC_PCLK>, <&rtcclk>;
228	clock-names = "rtc", "rtc_src";
229};
230
231&serial_0 {
232	status = "okay";
233	pinctrl-names = "default";
234	pinctrl-0 = <&uart1_pins>;
235};
236
237&usbdrd {
238	status = "okay";
239	vdd10-supply = <&reg_dummy>;
240	vdd33-supply = <&reg_dummy>;
241};
242
243&usbdrd_dwc3 {
244	dr_mode = "otg";
245	usb-role-switch;
246	role-switch-default-mode = "host";
247
248	port {
249		usb1_drd_sw: endpoint {
250			remote-endpoint = <&usb_dr_connector>;
251		};
252	};
253};
254
255&usbdrd_phy {
256	status = "okay";
257};
258
259&usi_uart {
260	samsung,clkreq-on; /* needed for UART mode */
261	status = "okay";
262};
263
264&watchdog_cl0 {
265	status = "okay";
266};
267
268&watchdog_cl1 {
269	status = "okay";
270};
271