Skip to content

Commit 87ee2c0

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 a3c6a7a commit 87ee2c0

File tree

6 files changed

+732
-1
lines changed

6 files changed

+732
-1
lines changed

arch/riscv/boot/dts/starfive/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# SPDX-License-Identifier: GPL-2.0
2+
dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-beaglev-starlight-a1.dtb
23
dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-beaglev-starlight.dtb
34
dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-starfive-visionfive-v1.dtb
45

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
};
25+
26+
&mdio {
27+
phy: ethernet-phy@7 {
28+
reg = <7>;
29+
};
30+
};

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";
@@ -16,6 +17,11 @@
1617
snps,reset-gpios = <&gpio 63 GPIO_ACTIVE_LOW>;
1718
};
1819

20+
&gpio {
21+
/* don't reset gpio mux for serial console on uart3 */
22+
starfive,keep-gpiomux = <13 14>;
23+
};
24+
1925
&mdio {
2026
phy: ethernet-phy@7 {
2127
reg = <7>;

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

Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212

1313
/ {
1414
aliases {
15+
mmc0 = &sdio0;
16+
mmc1 = &sdio1;
1517
serial0 = &uart3;
18+
serial1 = &uart0;
1619
};
1720

1821
chosen {
@@ -45,11 +48,41 @@
4548
#size-cells = <2>;
4649
ranges;
4750

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+
4875
dma-reserved {
4976
reg = <0x0 0xfa000000 0x0 0x1000000>;
5077
no-map;
5178
};
5279

80+
sffb_reserved: framebuffer@fb000000 {
81+
compatible = "shared-dma-pool";
82+
reg = <0x0 0xfb000000 0x0 0x2000000>;
83+
no-map;
84+
};
85+
5386
linux,dma {
5487
compatible = "shared-dma-pool";
5588
reg = <0x10 0x7a000000 0x0 0x1000000>;
@@ -63,6 +96,49 @@
6396
<0x00 0xfa000000 0x10 0x7a000000 0x00 0x01000000>,
6497
<0x00 0xfb000000 0x00 0xfb000000 0x07 0x85000000>;
6598
};
99+
100+
wifi_pwrseq: wifi-pwrseq {
101+
compatible = "mmc-pwrseq-simple";
102+
reset-gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
103+
};
104+
};
105+
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+
};
66142
};
67143

68144
&gmac {
@@ -194,6 +270,38 @@
194270
};
195271
};
196272

