1/*
2 * dts file for Hisilicon HiKey Development Board
3 *
4 * Copyright (C) 2015, Hisilicon Ltd.
5 *
6 */
7
8/dts-v1/;
9#include "hi6220.dtsi"
10#include "hikey-pinctrl.dtsi"
11#include <dt-bindings/gpio/gpio.h>
12
13/ {
14	model = "HiKey Development Board";
15	compatible = "hisilicon,hi6220-hikey", "hisilicon,hi6220";
16
17	aliases {
18		serial0 = &uart0; /* On board UART0 */
19		serial1 = &uart1; /* BT UART */
20		serial2 = &uart2; /* LS Expansion UART0 */
21		serial3 = &uart3; /* LS Expansion UART1 */
22	};
23
24	chosen {
25		stdout-path = "serial3:115200n8";
26	};
27
28	/*
29	 * Reserve below regions from memory node:
30	 *
31	 *  0x05e0,0000 - 0x05ef,ffff: MCU firmware runtime using
32	 *  0x06df,f000 - 0x06df,ffff: Mailbox message data
33	 *  0x0740,f000 - 0x0740,ffff: MCU firmware section
34	 *  0x3e00,0000 - 0x3fff,ffff: OP-TEE
35	 */
36	memory@0 {
37		device_type = "memory";
38		reg = <0x00000000 0x00000000 0x00000000 0x05e00000>,
39		      <0x00000000 0x05f00000 0x00000000 0x00eff000>,
40		      <0x00000000 0x06e00000 0x00000000 0x0060f000>,
41		      <0x00000000 0x07410000 0x00000000 0x36bf0000>;
42	};
43
44	soc {
45		spi0: spi@f7106000 {
46			status = "ok";
47		};
48
49		i2c0: i2c@f7100000 {
50			status = "ok";
51		};
52
53		i2c1: i2c@f7101000 {
54			status = "ok";
55		};
56
57		uart1: uart@f7111000 {
58			assigned-clocks = <&sys_ctrl HI6220_UART1_SRC>;
59			assigned-clock-rates = <150000000>;
60			status = "ok";
61		};
62
63		uart2: uart@f7112000 {
64			status = "ok";
65		};
66
67		uart3: uart@f7113000 {
68			status = "ok";
69		};
70
71		/*
72		 * Legend: proper name = the GPIO line is used as GPIO
73		 *         NC = not connected (not routed from the SoC)
74		 *         "[PER]" = pin is muxed for peripheral (not GPIO)
75		 *         "" = no idea, schematic doesn't say, could be
76		 *              unrouted (not connected to any external pin)
77		 *         LSEC = Low Speed External Connector
78		 *         HSEC = High Speed External Connector
79		 *
80		 * Pin assignments taken from LeMaker and CircuitCo Schematics
81		 * Rev A1.
82		 *
83		 * For the lines routed to the external connectors the
84		 * lines are named after the 96Boards CE Specification 1.0,
85		 * Appendix "Expansion Connector Signal Description".
86		 *
87		 * When the 96Board naming of a line and the schematic name of
88		 * the same line are in conflict, the 96Board specification
89		 * takes precedence, which means that the external UART on the
90		 * LSEC is named UART0 while the schematic and SoC names this
91		 * UART2. This is only for the informational lines i.e. "[FOO]",
92		 * the GPIO named lines "GPIO-A" thru "GPIO-L" are the only
93		 * ones actually used for GPIO.
94		 */
95		gpio0: gpio@f8011000 {
96			gpio-line-names = "PWR_HOLD", "DSI_SEL",
97			"USB_HUB_RESET_N", "USB_SEL", "HDMI_PD", "WL_REG_ON",
98			"PWRON_DET", "5V_HUB_EN";
99		};
100
101		gpio1: gpio@f8012000 {
102			gpio-line-names = "SD_DET", "HDMI_INT", "PMU_IRQ_N",
103			"WL_HOST_WAKE", "NC", "NC", "NC", "BT_REG_ON";
104		};
105
106		gpio2: gpio@f8013000 {
107			gpio-line-names =
108				"GPIO-A", /* LSEC Pin 23: GPIO2_0 */
109				"GPIO-B", /* LSEC Pin 24: GPIO2_1 */
110				"GPIO-C", /* LSEC Pin 25: GPIO2_2 */
111				"GPIO-D", /* LSEC Pin 26: GPIO2_3 */
112				"GPIO-E", /* LSEC Pin 27: GPIO2_4 */
113				"USB_ID_DET", "USB_VBUS_DET",
114				"GPIO-H"; /* LSEC Pin 30: GPIO2_7 */
115		};
116
117		gpio3: gpio@f8014000 {
118			gpio-line-names = "GPIO3_0", "NC", "NC", "", "NC", "",
119			"WLAN_ACTIVE", "NC", "NC";
120		};
121
122		gpio4: gpio@f7020000 {
123			gpio-line-names = "USER_LED1", "USER_LED2", "USER_LED3",
124			"USER_LED4", "SD_SEL", "NC", "NC", "BT_ACTIVE";
125		};
126
127		gpio5: gpio@f7021000 {
128			gpio-line-names = "NC", "NC",
129			"[UART1_RxD]", /* LSEC Pin 11: UART3_RX */
130			"[UART1_TxD]", /* LSEC Pin 13: UART3_TX */
131			"[AUX_SSI1]", "NC",
132			"[PCM_CLK]", /* LSEC Pin 18: MODEM_PCM_XCLK */
133			"[PCM_FS]"; /* LSEC Pin 16: MODEM_PCM_XFS */
134		};
135
136		gpio6: gpio@f7022000 {
137			gpio-line-names =
138			"[SPI0_DIN]", /* Pin 10: SPI0_DI */
139			"[SPI0_DOUT]", /* Pin 14: SPI0_DO */
140			"[SPI0_CS]", /* Pin 12: SPI0_CS_N */
141			"[SPI0_SCLK]", /* Pin 8: SPI0_SCLK */
142			"NC", "NC", "NC",
143			"GPIO-G"; /* Pin 29: GPIO6_7_DSI_TE0 */
144		};
145
146		gpio7: gpio@f7023000 {
147			gpio-line-names = "NC", "NC", "NC", "NC",
148			"[PCM_DI]", /* Pin 22: MODEM_PCM_DI */
149			"[PCM_DO]", /* Pin 20: MODEM_PCM_DO */
150			"NC", "NC";
151		};
152
153		gpio8: gpio@f7024000 {
154			gpio-line-names = "NC", "[CEC_CLK_19_2MHZ]", "NC",
155			"", "", "", "", "", "";
156		};
157
158		gpio9: gpio@f7025000 {
159			gpio-line-names = "",
160			"GPIO-J", /* LSEC Pin 32: ISP_PWDN0_GPIO9_1 */
161			"GPIO-L", /* LSEC Pin 34: ISP_PWDN1_GPIO9_2 */
162			"NC", "NC", "NC", "NC", "[ISP_CCLK0]";
163		};
164
165		gpio10: gpio@f7026000 {
166			gpio-line-names = "BOOT_SEL",
167			"[ISP_CCLK1]",
168			"GPIO-I", /* LSEC Pin 31: ISP_RSTB0_GPIO10_2 */
169			"GPIO-K", /* LSEC Pin 33: ISP_RSTB1_GPIO10_3 */
170			"NC", "NC",
171			"[I2C2_SDA]", /* HSEC Pin 34: ISP0_SDA */
172			"[I2C2_SCL]"; /* HSEC Pin 32: ISP0_SCL */
173		};
174
175		gpio11: gpio@f7027000 {
176			gpio-line-names =
177			"[I2C3_SDA]", /* HSEC Pin 38: ISP1_SDA */
178			"[I2C3_SCL]", /* HSEC Pin 36: ISP1_SCL */
179			"", "NC", "NC", "NC", "", "";
180		};
181
182		gpio12: gpio@f7028000 {
183			gpio-line-names = "[BT_PCM_XFS]", "[BT_PCM_DI]",
184			"[BT_PCM_DO]",
185			"NC", "NC", "NC", "NC",
186			"GPIO-F"; /* LSEC Pin 28: BL_PWM_GPIO12_7 */
187		};
188
189		gpio13: gpio@f7029000 {
190			gpio-line-names = "[UART0_RX]", "[UART0_TX]",
191			"[BT_UART1_CTS]", "[BT_UART1_RTS]",
192			"[BT_UART1_RX]", "[BT_UART1_TX]",
193			"[UART0_CTS]", /* LSEC Pin 3: UART2_CTS_N */
194			"[UART0_RTS]"; /* LSEC Pin 9: UART2_RTS_N */
195		};
196
197		gpio14: gpio@f702a000 {
198			gpio-line-names =
199			"[UART0_RxD]", /* LSEC Pin 7: UART2_RX */
200			"[UART0_TxD]", /* LSEC Pin 5: UART2_TX */
201			"[I2C0_SCL]", /* LSEC Pin 15: I2C0_SCL */
202			"[I2C0_SDA]", /* LSEC Pin 17: I2C0_SDA */
203			"[I2C1_SCL]", /* LSEC Pin 19: I2C1_SCL */
204			"[I2C1_SDA]", /* LSEC Pin 21: I2C1_SDA */
205			"[I2C2_SCL]", "[I2C2_SDA]";
206		};
207
208		gpio15: gpio@f702b000 {
209			gpio-line-names = "", "", "", "", "", "", "NC", "";
210		};
211
212		/* GPIO blocks 16 thru 19 do not appear to be routed to pins */
213
214		dwmmc_2: dwmmc2@f723f000 {
215			ti,non-removable;
216			non-removable;
217			/* WL_EN */
218			vmmc-supply = <&wlan_en_reg>;
219
220			#address-cells = <0x1>;
221			#size-cells = <0x0>;
222			wlcore: wlcore@2 {
223				compatible = "ti,wl1835";
224				reg = <2>;	/* sdio func num */
225				/* WL_IRQ, WL_HOST_WAKE_GPIO1_3 */
226				interrupt-parent = <&gpio1>;
227				interrupts = <3 IRQ_TYPE_EDGE_RISING>;
228			};
229		};
230
231		wlan_en_reg: regulator@1 {
232			compatible = "regulator-fixed";
233			regulator-name = "wlan-en-regulator";
234			regulator-min-microvolt = <1800000>;
235			regulator-max-microvolt = <1800000>;
236			/* WLAN_EN GPIO */
237			gpio = <&gpio0 5 0>;
238			/* WLAN card specific delay */
239			startup-delay-us = <70000>;
240			enable-active-high;
241		};
242	};
243
244	leds {
245		compatible = "gpio-leds";
246		user_led4 {
247			label = "user_led4";
248			gpios = <&gpio4 0 0>; /* <&gpio_user_led_1>; */
249			linux,default-trigger = "heartbeat";
250		};
251
252		user_led3 {
253			label = "user_led3";
254			gpios = <&gpio4 1 0>; /* <&gpio_user_led_2>; */
255			linux,default-trigger = "mmc0";
256		};
257
258		user_led2 {
259			label = "user_led2";
260			gpios = <&gpio4 2 0>; /* <&gpio_user_led_3>; */
261			linux,default-trigger = "mmc1";
262		};
263
264		user_led1 {
265			label = "user_led1";
266			gpios = <&gpio4 3 0>; /* <&gpio_user_led_4>; */
267			linux,default-trigger = "cpu0";
268		};
269
270		wlan_active_led {
271			label = "wifi_active";
272			gpios = <&gpio3 5 0>; /* <&gpio_wlan_active_led>; */
273			linux,default-trigger = "phy0tx";
274			default-state = "off";
275		};
276
277		bt_active_led {
278			label = "bt_active";
279			gpios = <&gpio4 7 0>; /* <&gpio_bt_active_led>; */
280			linux,default-trigger = "hci0rx";
281			default-state = "off";
282		};
283	};
284
285	pmic: pmic@f8000000 {
286		compatible = "hisilicon,hi655x-pmic";
287		reg = <0x0 0xf8000000 0x0 0x1000>;
288		interrupt-controller;
289		#interrupt-cells = <2>;
290		pmic-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
291
292		regulators {
293			ldo2: LDO2 {
294				regulator-name = "LDO2_2V8";
295				regulator-min-microvolt = <2500000>;
296				regulator-max-microvolt = <3200000>;
297				regulator-enable-ramp-delay = <120>;
298			};
299
300			ldo7: LDO7 {
301				regulator-name = "LDO7_SDIO";
302				regulator-min-microvolt = <1800000>;
303				regulator-max-microvolt = <3300000>;
304				regulator-enable-ramp-delay = <120>;
305			};
306
307			ldo10: LDO10 {
308				regulator-name = "LDO10_2V85";
309				regulator-min-microvolt = <1800000>;
310				regulator-max-microvolt = <3000000>;
311				regulator-enable-ramp-delay = <360>;
312			};
313
314			ldo13: LDO13 {
315				regulator-name = "LDO13_1V8";
316				regulator-min-microvolt = <1600000>;
317				regulator-max-microvolt = <1950000>;
318				regulator-enable-ramp-delay = <120>;
319			};
320
321			ldo14: LDO14 {
322				regulator-name = "LDO14_2V8";
323				regulator-min-microvolt = <2500000>;
324				regulator-max-microvolt = <3200000>;
325				regulator-enable-ramp-delay = <120>;
326			};
327
328			ldo15: LDO15 {
329				regulator-name = "LDO15_1V8";
330				regulator-min-microvolt = <1600000>;
331				regulator-max-microvolt = <1950000>;
332				regulator-boot-on;
333				regulator-always-on;
334				regulator-enable-ramp-delay = <120>;
335			};
336
337			ldo17: LDO17 {
338				regulator-name = "LDO17_2V5";
339				regulator-min-microvolt = <2500000>;
340				regulator-max-microvolt = <3200000>;
341				regulator-enable-ramp-delay = <120>;
342			};
343
344			ldo19: LDO19 {
345				regulator-name = "LDO19_3V0";
346				regulator-min-microvolt = <1800000>;
347				regulator-max-microvolt = <3000000>;
348				regulator-enable-ramp-delay = <360>;
349			};
350
351			ldo21: LDO21 {
352				regulator-name = "LDO21_1V8";
353				regulator-min-microvolt = <1650000>;
354				regulator-max-microvolt = <2000000>;
355				regulator-always-on;
356				regulator-enable-ramp-delay = <120>;
357			};
358
359			ldo22: LDO22 {
360				regulator-name = "LDO22_1V2";
361				regulator-min-microvolt = <900000>;
362				regulator-max-microvolt = <1200000>;
363				regulator-boot-on;
364				regulator-always-on;
365				regulator-enable-ramp-delay = <120>;
366			};
367		};
368	};
369};
370
371&uart2 {
372	label = "LS-UART0";
373};
374&uart3 {
375	label = "LS-UART1";
376};
377
378&ade {
379	status = "ok";
380};
381
382&dsi {
383	status = "ok";
384};
385