ARM: dts: Add cros_ec to exynos5420-peach-pit and exynos5800-peach-pi
[cascardo/linux.git] / arch / arm / boot / dts / exynos5800-peach-pi.dts
1 /*
2  * Google Peach Pi Rev 10+ board device tree source
3  *
4  * Copyright (c) 2014 Google, Inc
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10
11 /dts-v1/;
12 #include <dt-bindings/input/input.h>
13 #include <dt-bindings/gpio/gpio.h>
14 #include "exynos5800.dtsi"
15
16 / {
17         model = "Google Peach Pi Rev 10+";
18
19         compatible = "google,pi-rev16",
20                 "google,pi-rev15", "google,pi-rev14",
21                 "google,pi-rev13", "google,pi-rev12",
22                 "google,pi-rev11", "google,pi-rev10",
23                 "google,pi", "google,peach", "samsung,exynos5800",
24                 "samsung,exynos5";
25
26         aliases {
27                 /* Assign 20 so we don't get confused w/ builtin ones */
28                 i2c20 = "/spi@12d40000/cros-ec@0/i2c-tunnel";
29         };
30
31         backlight {
32                 compatible = "pwm-backlight";
33                 pwms = <&pwm 0 1000000 0>;
34                 brightness-levels = <0 100 500 1000 1500 2000 2500 2800>;
35                 default-brightness-level = <7>;
36                 pinctrl-0 = <&pwm0_out>;
37                 pinctrl-names = "default";
38         };
39
40         fixed-rate-clocks {
41                 oscclk {
42                         compatible = "samsung,exynos5420-oscclk";
43                         clock-frequency = <24000000>;
44                 };
45         };
46
47         gpio-keys {
48                 compatible = "gpio-keys";
49
50                 pinctrl-names = "default";
51                 pinctrl-0 = <&power_key_irq>;
52
53                 power {
54                         label = "Power";
55                         gpios = <&gpx1 2 GPIO_ACTIVE_LOW>;
56                         linux,code = <KEY_POWER>;
57                         gpio-key,wakeup;
58                 };
59         };
60
61         memory {
62                 reg = <0x20000000 0x80000000>;
63         };
64
65         sound {
66                 compatible = "google,snow-audio-max98091";
67
68                 samsung,model = "Peach-Pi-I2S-MAX98091";
69                 samsung,i2s-controller = <&i2s0>;
70                 samsung,audio-codec = <&max98091>;
71         };
72
73         usb300_vbus_reg: regulator-usb300 {
74                 compatible = "regulator-fixed";
75                 regulator-name = "P5.0V_USB3CON0";
76                 regulator-min-microvolt = <5000000>;
77                 regulator-max-microvolt = <5000000>;
78                 gpio = <&gph0 0 0>;
79                 pinctrl-names = "default";
80                 pinctrl-0 = <&usb300_vbus_en>;
81                 enable-active-high;
82         };
83
84         usb301_vbus_reg: regulator-usb301 {
85                 compatible = "regulator-fixed";
86                 regulator-name = "P5.0V_USB3CON1";
87                 regulator-min-microvolt = <5000000>;
88                 regulator-max-microvolt = <5000000>;
89                 gpio = <&gph0 1 0>;
90                 pinctrl-names = "default";
91                 pinctrl-0 = <&usb301_vbus_en>;
92                 enable-active-high;
93         };
94
95         vbat: fixed-regulator {
96                 compatible = "regulator-fixed";
97                 regulator-name = "vbat-supply";
98                 regulator-boot-on;
99                 regulator-always-on;
100         };
101 };
102
103 &dp {
104         status = "okay";
105         pinctrl-names = "default";
106         pinctrl-0 = <&dp_hpd_gpio>;
107         samsung,color-space = <0>;
108         samsung,dynamic-range = <0>;
109         samsung,ycbcr-coeff = <0>;
110         samsung,color-depth = <1>;
111         samsung,link-rate = <0x0a>;
112         samsung,lane-count = <2>;
113         samsung,hpd-gpio = <&gpx2 6 0>;
114
115         display-timings {
116                 native-mode = <&timing1>;
117
118                 timing1: timing@1 {
119                         clock-frequency = <150660000>;
120                         hactive = <1920>;
121                         vactive = <1080>;
122                         hfront-porch = <60>;
123                         hback-porch = <172>;
124                         hsync-len = <80>;
125                         vback-porch = <25>;
126                         vfront-porch = <10>;
127                         vsync-len = <10>;
128                 };
129         };
130 };
131
132 &fimd {
133         status = "okay";
134         samsung,invert-vclk;
135 };
136
137 &hdmi {
138         status = "okay";
139         hpd-gpio = <&gpx3 7 GPIO_ACTIVE_HIGH>;
140         pinctrl-names = "default";
141         pinctrl-0 = <&hdmi_hpd_irq>;
142         ddc = <&i2c_2>;
143 };
144
145 &hsi2c_7 {
146         status = "okay";
147
148         max98091: codec@10 {
149                 compatible = "maxim,max98091";
150                 reg = <0x10>;
151                 interrupts = <2 0>;
152                 interrupt-parent = <&gpx0>;
153                 pinctrl-names = "default";
154                 pinctrl-0 = <&max98091_irq>;
155         };
156 };
157
158 &hsi2c_9 {
159         status = "okay";
160         clock-frequency = <400000>;
161
162         tpm@20 {
163                 compatible = "infineon,slb9645tt";
164                 reg = <0x20>;
165
166                 /* Unused irq; but still need to configure the pins */
167                 pinctrl-names = "default";
168                 pinctrl-0 = <&tpm_irq>;
169         };
170 };
171
172 &i2c_2 {
173         status = "okay";
174         samsung,i2c-sda-delay = <100>;
175         samsung,i2c-max-bus-freq = <66000>;
176         samsung,i2c-slave-addr = <0x50>;
177 };
178
179 &i2s0 {
180         status = "okay";
181 };
182
183 &mmc_0 {
184         status = "okay";
185         num-slots = <1>;
186         broken-cd;
187         caps2-mmc-hs200-1_8v;
188         supports-highspeed;
189         non-removable;
190         card-detect-delay = <200>;
191         clock-frequency = <400000000>;
192         samsung,dw-mshc-ciu-div = <3>;
193         samsung,dw-mshc-sdr-timing = <0 4>;
194         samsung,dw-mshc-ddr-timing = <0 2>;
195         pinctrl-names = "default";
196         pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus4 &sd0_bus8>;
197
198         slot@0 {
199                 reg = <0>;
200                 bus-width = <8>;
201         };
202 };
203
204 &mmc_2 {
205         status = "okay";
206         num-slots = <1>;
207         supports-highspeed;
208         card-detect-delay = <200>;
209         clock-frequency = <400000000>;
210         samsung,dw-mshc-ciu-div = <3>;
211         samsung,dw-mshc-sdr-timing = <2 3>;
212         samsung,dw-mshc-ddr-timing = <1 2>;
213         pinctrl-names = "default";
214         pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4>;
215
216         slot@0 {
217                 reg = <0>;
218                 bus-width = <4>;
219         };
220 };
221
222
223 &pinctrl_0 {
224         pinctrl-names = "default";
225         pinctrl-0 = <&mask_tpm_reset>;
226
227         max98091_irq: max98091-irq {
228                 samsung,pins = "gpx0-2";
229                 samsung,pin-function = <0>;
230                 samsung,pin-pud = <0>;
231                 samsung,pin-drv = <0>;
232         };
233
234         /* We need GPX0_6 to be low at sleep time; just keep it low always */
235         mask_tpm_reset: mask-tpm-reset {
236                 samsung,pins = "gpx0-6";
237                 samsung,pin-function = <1>;
238                 samsung,pin-pud = <0>;
239                 samsung,pin-drv = <0>;
240                 samsung,pin-val = <0>;
241         };
242
243         tpm_irq: tpm-irq {
244                 samsung,pins = "gpx1-0";
245                 samsung,pin-function = <0>;
246                 samsung,pin-pud = <0>;
247                 samsung,pin-drv = <0>;
248         };
249
250         power_key_irq: power-key-irq {
251                 samsung,pins = "gpx1-2";
252                 samsung,pin-function = <0>;
253                 samsung,pin-pud = <0>;
254                 samsung,pin-drv = <0>;
255         };
256
257         ec_irq: ec-irq {
258                 samsung,pins = "gpx1-5";
259                 samsung,pin-function = <0>;
260                 samsung,pin-pud = <0>;
261                 samsung,pin-drv = <0>;
262         };
263
264         tps65090_irq: tps65090-irq {
265                 samsung,pins = "gpx2-5";
266                 samsung,pin-function = <0>;
267                 samsung,pin-pud = <0>;
268                 samsung,pin-drv = <0>;
269         };
270
271         dp_hpd_gpio: dp_hpd_gpio {
272                 samsung,pins = "gpx2-6";
273                 samsung,pin-function = <0>;
274                 samsung,pin-pud = <3>;
275                 samsung,pin-drv = <0>;
276         };
277
278         hdmi_hpd_irq: hdmi-hpd-irq {
279                 samsung,pins = "gpx3-7";
280                 samsung,pin-function = <0>;
281                 samsung,pin-pud = <1>;
282                 samsung,pin-drv = <0>;
283         };
284 };
285
286 &pinctrl_3 {
287         /* Drive SPI lines at x2 for better integrity */
288         spi2-bus {
289                 samsung,pin-drv = <2>;
290         };
291
292         /* Drive SPI chip select at x2 for better integrity */
293         ec_spi_cs: ec-spi-cs {
294                 samsung,pins = "gpb1-2";
295                 samsung,pin-function = <1>;
296                 samsung,pin-pud = <0>;
297                 samsung,pin-drv = <2>;
298         };
299
300         usb300_vbus_en: usb300-vbus-en {
301                 samsung,pins = "gph0-0";
302                 samsung,pin-function = <1>;
303                 samsung,pin-pud = <0>;
304                 samsung,pin-drv = <0>;
305         };
306
307         usb301_vbus_en: usb301-vbus-en {
308                 samsung,pins = "gph0-1";
309                 samsung,pin-function = <1>;
310                 samsung,pin-pud = <0>;
311                 samsung,pin-drv = <0>;
312         };
313 };
314
315 &rtc {
316         status = "okay";
317 };
318
319 &spi_2 {
320         status = "okay";
321         num-cs = <1>;
322         samsung,spi-src-clk = <0>;
323         cs-gpios = <&gpb1 2 0>;
324
325         cros_ec: cros-ec@0 {
326                 compatible = "google,cros-ec-spi";
327                 interrupt-parent = <&gpx1>;
328                 interrupts = <5 0>;
329                 pinctrl-names = "default";
330                 pinctrl-0 = <&ec_spi_cs &ec_irq>;
331                 reg = <0>;
332                 spi-max-frequency = <3125000>;
333
334                 controller-data {
335                         samsung,spi-feedback-delay = <1>;
336                 };
337
338                 i2c-tunnel {
339                         compatible = "google,cros-ec-i2c-tunnel";
340                         #address-cells = <1>;
341                         #size-cells = <0>;
342                         google,remote-bus = <0>;
343
344                         battery: sbs-battery@b {
345                                 compatible = "sbs,sbs-battery";
346                                 reg = <0xb>;
347                                 sbs,poll-retry-count = <1>;
348                                 sbs,i2c-retry-count = <2>;
349                         };
350
351                         power-regulator@48 {
352                                 compatible = "ti,tps65090";
353                                 reg = <0x48>;
354
355                                 /*
356                                  * Config irq to disable internal pulls
357                                  * even though we run in polling mode.
358                                  */
359                                 pinctrl-names = "default";
360                                 pinctrl-0 = <&tps65090_irq>;
361
362                                 vsys1-supply = <&vbat>;
363                                 vsys2-supply = <&vbat>;
364                                 vsys3-supply = <&vbat>;
365                                 infet1-supply = <&vbat>;
366                                 infet2-supply = <&vbat>;
367                                 infet3-supply = <&vbat>;
368                                 infet4-supply = <&vbat>;
369                                 infet5-supply = <&vbat>;
370                                 infet6-supply = <&vbat>;
371                                 infet7-supply = <&vbat>;
372                                 vsys-l1-supply = <&vbat>;
373                                 vsys-l2-supply = <&vbat>;
374
375                                 regulators {
376                                         tps65090_dcdc1: dcdc1 {
377                                                 ti,enable-ext-control;
378                                         };
379                                         tps65090_dcdc2: dcdc2 {
380                                                 ti,enable-ext-control;
381                                         };
382                                         tps65090_dcdc3: dcdc3 {
383                                                 ti,enable-ext-control;
384                                         };
385                                         tps65090_fet1: fet1 {
386                                                 regulator-name = "vcd_led";
387                                         };
388                                         tps65090_fet2: fet2 {
389                                                 regulator-name = "video_mid";
390                                                 regulator-always-on;
391                                         };
392                                         tps65090_fet3: fet3 {
393                                                 regulator-name = "wwan_r";
394                                                 regulator-always-on;
395                                         };
396                                         tps65090_fet4: fet4 {
397                                                 regulator-name = "sdcard";
398                                                 regulator-always-on;
399                                         };
400                                         tps65090_fet5: fet5 {
401                                                 regulator-name = "camout";
402                                         };
403                                         tps65090_fet6: fet6 {
404                                                 regulator-name = "lcd_vdd";
405                                         };
406                                         tps65090_fet7: fet7 {
407                                                 regulator-name = "video_mid_1a";
408                                                 regulator-always-on;
409                                         };
410                                         tps65090_ldo1: ldo1 {
411                                         };
412                                         tps65090_ldo2: ldo2 {
413                                         };
414                                 };
415
416                                 charger {
417                                         compatible = "ti,tps65090-charger";
418                                 };
419                         };
420                 };
421         };
422 };
423
424 &uart_3 {
425         status = "okay";
426 };
427
428 &usbdrd_phy0 {
429         vbus-supply = <&usb300_vbus_reg>;
430 };
431
432 &usbdrd_phy1 {
433         vbus-supply = <&usb301_vbus_reg>;
434 };
435
436 /*
437  * Use longest HW watchdog in SoC (32 seconds) since the hardware
438  * watchdog provides no debugging information (compared to soft/hard
439  * lockup detectors) and so should be last resort.
440  */
441 &watchdog {
442         timeout-sec = <32>;
443 };
444
445 #include "cros-ec-keyboard.dtsi"