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>
This commit is contained in:
carter.li 2023-07-27 15:42:41 +08:00 committed by Justin Hammond
parent 6f8c60494d
commit db0d7d7883
7 changed files with 179 additions and 28 deletions

View file

@ -17,4 +17,6 @@ dtb-$(CONFIG_SOC_STARFIVE_JH7110) += jh7110-visionfive-v2.dtb \
jh7110-visionfive-v2-wm8960.dtb \
jh7110-visionfive-v2-ac108.dtb \
jh7110-pine64-star64.dtb \
jh7110-pine64-pinetabv.dtb
jh7110-pine64-pinetabv.dtb \
jh7110-visionfive-v2-sof-wm8960.dtb \
jh7110-visionfive-v2-ac108.dtb

View file

@ -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";
};

View file

@ -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";
};

View file

@ -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";
};

View file

@ -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";
};

View file

@ -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>;
};

View file

@ -1838,25 +1838,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 {