1// SPDX-License-Identifier: GPL-2.0
2/*
3 * dts file for Hisilicon HiKey970 Development Board
4 *
5 * Copyright (C) 2016, HiSilicon Ltd.
6 * Copyright (C) 2018, Linaro Ltd.
7 *
8 */
9
10/dts-v1/;
11#include <dt-bindings/gpio/gpio.h>
12
13#include "hi3670.dtsi"
14#include "hikey970-pinctrl.dtsi"
15
16/ {
17	model = "HiKey970";
18	compatible = "hisilicon,hi3670-hikey970", "hisilicon,hi3670";
19
20	aliases {
21		mshc1 = &dwmmc1;
22		mshc2 = &dwmmc2;
23		serial0 = &uart0;
24		serial1 = &uart1;
25		serial2 = &uart2;
26		serial3 = &uart3;
27		serial4 = &uart4;
28		serial5 = &uart5;
29		serial6 = &uart6;       /* console UART */
30	};
31
32	chosen {
33		stdout-path = "serial6:115200n8";
34	};
35
36	memory@0 {
37		device_type = "memory";
38		/* expect bootloader to fill in this region */
39		reg = <0x0 0x0 0x0 0x0>;
40	};
41
42	sd_1v8: regulator-1v8 {
43		compatible = "regulator-fixed";
44		regulator-name = "fixed-1.8V";
45		regulator-min-microvolt = <1800000>;
46		regulator-max-microvolt = <1800000>;
47		regulator-always-on;
48	};
49
50	sd_3v3: regulator-3v3 {
51		compatible = "regulator-fixed";
52		regulator-name = "fixed-3.3V";
53		regulator-min-microvolt = <3300000>;
54		regulator-max-microvolt = <3300000>;
55		regulator-boot-on;
56		regulator-always-on;
57	};
58
59	wlan_en: wlan-en-1-8v {
60		compatible = "regulator-fixed";
61		regulator-name = "wlan-en-regulator";
62		regulator-min-microvolt = <1800000>;
63		regulator-max-microvolt = <1800000>;
64
65		/* GPIO_051_WIFI_EN */
66		gpio = <&gpio6 3 0>;
67
68		/* WLAN card specific delay */
69		startup-delay-us = <70000>;
70		enable-active-high;
71	};
72};
73
74/*
75 * Legend: proper name = the GPIO line is used as GPIO
76 *         NC = not connected (pin out but not routed from the chip to
77 *              anything the board)
78 *         "[PER]" = pin is muxed for [peripheral] (not GPIO)
79 *         "" = no idea, schematic doesn't say, could be
80 *              unrouted (not connected to any external pin)
81 *         LSEC = Low Speed External Connector
82 *         HSEC = High Speed External Connector
83 *
84 * Line names are taken from "hikey970-schematics.pdf" from HiSilicon.
85 *
86 * For the lines routed to the external connectors the
87 * lines are named after the 96Boards CE Specification 1.0,
88 * Appendix "Expansion Connector Signal Description".
89 *
90 * When the 96Board naming of a line and the schematic name of
91 * the same line are in conflict, the 96Board specification
92 * takes precedence, which means that the external UART on the
93 * LSEC is named UART0 while the schematic and SoC names this
94 * UART2. This is only for the informational lines i.e. "[FOO]",
95 * the GPIO named lines "GPIO-A" thru "GPIO-L" are the only
96 * ones actually used for GPIO.
97 */
98&gpio0 {
99	/* GPIO_000-GPIO_007 */
100	gpio-line-names =
101		"",
102		"TP901", /* TEST_MODE connected to TP901 */
103		"",
104		"GPIO_003_USB_HUB_RESET_N",
105		"NC",
106		"[AP_GPS_REF_CLK]",
107		"[I2C3_SCL]",
108		"[I2C3_SDA]";
109};
110
111&gpio1 {
112	/* GPIO_008-GPIO_015 */
113	gpio-line-names =
114		"[UART0_CTS]", /* LSEC pin 3: GPIO_008_UART2_CTS_N */
115		"[UART0_RTS]", /* LSEC pin 9: GPIO_009_UART2_RTS_N */
116		"[UART0_TXD]", /* LSEC pin 5: GPIO_010_UART2_TXD */
117		"[UART0_RXD]", /* LSEC pin 7: GPIO_011_UART2_RXD */
118		"[USER_LED5]",
119		"GPIO-I", /* LSEC pin 31: GPIO_013_CAM0_RST_N */
120		"[USER_LED3]",
121		"[USER_LED4]";
122};
123
124&gpio2 {
125	/* GPIO_016-GPIO_023 */
126	gpio-line-names =
127		"GPIO-G", /* LSEC pin 29: GPIO_016_LCD_TE0 */
128		"[CSI0_MCLK]", /* HSEC pin 15: ISP_CCLK0_MCAM */
129		"[CSI1_MCLK]", /* HSEC pin 17: ISP_CCLK1_SCAM */
130		"GPIO_019_BT_ACTIVE",
131		"[I2C2_SCL]", /* HSEC pin 32: ISP_SCL0 */
132		"[I2C2_SDA]", /* HSEC pin 34: ISP_SDA0 */
133		"[I2C3_SCL]", /* HSEC pin 36: ISP_SCL1 */
134		"[I2C3_SDA]"; /* HSEC pin 38: ISP_SDA1 */
135};
136
137&gpio3 {
138	/* GPIO_024-GPIO_031 */
139	gpio-line-names =
140		"GPIO_024_WIFI_ACTIVE",
141		"GPIO_025_PERST_M.2",
142		"[I2C4_SCL]",
143		"[I2C4_SDA]",
144		"NC",
145		"GPIO-H", /* LSEC pin 30: GPIO_029_LCD_RST_N */
146		"[USER_LED1]",
147		"GPIO-L"; /* LSEC pin 34: GPIO_031 */
148};
149
150&gpio4 {
151	/* GPIO_032-GPIO_039 */
152	gpio-line-names =
153		"GPIO-K", /* LSEC pin 33: GPIO_032_CAM1_RST_N */
154		"GPIO_033_PMU1_EN",
155		"GPIO_034_USBSW_SEL",
156		/*
157		 * These two pins should be used for SD(IO) data according
158		 * to the 96boards specification but seems to be repurposed
159		 * for UART 0. They are however named according to the spec.
160		 */
161		"[SD_DAT1]", /* HSEC pin 3: GPIO_035_UART0_RXD */
162		"[SD_DAT2]", /* HSEC pin 5: GPIO_036_UART0_TXD */
163		"[UART1_RXD]", /* LSEC pin 13: DEBUG_UART6_RXD */
164		"[UART1_TXD]", /* LSEC pin 11: DEBUG_UART6_TXD */
165		"[SOC_GPS_UART3_CTS_N]"; /* TP2304 */
166};
167
168&gpio5 {
169	/* GPIO_040-GPIO_047 */
170	gpio-line-names =
171		"[SOC_GPS_UART3_RTS_N]", /* TP2302 */
172		"[SOC_GPS_UART3_RXD]", /* TP2303 */
173		"[SOC_GPS_UART3_TXD]", /* TP2305 */
174		"[SOC_BT_UART4_CTS_N]",
175		"[SOC_BT_UART4_RTS_N]",
176		"[SOC_BT_UART4_RXD]",
177		"[SOC_BT_UART4_TXD]",
178		"NC";
179};
180
181&gpio6 {
182	/* GPIO_048-GPIO_055 */
183	gpio-line-names =
184		"NC",
185		"GPIO_049_USER_LED6",
186		"GPIO_050_CAN_RST",
187		"GPIO_051_WIFI_EN",
188		"GPIO-D", /* LSEC pin 26 */
189		"GPIO-J", /* LSEC pin 32 */
190		"GPIO_054_BT_EN",
191		"[GPIO_055_SEL]";
192};
193
194&gpio7 {
195	/* GPIO_056-GPIO_063 */
196	gpio-line-names =
197		"[PCIE_PERST_L]", "NC", "NC", "NC", "NC", "NC", "NC", "NC";
198};
199
200&gpio8 {
201	/* GPIO_064-GPIO_071 */
202	gpio-line-names = "NC", "NC", "NC", "NC", "NC", "NC", "NC", "NC";
203};
204
205&gpio9 {
206	/* GPIO_072-GPIO_079 */
207	gpio-line-names = "NC", "NC", "NC", "NC", "NC", "NC", "NC", "NC";
208};
209
210&gpio10 {
211	/* GPIO_080-GPIO_087 */
212	gpio-line-names = "NC", "NC", "NC", "NC", "NC", "NC", "NC", "NC";
213};
214
215&gpio11 {
216	/* GPIO_088-GPIO_095 */
217	gpio-line-names = "NC", "NC", "NC", "NC", "NC", "NC", "NC", "NC";
218};
219
220&gpio12 {
221	/* GPIO_096-GPIO_103 */
222	gpio-line-names = "NC", "", "", "", "", "", "", "";
223};
224
225&gpio13 {
226	/* GPIO_104-GPIO_111 */
227	gpio-line-names = "", "", "", "", "", "", "", "";
228};
229
230&gpio14 {
231	/* GPIO_112-GPIO_119 */
232	gpio-line-names = "", "", "", "", "", "", "", "";
233};
234
235&gpio15 {
236	/* GPIO_120-GPIO_127 */
237	gpio-line-names = "", "", "", "", "", "", "", "";
238};
239
240&gpio16 {
241	/* GPIO_128-GPIO_135 */
242	gpio-line-names =
243		"[WL_SDIO_CLK]",
244		"[WL_SDIO_CMD]",
245		"[WL_SDIO_DATA0]",
246		"[WL_SDIO_DATA1]",
247		"[WL_SDIO_DATA2]",
248		"[WL_SDIO_DATA3]",
249		"[ETH_ISOLATE]",
250		"NC";
251};
252
253&gpio17 {
254	/* GPIO_136-GPIO_143 */
255	gpio-line-names =
256		"[MINI1CLK_EN]", "NC", "", "", "", "", "", "";
257};
258
259&gpio18 {
260	/* GPIO_144-GPIO_151 */
261	gpio-line-names =
262		"[SPI1_SCLK]", /* HSEC pin 9: GPIO_144_SPI3_CLK */
263		"[SPI1_DIN]", /* HSEC pin 11: GPIO_145_SPI3_DI */
264		"[SPI1_DOUT]", /* HSEC pin 1: GPIO_146_SPI3_DO */
265		"[SPI1_CS]", /* HSEC pin 7: GPIO_147_SPI3_CS0_N */
266		"[POWER_INT_N]",
267		"[CDMA_GPS_SYNC]",
268		"GPIO_150_PEX_INTA",
269		"GPIO_151_CAN_INT";
270};
271
272&gpio19 {
273	/* GPIO_152-GPIO_159 */
274	gpio-line-names = "", "", "", "", "", "", "", "";
275};
276
277&gpio20 {
278	/* GPIO_160-GPIO_167 */
279	gpio-line-names =
280		"[SD_CLK]",
281		"[SD_CMD]",
282		"[SD_DATA0]",
283		"[SD_DATA1]",
284		"[SD_DATA2]",
285		"[SD_DATA3]",
286		"GPIO_166_ETHCLK_EN",
287		"GPIO_167_USER_LED2";
288};
289
290&gpio21 {
291	/* GPIO_168-GPIO_175 */
292	gpio-line-names =
293		"GPIO_168_GPS_EN",
294		"GPIO-C", /* LSEC pin 25: GPIO_169_USIM1_CLK */
295		"GPIO-E", /* LSEC pin 27: GPIO_170_USIM1_RST */
296		"GPIO-B", /* LSEC pin 24: GPIO_171_USIM1_DATA */
297		"", "", "", "", "";
298};
299
300&gpio22 {
301	/* GPIO_176-GPIO_183 */
302	gpio-line-names =
303		"[PMU_PWR_HOLD]",
304		"GPIO_177_WL_WAKEUP_AP",
305		"[JTAG_TCK]",
306		"[JTAG_TMS]",
307		"[JTAG_TDI]",
308		"[JTAG_TMS]",
309		"GPIO_182_FATAL_ERR",
310		"NC";
311};
312
313&gpio23 {
314	/* GPIO_184-GPIO_191 */
315	gpio-line-names =
316		"GPIO_184_JTAG_SEL",
317		"GPIO-F", /* LSEC pin 28: GPIO_185_LCD_BL_PWM */
318		"[I2C0_SCL]", /* LSEC pin 15: GPIO_186_I2C0_SCL */
319		"[I2C0_SDA]", /* LSEC pin 17: GPIO_187_I2C0_SDA */
320		"[GPIO_188_I2C1_SCL]", /* Actual SoC I2C1_SCL */
321		"[GPIO_189_I2C1_SDA]", /* Actual SoC I2C1_SDA */
322		"[I2C1_SCL]", /* LSEC pin 19: GPIO_190_I2C2_SCL */
323		"[I2C2_SDA]"; /* LSEC pin 21: GPIO_191_I2C2_SDA */
324};
325
326&gpio24 {
327	/* GPIO_192-GPIO_199 */
328	gpio-line-names =
329		"[SD_LED]",
330		"NC",
331		"[PCM_DI]", /* LSEC pin 22: GPIO_194_I2S0_DI */
332		"[PCM_DO]", /* LSEC pin 20: GPIO_195_I2S0_DO */
333		"[PCM_CLK]", /* LSEC pin 18: GPIO_196_I2S0_XCLK */
334		"[PCM_FS]", /* LSEC pin 16: GPIO_197_I2S0_XFS */
335		"",
336		"[I2S2_DO]";
337};
338
339&gpio25 {
340	/* GPIO_200-GPIO_207 */
341	gpio-line-names =
342		"[I2S2_XCLK]",
343		"[I2S2_XFS]",
344		"GPIO_202_PERST_ETH",
345		"GPIO_203_PWRON_DET",
346		"GPIO_204_PMU1_IRQ_N",
347		"GPIO_205_SD_DET",
348		"GPIO_206_GPS_MOTION_INT",
349		"GPIO_207_HDMI_SEL";
350};
351
352&gpio26 {
353	/* GPIO_208-GPIO_215 */
354	gpio-line-names =
355		"GPIO-A", /* LSEC pin 23: GPIO_208_WAKEUP_SOC */
356		"GPIO_209_VBUS_TYPEC",
357		"NC",
358		"NC",
359		"NC",
360		"[SPI0_SCLK]", /* LSEC pin 8: GPIO_213_SPI2_CLK */
361		"[SPI0_DIN]", /* LSEC pin 10: GPIO_214_SPI2_DI */
362		"[SPI0_DOUT]"; /* LSEC pin 14: GPIO_215_SPI2_DO */
363};
364
365&gpio27 {
366	/* GPIO_216-GPIO_223 */
367	gpio-line-names =
368		"[SPI0_CS]", /* LSEC pin 12: GPIO_216_SPI2_CS0_N */
369		"GPIO_217_HDMI_PD",
370		"GPIO_218_GPS_WAKEUP_AP",
371		"GPIO_219_M.2CLK_EN",
372		"GPIO_220_PERST_MINI",
373		"GPIO_221_CC_INT",
374		"[PCIE_CLKREQ_L]",
375		"NC";
376};
377
378&gpio28 {
379	/* GPIO_224-GPIO_231 */
380	gpio-line-names =
381		"[PMU0_INT]",
382		"[SPMI_DATA]",
383		"[SPMI_CLK]",
384		"[CAN_SPI_CLK]",
385		"[CAN_SPI_DI]",
386		"[CAN_SPI_DO]",
387		"[CAN_SPI_CS]",
388		"GPIO_231_HDMI_INT";
389};
390
391&dwmmc1 {
392	bus-width = <0x4>;
393	sd-uhs-sdr12;
394	sd-uhs-sdr25;
395	sd-uhs-sdr50;
396	sd-uhs-sdr104;
397	cap-sd-highspeed;
398	disable-wp;
399	cd-inverted;
400	cd-gpios = <&gpio25 5 GPIO_ACTIVE_HIGH>;
401	pinctrl-names = "default";
402	pinctrl-0 = <&sd_pmx_func
403		     &sd_clk_cfg_func
404		     &sd_cfg_func>;
405	vmmc-supply = <&sd_3v3>;
406	vqmmc-supply = <&sd_1v8>;
407	status = "okay";
408};
409
410&dwmmc2 { /* WIFI */
411	bus-width = <0x4>;
412	non-removable;
413	broken-cd;
414	cap-power-off-card;
415	pinctrl-names = "default";
416	pinctrl-0 = <&sdio_pmx_func
417		     &sdio_clk_cfg_func
418		     &sdio_cfg_func>;
419	/* WL_EN */
420	vmmc-supply = <&wlan_en>;
421	status = "okay";
422
423	wlcore: wlcore@2 {
424		compatible = "ti,wl1837";
425		reg = <2>;      /* sdio func num */
426		/* WL_IRQ, GPIO_177_WL_WAKEUP_AP */
427		interrupt-parent = <&gpio22>;
428		interrupts = <1 IRQ_TYPE_EDGE_RISING>;
429	};
430};
431
432&uart0 {
433	/* On High speed expansion header */
434	label = "HS-UART0";
435	status = "okay";
436};
437
438&uart2 {
439	/* On Low speed expansion header */
440	label = "LS-UART0";
441	status = "okay";
442};
443
444&uart6 {
445	/* On Low speed expansion header */
446	label = "LS-UART1";
447	status = "okay";
448};
449