Merge tag 'iio-fixes-for-5.6a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
[linux-2.6-microblaze.git] / arch / arm / boot / dts / am335x-guardian.dts
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
4  * Copyright (C) 2018 Robert Bosch Power Tools GmbH
5  */
6 /dts-v1/;
7
8 #include "am33xx.dtsi"
9 #include <dt-bindings/input/input.h>
10 #include <dt-bindings/interrupt-controller/irq.h>
11
12 / {
13         model = "Bosch AM335x Guardian";
14         compatible = "bosch,am335x-guardian", "ti,am33xx";
15
16         chosen {
17                 stdout-path = &uart0;
18                 tick-timer = &timer2;
19         };
20
21         cpus {
22                 cpu@0 {
23                         cpu0-supply = <&dcdc2_reg>;
24                 };
25         };
26
27         memory@80000000 {
28                 device_type = "memory";
29                 reg = <0x80000000 0x10000000>; /* 256 MB */
30         };
31
32         gpio_keys {
33                 compatible = "gpio-keys";
34                 #address-cells = <1>;
35                 #size-cells = <0>;
36                 pinctrl-names = "default";
37                 pinctrl-0 = <&gpio_keys_pins>;
38
39                 button21 {
40                         label = "guardian-power-button";
41                         linux,code = <KEY_POWER>;
42                         gpios = <&gpio2 21 0>;
43                         wakeup-source;
44                 };
45         };
46
47         leds {
48                 compatible = "gpio-leds";
49                 pinctrl-names = "default";
50                 pinctrl-0 = <&leds_pins>;
51
52                 led1 {
53                         label = "green:heartbeat";
54                         gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
55                         linux,default-trigger = "heartbeat";
56                         default-state = "off";
57                 };
58
59                 led2 {
60                         label = "green:mmc0";
61                         gpios = <&gpio1 26 GPIO_ACTIVE_HIGH>;
62                         linux,default-trigger = "mmc0";
63                         default-state = "off";
64                 };
65         };
66
67         panel {
68                 compatible = "ti,tilcdc,panel";
69                 pinctrl-names = "default", "sleep";
70                 pinctrl-0 = <&lcd_pins_default &lcd_disen_pins>;
71                 pinctrl-1 = <&lcd_pins_sleep>;
72
73                 display-timings {
74                         320x240 {
75                                 hactive         = <320>;
76                                 vactive         = <240>;
77                                 hback-porch     = <68>;
78                                 hfront-porch    = <20>;
79                                 hsync-len       = <1>;
80                                 vback-porch     = <18>;
81                                 vfront-porch    = <4>;
82                                 vsync-len       = <1>;
83                                 clock-frequency = <9000000>;
84                                 hsync-active    = <0>;
85                                 vsync-active    = <0>;
86                         };
87                 };
88                 panel-info {
89                         ac-bias           = <255>;
90                         ac-bias-intrpt    = <0>;
91                         dma-burst-sz      = <16>;
92                         bpp               = <24>;
93                         bus-width         = <16>;
94                         fdd               = <0x80>;
95                         sync-edge         = <0>;
96                         sync-ctrl         = <1>;
97                         raster-order      = <0>;
98                         fifo-th           = <0>;
99                 };
100
101         };
102
103         pwm7: dmtimer-pwm {
104                 compatible = "ti,omap-dmtimer-pwm";
105                 ti,timers = <&timer7>;
106                 pinctrl-names = "default";
107                 pinctrl-0 = <&dmtimer7_pins>;
108         };
109
110         vmmcsd_fixed: regulator-3v3 {
111                 compatible = "regulator-fixed";
112                 regulator-name = "vmmcsd_fixed";
113                 regulator-min-microvolt = <3300000>;
114                 regulator-max-microvolt = <3300000>;
115         };
116 };
117
118 &elm {
119         status = "okay";
120 };
121
122 &gpmc {
123         pinctrl-names = "default";
124         pinctrl-0 = <&nandflash_pins>;
125         ranges = <0 0 0x08000000 0x1000000>;  /* CS0: 16MB for NAND */
126         status = "okay";
127
128         nand@0,0 {
129                 compatible = "ti,omap2-nand";
130                 reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
131                 interrupt-parent = <&gpmc>;
132                 interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
133                              <1 IRQ_TYPE_NONE>; /* termcount */
134                 rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */
135                 ti,nand-ecc-opt = "bch16";
136                 ti,elm-id = <&elm>;
137                 nand-bus-width = <8>;
138                 gpmc,device-width = <1>;
139                 gpmc,sync-clk-ps = <0>;
140                 gpmc,cs-on-ns = <0>;
141                 gpmc,cs-rd-off-ns = <44>;
142                 gpmc,cs-wr-off-ns = <44>;
143                 gpmc,adv-on-ns = <6>;
144                 gpmc,adv-rd-off-ns = <34>;
145                 gpmc,adv-wr-off-ns = <44>;
146                 gpmc,we-on-ns = <0>;
147                 gpmc,we-off-ns = <40>;
148                 gpmc,oe-on-ns = <0>;
149                 gpmc,oe-off-ns = <54>;
150                 gpmc,access-ns = <64>;
151                 gpmc,rd-cycle-ns = <82>;
152                 gpmc,wr-cycle-ns = <82>;
153                 gpmc,bus-turnaround-ns = <0>;
154                 gpmc,cycle2cycle-delay-ns = <0>;
155                 gpmc,clk-activation-ns = <0>;
156                 gpmc,wr-access-ns = <40>;
157                 gpmc,wr-data-mux-bus-ns = <0>;
158
159                 /*
160                  * MTD partition table
161                  *
162                  * All SPL-* partitions are sized to minimal length which can
163                  * be independently programmable. For NAND flash this is equal
164                  * to size of erase-block.
165                  */
166                 #address-cells = <1>;
167                 #size-cells = <1>;
168
169                 partition@0 {
170                         label = "SPL";
171                         reg = <0x0 0x40000>;
172                 };
173
174                 partition@1 {
175                         label = "SPL.backup1";
176                         reg = <0x40000  0x40000>;
177                 };
178
179                 partition@2 {
180                         label = "SPL.backup2";
181                         reg = <0x80000  0x40000>;
182                 };
183
184                 partition@3 {
185                         label = "SPL.backup3";
186                         reg = <0xc0000  0x40000>;
187                 };
188
189                 partition@4 {
190                         label = "u-boot";
191                         reg = <0x100000 0x100000>;
192                 };
193
194                 partition@5 {
195                         label = "u-boot.backup1";
196                         reg = <0x200000 0x100000>;
197                 };
198
199                 partition@6 {
200                         label = "u-boot-env";
201                         reg = <0x300000 0x40000>;
202                 };
203
204                 partition@7 {
205                         label = "u-boot-env.backup1";
206                         reg = <0x340000 0x40000>;
207                 };
208
209                 partition@8 {
210                         label = "UBI";
211                         reg = <0x380000 0x1fc80000>;
212                 };
213         };
214 };
215
216 &i2c0 {
217         pinctrl-names = "default";
218         pinctrl-0 = <&i2c0_pins>;
219         clock-frequency = <400000>;
220         status = "okay";
221
222         tps: tps@24 {
223                 reg = <0x24>;
224         };
225 };
226
227 &lcdc {
228         blue-and-red-wiring = "crossed";
229         status = "okay";
230 };
231
232 &mmc1 {
233         bus-width = <0x4>;
234         pinctrl-names = "default";
235         pinctrl-0 = <&mmc1_pins>;
236         cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
237         vmmc-supply = <&vmmcsd_fixed>;
238         status = "okay";
239 };
240
241 &rtc {
242         clocks = <&clk_32768_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>;
243         clock-names = "ext-clk", "int-clk";
244         system-power-controller;
245 };
246
247 &spi0 {
248         ti,pindir-d0-out-d1-in;
249         pinctrl-names = "default";
250         pinctrl-0 = <&spi0_pins>;
251         status = "okay";
252 };
253
254 #include "tps65217.dtsi"
255
256 &tps {
257         ti,pmic-shutdown-controller;
258         interrupt-parent = <&intc>;
259         interrupts = <7>; /* NMI */
260
261         backlight {
262                 isel = <1>;  /* 1 - ISET1, 2 ISET2 */
263                 fdim = <100>; /* TPS65217_BL_FDIM_100HZ */
264                 default-brightness = <100>;
265         };
266
267         regulators {
268                 dcdc1_reg: regulator@0 {
269                         regulator-name = "vdds_dpr";
270                         regulator-always-on;
271                 };
272
273                 dcdc2_reg: regulator@1 {
274                         regulator-name = "vdd_mpu";
275                         regulator-min-microvolt = <925000>;
276                         regulator-max-microvolt = <1351500>;
277                         regulator-boot-on;
278                         regulator-always-on;
279                 };
280
281                 dcdc3_reg: regulator@2 {
282                         regulator-name = "vdd_core";
283                         regulator-min-microvolt = <925000>;
284                         regulator-max-microvolt = <1150000>;
285                         regulator-boot-on;
286                         regulator-always-on;
287                 };
288
289                 ldo1_reg: regulator@3 {
290                         regulator-name = "vio,vrtc,vdds";
291                         regulator-always-on;
292                 };
293
294                 ldo2_reg: regulator@4 {
295                         regulator-name = "vdd_3v3aux";
296                         regulator-always-on;
297                 };
298
299                 ldo3_reg: regulator@5 {
300                         regulator-name = "vdd_1v8";
301                         regulator-min-microvolt = <1800000>;
302                         regulator-max-microvolt = <1800000>;
303                         regulator-always-on;
304                 };
305
306                 ldo4_reg: regulator@6 {
307                         regulator-name = "vdd_3v3a";
308                         regulator-always-on;
309                 };
310         };
311 };
312
313 &tscadc {
314         status = "okay";
315
316         adc {
317                 ti,adc-channels = <0 1 2 3 4 5 6>;
318         };
319 };
320
321 &uart0 {
322         pinctrl-names = "default";
323         pinctrl-0 = <&uart0_pins>;
324         status = "okay";
325 };
326
327 &usb0 {
328         dr_mode = "peripheral";
329 };
330
331 &usb1 {
332         dr_mode = "host";
333 };
334
335 &am33xx_pinmux {
336         pinctrl-names = "default";
337         pinctrl-0 = <&clkout2_pin &gpio_pins>;
338
339         clkout2_pin: pinmux_clkout2_pin {
340                 pinctrl-single,pins = <
341                         AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3)
342                 >;
343         };
344
345         dmtimer7_pins: pinmux_dmtimer7_pins {
346                 pinctrl-single,pins = <
347                         AM33XX_IOPAD(0x968, PIN_OUTPUT | MUX_MODE5)
348                 >;
349         };
350
351         gpio_keys_pins: pinmux_gpio_keys_pins {
352                 pinctrl-single,pins = <
353                         AM33XX_IOPAD(0x940, PIN_INPUT | MUX_MODE7)
354                 >;
355         };
356
357         gpio_pins: pinmux_gpio_pins {
358                 pinctrl-single,pins = <
359                         AM33XX_IOPAD(0x928, PIN_OUTPUT | MUX_MODE7)
360                         AM33XX_IOPAD(0x990, PIN_OUTPUT | MUX_MODE7)
361                 >;
362         };
363
364         i2c0_pins: pinmux_i2c0_pins {
365                 pinctrl-single,pins = <
366                         AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0)
367                         AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0)
368                 >;
369         };
370
371         lcd_disen_pins: pinmux_lcd_disen_pins {
372                 pinctrl-single,pins = <
373                         AM33XX_IOPAD(0x9a4, PIN_OUTPUT_PULLUP | SLEWCTRL_SLOW | MUX_MODE7)
374                 >;
375         };
376
377         lcd_pins_default: pinmux_lcd_pins_default {
378                 pinctrl-single,pins = <
379                         AM33XX_IOPAD(0x820, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1)
380                         AM33XX_IOPAD(0x824, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1)
381                         AM33XX_IOPAD(0x828, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1)
382                         AM33XX_IOPAD(0x82c, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1)
383                         AM33XX_IOPAD(0x830, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1)
384                         AM33XX_IOPAD(0x834, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1)
385                         AM33XX_IOPAD(0x838, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1)
386                         AM33XX_IOPAD(0x83c, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1)
387                         AM33XX_IOPAD(0x8a0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
388                         AM33XX_IOPAD(0x8a4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
389                         AM33XX_IOPAD(0x8a8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
390                         AM33XX_IOPAD(0x8ac, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
391                         AM33XX_IOPAD(0x8b0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
392                         AM33XX_IOPAD(0x8b4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
393                         AM33XX_IOPAD(0x8b8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
394                         AM33XX_IOPAD(0x8bc, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
395                         AM33XX_IOPAD(0x8c0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
396                         AM33XX_IOPAD(0x8c4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
397                         AM33XX_IOPAD(0x8c8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
398                         AM33XX_IOPAD(0x8cc, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
399                         AM33XX_IOPAD(0x8d0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
400                         AM33XX_IOPAD(0x8d4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
401                         AM33XX_IOPAD(0x8d8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
402                         AM33XX_IOPAD(0x8dc, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
403                         AM33XX_IOPAD(0x8e0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
404                         AM33XX_IOPAD(0x8e4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
405                         AM33XX_IOPAD(0x8e8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
406                         AM33XX_IOPAD(0x8ec, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
407                 >;
408         };
409
410         lcd_pins_sleep: pinmux_lcd_pins_sleep {
411                 pinctrl-single,pins = <
412                         AM33XX_IOPAD(0x8a0, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
413                         AM33XX_IOPAD(0x8a4, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
414                         AM33XX_IOPAD(0x8a8, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
415                         AM33XX_IOPAD(0x8ac, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
416                         AM33XX_IOPAD(0x8b0, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
417                         AM33XX_IOPAD(0x8b4, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
418                         AM33XX_IOPAD(0x8b8, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
419                         AM33XX_IOPAD(0x8bc, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
420                         AM33XX_IOPAD(0x8c0, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
421                         AM33XX_IOPAD(0x8c4, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
422                         AM33XX_IOPAD(0x8c8, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
423                         AM33XX_IOPAD(0x8cc, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
424                         AM33XX_IOPAD(0x8d0, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
425                         AM33XX_IOPAD(0x8d4, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
426                         AM33XX_IOPAD(0x8d8, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
427                         AM33XX_IOPAD(0x8dc, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
428                         AM33XX_IOPAD(0x8e0, PIN_INPUT_PULLDOWN | SLEWCTRL_SLOW | MUX_MODE7)
429                         AM33XX_IOPAD(0x8e4, PIN_INPUT_PULLDOWN | SLEWCTRL_SLOW | MUX_MODE7)
430                         AM33XX_IOPAD(0x8e8, PIN_INPUT_PULLDOWN | SLEWCTRL_SLOW | MUX_MODE7)
431                         AM33XX_IOPAD(0x8ec, PIN_INPUT_PULLDOWN | SLEWCTRL_SLOW | MUX_MODE7)
432                 >;
433         };
434
435         leds_pins: pinmux_leds_pins {
436                 pinctrl-single,pins = <
437                         AM33XX_IOPAD(0x868, PIN_OUTPUT | MUX_MODE7)
438                         AM33XX_IOPAD(0x86c, PIN_OUTPUT | MUX_MODE7)
439                 >;
440         };
441
442         mmc1_pins: pinmux_mmc1_pins {
443                 pinctrl-single,pins = <
444                         AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0)
445                         AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0)
446                         AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0)
447                         AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0)
448                         AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0)
449                         AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0)
450                         AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7)
451                 >;
452         };
453
454         spi0_pins: pinmux_spi0_pins {
455                 pinctrl-single,pins = <
456                         AM33XX_IOPAD(0x950, PIN_OUTPUT_PULLDOWN | MUX_MODE0)
457                         AM33XX_IOPAD(0x954, PIN_OUTPUT_PULLUP | MUX_MODE0)
458                         AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0)
459                         AM33XX_IOPAD(0x95c, PIN_OUTPUT_PULLUP | MUX_MODE0)
460                 >;
461         };
462
463         uart0_pins: pinmux_uart0_pins {
464                 pinctrl-single,pins = <
465                         AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0)
466                         AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0)
467                 >;
468         };
469
470         nandflash_pins: pinmux_nandflash_pins {
471                 pinctrl-single,pins = <
472                         AM33XX_IOPAD(0x800, PIN_INPUT | MUX_MODE0)
473                         AM33XX_IOPAD(0x804, PIN_INPUT | MUX_MODE0)
474                         AM33XX_IOPAD(0x808, PIN_INPUT | MUX_MODE0)
475                         AM33XX_IOPAD(0x80c, PIN_INPUT | MUX_MODE0)
476                         AM33XX_IOPAD(0x810, PIN_INPUT | MUX_MODE0)
477                         AM33XX_IOPAD(0x814, PIN_INPUT | MUX_MODE0)
478                         AM33XX_IOPAD(0x818, PIN_INPUT | MUX_MODE0)
479                         AM33XX_IOPAD(0x81c, PIN_INPUT | MUX_MODE0)
480                         AM33XX_IOPAD(0x870, PIN_INPUT | MUX_MODE0)
481                         AM33XX_IOPAD(0x874, PIN_OUTPUT | MUX_MODE0)
482                         AM33XX_IOPAD(0x87c, PIN_OUTPUT | MUX_MODE0)
483                         AM33XX_IOPAD(0x890, PIN_OUTPUT | MUX_MODE0)
484                         AM33XX_IOPAD(0x894, PIN_OUTPUT | MUX_MODE0)
485                         AM33XX_IOPAD(0x898, PIN_OUTPUT | MUX_MODE0)
486                         AM33XX_IOPAD(0x89c, PIN_OUTPUT | MUX_MODE0)
487                 >;
488         };
489 };