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