Hi,
We are trying to port Linux to our customer board which is based on AM3352. The MCASP0 of the SOC is interfaced to an audio codec, TFA9879.
Please refer to Audio_Codec_Schematics.png for the connection details. We have configured the MCASP as master and audio codec as slave in the DTS files. The drivers got integrated successfully and the sound card is detected under /proc/asound.
However when we tried to play an audio file with aplay command. We dont observe any output from the speaker.
On further debugging, we connected a DSO to the audio codec pins, and we observe that no clock is being supplied to the codec in BCLK line.
More information:-
AM3352BZCZ SoC
512MB Samsung K4B4G1646B DDR3 RAM
TFA9879 Audio Codec
SDK Version: 08_02_00_24
Kernel Version: 5.10.100
U-Boot Version: u-boot-2021.01
RFS : tisdk-default-image-am335x-evm
Reference to Schematics:-
Reference to Device tree files:-
/* This file was auto-generated by TI PinMux on 14/09/2022 at 12:44:06. */ /* This file should only be used as a reference. Some pins/peripherals, */ /* depending on your use case, may need additional configuration. */ &am33xx_pinmux { /*pinmux for mcasp1 interface - sound card*/ mcasp_pins_default: mcasp_pins_default { pinctrl-single,pins = < AM33XX_IOPAD(0x918, PIN_OUTPUT | MUX_MODE4) /* (J17) gmii1_rxdv.mcasp1_aclkx */ AM33XX_IOPAD(0x91c, PIN_OUTPUT | MUX_MODE4) /* (J18) gmii1_txd3.mcasp1_fsx */ AM33XX_IOPAD(0x920, PIN_OUTPUT | MUX_MODE4) /* (K15) gmii1_txd2.mcasp1_axr0 */ AM33XX_IOPAD(0x908, PIN_OUTPUT | MUX_MODE4) /* (H16) gmii1_col.mcasp1_axr2 */ >; }; /*pinmux for mmc0 interface - sd card*/ mmc0_pins_default: mmc0_pins_default { pinctrl-single,pins = < AM33XX_IOPAD(0x900, PIN_INPUT | MUX_MODE0) /* (G17) mmc0_clk.mmc0_clk */ AM33XX_IOPAD(0x904, PIN_INPUT | MUX_MODE0) /* (G18) mmc0_cmd.mmc0_cmd */ AM33XX_IOPAD(0x8fc, PIN_INPUT | MUX_MODE0) /* (G16) mmc0_dat0.mmc0_dat0 */ AM33XX_IOPAD(0x8f8, PIN_INPUT | MUX_MODE0) /* (G15) mmc0_dat1.mmc0_dat1 */ AM33XX_IOPAD(0x8f4, PIN_INPUT | MUX_MODE0) /* (F18) mmc0_dat2.mmc0_dat2 */ AM33XX_IOPAD(0x8f0, PIN_INPUT | MUX_MODE0) /* (F17) mmc0_dat3.mmc0_dat3 */ >; }; /*pinmux for mmc1 interface - eMMC*/ mmc1_pins_default: mmc1_pins_default { pinctrl-single,pins = < AM33XX_IOPAD(0x880, PIN_INPUT | MUX_MODE2) /* (U9) gpmc_csn1.mmc1_clk */ AM33XX_IOPAD(0x884, PIN_INPUT | MUX_MODE2) /* (V9) gpmc_csn2.mmc1_cmd */ AM33XX_IOPAD(0x800, PIN_INPUT | MUX_MODE1) /* (U7) gpmc_ad0.mmc1_dat0 */ AM33XX_IOPAD(0x804, PIN_INPUT | MUX_MODE1) /* (V7) gpmc_ad1.mmc1_dat1 */ AM33XX_IOPAD(0x808, PIN_INPUT | MUX_MODE1) /* (R8) gpmc_ad2.mmc1_dat2 */ AM33XX_IOPAD(0x80c, PIN_INPUT | MUX_MODE1) /* (T8) gpmc_ad3.mmc1_dat3 */ AM33XX_IOPAD(0x810, PIN_INPUT | MUX_MODE1) /* (U8) gpmc_ad4.mmc1_dat4 */ AM33XX_IOPAD(0x814, PIN_INPUT | MUX_MODE1) /* (V8) gpmc_ad5.mmc1_dat5 */ AM33XX_IOPAD(0x818, PIN_INPUT | MUX_MODE1) /* (R9) gpmc_ad6.mmc1_dat6 */ AM33XX_IOPAD(0x81c, PIN_INPUT | MUX_MODE1) /* (T9) gpmc_ad7.mmc1_dat7 */ >; }; /*pinmux for uart0 interface - Console UART*/ uart0_pins_default: uart0_pins_default { pinctrl-single,pins = < AM33XX_IOPAD(0x970, PIN_INPUT | MUX_MODE0) /* (E15) uart0_rxd.uart0_rxd */ AM33XX_IOPAD(0x974, PIN_OUTPUT | MUX_MODE0) /* (E16) uart0_txd.uart0_txd */ >; }; /*pinmux for i2c0 interface */ myi2c0_pins_default: myi2c0_pins_default { pinctrl-single,pins = < AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0) /* (C16) I2C0_SCL.I2C0_SCL */ AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0) /* (C17) I2C0_SDA.I2C0_SDA */ >; }; /*pinmux for gpio pins - user leds*/ mygpio2_pins_default: mygpio2_pins_default { pinctrl-single,pins = < AM33XX_IOPAD(0x890, PIN_INPUT | MUX_MODE7) /* (R7) gpmc_advn_ale.gpio2[2] */ AM33XX_IOPAD(0x894, PIN_INPUT | MUX_MODE7) /* (T7) gpmc_oen_ren.gpio2[3] */ AM33XX_IOPAD(0x898, PIN_INPUT | MUX_MODE7) /* (U6) gpmc_wen.gpio2[4] */ AM33XX_IOPAD(0x89c, PIN_INPUT | MUX_MODE7) /* (T6) gpmc_be0n_cle.gpio2[5] */ >; }; };
/* * Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ /dts-v1/; #include "am33xx.dtsi" #include "am335x-custom-pinmux.dtsi" / { model = "Custom Board "; compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; memory@80000000 { device_type = "memory"; reg = <0x80000000 0x10000000>; /* 512 MB */ }; /*memory@80000000*/ chosen { stdout-path = &uart0; } ; /*chosen*/ /*Regulator DTS configs*/ vmmcsd_fixed: fixedregulator0 { compatible = "regulator-fixed"; regulator-name = "vmmcsd_fixed"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; }; /*vmmcsd_fixed*/ /*Sound Card DTS configs*/ sound { compatible = "simple-audio-card"; simple-audio-card,name = "Custom Sound"; simple-audio-card,format = "i2s"; simple-audio-card,bitclock-master = <&sound_master>; simple-audio-card,frame-master = <&sound_master>; simple-audio-card,codec { sound-dai = <&>; }; sound_master: simple-audio-card,cpu { sound-dai = <&mcasp1>; bitclock-master; frame-master; system-clock-frequency = <24576000>; system-clock-direction = "out"; }; }; }; /*root node */ /*UARTO DTS configs*/ &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins_default>; status = "okay"; }; /*SD DTS configs*/ &mmc1 { pinctrl-names = "default"; status = "okay"; }; /*eMMC DTS configs*/ &mmc2 { pinctrl-names = "default"; bus-width = <8>; status = "okay"; }; /*I2C0 DTS configs*/ &i2c0 { pinctrl-names = "default"; pinctrl-0 = <&myi2c0_pins_default>; status = "okay"; tps: tps@24 { reg = <0x24>; }; amp: amp@6c { #sound-dai-cells = <0>; compatible = "nxp,tfa9879"; reg = <0x6c>; }; }; /*User LED DTS configs*/ &gpio2 { pinctrl-names = "default"; pinctrl-0 = <&mygpio2_pins_default>; status = "okay"; }; /*Ethernet DTS configs*/ &mac { pinctrl-names = "default"; status = "okay"; slaves = <1>; }; &davinci_mdio { pinctrl-names = "default"; status = "okay"; ethphy0: ethernet-phy@1 { reg = <1>; }; }; &cpsw_emac0 { phy-handle = <ðphy0>; phy-mode = "rmii"; }; /*USB Host DTS configs*/ &usb { status = "okay"; }; &usb_ctrl_mod { status = "okay"; }; &usb0_phy { status = "okay"; }; &usb0 { status = "okay"; dr_mode = "host"; }; /*McASP DTS configs*/ &mcasp1 { compatible = "ti,am33xx-mcasp-audio"; #sound-dai-cells = <0>; pinctrl-names = "default"; pinctrl-0 = <&mcasp_pins_default>; status = "okay"; op-mode = <0>; /* MCASP_IIS_MODE */ tdm-slots = <2>; /* 4 serializers */ num-serializer = <4>; serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ 1 0 1 0 >; }; /*ADC Voltage Monitoring DTS configs*/ &tscadc { status = "okay"; adc { ti,adc-channels = <4 5 6 7>; }; }; /*Volatge regulator DTS configs*/ /include/ "tps65217.dtsi" &tps { interrupts = <7>; /* NMI */ interrupt-parent = <&intc>; ti,pmic-shutdown-controller; charger { status = "okay"; }; regulators { dcdc1_reg: regulator@0 { regulator-name = "Z1V5PMIC"; regulator-always-on; }; dcdc2_reg: regulator@1 { /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */ regulator-name = "Z1V1PMIC2"; regulator-min-microvolt = <925000>; regulator-max-microvolt = <1351500>; regulator-boot-on; regulator-always-on; }; dcdc3_reg: regulator@2 { /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */ regulator-name = "Z1V1PMIC1"; regulator-min-microvolt = <925000>; regulator-max-microvolt = <1150000>; regulator-boot-on; regulator-always-on; }; ldo1_reg: regulator@3 { regulator-name = "Z1V8PMIC1"; regulator-always-on; }; ldo2_reg: regulator@4 { regulator-name = "Z3V3PMIC2"; regulator-always-on; }; ldo3_reg: regulator@5 { regulator-name = "Z1V8PMIC2"; regulator-always-on; }; ldo4_reg: regulator@6 { regulator-name = "Z3V3PMIC1"; regulator-always-on; }; }; };
Details of Audio file:-
44.1KHz
WAV format
Stereo
16 Bit Signed
We have no requirements to play this particular audio file. Any audio file with any sampling frequency will do. Just want to get the output from the speakers