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