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 25, 2023
1 parent 0f353a0 commit 65d92d0
Show file tree
Hide file tree
Showing 6 changed files with 923 additions and 2 deletions.
1 change: 1 addition & 0 deletions arch/riscv/boot/dts/starfive/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-starfive-visionfive-v1.dtb

dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.2a.dtb
dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.3b.dtb
dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-audio-card.dtb
67 changes: 67 additions & 0 deletions arch/riscv/boot/dts/starfive/jh7110-starfive-audio-card.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// SPDX-License-Identifier: GPL-2.0 OR MIT
/*
* Device Tree for JH7110 + Simple Audio Card
*
* Copyright (C) 2023 StarFive Technology Co., Ltd.
*/

/dts-v1/;
#include "jh7110-starfive-visionfive-2-v1.3b.dts"

/ {
model = "StarFive VisionFive 2 Audio Board";
compatible = "starfive,visionfive-2-audio", "starfive,jh7110";

wm8960_mclk: wm8960-mclk {
compatible = "fixed-clock";
clock-output-names = "wm8960_mclk";
#clock-cells = <0>;
clock-frequency = <24576000>;
};

sound {
compatible = "simple-audio-card";

#address-cells = <1>;
#size-cells = <0>;

simple-audio-card,name = "Starfive-TDM-Sound-Card";
simple-audio-card,widgets = "Microphone", "Mic Jack",
"Line", "Line In",
"Line", "Line Out",
"Speaker", "Speaker",
"Headphone", "Headphone Jack";
simple-audio-card,routing = "Headphone Jack", "HP_L",
"Headphone Jack", "HP_R",
"Speaker", "SPK_LP",
"Speaker", "SPK_LN",
"LINPUT1", "Mic Jack",
"LINPUT3", "Mic Jack",
"RINPUT1", "Mic Jack",
"RINPUT2", "Mic Jack";

simple-audio-card,dai-link@0 {
reg = <0>;
format = "dsp_a";
bitclock-master = <&dailink_master>;
frame-master = <&dailink_master>;

cpu {
sound-dai = <&tdm>;
};
dailink_master: codec {
sound-dai = <&wm8960>;
clocks = <&wm8960_mclk>;
};
};
};
};

&i2c0 {
wm8960: codec@1a {
compatible = "wlf,wm8960";
reg = <0x1a>;
wlf,shared-lrclk;
#sound-dai-cells = <0>;
};
};
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>;
};
Loading

0 comments on commit 65d92d0

Please sign in to comment.