Skip to content

Commit 49eef29

Browse files
committed
riscv: dts: Add full JH7100, Starlight and VisionFive support
Based on the device tree in https://github.com/starfive-tech/u-boot/ with contributions from: yanhong.wang <yanhong.wang@starfivetech.com> Huan.Feng <huan.feng@starfivetech.com> ke.zhu <ke.zhu@starfivetech.com> yiming.li <yiming.li@starfivetech.com> jack.zhu <jack.zhu@starfivetech.com> Samin Guo <samin.guo@starfivetech.com> Chenjieqin <Jessica.Chen@starfivetech.com> bo.li <bo.li@starfivetech.com> Rearranged, cleanups, fixes, pins and resets added by Emil. Cleanups, fixes, clocks added by Geert. Cleanups and GPIO fixes from Drew. Thermal zone added by Stephen. PWM pins added by Jianlong. cpu-map added by Jonas. Signed-off-by: Emil Renner Berthing <kernel@esmil.dk> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Stephen L Arnold <nerdboy@gentoo.org> Signed-off-by: Drew Fustini <drew@beagleboard.org> Signed-off-by: Jianlong Huang <jianlong.huang@starfivetech.com> Signed-off-by: Jonas Hahnfeld <hahnjo@hahnjo.de>
1 parent 8bf3d21 commit 49eef29

File tree

6 files changed

+667
-1
lines changed

6 files changed

+667
-1
lines changed

arch/riscv/boot/dts/starfive/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# SPDX-License-Identifier: GPL-2.0
22
# Enables support for device-tree overlays
3+
DTC_FLAGS_jh7100-beaglev-starlight-a1 := -@
34
DTC_FLAGS_jh7100-beaglev-starlight := -@
45
DTC_FLAGS_jh7100-starfive-visionfive-v1 := -@
56
DTC_FLAGS_jh7110-starfive-visionfive-2-v1.2a := -@
67
DTC_FLAGS_jh7110-starfive-visionfive-2-v1.3b := -@
78

9+
dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-beaglev-starlight-a1.dtb
810
dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-beaglev-starlight.dtb
911
dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-starfive-visionfive-v1.dtb
1012

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// SPDX-License-Identifier: GPL-2.0 OR MIT
2+
/*
3+
* Copyright (C) 2021 Emil Renner Berthing <kernel@esmil.dk>
4+
*/
5+
6+
/dts-v1/;
7+
#include "jh7100-common.dtsi"
8+
#include <dt-bindings/gpio/gpio.h>
9+
10+
/ {
11+
model = "BeagleV Starlight Beta A1";
12+
compatible = "beagle,beaglev-starlight-jh7100-a1", "starfive,jh7100";
13+
14+
gpio-restart {
15+
compatible = "gpio-restart";
16+
gpios = <&gpio 63 GPIO_ACTIVE_HIGH>;
17+
priority = <224>;
18+
};
19+
};
20+
21+
&gpio {
22+
/* don't reset gpio mux for serial console and reset gpio */
23+
starfive,keep-gpiomux = <13 14 63>;
24+
};

arch/riscv/boot/dts/starfive/jh7100-beaglev-starlight.dts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
/dts-v1/;
88
#include "jh7100-common.dtsi"
9+
#include <dt-bindings/gpio/gpio.h>
910

1011
/ {
1112
model = "BeagleV Starlight Beta";
@@ -15,3 +16,8 @@
1516
&gmac {
1617
snps,reset-gpios = <&gpio 63 GPIO_ACTIVE_LOW>;
1718
};
19+
20+
&gpio {
21+
/* don't reset gpio mux for serial console on uart3 */
22+
starfive,keep-gpiomux = <13 14>;
23+
};

arch/riscv/boot/dts/starfive/jh7100-common.dtsi

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
mmc0 = &sdio0;
1616
mmc1 = &sdio1;
1717
serial0 = &uart3;
18+
serial1 = &uart0;
1819
};
1920

