This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux: mcasp4 has no mclk

Other Parts Discussed in Thread: TLV320AIC3106

Tool/software: Linux

Hi,

  We designed a custom board, referenced to “VAYU EVM XC5777X CPU BOARD”, for codec module,

The devicetree file I am referring to is "dra7-evm.dts",

we changed from mcasp3 to mcasp4, so I made the following changes in the devicetree file "a7-evm-common.dtsi":

sound0: sound0 {
compatible = "simple-audio-card";
simple-audio-card,name = "DRA7xx-EVMx";
simple-audio-card,widgets =
"Headphone", "Headphone Jack",
"Line", "Line Out",
"Microphone", "Mic Jack",
"Line", "Line In";
simple-audio-card,routing =
"Headphone Jack", "HPLOUT",
"Headphone Jack", "HPROUT",
"Line Out", "LLOUT",
"Line Out", "RLOUT",
"MIC3L", "Mic Jack",
"MIC3R", "Mic Jack",
"Mic Jack", "Mic Bias",
"LINE1L", "Line In",
"LINE1R", "Line In";
simple-audio-card,format = "dsp_b";
simple-audio-card,bitclock-master = <&sound0_master>;
simple-audio-card,frame-master = <&sound0_master>;
simple-audio-card,bitclock-inversion;

sound0_master: simple-audio-card,cpu {
sound-dai = <&mcasp4>;
system-clock-frequency = <11289600>;
};

simple-audio-card,codec {
sound-dai = <&tlv320aic3106>;
clocks = <&atl_clkin3_ck>;
};
};

&atl {
assigned-clocks = <&abe_dpll_sys_clk_mux>,
<&atl_gfclk_mux>,
<&dpll_abe_ck>,
<&dpll_abe_m2x2_ck>,
<&atl_clkin1_ck>,
<&atl_clkin3_ck>;
assigned-clock-parents = <&sys_clkin2>, <&dpll_abe_m2_ck>;
assigned-clock-rates = <0>, <0>, <180633600>, <361267200>,
<11289600>, <11289600>;

status = "okay";

atl3 {
bws = <DRA7_ATL_WS_MCASP2_FSX>;
aws = <DRA7_ATL_WS_MCASP4_FSX>;
};
};

&mcasp4 {
#sound-dai-cells = <0>;

assigned-clocks = <&mcasp4_ahclkx_mux>;
assigned-clock-parents = <&atl_clkin3_ck>;

status = "okay";

op-mode = <0>; /* MCASP_IIS_MODE */
tdm-slots = <2>;
/* 4 serializer */
serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
1 2 0 0
>;
tx-num-evt = <32>;
rx-num-evt = <32>;
};

When I run arecord or aply,no error appears,but I can't get clock in mclk,the corresponding pin is C23.

Is my modification correct? Do I need to modify the driver?

  • Your changes look correct. The McASP4 ahclkx clock doesn't the same register offset problem as McASP8  (which was the root caused of the other e2e post were you originally asked this question).

    Have you configured the CTRL_CORE_PAD_XREF_CLK3 register (0x4A0036A0) with the mux mode 5 (atl_clk3)?

  • Thank you,Misael.

    here is my register value:

    CTRL_CORE_PAD_XREF_CLK3

    Read at address  0x4A0036A0 (0xb6f4e6a0): 0x0005000E

    but in the another hand, CTRL_CORE_PAD_XREF_CLK2 with the mux mode 5:

    Read at address  0x4A00369A (0xb6fee698): 0x00040005

     

    when I write a .ko module and change the CTRL_CORE_PAD_XREF_CLK3 with 0x00040005,

    Read at address  0x4A0036A0 (0xb6f636a0): 0x00040005

     

     I can see MCLK has clock,The frequency is approximately 11.28,which should be correct.

     

    And I have some questions:

    1. I see that the configuration of CTRL_CORE_PAD_XREF_CLK2 is correct (for mcasp3), so I should not need to add additional code in the driver, but just modify it. Which function of which file should I modify the value of this register?

    2.When I run aplay or arecord, I don't see the BCLK has clocks,Does this mean that I2S is not working?

     and when I run "omapconf show mcasp4",It tells me:

     omapconf: mcasp4 is not active, cannot proceed further

    What else do I need to make?

    Thanks.

     

  • I modified the configuration of "board/ti/dra7xx/mux_data.h" in u-boot,
    set the pin(XREF_CLK3,MCASP4 ,etc) to the correct definition.

    and now I can see the waveform on I2S.

    But when running "omapconf show mcasp4",

    there are still prompts:

    omapconf: mcasp4 is not active, cannot proceed further

    What is the reason?
  • Are you running omapconf while aplay is also running (in the background)?
    For instance:
    # aplay -D hw:0,0 -f S16_LE -r44100 -c2 /dev/urandom &
    # omapconf show mcasp4
  • OK. According to your instructions, I can see the details.
    Thank you very much.