GNU Linux-libre 4.19.264-gnu1
[releases.git] / arch / arm / boot / dts / am335x-osd3358-sm-red.dts
1 //SPDX-License-Identifier: GPL-2.0
2 /* Copyright (C) 2018 Octavo Systems LLC - http://www.octavosystems.com/
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  */
8
9 /dts-v1/;
10
11 #include "am33xx.dtsi"
12 #include "am335x-osd335x-common.dtsi"
13 #include <dt-bindings/interrupt-controller/irq.h>
14
15 #include <dt-bindings/display/tda998x.h>
16
17 / {
18         model = "Octavo Systems OSD3358-SM-RED";
19         compatible = "oct,osd3358-sm-refdesign", "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
20 };
21
22 &ldo3_reg {
23         regulator-min-microvolt = <1800000>;
24         regulator-max-microvolt = <1800000>;
25         regulator-always-on;
26 };
27
28 &mmc1 {
29         vmmc-supply = <&vmmcsd_fixed>;
30 };
31
32 &mmc2 {
33         vmmc-supply = <&vmmcsd_fixed>;
34         pinctrl-names = "default";
35         pinctrl-0 = <&emmc_pins>;
36         bus-width = <8>;
37         status = "okay";
38 };
39
40 &am33xx_pinmux {
41         nxp_hdmi_bonelt_pins: nxp-hdmi-bonelt-pins {
42                 pinctrl-single,pins = <
43                         AM33XX_IOPAD(0x9b0, PIN_OUTPUT_PULLDOWN | MUX_MODE3)    /* xdma_event_intr0 */
44                         AM33XX_IOPAD(0x8a0, PIN_OUTPUT | MUX_MODE0)             /* lcd_data0.lcd_data0 */
45                         AM33XX_IOPAD(0x8a4, PIN_OUTPUT | MUX_MODE0)             /* lcd_data1.lcd_data1 */
46                         AM33XX_IOPAD(0x8a8, PIN_OUTPUT | MUX_MODE0)             /* lcd_data2.lcd_data2 */
47                         AM33XX_IOPAD(0x8ac, PIN_OUTPUT | MUX_MODE0)             /* lcd_data3.lcd_data3 */
48                         AM33XX_IOPAD(0x8b0, PIN_OUTPUT | MUX_MODE0)             /* lcd_data4.lcd_data4 */
49                         AM33XX_IOPAD(0x8b4, PIN_OUTPUT | MUX_MODE0)             /* lcd_data5.lcd_data5 */
50                         AM33XX_IOPAD(0x8b8, PIN_OUTPUT | MUX_MODE0)             /* lcd_data6.lcd_data6 */
51                         AM33XX_IOPAD(0x8bc, PIN_OUTPUT | MUX_MODE0)             /* lcd_data7.lcd_data7 */
52                         AM33XX_IOPAD(0x8c0, PIN_OUTPUT | MUX_MODE0)             /* lcd_data8.lcd_data8 */
53                         AM33XX_IOPAD(0x8c4, PIN_OUTPUT | MUX_MODE0)             /* lcd_data9.lcd_data9 */
54                         AM33XX_IOPAD(0x8c8, PIN_OUTPUT | MUX_MODE0)             /* lcd_data10.lcd_data10 */
55                         AM33XX_IOPAD(0x8cc, PIN_OUTPUT | MUX_MODE0)             /* lcd_data11.lcd_data11 */
56                         AM33XX_IOPAD(0x8d0, PIN_OUTPUT | MUX_MODE0)             /* lcd_data12.lcd_data12 */
57                         AM33XX_IOPAD(0x8d4, PIN_OUTPUT | MUX_MODE0)             /* lcd_data13.lcd_data13 */
58                         AM33XX_IOPAD(0x8d8, PIN_OUTPUT | MUX_MODE0)             /* lcd_data14.lcd_data14 */
59                         AM33XX_IOPAD(0x8dc, PIN_OUTPUT | MUX_MODE0)             /* lcd_data15.lcd_data15 */
60                         AM33XX_IOPAD(0x8e0, PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* lcd_vsync.lcd_vsync */
61                         AM33XX_IOPAD(0x8e4, PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* lcd_hsync.lcd_hsync */
62                         AM33XX_IOPAD(0x8e8, PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* lcd_pclk.lcd_pclk */
63                         AM33XX_IOPAD(0x8ec, PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* lcd_ac_bias_en.lcd_ac_bias_en */
64                 >;
65         };
66
67         nxp_hdmi_bonelt_off_pins: nxp-hdmi-bonelt-off-pins {
68                 pinctrl-single,pins = <
69                         AM33XX_IOPAD(0x9b0, PIN_OUTPUT_PULLDOWN | MUX_MODE3)    /* xdma_event_intr0 */
70                 >;
71         };
72
73         mcasp0_pins: mcasp0-pins {
74                 pinctrl-single,pins = <
75                         AM33XX_IOPAD(0x9ac, PIN_INPUT_PULLUP | MUX_MODE0) /* mcasp0_ahcklx.mcasp0_ahclkx */
76                         AM33XX_IOPAD(0x99c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mcasp0_ahclkr.mcasp0_axr2*/
77                         AM33XX_IOPAD(0x994, PIN_OUTPUT_PULLUP | MUX_MODE0) /* mcasp0_fsx.mcasp0_fsx */
78                         AM33XX_IOPAD(0x990, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp0_aclkx.mcasp0_aclkx */
79                         AM33XX_IOPAD(0x86c, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a11.GPIO1_27 */
80                 >;
81         };
82
83         flash_enable: flash-enable {
84                 pinctrl-single,pins = <
85                         AM33XX_IOPAD(0x944, PIN_OUTPUT_PULLDOWN | MUX_MODE7)    /* rmii1_ref_clk.gpio0_29 */
86                 >;
87         };
88
89         imu_interrupt: imu-interrupt {
90                 pinctrl-single,pins = <
91                         AM33XX_IOPAD(0x910, PIN_INPUT_PULLDOWN | MUX_MODE7)             /* mii1_rx_er.gpio3_2 */
92                 >;
93         };
94
95         ethernet_interrupt: ethernet-interrupt{
96                 pinctrl-single,pins = <
97                         AM33XX_IOPAD(0x908, PIN_INPUT_PULLDOWN | MUX_MODE7)             /* mii1_col.gpio3_0 */
98                 >;
99         };
100 };
101
102 &lcdc {
103         status = "okay";
104
105         /* If you want to get 24 bit RGB and 16 BGR mode instead of
106          * current 16 bit RGB and 24 BGR modes, set the propety
107          * below to "crossed" and uncomment the video-ports -property
108          * in tda19988 node.
109          * AM335x errata for wiring:
110          * http://www.ti.com/lit/er/sprz360i/sprz360i.pdf
111          */
112
113         blue-and-red-wiring = "straight";
114
115         port {
116                 lcdc_0: endpoint {
117                         remote-endpoint = <&hdmi_0>;
118                 };
119         };
120 };
121
122 &i2c0 {
123         tda19988: hdmi-encoder@70 {
124                 compatible = "nxp,tda998x";
125                 reg = <0x70>;
126
127                 pinctrl-names = "default", "off";
128                 pinctrl-0 = <&nxp_hdmi_bonelt_pins>;
129                 pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>;
130
131                 /* Convert 24bit BGR to RGB, e.g. cross red and blue wiring */
132                 /* video-ports = <0x234501>; */
133
134                 #sound-dai-cells = <0>;
135                 audio-ports = < TDA998x_I2S     0x03>;
136
137                 port {
138                         hdmi_0: endpoint {
139                                 remote-endpoint = <&lcdc_0>;
140                         };
141                 };
142         };
143
144         mpu9250: imu@68 {
145                 compatible = "invensense,mpu6050";
146                 reg = <0x68>;
147                 interrupt-parent = <&gpio3>;
148                 interrupts = <21 IRQ_TYPE_EDGE_RISING>;
149                 i2c-gate {
150                         #address-cells = <1>;
151                         #size-cells = <0>;
152                         ax8975@c {
153                                 compatible = "ak,ak8975";
154                                 reg = <0x0c>;
155                         };
156                 };
157                 /*invensense,int_config = <0x10>;
158                 invensense,level_shifter = <0>;
159                 invensense,orientation = [01 00 00 00 01 00 00 00 01];
160                 invensense,sec_slave_type = <0>;
161                 invensense,key = [4e cc 7e eb f6 1e 35 22 00 34 0d 65 32 e9 94 89];*/
162         };
163
164         bmp280: pressure@76 {
165                 compatible = "bosch,bmp280";
166                 reg = <0x76>;
167         };
168 };
169
170 &rtc {
171         system-power-controller;
172 };
173
174 &mcasp0 {
175         #sound-dai-cells = <0>;
176         pinctrl-names = "default";
177         pinctrl-0 = <&mcasp0_pins>;
178         status = "okay";
179         op-mode = <0>;  /* MCASP_IIS_MODE */
180         tdm-slots = <2>;
181         serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
182                         0 0 1 0
183                 >;
184         tx-num-evt = <32>;
185         rx-num-evt = <32>;
186 };
187
188 / {
189         clk_mcasp0_fixed: clk-mcasp0-fixed {
190                 #clock-cells = <0>;
191                 compatible = "fixed-clock";
192                 clock-frequency = <24576000>;
193         };
194
195         clk_mcasp0: clk-mcasp0 {
196                 #clock-cells = <0>;
197                 compatible = "gpio-gate-clock";
198                 clocks = <&clk_mcasp0_fixed>;
199                 enable-gpios = <&gpio1 27 0>; /* BeagleBone Black Clk enable on GPIO1_27 */
200         };
201
202         sound {
203                 compatible = "simple-audio-card";
204                 simple-audio-card,name = "TI BeagleBone Black";
205                 simple-audio-card,format = "i2s";
206                 simple-audio-card,bitclock-master = <&dailink0_master>;
207                 simple-audio-card,frame-master = <&dailink0_master>;
208
209                 dailink0_master: simple-audio-card,cpu {
210                         sound-dai = <&mcasp0>;
211                         clocks = <&clk_mcasp0>;
212                 };
213
214                 simple-audio-card,codec {
215                         sound-dai = <&tda19988>;
216                 };
217         };
218
219         chosen {
220                 stdout-path = &uart0;
221         };
222
223         leds {
224                 pinctrl-names = "default";
225                 pinctrl-0 = <&user_leds_s0>;
226
227                 compatible = "gpio-leds";
228
229                 led2 {
230                         label = "beaglebone:green:usr0";
231                         gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
232                         linux,default-trigger = "heartbeat";
233                         default-state = "off";
234                 };
235
236                 led3 {
237                         label = "beaglebone:green:usr1";
238                         gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
239                         linux,default-trigger = "mmc0";
240                         default-state = "off";
241                 };
242
243                 led4 {
244                         label = "beaglebone:green:usr2";
245                         gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
246                         linux,default-trigger = "cpu0";
247                         default-state = "off";
248                 };
249
250                 led5 {
251                         label = "beaglebone:green:usr3";
252                         gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>;
253                         linux,default-trigger = "mmc1";
254                         default-state = "off";
255                 };
256         };
257
258         vmmcsd_fixed: fixedregulator0 {
259                 compatible = "regulator-fixed";
260                 regulator-name = "vmmcsd_fixed";
261                 regulator-min-microvolt = <3300000>;
262                 regulator-max-microvolt = <3300000>;
263         };
264 };
265
266 &am33xx_pinmux {
267         pinctrl-names = "default";
268         pinctrl-0 = <&clkout2_pin>;
269
270         user_leds_s0: user-leds-s0 {
271                 pinctrl-single,pins = <
272                         AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a5.gpio1_21 */
273                         AM33XX_IOPAD(0x858, PIN_OUTPUT_PULLUP | MUX_MODE7)      /* gpmc_a6.gpio1_22 */
274                         AM33XX_IOPAD(0x85c, PIN_OUTPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a7.gpio1_23 */
275                         AM33XX_IOPAD(0x860, PIN_OUTPUT_PULLUP | MUX_MODE7)      /* gpmc_a8.gpio1_24 */
276                 >;
277         };
278
279         i2c2_pins: pinmux-i2c2-pins {
280                 pinctrl-single,pins = <
281                         AM33XX_IOPAD(0x978, PIN_INPUT_PULLUP | MUX_MODE3)       /* uart1_ctsn.i2c2_sda */
282                         AM33XX_IOPAD(0x97c, PIN_INPUT_PULLUP | MUX_MODE3)       /* uart1_rtsn.i2c2_scl */
283                 >;
284         };
285
286         uart0_pins: pinmux-uart0-pins {
287                 pinctrl-single,pins = <
288                         AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0)       /* uart0_rxd.uart0_rxd */
289                         AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* uart0_txd.uart0_txd */
290                 >;
291         };
292
293         clkout2_pin: pinmux-clkout2-pin {
294                 pinctrl-single,pins = <
295                         AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3)    /* xdma_event_intr1.clkout2 */
296                 >;
297         };
298
299         cpsw_default: cpsw-default {
300                 pinctrl-single,pins = <
301                         /* Slave 1 */
302                         AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txen.rgmii1_tctl */
303                         AM33XX_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE2)             /* mii1_rxdv.rgmii1_rctl */
304                         AM33XX_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txd3.rgmii1_txd3 */
305                         AM33XX_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txd2.rgmii1_txd2 */
306                         AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txd1.rgmii1_txd1 */
307                         AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txd0.rgmii1_txd0 */
308                         AM33XX_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE2)    /* mii1_txclk.rgmii1_txclk */
309                         AM33XX_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE2)             /* mii1_rxclk.rgmii1_rxclk */
310                         AM33XX_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE2)             /* mii1_rxd3.rgmii1_rxd3 */
311                         AM33XX_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE2)             /* mii1_rxd2.rgmii1_rxd2 */
312                         AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE2)             /* mii1_rxd1.rgmii1_rxd1 */
313                         AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE2)             /* mii1_rxd0.rgmii1_rxd0 */
314                 >;
315         };
316
317         cpsw_sleep: cpsw-sleep {
318                 pinctrl-single,pins = <
319                         /* Slave 1 reset value */
320                         AM33XX_IOPAD(0x914, PIN_INPUT_PULLDOWN | MUX_MODE7)
321                         AM33XX_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE7)
322                         AM33XX_IOPAD(0x91c, PIN_INPUT_PULLDOWN | MUX_MODE7)
323                         AM33XX_IOPAD(0x920, PIN_INPUT_PULLDOWN | MUX_MODE7)
324                         AM33XX_IOPAD(0x924, PIN_INPUT_PULLDOWN | MUX_MODE7)
325                         AM33XX_IOPAD(0x928, PIN_INPUT_PULLDOWN | MUX_MODE7)
326                         AM33XX_IOPAD(0x92c, PIN_INPUT_PULLDOWN | MUX_MODE7)
327                         AM33XX_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE7)
328                         AM33XX_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE7)
329                         AM33XX_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE7)
330                         AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE7)
331                         AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE7)
332                 >;
333         };
334
335         davinci_mdio_default: davinci-mdio-default {
336                 pinctrl-single,pins = <
337                         /* MDIO */
338                         AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)       /* mdio_data.mdio_data */
339                         AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0)                      /* mdio_clk.mdio_clk */
340                 >;
341         };
342
343         davinci_mdio_sleep: davinci-mdio-sleep {
344                 pinctrl-single,pins = <
345                         /* MDIO reset value */
346                         AM33XX_IOPAD(0x948, PIN_INPUT_PULLDOWN | MUX_MODE7)
347                         AM33XX_IOPAD(0x94c, PIN_INPUT_PULLDOWN | MUX_MODE7)
348                 >;
349         };
350
351         mmc1_pins: pinmux-mmc1-pins {
352                 pinctrl-single,pins = <
353                         AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* (C15) spi0_cs1.gpio0[6] */
354                         AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0) /* (G16) mmc0_dat0.mmc0_dat0 */
355                         AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0) /* (G15) mmc0_dat1.mmc0_dat1 */
356                         AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0) /* (F18) mmc0_dat2.mmc0_dat2 */
357                         AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) /* (F17) mmc0_dat3.mmc0_dat3 */
358                         AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) /* (G18) mmc0_cmd.mmc0_cmd */
359                         AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) /* (G17) mmc0_clk.mmc0_clk */
360                 >;
361         };
362
363         emmc_pins: pinmux-emmc-pins {
364                 pinctrl-single,pins = <
365                         AM33XX_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */
366                         AM33XX_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */
367                         AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */
368                         AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */
369                         AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */
370                         AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */
371                         AM33XX_IOPAD(0x810, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad4.mmc1_dat4 */
372                         AM33XX_IOPAD(0x814, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad5.mmc1_dat5 */
373                         AM33XX_IOPAD(0x818, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad6.mmc1_dat6 */
374                         AM33XX_IOPAD(0x81c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad7.mmc1_dat7 */
375                 >;
376         };
377 };
378
379
380 &uart0 {
381         pinctrl-names = "default";
382         pinctrl-0 = <&uart0_pins>;
383
384         status = "okay";
385 };
386
387 &usb {
388         status = "okay";
389 };
390
391 &usb_ctrl_mod {
392         status = "okay";
393 };
394
395 &usb0_phy {
396         status = "okay";
397 };
398
399 &usb1_phy {
400         status = "okay";
401 };
402
403 &usb0 {
404         status = "okay";
405         dr_mode = "peripheral";
406         interrupts-extended = <&intc 18 &tps 0>;
407         interrupt-names = "mc", "vbus";
408 };
409
410 &usb1 {
411         status = "okay";
412         dr_mode = "host";
413 };
414
415 &cppi41dma  {
416         status = "okay";
417 };
418
419 &i2c2 {
420         pinctrl-names = "default";
421         pinctrl-0 = <&i2c2_pins>;
422         status = "okay";
423         clock-frequency = <100000>;
424 };
425
426 &cpsw_emac0 {
427         phy_id = <&davinci_mdio>, <4>;
428         phy-mode = "rgmii-txid";
429 };
430
431 &mac {
432         slaves = <1>;
433         pinctrl-names = "default", "sleep";
434         pinctrl-0 = <&cpsw_default>;
435         pinctrl-1 = <&cpsw_sleep>;
436         status = "okay";
437 };
438
439 &davinci_mdio {
440         pinctrl-names = "default", "sleep";
441         pinctrl-0 = <&davinci_mdio_default>;
442         pinctrl-1 = <&davinci_mdio_sleep>;
443         status = "okay";
444 };
445
446 &mmc1 {
447         status = "okay";
448         bus-width = <0x4>;
449         pinctrl-names = "default";
450         pinctrl-0 = <&mmc1_pins>;
451         cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
452 };
453
454 &rtc {
455         clocks = <&clk_32768_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>;
456         clock-names = "ext-clk", "int-clk";
457 };