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