Merge branch 'CR_1537_USB_515_mason.huo' 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 = <3000>;
131         i2c-scl-falling-time-ns = <3000>;
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 = <3000>;
157         i2c-scl-falling-time-ns = <3000>;
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 = <3000>;
168         i2c-scl-falling-time-ns = <3000>;
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 = <3000>;
191         i2c-scl-falling-time-ns = <3000>;
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 = <3000>;
202         i2c-scl-falling-time-ns = <3000>;
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 = <3000>;
244         i2c-scl-falling-time-ns = <3000>;
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 = <3000>;
255         i2c-scl-falling-time-ns = <3000>;
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 };
386
387 &gmac1 {
388         #address-cells = <1>;
389         #size-cells = <0>;
390         status = "okay";
391         phy0: ethernet-phy@0 {
392                 rxc-skew-ps = <1060>;
393                 txc-skew-ps = <1800>;
394                 reg = <0>;
395         };
396 };
397
398 &gpu {
399         status = "okay";
400 };
401
402 &can0 {
403         pinctrl-names = "default";
404         pinctrl-0 = <&can0_pins>;
405         status = "disabled";
406 };
407
408 &can1 {
409         pinctrl-names = "default";
410         pinctrl-0 = <&can1_pins>;
411         status = "disabled";
412 };
413
414 &tdm {
415         pinctrl-names = "default";
416         pinctrl-0 = <&tdm0_pins>;
417         status = "disabled";
418 };
419
420 &spdif0 {
421         pinctrl-names = "default";
422         pinctrl-0 = <&spdif0_pins>;
423         status = "disabled";
424 };
425
426 &pwmdac {
427         pinctrl-names = "default";
428         pinctrl-0 = <&pwmdac0_pins>;
429         status = "disabled";
430 };
431
432 &i2stx {
433         status = "disabled";
434 };
435
436 &pdm {
437         pinctrl-names = "default";
438         pinctrl-0 = <&pdm0_pins>;
439         status = "disabled";
440 };
441
442 &i2srx_mst {
443         pinctrl-names = "default";
444         pinctrl-0 = <&i2srx_clk_pins>;
445         status = "disabled";
446 };
447
448 &i2srx_3ch {
449         pinctrl-names = "default";
450         pinctrl-0 = <&i2srx_pins>;
451         status = "disabled";
452 };
453
454 &i2stx_4ch0 {
455         status = "disabled";
456 };
457
458 &i2stx_4ch1 {
459         pinctrl-names = "default";
460         pinctrl-0 = <&i2s_clk_pins &i2stx_pins>;
461         status = "disabled";
462 };
463
464 &spdif_transmitter {
465         compatible = "linux,spdif-dit";
466         #sound-dai-cells = <0>;
467         status = "disabled";
468 };
469
470 &spdif_receiver {
471         compatible = "linux,spdif-dir";
472         #sound-dai-cells = <0>;
473         status = "disabled";
474 };
475
476 &pwmdac_codec {
477         status = "okay";
478 };
479
480 &dmic_codec {
481         status = "okay";
482 };
483
484 &spi0 {
485         pinctrl-names = "default";
486         pinctrl-0 = <&ssp0_pins>;
487         status = "disabled";
488
489         spi_dev0: spi@0 {
490                 compatible = "rohm,dh2228fv";
491                 pl022,com-mode = <1>;
492                 spi-max-frequency = <10000000>;
493                 reg = <0>;
494                 status = "okay";
495         };
496 };
497
498 &spi1 {
499         pinctrl-names = "default";
500         pinctrl-0 = <&ssp1_pins>;
501         status = "disabled";
502
503         spi_dev1: spi@0 {
504                 compatible = "rohm,dh2228fv";
505                 pl022,com-mode = <1>;
506                 spi-max-frequency = <10000000>;
507                 reg = <0>;
508                 status = "okay";
509         };
510 };
511
512 &spi2 {
513         pinctrl-names = "default";
514         pinctrl-0 = <&ssp2_pins>;
515         status = "disabled";
516
517         spi_dev2: spi@0 {
518                 compatible = "rohm,dh2228fv";
519                 pl022,com-mode = <1>;
520                 spi-max-frequency = <10000000>;
521                 reg = <0>;
522                 status = "okay";
523         };
524 };
525
526 &spi3 {
527         pinctrl-names = "default";
528         pinctrl-0 = <&ssp3_pins>;
529         status = "disabled";
530
531         spi_dev3: spi@0 {
532                 compatible = "rohm,dh2228fv";
533                 pl022,com-mode = <1>;
534                 spi-max-frequency = <10000000>;
535                 reg = <0>;
536                 status = "okay";
537         };
538 };
539
540 &spi4 {
541         pinctrl-names = "default";
542         pinctrl-0 = <&ssp4_pins>;
543         status = "disabled";
544
545         spi_dev4: spi@0 {
546                 compatible = "rohm,dh2228fv";
547                 pl022,com-mode = <1>;
548                 spi-max-frequency = <10000000>;
549                 reg = <0>;
550                 status = "okay";
551         };
552 };
553
554 &spi5 {
555         pinctrl-names = "default";
556         pinctrl-0 = <&ssp5_pins>;
557         status = "disabled";
558
559         spi_dev5: spi@0 {
560                 compatible = "rohm,dh2228fv";
561                 pl022,com-mode = <1>;
562                 spi-max-frequency = <10000000>;
563                 reg = <0>;
564                 status = "okay";
565         };
566 };
567
568 &spi6 {
569         pinctrl-names = "default";
570         pinctrl-0 = <&ssp6_pins>;
571         status = "disabled";
572
573         spi_dev6: spi@0 {
574                 compatible = "rohm,dh2228fv";
575                 pl022,com-mode = <1>;
576                 spi-max-frequency = <10000000>;
577                 reg = <0>;
578                 status = "okay";
579         };
580 };
581
582 &pcie0 {
583         pinctrl-names = "perst-default", "perst-active", "power-active";
584         pinctrl-0 = <&pcie0_perst_default>;
585         pinctrl-1 = <&pcie0_perst_active>;
586         pinctrl-2 = <&pcie0_power_active>;
587         status = "disabled";
588 };
589
590 &pcie1 {
591         pinctrl-names = "perst-default", "perst-active", "power-active";
592         pinctrl-0 = <&pcie1_perst_default>;
593         pinctrl-1 = <&pcie1_perst_active>;
594         pinctrl-2 = <&pcie1_power_active>;
595         status = "disabled";
596 };
597
598 &mailbox_contrl0 {
599         status = "okay";
600 };
601
602 &mailbox_client0 {
603         status = "okay";
604 };
605
606 &display {
607         status = "okay";
608 };
609
610 &hdmi {
611         status = "okay";
612         pinctrl-names = "default";
613         pinctrl-0 = <&inno_hdmi_pins>;
614
615         hdmi_in: port {
616                 #address-cells = <1>;
617                 #size-cells = <0>;
618                 hdmi_in_lcdc: endpoint@0 {
619                         reg = <0>;
620                         remote-endpoint = <&dc_out_dpi1>;
621                 };
622         };
623 };
624
625 &dc8200 {
626         status = "okay";
627
628         dc_out: port {
629                 #address-cells = <1>;
630                 #size-cells = <0>;
631                 dc_out_dpi0: endpoint@0 {
632                         reg = <0>;
633                         remote-endpoint = <&hdmi_input0>;
634                 };
635                 dc_out_dpi1: endpoint@1 {
636                         reg = <1>;
637                         remote-endpoint = <&hdmi_in_lcdc>;
638                 };
639
640                 dc_out_dpi2: endpoint@2 {
641                         reg = <2>;
642                         remote-endpoint = <&mipi_in>;
643                 };
644         };
645 };
646
647 &hdmi_output {
648         status = "okay";
649
650         ports {
651                 #address-cells = <1>;
652                 #size-cells = <0>;
653                 port@0 {
654                         #address-cells = <1>;
655                         #size-cells = <0>;
656                         reg = <0>;
657                         hdmi_input0:endpoint@0 {
658                                 reg = <0>;
659                                 remote-endpoint = <&dc_out_dpi0>;
660                         };
661                 };
662                 port@1 {
663                         reg = <1>;
664                         hdmi_out:endpoint {
665                                 remote-endpoint = <&tda998x_0_input>;
666                         };
667                 };
668         };
669 };
670
671 &tda988x_pin {
672         pinctrl-names = "default";
673         pinctrl-0 = <&rgb_pad_pins>;
674         status = "disabled";
675 };
676
677 &encoder {
678         status = "okay";
679
680         ports {
681                 #address-cells = <1>;
682                 #size-cells = <0>;
683
684                 port@0 {
685                         reg = <0>;
686                         mipi_in: endpoint {
687                                 remote-endpoint = <&dc_out_dpi2>;
688                         };
689                 };
690
691                 port@1 {
692                         reg = <1>;
693                         mipi_out: endpoint {
694                                 remote-endpoint = <&dsi_in_port>;
695                         };
696                 };
697         };
698 };
699
700 &mipi_dsi {
701         status = "okay";
702 };
703
704 &mipi_dphy {
705         status = "okay";
706 };
707
708 &co_process {
709         status = "okay";
710 };
711
712 &usbdrd30 {
713         pinctrl-names = "default";
714         pinctrl-0 = <&usb_pins>;
715         dr_mode = "host"; /*host or peripheral*/
716         status = "disabled";
717 };
718
719 &xrp {
720         status = "okay";
721 };