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	 *  0x05f0,1000 - 0x05f0,1fff: Reboot reason
33	 *  0x06df,f000 - 0x06df,ffff: Mailbox message data
34	 *  0x0740,f000 - 0x0740,ffff: MCU firmware section
35	 *  0x21f0,0000 - 0x21ff,ffff: pstore/ramoops buffer
36	 *  0x3e00,0000 - 0x3fff,ffff: OP-TEE
37	 */
38	memory@0 {
39		device_type = "memory";
40		reg = <0x00000000 0x00000000 0x00000000 0x05e00000>,
41		      <0x00000000 0x05f00000 0x00000000 0x00001000>,
42		      <0x00000000 0x05f02000 0x00000000 0x00efd000>,
43		      <0x00000000 0x06e00000 0x00000000 0x0060f000>,
44		      <0x00000000 0x07410000 0x00000000 0x1aaf0000>,
45		      <0x00000000 0x22000000 0x00000000 0x1c000000>;
46	};
47
48	reserved-memory {
49		#address-cells = <2>;
50		#size-cells = <2>;
51		ranges;
52
53		ramoops@0x21f00000 {
54			compatible = "ramoops";
55			reg = <0x0 0x21f00000 0x0 0x00100000>;
56			record-size	= <0x00020000>;
57			console-size	= <0x00020000>;
58			ftrace-size	= <0x00020000>;
59		};
60
61		/* global autoconfigured region for contiguous allocations */
62		linux,cma {
63			compatible = "shared-dma-pool";
64			reusable;
65			size = <0x00000000 0x08000000>;
66			linux,cma-default;
67		};
68	};
69
70	reboot-mode-syscon@5f01000 {
71		compatible = "syscon", "simple-mfd";
72		reg = <0x0 0x05f01000 0x0 0x00001000>;
73
74		reboot-mode {
75			compatible = "syscon-reboot-mode";
76			offset = <0x0>;
77
78			mode-normal	= <0x77665501>;
79			mode-bootloader	= <0x77665500>;
80			mode-recovery	= <0x77665502>;
81		};
82	};
83
84	reg_sys_5v: regulator@0 {
85		compatible = "regulator-fixed";
86		regulator-name = "SYS_5V";
87		regulator-min-microvolt = <5000000>;
88		regulator-max-microvolt = <5000000>;
89		regulator-boot-on;
90		regulator-always-on;
91	};
92
93	reg_vdd_3v3: regulator@1 {
94		compatible = "regulator-fixed";
95		regulator-name = "VDD_3V3";
96		regulator-min-microvolt = <3300000>;
97		regulator-max-microvolt = <3300000>;
98		regulator-boot-on;
99		regulator-always-on;
100		vin-supply = <&reg_sys_5v>;
101	};
102
103	reg_5v_hub: regulator@2 {
104		compatible = "regulator-fixed";
105		regulator-name = "5V_HUB";
106		regulator-min-microvolt = <5000000>;
107		regulator-max-microvolt = <5000000>;
108		regulator-boot-on;
109		gpio = <&gpio0 7 0>;
110		regulator-always-on;
111		vin-supply = <&reg_sys_5v>;
112	};
113
114	soc {
115		spi0: spi@f7106000 {
116			status = "ok";
117		};
118
119		i2c0: i2c@f7100000 {
120			status = "ok";
121		};
122
123		i2c1: i2c@f7101000 {
124			status = "ok";
125		};
126
127		uart1: uart@f7111000 {
128			assigned-clocks = <&sys_ctrl HI6220_UART1_SRC>;
129			assigned-clock-rates = <150000000>;
130			status = "ok";
131
132			bluetooth {
133				compatible = "ti,wl1835-st";
134				enable-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
135			};
136		};
137
138		uart2: uart@f7112000 {
139			status = "ok";
140		};
141
142		uart3: uart@f7113000 {
143			status = "ok";
144		};
145
146		/*
147		 * Legend: proper name = the GPIO line is used as GPIO
148		 *         NC = not connected (not routed from the SoC)
149		 *         "[PER]" = pin is muxed for peripheral (not GPIO)
150		 *         "" = no idea, schematic doesn't say, could be
151		 *              unrouted (not connected to any external pin)
152		 *         LSEC = Low Speed External Connector
153		 *         HSEC = High Speed External Connector
154		 *
155		 * Pin assignments taken from LeMaker and CircuitCo Schematics
156		 * Rev A1.
157		 *
158		 * For the lines routed to the external connectors the
159		 * lines are named after the 96Boards CE Specification 1.0,
160		 * Appendix "Expansion Connector Signal Description".
161		 *
162		 * When the 96Board naming of a line and the schematic name of
163		 * the same line are in conflict, the 96Board specification
164		 * takes precedence, which means that the external UART on the
165		 * LSEC is named UART0 while the schematic and SoC names this
166		 * UART2. This is only for the informational lines i.e. "[FOO]",
167		 * the GPIO named lines "GPIO-A" thru "GPIO-L" are the only
168		 * ones actually used for GPIO.
169		 */
170		gpio0: gpio@f8011000 {
171			gpio-line-names = "PWR_HOLD", "DSI_SEL",
172			"USB_HUB_RESET_N", "USB_SEL", "HDMI_PD", "WL_REG_ON",
173			"PWRON_DET", "5V_HUB_EN";
174		};
175
176		gpio1: gpio@f8012000 {
177			gpio-line-names = "SD_DET", "HDMI_INT", "PMU_IRQ_N",
178			"WL_HOST_WAKE", "NC", "NC", "NC", "BT_REG_ON";
179		};
180
181		gpio2: gpio@f8013000 {
182			gpio-line-names =
183				"GPIO-A", /* LSEC Pin 23: GPIO2_0 */
184				"GPIO-B", /* LSEC Pin 24: GPIO2_1 */
185				"GPIO-C", /* LSEC Pin 25: GPIO2_2 */
186				"GPIO-D", /* LSEC Pin 26: GPIO2_3 */
187				"GPIO-E", /* LSEC Pin 27: GPIO2_4 */
188				"USB_ID_DET", "USB_VBUS_DET",
189				"GPIO-H"; /* LSEC Pin 30: GPIO2_7 */
190		};
191
192		gpio3: gpio@f8014000 {
193			gpio-line-names = "GPIO3_0", "NC", "NC", "", "NC", "",
194			"WLAN_ACTIVE", "NC", "NC";
195		};
196
197		gpio4: gpio@f7020000 {
198			gpio-line-names = "USER_LED1", "USER_LED2", "USER_LED3",
199			"USER_LED4", "SD_SEL", "NC", "NC", "BT_ACTIVE";
200		};
201
202		gpio5: gpio@f7021000 {
203			gpio-line-names = "NC", "NC",
204			"[UART1_RxD]", /* LSEC Pin 11: UART3_RX */
205			"[UART1_TxD]", /* LSEC Pin 13: UART3_TX */
206			"[AUX_SSI1]", "NC",
207			"[PCM_CLK]", /* LSEC Pin 18: MODEM_PCM_XCLK */
208			"[PCM_FS]"; /* LSEC Pin 16: MODEM_PCM_XFS */
209		};
210
211		gpio6: gpio@f7022000 {
212			gpio-line-names =
213			"[SPI0_DIN]", /* Pin 10: SPI0_DI */
214			"[SPI0_DOUT]", /* Pin 14: SPI0_DO */
215			"[SPI0_CS]", /* Pin 12: SPI0_CS_N */
216			"[SPI0_SCLK]", /* Pin 8: SPI0_SCLK */
217			"NC", "NC", "NC",
218			"GPIO-G"; /* Pin 29: GPIO6_7_DSI_TE0 */
219		};
220
221		gpio7: gpio@f7023000 {
222			gpio-line-names = "NC", "NC", "NC", "NC",
223			"[PCM_DI]", /* Pin 22: MODEM_PCM_DI */
224			"[PCM_DO]", /* Pin 20: MODEM_PCM_DO */
225			"NC", "NC";
226		};
227
228		gpio8: gpio@f7024000 {
229			gpio-line-names = "NC", "[CEC_CLK_19_2MHZ]", "NC",
230			"", "", "", "", "", "";
231		};
232
233		gpio9: gpio@f7025000 {
234			gpio-line-names = "",
235			"GPIO-J", /* LSEC Pin 32: ISP_PWDN0_GPIO9_1 */
236			"GPIO-L", /* LSEC Pin 34: ISP_PWDN1_GPIO9_2 */
237			"NC", "NC", "NC", "NC", "[ISP_CCLK0]";
238		};
239
240		gpio10: gpio@f7026000 {
241			gpio-line-names = "BOOT_SEL",
242			"[ISP_CCLK1]",
243			"GPIO-I", /* LSEC Pin 31: ISP_RSTB0_GPIO10_2 */
244			"GPIO-K", /* LSEC Pin 33: ISP_RSTB1_GPIO10_3 */
245			"NC", "NC",
246			"[I2C2_SDA]", /* HSEC Pin 34: ISP0_SDA */
247			"[I2C2_SCL]"; /* HSEC Pin 32: ISP0_SCL */
248		};
249
250		gpio11: gpio@f7027000 {
251			gpio-line-names =
252			"[I2C3_SDA]", /* HSEC Pin 38: ISP1_SDA */
253			"[I2C3_SCL]", /* HSEC Pin 36: ISP1_SCL */
254			"", "NC", "NC", "NC", "", "";
255		};
256
257		gpio12: gpio@f7028000 {
258			gpio-line-names = "[BT_PCM_XFS]", "[BT_PCM_DI]",
259			"[BT_PCM_DO]",
260			"NC", "NC", "NC", "NC",
261			"GPIO-F"; /* LSEC Pin 28: BL_PWM_GPIO12_7 */
262		};
263
264		gpio13: gpio@f7029000 {
265			gpio-line-names = "[UART0_RX]", "[UART0_TX]",
266			"[BT_UART1_CTS]", "[BT_UART1_RTS]",
267			"[BT_UART1_RX]", "[BT_UART1_TX]",
268			"[UART0_CTS]", /* LSEC Pin 3: UART2_CTS_N */
269			"[UART0_RTS]"; /* LSEC Pin 9: UART2_RTS_N */
270		};
271
272		gpio14: gpio@f702a000 {
273			gpio-line-names =
274			"[UART0_RxD]", /* LSEC Pin 7: UART2_RX */
275			"[UART0_TxD]", /* LSEC Pin 5: UART2_TX */
276			"[I2C0_SCL]", /* LSEC Pin 15: I2C0_SCL */
277			"[I2C0_SDA]", /* LSEC Pin 17: I2C0_SDA */
278			"[I2C1_SCL]", /* LSEC Pin 19: I2C1_SCL */
279			"[I2C1_SDA]", /* LSEC Pin 21: I2C1_SDA */
280			"[I2C2_SCL]", "[I2C2_SDA]";
281		};
282
283		gpio15: gpio@f702b000 {
284			gpio-line-names = "", "", "", "", "", "", "NC", "";
285		};
286
287		/* GPIO blocks 16 thru 19 do not appear to be routed to pins */
288
289		dwmmc_2: dwmmc2@f723f000 {
290			ti,non-removable;
291			non-removable;
292			/* WL_EN */
293			vmmc-supply = <&wlan_en_reg>;
294
295			#address-cells = <0x1>;
296			#size-cells = <0x0>;
297			wlcore: wlcore@2 {
298				compatible = "ti,wl1835";
299				reg = <2>;	/* sdio func num */
300				/* WL_IRQ, WL_HOST_WAKE_GPIO1_3 */
301				interrupt-parent = <&gpio1>;
302				interrupts = <3 IRQ_TYPE_EDGE_RISING>;
303			};
304		};
305
306		wlan_en_reg: regulator@1 {
307			compatible = "regulator-fixed";
308			regulator-name = "wlan-en-regulator";
309			regulator-min-microvolt = <1800000>;
310			regulator-max-microvolt = <1800000>;
311			/* WLAN_EN GPIO */
312			gpio = <&gpio0 5 0>;
313			/* WLAN card specific delay */
314			startup-delay-us = <70000>;
315			enable-active-high;
316		};
317	};
318
319	leds {
320		compatible = "gpio-leds";
321		user_led4 {
322			label = "user_led4";
323			gpios = <&gpio4 0 0>; /* <&gpio_user_led_1>; */
324			linux,default-trigger = "heartbeat";
325		};
326
327		user_led3 {
328			label = "user_led3";
329			gpios = <&gpio4 1 0>; /* <&gpio_user_led_2>; */
330			linux,default-trigger = "mmc0";
331		};
332
333		user_led2 {
334			label = "user_led2";
335			gpios = <&gpio4 2 0>; /* <&gpio_user_led_3>; */
336			linux,default-trigger = "mmc1";
337		};
338
339		user_led1 {
340			label = "user_led1";
341			gpios = <&gpio4 3 0>; /* <&gpio_user_led_4>; */
342			linux,default-trigger = "cpu0";
343		};
344
345		wlan_active_led {
346			label = "wifi_active";
347			gpios = <&gpio3 5 0>; /* <&gpio_wlan_active_led>; */
348			linux,default-trigger = "phy0tx";
349			default-state = "off";
350		};
351
352		bt_active_led {
353			label = "bt_active";
354			gpios = <&gpio4 7 0>; /* <&gpio_bt_active_led>; */
355			linux,default-trigger = "hci0rx";
356			default-state = "off";
357		};
358	};
359
360	pmic: pmic@f8000000 {
361		compatible = "hisilicon,hi655x-pmic";
362		reg = <0x0 0xf8000000 0x0 0x1000>;
363		#clock-cells = <0>;
364		interrupt-controller;
365		#interrupt-cells = <2>;
366		pmic-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
367
368		regulators {
369			ldo2: LDO2 {
370				regulator-name = "LDO2_2V8";
371				regulator-min-microvolt = <2500000>;
372				regulator-max-microvolt = <3200000>;
373				regulator-enable-ramp-delay = <120>;
374			};
375
376			ldo7: LDO7 {
377				regulator-name = "LDO7_SDIO";
378				regulator-min-microvolt = <1800000>;
379				regulator-max-microvolt = <3300000>;
380				regulator-enable-ramp-delay = <120>;
381			};
382
383			ldo10: LDO10 {
384				regulator-name = "LDO10_2V85";
385				regulator-min-microvolt = <1800000>;
386				regulator-max-microvolt = <3000000>;
387				regulator-enable-ramp-delay = <360>;
388			};
389
390			ldo13: LDO13 {
391				regulator-name = "LDO13_1V8";
392				regulator-min-microvolt = <1600000>;
393				regulator-max-microvolt = <1950000>;
394				regulator-enable-ramp-delay = <120>;
395			};
396
397			ldo14: LDO14 {
398				regulator-name = "LDO14_2V8";
399				regulator-min-microvolt = <2500000>;
400				regulator-max-microvolt = <3200000>;
401				regulator-enable-ramp-delay = <120>;
402			};
403
404			ldo15: LDO15 {
405				regulator-name = "LDO15_1V8";
406				regulator-min-microvolt = <1600000>;
407				regulator-max-microvolt = <1950000>;
408				regulator-boot-on;
409				regulator-always-on;
410				regulator-enable-ramp-delay = <120>;
411			};
412
413			ldo17: LDO17 {
414				regulator-name = "LDO17_2V5";
415				regulator-min-microvolt = <2500000>;
416				regulator-max-microvolt = <3200000>;
417				regulator-enable-ramp-delay = <120>;
418			};
419
420			ldo19: LDO19 {
421				regulator-name = "LDO19_3V0";
422				regulator-min-microvolt = <1800000>;
423				regulator-max-microvolt = <3000000>;
424				regulator-enable-ramp-delay = <360>;
425			};
426
427			ldo21: LDO21 {
428				regulator-name = "LDO21_1V8";
429				regulator-min-microvolt = <1650000>;
430				regulator-max-microvolt = <2000000>;
431				regulator-always-on;
432				regulator-enable-ramp-delay = <120>;
433			};
434
435			ldo22: LDO22 {
436				regulator-name = "LDO22_1V2";
437				regulator-min-microvolt = <900000>;
438				regulator-max-microvolt = <1200000>;
439				regulator-boot-on;
440				regulator-always-on;
441				regulator-enable-ramp-delay = <120>;
442			};
443		};
444	};
445
446	firmware {
447		optee {
448			compatible = "linaro,optee-tz";
449			method = "smc";
450		};
451	};
452};
453
454&uart2 {
455	label = "LS-UART0";
456};
457&uart3 {
458	label = "LS-UART1";
459};
460
461&ade {
462	status = "ok";
463};
464
465&dsi {
466	status = "ok";
467
468	ports {
469		/* 1 for output port */
470		port@1 {
471			reg = <1>;
472
473			dsi_out0: endpoint@0 {
474				remote-endpoint = <&adv7533_in>;
475			};
476		};
477	};
478};
479
480&i2c2 {
481	#address-cells = <1>;
482	#size-cells = <0>;
483	status = "ok";
484
485	adv7533: adv7533@39 {
486		compatible = "adi,adv7533";
487		reg = <0x39>;
488		interrupt-parent = <&gpio1>;
489		interrupts = <1 2>;
490		pd-gpio = <&gpio0 4 0>;
491		adi,dsi-lanes = <4>;
492
493		port {
494			adv7533_in: endpoint {
495				remote-endpoint = <&dsi_out0>;
496			};
497		};
498	};
499};
500