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