2021
chosen {
@@ -47,11 +48,41 @@
4748
#size-cells = <2>;
4849
ranges;
4950

51+
linux,cma {
52+
compatible = "shared-dma-pool";
53+
alloc-ranges = <0x0 0xa0000000 0x0 0x28000000>;
54+
size = <0x0 0x28000000>;
55+
alignment = <0x0 0x1000>;
56+
reusable;
57+
linux,cma-default;
58+
};
59+
60+
jpu_reserved: framebuffer@c9000000 {
61+
reg = <0x0 0xc9000000 0x0 0x4000000>;
62+
};
63+
64+
nvdla_reserved: framebuffer@d0000000 {
65+
reg = <0x0 0xd0000000 0x0 0x28000000>;
66+
no-map;
67+
};
68+
69+
vin_reserved: framebuffer@f9000000 {
70+
compatible = "shared-dma-pool";
71+
reg = <0x0 0xf9000000 0x0 0x1000000>;
72+
no-map;
73+
};
74+
5075
dma-reserved@fa000000 {
5176
reg = <0x0 0xfa000000 0x0 0x1000000>;
5277
no-map;
5378
};
5479

80+
sffb_reserved: framebuffer@fb000000 {
81+
compatible = "shared-dma-pool";
82+
reg = <0x0 0xfb000000 0x0 0x2000000>;
83+
no-map;
84+
};
85+
5586
linux,dma@107a000000 {
5687
compatible = "shared-dma-pool";
5788
reg = <0x10 0x7a000000 0x0 0x1000000>;
@@ -72,6 +103,44 @@
72103
};
73104
};
74105

106+
&display {
107+
memory-region = <&sffb_reserved>;
108+
status = "okay";
109+
};
110+
111+
&crtc {
112+
ddr-format = <4>; //<WIN_FMT_RGB565>;
113+
status = "okay";
114+
115+
port: port@0 {
116+
reg = <0>;
117+
118+
crtc_0_out: endpoint {
119+
remote-endpoint = <&hdmi_input0>;
120+
};
121+
};
122+
};
123+
124+
&encoder {
125+
encoder-type = <2>; // 2-TMDS, 3-LVDS, 6-DSI, 8-DPI
126+
status = "okay";
127+
128+
ports {
129+
port@0 {
130+
hdmi_out: endpoint {
131+
remote-endpoint = <&tda998x_0_input>;
132+
};
133+
};
134+
135+
port@1 {
136+
hdmi_input0: endpoint {
137+
remote-endpoint = <&crtc_0_out>;
138+
};
139+
};
140+
141+
};
142+
};
143+
75144
&gmac {
76145
pinctrl-names = "default";
77146
pinctrl-0 = <&gmac_pins>;
@@ -193,6 +262,20 @@
193262
};
194263
};
195264