273+
pwmdac_pins: pwmdac-0 {
274+
pwmdac-pins {
275+
pinmux = <GPIOMUX(23, GPO_PWMDAC_LEFT_OUT,
276+
GPO_ENABLE, GPI_NONE)>,
277+
<GPIOMUX(24, GPO_PWMDAC_RIGHT_OUT,
278+
GPO_ENABLE, GPI_NONE)>;
279+
bias-disable;
280+
drive-strength = <35>;
281+
input-disable;
282+
input-schmitt-disable;
283+
slew-rate = <0>;
284+
};
285+
};
286+
287+
pwm_pins: pwm-0 {
288+
pwm-pins {
289+
pinmux = <GPIOMUX(7,
290+
GPO_PWM_PAD_OUT_BIT0,
291+
GPO_PWM_PAD_OE_N_BIT0,
292+
GPI_NONE)>,
293+
<GPIOMUX(5,
294+
GPO_PWM_PAD_OUT_BIT1,
295+
GPO_PWM_PAD_OE_N_BIT1,
296+
GPI_NONE)>;
297+
bias-disable;
298+
drive-strength = <35>;
299+
input-disable;
300+
input-schmitt-disable;
301+
slew-rate = <0>;
302+
};
303+
};
304+
197305
sdio0_pins: sdio0-0 {
198306
clk-pins {
199307
pinmux = <GPIOMUX(54, GPO_SDIO0_PAD_CCLK_OUT,
@@ -266,6 +374,62 @@
266374
};
267375
};
268376

377+
spi2_pins: spi2-0 {
378+
mosi-pins {
379+
pinmux = <GPIOMUX(18, GPO_SPI2_PAD_TXD,
380+
GPO_ENABLE, GPI_NONE)>;
381+
bias-disable;
382+
input-disable;
383+
input-schmitt-disable;
384+
};
385+
miso-pins {
386+
pinmux = <GPIOMUX(16, GPO_LOW, GPO_DISABLE,
387+
GPI_SPI2_PAD_RXD)>;
388+
bias-pull-up;
389+
input-enable;
390+
input-schmitt-enable;
391+
};
392+
sck-pins {
393+
pinmux = <GPIOMUX(12, GPO_SPI2_PAD_SCK_OUT,
394+
GPO_ENABLE, GPI_NONE)>;
395+
bias-disable;
396+
input-disable;
397+
input-schmitt-disable;
398+
};
399+
ss-pins {
400+
pinmux = <GPIOMUX(15, GPO_SPI2_PAD_SS_0_N,
401+
GPO_ENABLE, GPI_NONE)>,
402+
<GPIOMUX(11, GPO_SPI2_PAD_SS_1_N,
403+
GPO_ENABLE, GPI_NONE)>;
404+
bias-disable;
405+
input-disable;
406+
input-schmitt-disable;
407+
};
408+
};
409+
410+
uart0_pins: uart0-0 {
411+
rx-pins {
412+
pinmux = <GPIOMUX(40, GPO_LOW, GPO_DISABLE,
413+
GPI_UART0_PAD_SIN)>,
414+
<GPIOMUX(39, GPO_LOW, GPO_DISABLE,
415+
GPI_UART0_PAD_CTSN)>;
416+
bias-pull-up;
417+
drive-strength = <14>;
418+
input-enable;
419+
input-schmitt-enable;
420+
};
421+
tx-pins {
422+
pinmux = <GPIOMUX(41, GPO_UART0_PAD_SOUT,
423+
GPO_ENABLE, GPI_NONE)>,
424+
<GPIOMUX(42, GPO_UART0_PAD_RTSN,
425+
GPO_ENABLE, GPI_NONE)>;
426+
bias-disable;
427+
drive-strength = <35>;
428+
input-disable;
429+
input-schmitt-disable;
430+
};
431+
};
432+
269433
uart3_pins: uart3-0 {
270434
rx-pins {
271435
pinmux = <GPIOMUX(13, GPO_LOW, GPO_DISABLE,
@@ -306,6 +470,17 @@
306470
regulators {
307471
};
308472
};
473+
474+
tda998x@70 {
475+
compatible = "nxp,tda998x";
476+
reg = <0x70>;
477+
478+
port {
479+
tda998x_0_input: endpoint {
480+
remote-endpoint = <&hdmi_out>;
481+
};
482+
};
483+
};
309484
};
310485

311486
&i2c1 {
@@ -336,6 +511,50 @@
336511
clock-frequency = <27000000>;
337512
};
338513

514+
&ptc {
515+
pinctrl-names = "default";
516+
pinctrl-0 = <&pwm_pins>;
517+
status = "okay";
518+
};
519+
520+
&pwmdac {
521+
pinctrl-names = "default";
522+
pinctrl-0 = <&pwmdac_pins>;
523+
status = "okay";
524+
};
525+
526+
&qspi {
527+
nor_flash: nor-flash@0 {
528+
compatible = "spi-flash";
529+
reg = <0>;
530+
spi-max-frequency = <31250000>;
531+
page-size = <256>;
532+
block-size = <16>;
533+
cdns,read-delay = <4>;
534+
cdns,tshsl-ns = <1>;
535+
cdns,tsd2d-ns = <1>;
536+
cdns,tchsh-ns = <1>;
537+
cdns,tslch-ns = <1>;
538+
spi-tx-bus-width = <1>;
539+
spi-rx-bus-width = <1>;
540+
};
541+
542+
nand_flash: nand-flash@1 {
543+
compatible = "spi-flash-nand";
544+
reg = <1>;
545+
spi-max-frequency = <31250000>;
546+
page-size = <2048>;
547+
block-size = <17>;
548+
cdns,read-delay = <4>;
549+
cdns,tshsl-ns = <1>;
550+
cdns,tsd2d-ns = <1>;
551+
cdns,tchsh-ns = <1>;
552+
cdns,tslch-ns = <1>;
553+
spi-tx-bus-width = <1>;
554+
spi-rx-bus-width = <1>;
555+
};
556+
};
557+
339558
&sdio0 {
340559
broken-cd;
341560
bus-width = <4>;
@@ -345,6 +564,43 @@
345564
status = "okay";
346565
};
347566

567+
&sdio1 {
568+
#address-cells = <1>;
569+
#size-cells = <0>;
570+
bus-width = <4>;
571+
cap-sd-highspeed;
572+
cap-sdio-irq;
573+
cap-power-off-card;
574+
mmc-pwrseq = <&wifi_pwrseq>;
575+
non-removable;
576+
pinctrl-names = "default";
577+
pinctrl-0 = <&sdio1_pins>;
578+
status = "okay";
579+
580+
wifi@1 {
581+
compatible = "brcm,bcm4329-fmac";
582+
reg = <1>;
583+
};
584+
};
585+
586+
&spi2 {
587+
pinctrl-names = "default";
588+
pinctrl-0 = <&spi2_pins>;
589+
status = "okay";
590+
591+
spi_dev0: spi@0 {
592+
compatible = "rohm,dh2228fv";
593+
spi-max-frequency = <10000000>;
594+
reg = <0>;
595+
};
596+
};
597+
598+
&uart0 {
599+
pinctrl-names = "default";
600+
pinctrl-0 = <&uart0_pins>;
601+
status = "okay";
602+
};
603+
348604
&uart3 {
349605
pinctrl-names = "default";
350606
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
@@ -19,6 +19,19 @@
1919
};
2020
};
2121

22+
&gpio {
23+
/* don't reset gpio mux for serial console and reset gpio */
24+
starfive,keep-gpiomux = <13 14 63>;
25+
};
26+
27+
&i2c0 {
28+
eeprom@50 {
29+
compatible = "atmel,24c04";
30+
reg = <0x50>;
31+
pagesize = <16>;
32+
};
33+
};
34+
2235
&mdio {
2336
phy: ethernet-phy@0 {
2437
reg = <0>;

0 commit comments

Comments
 (0)