summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcarter.li <carter.li@starfivetech.com>2023-07-27 10:42:41 +0300
committercarter.li <carter.li@starfivetech.com>2023-08-14 06:26:28 +0300
commit09ec182c762d3154a106d1184b1e48e86f39a30f (patch)
tree6a371b38ee2fef5fca4e15083d97004008a543b7
parent6c1e7bd497f3a3a90da06b3b80e97b3ff109e51c (diff)
downloadlinux-09ec182c762d3154a106d1184b1e48e86f39a30f.tar.xz
riscv: dts: starfive: add sof dsp node for hifi4
init sof_wm8960.dtsi, add sof_dsp node for sof hifi4. Signed-off-by: carter.li <carter.li@starfivetech.com>
-rw-r--r--arch/riscv/boot/dts/starfive/Makefile1
-rw-r--r--arch/riscv/boot/dts/starfive/codecs/sof_wm8960.dtsi84
-rwxr-xr-xarch/riscv/boot/dts/starfive/jh7110-common.dtsi13
-rw-r--r--arch/riscv/boot/dts/starfive/jh7110-visionfive-v2-sof-wm8960.dts36
-rw-r--r--arch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dts40
-rwxr-xr-xarch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dtsi16
-rwxr-xr-xarch/riscv/boot/dts/starfive/jh7110.dtsi14
7 files changed, 177 insertions, 27 deletions
diff --git a/arch/riscv/boot/dts/starfive/Makefile b/arch/riscv/boot/dts/starfive/Makefile
index 93fd8db63f47..9919dcdb9839 100644
--- a/arch/riscv/boot/dts/starfive/Makefile
+++ b/arch/riscv/boot/dts/starfive/Makefile
@@ -15,4 +15,5 @@ dtb-$(CONFIG_SOC_STARFIVE_JH7110) += jh7110-visionfive-v2.dtb \
jh7110-visionfive-v2-A10.dtb \
jh7110-visionfive-v2-A11.dtb \
jh7110-visionfive-v2-wm8960.dtb \
+ jh7110-visionfive-v2-sof-wm8960.dtb \
jh7110-visionfive-v2-ac108.dtb
diff --git a/arch/riscv/boot/dts/starfive/codecs/sof_wm8960.dtsi b/arch/riscv/boot/dts/starfive/codecs/sof_wm8960.dtsi
new file mode 100644
index 000000000000..8295b3918533
--- /dev/null
+++ b/arch/riscv/boot/dts/starfive/codecs/sof_wm8960.dtsi
@@ -0,0 +1,84 @@
+&sound6 {
+ /* sof + wm8960 */
+ simple-audio-card,dai-link@0 {
+ reg = <0>;
+ format = "dsp_a";
+ bitclock-master = <&sndcodec1>;
+ frame-master = <&sndcodec1>;
+
+ widgets = "Microphone", "Mic Jack",
+ "Line", "Line In",
+ "Line", "Line Out",
+ "Speaker", "Speaker",
+ "Headphone", "Headphone Jack";
+ 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",
+ "Playback", "SSP0.OUT",
+ "SSP0.IN", "Capture";
+
+ cpu {
+ sound-dai = <&sof_tdm>;
+ };
+
+ plat {
+ sound-dai = <&sof_dsp>;
+ };
+
+ sndcodec1:codec {
+ sound-dai = <&wm8960>;
+ clocks = <&wm8960_mclk>;
+ clock-names = "mclk";
+ };
+ };
+};
+
+&soc {
+ sof_tdm: sof-tdm@0 {
+ compatible = "starfive,jh7110-sof-dai";
+ reg = <0x0 0x10090000 0x0 0x1000>;
+ reg-names = "tdm";
+ clocks = <&clkgen JH7110_TDM_CLK_AHB>,
+ <&clkgen JH7110_TDM_CLK_APB>,
+ <&clkgen JH7110_TDM_INTERNAL>,
+ <&tdm_ext>,
+ <&clkgen JH7110_TDM_CLK_TDM>,
+ <&clkgen JH7110_MCLK_INNER>;
+ clock-names = "clk_tdm_ahb", "clk_tdm_apb",
+ "clk_tdm_internal", "clk_tdm_ext",
+ "clk_tdm", "mclk_inner";
+ resets = <&rstgen RSTN_U0_TDM16SLOT_AHB>,
+ <&rstgen RSTN_U0_TDM16SLOT_APB>,
+ <&rstgen RSTN_U0_TDM16SLOT_TDM>;
+ reset-names = "tdm_ahb", "tdm_apb", "tdm_rst";
+ #sound-dai-cells = <0>;
+ status = "disabled";
+ };
+};
+
+
+&sof_dsp {
+ #sound-dai-cells = <0>;
+ compatible = "starfive,vf2-dsp-v1";
+ firmware-name = "sof-vf2.ri";
+ tplg-name = "sof-vf2-wm8960.tplg";
+ machine-drv-name = "asoc-simple-card";
+ status = "disabled";
+};
+
+&dma {
+ dma-channels = <2>;
+ snps,priority = <0 1>;
+ snps,block-size = <65536 65536>;
+};
+
+&sof_tdm {
+ pinctrl-names = "default";
+ pinctrl-0 = <&tdm0_pins>;
+ status = "disabled";
+}; \ No newline at end of file
diff --git a/arch/riscv/boot/dts/starfive/jh7110-common.dtsi b/arch/riscv/boot/dts/starfive/jh7110-common.dtsi
index 987fbba5a587..054997b44290 100755
--- a/arch/riscv/boot/dts/starfive/jh7110-common.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7110-common.dtsi
@@ -62,11 +62,8 @@
reg = <0x0 0x6ce00000 0x0 0x1600000>;
};
- xrp_reserved: xrpbuffer@f0000000 {
- reg = <0x0 0x69c00000 0x0 0x01ffffff
- 0x0 0x6bc00000 0x0 0x00001000
- 0x0 0x6bc01000 0x0 0x00fff000
- 0x0 0x6cc00000 0x0 0x00001000>;
+ hifi4_reserved: hifi4@f0000000 {
+ reg = <0x0 0x69c00000 0x0 0x03001000>;
};
};
@@ -751,7 +748,7 @@
status = "disabled";
};
-&xrp {
- memory-region = <&xrp_reserved>;
- status = "okay";
+&sof_dsp {
+ memory-region = <&hifi4_reserved>;
+ status = "disabled";
};
diff --git a/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2-sof-wm8960.dts b/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2-sof-wm8960.dts
new file mode 100644
index 000000000000..8be56ab74e3b
--- /dev/null
+++ b/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2-sof-wm8960.dts
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0 OR MIT
+/*
+ * Copyright (C) 2022 StarFive Technology Co., Ltd.
+ * Copyright (C) 2022 Hal Feng <hal.feng@starfivetech.com>
+ */
+
+/dts-v1/;
+#include "jh7110-visionfive-v2.dts"
+#include "codecs/sof_wm8960.dtsi"
+
+&i2c0 {
+ status = "okay";
+ wm8960: codec@1a {
+ compatible = "wlf,wm8960";
+ reg = <0x1a>;
+ #sound-dai-cells = <0>;
+
+ wlf,shared-lrclk;
+ };
+};
+
+&pdm {
+ status = "disabled";
+};
+
+&mailbox_client0 {
+ status = "disabled";
+};
+
+&sof_tdm {
+ status = "okay";
+};
+
+&sof_dsp {
+ status = "okay";
+}; \ No newline at end of file
diff --git a/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dts b/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dts
index 9e4563355cc4..2cdf93d849d6 100644
--- a/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dts
+++ b/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dts
@@ -212,6 +212,40 @@
starfive,pin-gpio-doen = <OEN_HIGH>;
};
};
+
+ tdm0_pins: tdm0-pins {
+ tdm0-pins-tx {
+ starfive,pins = <PAD_GPIO44>;
+ starfive,pinmux = <PAD_GPIO44_FUNC_SEL 0>;
+ starfive,pin-ioconfig = <IO(GPIO_IE(1))>;
+ starfive,pin-gpio-dout = <GPO_TDM0_PCM_TXD>;
+ starfive,pin-gpio-doen = <OEN_LOW>;
+ };
+
+ tdm0-pins-rx {
+ starfive,pins = <PAD_GPIO61>;
+ starfive,pinmux = <PAD_GPIO61_FUNC_SEL 0>;
+ starfive,pin-ioconfig = <IO(GPIO_IE(1))>;
+ starfive,pin-gpio-doen = <OEN_HIGH>;
+ starfive,pin-gpio-din = <GPI_TDM0_PCM_RXD>;
+ };
+
+ tdm0-pins-sync {
+ starfive,pins = <PAD_GPIO63>;
+ starfive,pinmux = <PAD_GPIO63_FUNC_SEL 0>;
+ starfive,pin-ioconfig = <IO(GPIO_IE(1))>;
+ starfive,pin-gpio-doen = <OEN_HIGH>;
+ starfive,pin-gpio-din = <GPI_TDM0_PCM_SYNCIN>;
+ };
+
+ tdm0-pins-pcmclk {
+ starfive,pins = <PAD_GPIO38>;
+ starfive,pinmux = <PAD_GPIO38_FUNC_SEL 0>;
+ starfive,pin-ioconfig = <IO(GPIO_IE(1))>;
+ starfive,pin-gpio-doen = <OEN_HIGH>;
+ starfive,pin-gpio-din = <GPI_TDM0_CLK_SLV>;
+ };
+ };
};
&uart0 {
@@ -257,3 +291,9 @@
clocks = <&clkgen JH7110_CPU_CORE>;
clock-names = "cpu";
};
+
+&tdm {
+ pinctrl-names = "default";
+ pinctrl-0 = <&tdm0_pins>;
+ status = "disabled";
+};
diff --git a/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dtsi
index fbaa2bf0b060..6f26806c0599 100755
--- a/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7110-visionfive-v2.dtsi
@@ -67,11 +67,8 @@
reg = <0x0 0x6ce00000 0x0 0x1600000>;
};
- xrp_reserved: xrpbuffer@f0000000 {
- reg = <0x0 0x69c00000 0x0 0x01ffffff
- 0x0 0x6bc00000 0x0 0x00001000
- 0x0 0x6bc01000 0x0 0x00fff000
- 0x0 0x6cc00000 0x0 0x00001000>;
+ hifi4_reserved: hifi4@f0000000 {
+ reg = <0x0 0x69c00000 0x0 0x03001000>;
};
};
@@ -911,13 +908,12 @@
status = "okay";
};
-&xrp {
- memory-region = <&xrp_reserved>;
- status = "okay";
-};
-
&ptc {
pinctrl-names = "default";
pinctrl-0 = <&pwm_pins>;
status = "okay";
};
+
+&sof_dsp {
+ memory-region = <&hifi4_reserved>;
+};
diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
index 96a6af93134f..1998e00fe8de 100755
--- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
@@ -1831,25 +1831,21 @@
dsp@0 {};
};
- xrp: xrp@0 {
- compatible = "cdns,xrp";
+ sof_dsp: sof_dsp@0 {
+ compatible = "starfive,vf2-dsp-v1";
dma-coherent;
- reg = <0x0 0x10230000 0x0 0x00010000
- 0x0 0x10240000 0x0 0x00010000>;
+ reg = <0x0 0x20020000 0x0 0x10000>;
clocks = <&clkgen JH7110_HIFI4_CLK_CORE>;
clock-names = "core_clk";
resets = <&rstgen RSTN_U0_HIFI4_CORE>,
<&rstgen RSTN_U0_HIFI4_AXI>;
reset-names = "rst_core","rst_axi";
starfive,stg-syscon = <&stg_syscon>;
- firmware-name = "hifi4_elf";
+ mbox-names = "tx", "rx";
+ mboxes = <&mailbox_contrl0 0 1>,<&mailbox_contrl0 1 0>;
#address-cells = <1>;
#size-cells = <1>;
- ranges = <0x40000000 0x0 0x20000000 0x040000
- 0x69c00000 0x0 0x69c00000 0x03000000>;
status = "disabled";
- dsp@0 {
- };
};
starfive_cpufreq: starfive,jh7110-cpufreq {