265+
pwmdac_pins: pwmdac-0 {
266+
pwmdac-pins {
267+
pinmux = <GPIOMUX(23, GPO_PWMDAC_LEFT_OUT,
268+
GPO_ENABLE, GPI_NONE)>,
269+
<GPIOMUX(24, GPO_PWMDAC_RIGHT_OUT,
270+
GPO_ENABLE, GPI_NONE)>;
271+
bias-disable;
272+
drive-strength = <35>;
273+
input-disable;
274+
input-schmitt-disable;
275+
slew-rate = <0>;
276+
};
277+
};
278+
196279
pwm_pins: pwm-0 {
197280
pwm-pins {
198281
pinmux = <GPIOMUX(7,
@@ -283,6 +366,62 @@
283366
};
284367
};
285368

369+
spi2_pins: spi2-0 {
370+
mosi-pins {
371+
pinmux = <GPIOMUX(18, GPO_SPI2_PAD_TXD,
372+
GPO_ENABLE, GPI_NONE)>;
373+
bias-disable;
374+
input-disable;
375+
input-schmitt-disable;
376+
};
377+
miso-pins {
378+
pinmux = <GPIOMUX(16, GPO_LOW, GPO_DISABLE,
379+
GPI_SPI2_PAD_RXD)>;
380+
bias-pull-up;
381+
input-enable;
382+
input-schmitt-enable;
383+
};
384+
sck-pins {
385+
pinmux = <GPIOMUX(12, GPO_SPI2_PAD_SCK_OUT,
386+
GPO_ENABLE, GPI_NONE)>;
387+
bias-disable;
388+
input-disable;
389+
input-schmitt-disable;
390+
};
391+
ss-pins {
392+
pinmux = <GPIOMUX(15, GPO_SPI2_PAD_SS_0_N,
393+
GPO_ENABLE, GPI_NONE)>,
394+
<GPIOMUX(11, GPO_SPI2_PAD_SS_1_N,
395+
GPO_ENABLE, GPI_NONE)>;
396+
bias-disable;
397+
input-disable;
398+
input-schmitt-disable;
399+
};
400+
};
401+
402+
uart0_pins: uart0-0 {
403+
rx-pins {
404+
pinmux = <GPIOMUX(40, GPO_LOW, GPO_DISABLE,
405+
GPI_UART0_PAD_SIN)>,
406+
<GPIOMUX(39, GPO_LOW, GPO_DISABLE,
407+
GPI_UART0_PAD_CTSN)>;
408+
bias-pull-up;
409+
drive-strength = <14>;
410+
input-enable;
411+
input-schmitt-enable;
412+
};
413+
tx-pins {
414+
pinmux = <GPIOMUX(41, GPO_UART0_PAD_SOUT,
415+
GPO_ENABLE, GPI_NONE)>,
416+
<GPIOMUX(42, GPO_UART0_PAD_RTSN,
417+
GPO_ENABLE, GPI_NONE)>;
418+
bias-disable;
419+
drive-strength = <35>;
420+
input-disable;
421+
input-schmitt-disable;
422+
};
423+
};
424+
286425
uart3_pins: uart3-0 {
287426
rx-pins {
288427
pinmux = <GPIOMUX(13, GPO_LOW, GPO_DISABLE,
@@ -323,6 +462,17 @@
323462
regulators {
324463
};
325464
};
465+
466+
tda998x@70 {
467+
compatible = "nxp,tda998x";
468+
reg = <0x70>;
469+
470+
port {
471+
tda998x_0_input: endpoint {
472+
remote-endpoint = <&hdmi_out>;
473+
};
474+
};
475+
};
326476
};
327477

328478
&i2c1 {
@@ -359,6 +509,44 @@
359509
status = "okay";
360510
};
361511

512+
&pwmdac {
513+
pinctrl-names = "default";
514+
pinctrl-0 = <&pwmdac_pins>;
515+
status = "okay";
516+
};
517+
518+
&qspi {
519+
nor_flash: nor-flash@0 {
520+
compatible = "spi-flash";
521+
reg = <0>;
522+
spi-max-frequency = <31250000>;
523+
page-size = <256>;
524+
block-size = <16>;
525+
cdns,read-delay = <4>;
526+
cdns,tshsl-ns = <1>;
527+
cdns,tsd2d-ns = <1>;
528+
cdns,tchsh-ns = <1>;
529+
cdns,tslch-ns = <1>;
530+
spi-tx-bus-width = <1>;
531+
spi-rx-bus-width = <1>;
532+
};
533+
534+
nand_flash: nand-flash@1 {
535+
compatible = "spi-flash-nand";
536+
reg = <1>;
537+
spi-max-frequency = <31250000>;
538+
page-size = <2048>;
539+
block-size = <17>;
540+
cdns,read-delay = <4>;
541+
cdns,tshsl-ns = <1>;
542+
cdns,tsd2d-ns = <1>;
543+
cdns,tchsh-ns = <1>;
544+
cdns,tslch-ns = <1>;
545+
spi-tx-bus-width = <1>;
546+
spi-rx-bus-width = <1>;
547+
};
548+
};
549+
362550
&sdio0 {
363551
broken-cd;
364552
bus-width = <4>;
@@ -387,6 +575,24 @@
387575
};
388576
};
389577

578+
&spi2 {
579+
pinctrl-names = "default";
580+
pinctrl-0 = <&spi2_pins>;
581+
status = "okay";
582+
583+
spi_dev0: spi@0 {
584+
compatible = "rohm,dh2228fv";
585+
spi-max-frequency = <10000000>;
586+
reg = <0>;
587+
};
588+
};
589+
590+
&uart0 {
591+
pinctrl-names = "default";
592+
pinctrl-0 = <&uart0_pins>;
593+
status = "okay";
594+
};
595+
390596
&uart3 {
391597
pinctrl-names = "default";
392598
pinctrl-0 = <&uart3_pins>;

arch/riscv/boot/dts/starfive/jh7100-starfive-visionfive-v1.dts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,16 @@
3333
};
3434
};
3535
};
36+
37+
&gpio {
38+
/* don't reset gpio mux for serial console and reset gpio */
39+
starfive,keep-gpiomux = <13 14 63>;
40+
};
41+
42+
&i2c0 {
43+
eeprom@50 {
44+
compatible = "atmel,24c04";
45+
reg = <0x50>;
46+
pagesize = <16>;
47+
};
48+
};

0 commit comments

Comments
 (0)