50d926d887ee956dfd6da6db3d891aba7332ebbe
[platform/kernel/linux-starfive.git] / arch / riscv / boot / dts / starfive / jh7110-common.dtsi
1 // SPDX-License-Identifier: GPL-2.0 OR MIT
2 /*
3  * Copyright (C) 2022 StarFive Technology Co., Ltd.
4  * Copyright (C) 2022 Hal Feng <hal.feng@starfivetech.com>
5  */
6
7 /dts-v1/;
8 #include "jh7110.dtsi"
9 #include "jh7110-evb-pinctrl.dtsi"
10 #include "codecs/sf_hdmi.dtsi"
11
12 / {
13         aliases {
14                 spi0 = &qspi;
15                 gpio0 = &gpio;
16                 ethernet0 = &gmac0;
17                 ethernet1 = &gmac1;
18                 mmc0 = &sdio0;
19                 mmc1 = &sdio1;
20                 serial0 = &uart0;
21                 serial3 = &uart3;
22                 i2c0 = &i2c0;
23                 i2c1 = &i2c1;
24                 i2c2 = &i2c2;
25                 i2c3 = &i2c3;
26                 i2c4 = &i2c4;
27                 i2c5 = &i2c5;
28                 i2c6 = &i2c6;
29         };
30
31         chosen {
32                 linux,initrd-start = <0x0 0x46100000>;
33                 linux,initrd-end = <0x0 0x4c000000>;
34                 stdout-path = "serial0:115200";
35                 #bootargs = "debug console=ttyS0 rootwait";
36         };
37
38         cpus {
39                 timebase-frequency = <4000000>;
40         };
41
42         memory@40000000 {
43                 device_type = "memory";
44                 reg = <0x0 0x40000000 0x1 0x0>;
45         };
46
47         reserved-memory {
48                 #address-cells = <2>;
49                 #size-cells = <2>;
50                 ranges;
51
52                 linux,cma {
53                         compatible = "shared-dma-pool";
54                         reusable;
55                         size = <0x0 0x20000000>;
56                         alignment = <0x0 0x1000>;
57                         alloc-ranges = <0x0 0x80000000 0x0 0x20000000>;
58                         linux,cma-default;
59                 };
60
61                 e24_mem: e24@c0000000 {
62                         no-map;
63                         reg = <0x0 0xc0110000 0x0 0xf0000>;
64                 };
65
66                 xrp_reserved: xrpbuffer@f0000000 {
67                         reg = <0x0 0xf0000000 0x0 0x01ffffff
68                                 0x0 0xf2000000 0x0 0x00001000
69                                 0x0 0xf2001000 0x0 0x00fff000
70                                 0x0 0xf3000000 0x0 0x00001000>;
71                 };
72
73         };
74 };
75
76 &uart0 {
77         pinctrl-names = "default";
78         pinctrl-0 = <&uart0_pins>;
79         status = "okay";
80 };
81
82 &uart1 {
83        pinctrl-names = "default";
84        pinctrl-0 = <&uart1_pins>;
85        status = "disabled";
86 };
87
88 &uart2 {
89        pinctrl-names = "default";
90        pinctrl-0 = <&uart2_pins>;
91        status = "disabled";
92 };
93
94 &uart3 {
95        pinctrl-names = "default";
96        pinctrl-0 = <&uart3_pins>;
97        status = "disabled";
98 };
99
100 &uart4 {
101        pinctrl-names = "default";
102        pinctrl-0 = <&uart4_pins>;
103        status = "disabled";
104 };
105
106 &uart5 {
107        pinctrl-names = "default";
108        pinctrl-0 = <&uart5_pins>;
109        status = "disabled";
110 };
111
112 &dma {
113         status = "okay";
114 };
115
116 &trng {
117         status = "okay";
118 };
119
120 &crypto {
121         status = "okay";
122 };
123
124 &sec_dma {
125         status = "okay";
126 };
127
128 &i2c0 {
129         clock-frequency = <100000>;
130         i2c-sda-hold-time-ns = <300>;
131         i2c-sda-falling-time-ns = <510>;
132         i2c-scl-falling-time-ns = <510>;
133         auto_calc_scl_lhcnt;
134         pinctrl-names = "default";
135         pinctrl-0 = <&i2c0_pins>;
136         status = "disabled";
137
138         ac108_a: ac108@3b {
139                 compatible = "x-power,ac108_0";
140                 reg = <0x3b>;
141                 #sound-dai-cells = <0>;
142                 data-protocol = <0>;
143         };
144
145         wm8960: codec@1a {
146                 compatible = "wlf,wm8960";
147                 reg = <0x1a>;
148                 #sound-dai-cells = <0>;
149
150                 wlf,shared-lrclk;
151         };
152 };
153
154 &i2c1 {
155         clock-frequency = <100000>;
156         i2c-sda-hold-time-ns = <300>;
157         i2c-sda-falling-time-ns = <510>;
158         i2c-scl-falling-time-ns = <510>;
159         auto_calc_scl_lhcnt;
160         pinctrl-names = "default";
161         pinctrl-0 = <&i2c1_pins>;
162         status = "disabled";
163 };
164
165 &i2c2 {
166         clock-frequency = <100000>;
167         i2c-sda-hold-time-ns = <300>;
168         i2c-sda-falling-time-ns = <510>;
169         i2c-scl-falling-time-ns = <510>;
170         auto_calc_scl_lhcnt;
171         pinctrl-names = "default";
172         pinctrl-0 = <&i2c2_pins>;
173         status = "okay";
174
175         seeed_plane_i2c@45 {
176                 compatible = "seeed_panel";
177                 reg = <0x45>;
178
179                 port {
180                         panel_dsi_port: endpoint {
181                                 remote-endpoint = <&dsi_out_port>;
182                         };
183                 };
184         };
185
186 };
187
188 &i2c3 {
189         clock-frequency = <100000>;
190         i2c-sda-hold-time-ns = <300>;
191         i2c-sda-falling-time-ns = <510>;
192         i2c-scl-falling-time-ns = <510>;
193         auto_calc_scl_lhcnt;
194         pinctrl-names = "default";
195         pinctrl-0 = <&i2c3_pins>;
196         status = "disabled";
197 };
198
199 &i2c4 {
200         clock-frequency = <100000>;
201         i2c-sda-hold-time-ns = <300>;
202         i2c-sda-falling-time-ns = <510>;
203         i2c-scl-falling-time-ns = <510>;
204         auto_calc_scl_lhcnt;
205         pinctrl-names = "default";
206         pinctrl-0 = <&i2c4_pins>;
207         status = "okay";
208
209         sc2235: sc2235@30 {
210                 compatible = "smartsens,sc2235";
211                 reg = <0x30>;
212                 clocks = <&clk_ext_camera>;
213                 clock-names = "xclk";
214
215                 port {
216                         /* Parallel bus endpoint */
217                         sc2235_to_parallel: endpoint {
218                                 remote-endpoint = <&parallel_from_sc2235>;
219                                 bus-type = <5>;      /* Parallel */
220                                 bus-width = <8>;
221                                 data-shift = <2>; /* lines 13:6 are used */
222                                 hsync-active = <1>;
223                                 vsync-active = <1>;
224                                 pclk-sample = <1>;
225                         };
226                 };
227         };
228
229         tda998x@70 {
230                 compatible = "nxp,tda998x";
231                 reg = <0x70>;
232
233                 port {
234                         tda998x_0_input: endpoint {
235                                 remote-endpoint = <&hdmi_out>;
236                         };
237                 };
238         };
239 };
240
241 &i2c5 {
242         clock-frequency = <100000>;
243         i2c-sda-hold-time-ns = <300>;
244         i2c-sda-falling-time-ns = <510>;
245         i2c-scl-falling-time-ns = <510>;
246         auto_calc_scl_lhcnt;
247         pinctrl-names = "default";
248         pinctrl-0 = <&i2c5_pins>;
249         status = "okay";
250 };
251
252 &i2c6 {
253         clock-frequency = <100000>;
254         i2c-sda-hold-time-ns = <300>;
255         i2c-sda-falling-time-ns = <510>;
256         i2c-scl-falling-time-ns = <510>;
257         auto_calc_scl_lhcnt;
258         pinctrl-names = "default";
259         pinctrl-0 = <&i2c6_pins>;
260         status = "okay";
261
262         ov4689: ov4689@36 {
263                 compatible = "ovti,ov4689";
264                 reg = <0x36>;
265                 clocks = <&clk_ext_camera>;
266                 clock-names = "xclk";
267                 //reset-gpio = <&gpio 18 0>;
268                 rotation = <180>;
269
270                 port {
271                         /* Parallel bus endpoint */
272                         ov4689_to_csi2rx0: endpoint {
273                                 remote-endpoint = <&csi2rx0_from_ov4689>;
274                                 bus-type = <4>;         /* MIPI CSI-2 D-PHY */
275                                 clock-lanes = <0>;
276                                 data-lanes = <1 2 3 4>;
277                         };
278                 };
279         };
280
281         imx219: imx219@10 {
282                 compatible = "sony,imx219";
283                 reg = <0x10>;
284                 clocks = <&clk_ext_camera>;
285                 clock-names = "xclk";
286                 //reset-gpio = <&gpio 10 0>;
287                 //DOVDD-supply = <&v2v8>;
288                 pinctrl-names = "default", "power_up", "power_down";
289                 pinctrl-0 = <&csi_pins_default>;
290                 pinctrl-1 = <&csi_pins_pwup>;
291                 pinctrl-2 = <&csi_pins_pwdn>;
292                 rotation = <0>;
293                 orientation = <1>; //CAMERA_ORIENTATION_BACK
294
295                 port {
296                         /* CSI2 bus endpoint */
297                         imx219_to_csi2rx0: endpoint {
298                                 remote-endpoint = <&csi2rx0_from_imx219>;
299                                 bus-type = <4>;      /* MIPI CSI-2 D-PHY */
300                                 clock-lanes = <0>;
301                                 data-lanes = <2 1>;
302                                 lane-polarities = <1 1 1>;
303                                 link-frequencies = /bits/ 64 <456000000>;
304                         };
305                 };
306         };
307 };
308
309 &sdio0 {
310         status = "disabled";
311 };
312
313 &sdio1 {
314         status = "disabled";
315 };
316
317 &vin_sysctl {
318         status = "okay";
319
320         ports {
321                 #address-cells = <1>;
322                 #size-cells = <0>;
323
324                 port@0 {
325                         reg = <0>;
326                         #address-cells = <1>;
327                         #size-cells = <0>;
328
329                         /* Parallel bus endpoint */
330                         parallel_from_sc2235: endpoint@0 {
331                                 reg = <0>;
332                                 remote-endpoint = <&sc2235_to_parallel>;
333                                 bus-type = <5>;         /* Parallel */
334                                 bus-width = <8>;
335                                 data-shift = <2>;       /* lines 9:2 are used */
336                                 hsync-active = <1>;
337                                 vsync-active = <0>;
338                                 pclk-sample = <1>;
339                                 status = "okay";
340                         };
341                 };
342
343                 port@1 {
344                         reg = <1>;
345                         #address-cells = <1>;
346                         #size-cells = <0>;
347
348                         /* CSI2 bus endpoint */
349                         csi2rx0_from_ov4689: endpoint@0 {
350                                 reg = <0>;
351                                 remote-endpoint = <&ov4689_to_csi2rx0>;
352                                 bus-type = <4>;      /* MIPI CSI-2 D-PHY */
353                                 clock-lanes = <0>;
354                                 data-lanes = <1 2 3 4>;
355                                 status = "okay";
356                         };
357
358                         /* CSI2 bus endpoint */
359                         csi2rx0_from_imx219: endpoint@1 {
360                                 reg = <1>;
361                                 remote-endpoint = <&imx219_to_csi2rx0>;
362                                 bus-type = <4>;      /* MIPI CSI-2 D-PHY */
363                                 clock-lanes = <0>;
364                                 data-lanes = <2 1>;
365                                 lane-polarities = <1 1 1>;
366                                 status = "okay";
367                         };
368                 };
369         };
370 };
371
372 &sfctemp {
373         status = "okay";
374 };
375
376 &jpu {
377         status = "okay";
378 };
379
380 &vpu_dec {
381         status = "okay";
382 };
383
384 &vpu_enc {
385         status = "okay";
386 };
387
388 &gmac0 {
389         status = "okay";
390         #address-cells = <1>;
391         #size-cells = <0>;
392         phy0: ethernet-phy@0 {
393                 rxc_dly_en = <0>;
394                 tx_delay_sel_fe = <5>;
395                 tx_delay_sel = <11>;
396         };
397 };
398
399 &gmac1 {
400         #address-cells = <1>;
401         #size-cells = <0>;
402         status = "okay";
403         phy1: ethernet-phy@1 {
404                 rxc-skew-ps = <1060>;
405                 txc-skew-ps = <1800>;
406                 reg = <0>;
407         };
408 };
409
410 &gpu {
411         status = "okay";
412 };
413
414 &can0 {
415         pinctrl-names = "default";
416         pinctrl-0 = <&can0_pins>;
417         status = "disabled";
418 };
419
420 &can1 {
421         pinctrl-names = "default";
422         pinctrl-0 = <&can1_pins>;
423         status = "disabled";
424 };
425
426 &tdm {
427         pinctrl-names = "default";
428         pinctrl-0 = <&tdm0_pins>;
429         status = "disabled";
430 };
431
432 &spdif0 {
433         pinctrl-names = "default";
434         pinctrl-0 = <&spdif0_pins>;
435         status = "disabled";
436 };
437
438 &pwmdac {
439         pinctrl-names = "default";
440         pinctrl-0 = <&pwmdac0_pins>;
441         status = "disabled";
442 };
443
444 &i2stx {
445         status = "disabled";
446 };
447
448 &pdm {
449         pinctrl-names = "default";
450         pinctrl-0 = <&pdm0_pins>;
451         status = "disabled";
452 };
453
454 &i2srx_mst {
455         pinctrl-names = "default";
456         pinctrl-0 = <&i2srx_clk_pins>;
457         status = "disabled";
458 };
459
460 &i2srx_3ch {
461         pinctrl-names = "default";
462         pinctrl-0 = <&i2s_clk_pins &i2srx_pins>;
463         status = "disabled";
464 };
465
466 &i2stx_4ch0 {
467         pinctrl-names = "default";
468         pinctrl-0 = <&mclk_ext_pins>;
469         status = "okay";
470 };
471
472 &i2stx_4ch1 {
473         pinctrl-names = "default";
474         pinctrl-0 = <&i2stx_pins>;
475         status = "disabled";
476 };
477
478 &spdif_transmitter {
479         status = "disabled";
480 };
481
482 &pwmdac_codec {
483         status = "okay";
484 };
485
486 &dmic_codec {
487         status = "okay";
488 };
489
490 &spi0 {
491         pinctrl-names = "default";
492         pinctrl-0 = <&ssp0_pins>;
493         status = "disabled";
494
495         spi_dev0: spi@0 {
496                 compatible = "rohm,dh2228fv";
497                 pl022,com-mode = <1>;
498                 spi-max-frequency = <10000000>;
499                 reg = <0>;
500                 status = "okay";
501         };
502 };
503
504 &spi1 {
505         pinctrl-names = "default";
506         pinctrl-0 = <&ssp1_pins>;
507         status = "disabled";
508
509         spi_dev1: spi@0 {
510                 compatible = "rohm,dh2228fv";
511                 pl022,com-mode = <1>;
512                 spi-max-frequency = <10000000>;
513                 reg = <0>;
514                 status = "okay";
515         };
516 };
517
518 &spi2 {
519         pinctrl-names = "default";
520         pinctrl-0 = <&ssp2_pins>;
521         status = "disabled";
522
523         spi_dev2: spi@0 {
524                 compatible = "rohm,dh2228fv";
525                 pl022,com-mode = <1>;
526                 spi-max-frequency = <10000000>;
527                 reg = <0>;
528                 status = "okay";
529         };
530 };
531
532 &spi3 {
533         pinctrl-names = "default";
534         pinctrl-0 = <&ssp3_pins>;
535         status = "disabled";
536
537         spi_dev3: spi@0 {
538                 compatible = "rohm,dh2228fv";
539                 pl022,com-mode = <1>;
540                 spi-max-frequency = <10000000>;
541                 reg = <0>;
542                 status = "okay";
543         };
544 };
545
546 &spi4 {
547         pinctrl-names = "default";
548         pinctrl-0 = <&ssp4_pins>;
549         status = "disabled";
550
551         spi_dev4: spi@0 {
552                 compatible = "rohm,dh2228fv";
553                 pl022,com-mode = <1>;
554                 spi-max-frequency = <10000000>;
555                 reg = <0>;
556                 status = "okay";
557         };
558 };
559
560 &spi5 {
561         pinctrl-names = "default";
562         pinctrl-0 = <&ssp5_pins>;
563         status = "disabled";
564
565         spi_dev5: spi@0 {
566                 compatible = "rohm,dh2228fv";
567                 pl022,com-mode = <1>;
568                 spi-max-frequency = <10000000>;
569                 reg = <0>;
570                 status = "okay";
571         };
572 };
573
574 &spi6 {
575         pinctrl-names = "default";
576         pinctrl-0 = <&ssp6_pins>;
577         status = "disabled";
578
579         spi_dev6: spi@0 {
580                 compatible = "rohm,dh2228fv";
581                 pl022,com-mode = <1>;
582                 spi-max-frequency = <10000000>;
583                 reg = <0>;
584                 status = "okay";
585         };
586 };
587
588 &pcie0 {
589         pinctrl-names = "perst-default", "perst-active", "power-active";
590         pinctrl-0 = <&pcie0_perst_default>;
591         pinctrl-1 = <&pcie0_perst_active>;
592         pinctrl-2 = <&pcie0_power_active>;
593         status = "disabled";
594 };
595
596 &pcie1 {
597         pinctrl-names = "perst-default", "perst-active", "power-active";
598         pinctrl-0 = <&pcie1_perst_default>;
599         pinctrl-1 = <&pcie1_perst_active>;
600         pinctrl-2 = <&pcie1_power_active>;
601         status = "disabled";
602 };
603
604 &mailbox_contrl0 {
605         status = "okay";
606 };
607
608 &mailbox_client0 {
609         status = "okay";
610 };
611
612 &display {
613         status = "okay";
614 };
615
616 &hdmi {
617         status = "okay";
618         pinctrl-names = "default";
619         pinctrl-0 = <&inno_hdmi_pins>;
620
621         hdmi_in: port {
622                 #address-cells = <1>;
623                 #size-cells = <0>;
624                 hdmi_in_lcdc: endpoint@0 {
625                         reg = <0>;
626                         remote-endpoint = <&dc_out_dpi1>;
627                 };
628         };
629 };
630
631 &dc8200 {
632         status = "okay";
633
634         dc_out: port {
635                 #address-cells = <1>;
636                 #size-cells = <0>;
637                 dc_out_dpi0: endpoint@0 {
638                         reg = <0>;
639                         remote-endpoint = <&hdmi_input0>;
640                 };
641                 dc_out_dpi1: endpoint@1 {
642                         reg = <1>;
643                         remote-endpoint = <&hdmi_in_lcdc>;
644                 };
645
646                 dc_out_dpi2: endpoint@2 {
647                         reg = <2>;
648                         remote-endpoint = <&mipi_in>;
649                 };
650         };
651 };
652
653 &rgb_output {
654         status = "okay";
655
656         ports {
657                 #address-cells = <1>;
658                 #size-cells = <0>;
659                 port@0 {
660                         #address-cells = <1>;
661                         #size-cells = <0>;
662                         reg = <0>;
663                         hdmi_input0:endpoint@0 {
664                                 reg = <0>;
665                                 remote-endpoint = <&dc_out_dpi0>;
666                         };
667                 };
668                 port@1 {
669                         reg = <1>;
670                         hdmi_out:endpoint {
671                                 remote-endpoint = <&tda998x_0_input>;
672                         };
673                 };
674         };
675 };
676
677 &tda988x_pin {
678         pinctrl-names = "default";
679         pinctrl-0 = <&rgb_pad_pins>;
680         status = "disabled";
681 };
682
683 &dsi_output {
684         status = "okay";
685
686         ports {
687                 #address-cells = <1>;
688                 #size-cells = <0>;
689
690                 port@0 {
691                         reg = <0>;
692                         mipi_in: endpoint {
693                                 remote-endpoint = <&dc_out_dpi2>;
694                         };
695                 };
696
697                 port@1 {
698                         reg = <1>;
699                         mipi_out: endpoint {
700                                 remote-endpoint = <&dsi_in_port>;
701                         };
702                 };
703         };
704 };
705
706 &mipi_dsi {
707         status = "okay";
708 };
709
710 &mipi_dphy {
711         status = "okay";
712 };
713
714 &co_process {
715         status = "okay";
716 };
717
718 &usbdrd30 {
719         pinctrl-names = "default";
720         pinctrl-0 = <&usb_pins>;
721         dr_mode = "host"; /*host or peripheral*/
722         status = "disabled";
723 };
724
725 &xrp {
726         status = "okay";
727 };