Skip to content

Commit

Permalink
riscv: dts: starfive: Add full support for JH7110 and VisionFive 2 board
Browse files Browse the repository at this point in the history
Merge all StarFive dts patches together.

Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
  • Loading branch information
hal-feng committed Apr 11, 2023
1 parent cb79f61 commit fbd9d8b
Show file tree
Hide file tree
Showing 4 changed files with 725 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,16 @@
model = "StarFive VisionFive 2 v1.2A";
compatible = "starfive,visionfive-2-v1.2a", "starfive,jh7110";
};

&gmac1 {
phy-mode = "rmii";
assigned-clocks = <&syscrg JH7110_SYSCLK_GMAC1_TX>,
<&syscrg JH7110_SYSCLK_GMAC1_RX>;
assigned-clock-parents = <&syscrg JH7110_SYSCLK_GMAC1_RMII_RTX>,
<&syscrg JH7110_SYSCLK_GMAC1_RMII_RTX>;
};

&phy0 {
rx-internal-delay-ps = <1900>;
tx-internal-delay-ps = <1350>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,30 @@
model = "StarFive VisionFive 2 v1.3B";
compatible = "starfive,visionfive-2-v1.3b", "starfive,jh7110";
};

&gmac0 {
starfive,tx-use-rgmii-clk;
assigned-clocks = <&aoncrg JH7110_AONCLK_GMAC0_TX>;
assigned-clock-parents = <&aoncrg JH7110_AONCLK_GMAC0_RMII_RTX>;
};

&gmac1 {
starfive,tx-use-rgmii-clk;
assigned-clocks = <&syscrg JH7110_SYSCLK_GMAC1_TX>;
assigned-clock-parents = <&syscrg JH7110_SYSCLK_GMAC1_RMII_RTX>;
};

&phy0 {
motorcomm,tx-clk-adj-enabled;
motorcomm,tx-clk-100-inverted;
motorcomm,tx-clk-1000-inverted;
rx-internal-delay-ps = <1900>;
tx-internal-delay-ps = <1500>;
};

&phy1 {
motorcomm,tx-clk-adj-enabled;
motorcomm,tx-clk-100-inverted;
rx-internal-delay-ps = <0>;
tx-internal-delay-ps = <0>;
};
178 changes: 178 additions & 0 deletions arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/ {
aliases {
ethernet0 = &gmac0;
ethernet1 = &gmac1;
i2c0 = &i2c0;
i2c2 = &i2c2;
i2c5 = &i2c5;
Expand All @@ -31,13 +33,45 @@
reg = <0x0 0x40000000 0x1 0x0>;
};

thermal-zones {
cpu-thermal {
polling-delay-passive = <250>;
polling-delay = <15000>;

thermal-sensors = <&sfctemp>;

cooling-maps {
};

trips {
cpu_alert0: cpu_alert0 {
/* milliCelsius */
temperature = <75000>;
hysteresis = <2000>;
type = "passive";
};

cpu_crit: cpu_crit {
/* milliCelsius */
temperature = <90000>;
hysteresis = <2000>;
type = "critical";
};
};
};
};

gpio-restart {
compatible = "gpio-restart";
gpios = <&sysgpio 35 GPIO_ACTIVE_HIGH>;
priority = <224>;
};
};

&dvp_clk {
clock-frequency = <74250000>;
};

&gmac0_rgmii_rxin {
clock-frequency = <125000000>;
};
Expand All @@ -54,6 +88,10 @@
clock-frequency = <50000000>;
};

&hdmitx0_pixelclk {
clock-frequency = <297000000>;
};

&i2srx_bclk_ext {
clock-frequency = <12288000>;
};
Expand Down Expand Up @@ -86,6 +124,38 @@
clock-frequency = <49152000>;
};

&gmac0 {
phy-handle = <&phy0>;
phy-mode = "rgmii-id";
status = "okay";

mdio {
#address-cells = <1>;
#size-cells = <0>;
compatible = "snps,dwmac-mdio";

phy0: ethernet-phy@0 {
reg = <0>;
};
};
};

