本帖最后由 ぉ沙皮狗的忧伤 于 2020-3-18 15:44 编辑
1、在内核中添加ADAU1761工具以及修改配置
(1)在内核中添加ADAU1761工具alsa工具
#make menuconfig
Device Drivers --->
<*> Sound card support --->
<*>Advanced Linux Sound Architecture --->
<*>ALSA for SoC audio support --->
--- ALSA for SoC audio support
<*> Audio support for Analog Devices reference designs
<*> AXI-I2S support
<*> AXI-SPDIF support
< > AMD Audio Coprocessor support
< > SoC Audio for the Atmel System-on-Chip
< > Synopsys I2S Device Driver
SoC Audio for Freescale CPUs --->
< > Hisilicon I2S controller
[ ] Audio support for Imagination Technologies designs
STMicroelectronics STM32 SOC audio support
< > Audio support for the the Xilinx DisplayPor
<*> Audio support for the the Xilinx audio formatter
<*> Audio support for the the Xilinx I2S
< > XTFPGA I2S master
< > ZTE ZX TDM Driver Support
CODEC drivers --->
<*> Analog Devices AU1761 CODEC - I2C
<*> ASoC Simple sound card support
< > ASoC Simple SCU sound card support
< > ASoC Audio Graph sound card support
< > ASoC Audio Graph SCU sound card support
(2)将内核目录下firmware用附件中的文件替换,并修改.config文件
CONFIG_EXTRA_FIRMWARE="adau1761.bin"
CONFIG_EXTRA_FIRMWARE_DIR="./firmware"
注:firmware目录下的文件好像是alsa配置文件,从zed内核中抠出来的
(3)修改.config,根据zynq_1761.dtsi中compatible中的名称在.config中查看是否配置,未配置则配置一下
注:①、修改.config就是make menuconfig配置内核,添加相应模块
②、因为zynq_1761.dtsi文件是描述vivado工程下面一些ip核硬件信息,而在.config中添加相应的代码相当于给设备添加驱动,
下面是我在我的.config中添加的,自己要去对照着zynq_1761.dtsi去修改
CONFIG_COMMON_CLK_AXI_CLKGEN=y
CONFIG_SND_SIMPLE_CARD=y
CONFIG_SND_SIMPLE_SCU_CARD=y
make all
make uImage
将arch/arm/boot/uImage拷到SD卡中
2、修改设备树
(1)、在arch/arm/boot/dts/zynq-myc-c7z020.dts设备树中i2c节点下添加子节点
&i2c0 {
status = "okay";
clock-frequency = <400000>;
xlnx,has-interrupt = <0x1>;
ds1307: ds1307@68 {
compatible = "dallas,ds1307";
reg = <0x68>;
#clock-cells = <1>;
};
adau1761: adau1761@3b {
compatible = "adi,adau1761";
reg = <0x3b>;
clocks = <&audio_clock>;
clock-names = "mclk";
#sound-dai-cells = <0>;
};
};
(2)、在zynq-1761.dtsi文件中添加以下代码
/ {
amba_pl: amba_pl {
compatible = "simple-bus";
#address-cells = <0x1>;
#size-cells = <0x1>;
ranges;
axi_i2s_0: axi-i2s@77600000 {
compatible = "adi,axi-i2s-1.00.a";
reg = <0x77600000 0x1000>;
dmas = <&dmac_s 1 &dmac_s 2>;
dma-names = "tx", "rx";
clocks = <&clkc 15>, <&audio_clock>;
clock-names = "axi", "ref";
#sound-dai-cells = <0>;
};
axi_sysid_0: axi-sysid-0@45000000 {
compatible = "adi,axi-sysid-1.00.a";
reg = <0x45000000 0x10000>;
};
};
hdmi_clock: axi-clkgen@79000000 {
compatible = "adi,axi-clkgen-2.00.a";
reg = <0x79000000 0x10000>;
#clock-cells = <0>;
clocks = <&clkc 16>;
};
audio_clock: audio_clock {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <12288000>;
//clock-frequency = <24576000>;
};
zed_sound {
compatible = "simple-audio-card";
simple-audio-card,name = "ZED ADAU1761";
simple-audio-card,widgets =
"Microphone", "Mic In",
"Headphone", "Headphone Out",
"Line", "Line In",
"Line", "Line Out";
simple-audio-card,routing =
"Line Out", "LOUT",
"Line Out", "ROUT",
"Headphone Out", "LHP",
"Headphone Out", "RHP",
"Mic In", "MICBIAS",
"LINN", "Mic In",
"RINN", "Mic In",
"LAUX", "Line In",
"RAUX", "Line In";
simple-audio-card,dai-link@0 {
format = "i2s";
cpu {
sound-dai = <&axi_i2s_0>;
frame-master;
bitclock-master;
};
codec {
sound-dai = <&adau1761>;
};
};
};
};
make all
make dts
将arch/arm/boot/dts中的system-top.dtb.dtb拷贝到SD卡中
|
|