&gmac1 {
phy-handle = <&phy1>;
phy-mode = "rgmii-id";
status = "okay";

mdio {
#address-cells = <1>;
#size-cells = <0>;
compatible = "snps,dwmac-mdio";

phy1: ethernet-phy@1 {
reg = <0>;
};
};
};

&i2c0 {
clock-frequency = <100000>;
i2c-sda-hold-time-ns = <300>;
Expand Down Expand Up @@ -126,6 +196,49 @@
status = "okay";
};

&mmc0 {
max-frequency = <100000000>;
bus-width = <8>;
cap-mmc-highspeed;
mmc-ddr-1_8v;
mmc-hs200-1_8v;
non-removable;
cap-mmc-hw-reset;
post-power-on-delay-ms = <200>;
status = "okay";
};

&mmc1 {
max-frequency = <100000000>;
bus-width = <4>;
no-sdio;
no-mmc;
broken-cd;
cap-sd-highspeed;
post-power-on-delay-ms = <200>;
status = "okay";
};

&pcie0 {
pinctrl-names = "default";
reset-gpios = <&sysgpio 26 GPIO_ACTIVE_LOW>;
phys = <&pciephy0>;
status = "okay";
};

&pcie1 {
pinctrl-names = "default";
reset-gpios = <&sysgpio 28 GPIO_ACTIVE_LOW>;
phys = <&pciephy1>;
status = "okay";
};

&ptc {
pinctrl-names = "default";
pinctrl-0 = <&pwm_pins>;
status = "okay";
};

&sysgpio {
i2c0_pins: i2c0-0 {
i2c-pins {
Expand Down Expand Up @@ -183,6 +296,64 @@
};
};

pcie0_wake_default: pcie0_wake_default {
wake-pins {
pinmux = <GPIOMUX(32, GPOUT_HIGH, GPOEN_ENABLE, GPI_NONE)>;
bias-disable;
drive-strength = <2>;
input-enable;
input-schmitt-disable;
slew-rate = <0>;
};
};

pcie0_clkreq_default: pcie0_clkreq_default {
clkreq-pins {
bias-disable;
pinmux = <GPIOMUX(27, GPOUT_HIGH, GPOEN_ENABLE, GPI_NONE)>;
drive-strength = <2>;
input-enable;
input-schmitt-disable;
slew-rate = <0>;
};
};

pcie1_wake_default: pcie1_wake_default {
wake-pins {
bias-disable;
pinmux = <GPIOMUX(21, GPOUT_HIGH, GPOEN_ENABLE, GPI_NONE)>;
drive-strength = <2>;
input-enable;
input-schmitt-disable;
slew-rate = <0>;
};
};

pcie1_clkreq_default: pcie1_clkreq_default {
clkreq-pins {
bias-disable;
pinmux = <GPIOMUX(29, GPOUT_HIGH, GPOEN_ENABLE, GPI_NONE)>;
drive-strength = <2>;
input-enable;
input-schmitt-disable;
slew-rate = <0>;
};
};

pwm_pins: pwm-0 {
pwm-pins {
pinmux = <GPIOMUX(46, GPOUT_SYS_PWM_CHANNEL0,
GPOEN_SYS_PWM0_CHANNEL0, GPI_NONE)>,
<GPIOMUX(59, GPOUT_SYS_PWM_CHANNEL1,
GPOEN_SYS_PWM0_CHANNEL1, GPI_NONE)>;
bias-disable;
drive-strength = <12>;
input-disable;
input-schmitt-disable;
slew-rate = <0>;
};
};

uart0_pins: uart0-0 {
tx-pins {
pinmux = <GPIOMUX(5, GPOUT_SYS_UART0_TX,
Expand Down Expand Up @@ -213,3 +384,10 @@
pinctrl-0 = <&uart0_pins>;
status = "okay";
};

&usb0 {
status = "okay";
usbdrd_cdns3: usb@0 {
dr_mode = "peripheral";
};
};
Loading

0 comments on commit fbd9d8b

Please sign in to comment.