Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: topology1: imx8ulp: correct BCLK rate and change BCLK polarity and protocol #8978

Merged

Commits on Mar 22, 2024

  1. tools: topology1: imx8ulp: rename RATE to FSYNC_RATE

    Rename the `RATE` parameter to `FSYNC_RATE` in order to
    remove ambiguity regarding what the parameter is.
    
    Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
    LaurentiuM1234 committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    fc2fc96 View commit details
    Browse the repository at this point in the history
  2. tools: topology1: imx8ulp: correct BCLK frequency

    8ULP has two supported BT HFP scenarios: NBS and WBS. For
    NBS the frequency of FSYNC is 8k, while for WBS the frequency
    of FSYNC is 16k. Since the BCLK is computed as:
    	Freq(BCLK) = TDM_SLOTS * TDM_SLOT_WIDTH * Freq(FSYNC)
    then that means we're going to end up with two different BCLK
    frequencies (one for each supported scenario).
    
    Currently, what we do is pass the frequency of FSYNC
    as a build argument, while keeping the frequency of BCLK
    constant (set to 256000, which would be the same value as the
    one used in WBS). This causes the following issues:
    
    	1) The Zephyr native SAI driver returns an error
    	when trying to commit the configuration because the
    	frequency of BCLK doesn't abide by the aforementioned
    	formula.
    
    	2) We end up consuming twice as many samples in a given
    	unit of time.
    
    To fix these issues, use the aforementioned formula to compute
    the frequency of BCLK.
    
    Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
    LaurentiuM1234 committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    54c2d85 View commit details
    Browse the repository at this point in the history
  3. tools: topology1: imx8ulp: change protocol and BCLK polarity

    The BT codec used by the IW416 chip expects FSYNC to be
    asserted for only one BCLK. Also, FSYNC should be active HIGH.
    As such, change from I2S protocol to DSP_A protocol since the
    configurations made for this protocol inside the SAI driver
    are more suited.
    
    Also, by default, the BT codec drives data on BCLK rising
    edge and samples it on falling edge. With the DSP_A protocol,
    the SAI driver also has the same configuration, which is wrong
    since we can't drive and sample on the same edge and cycle. As such,
    invert BCLK polarity such that the SAI will drive on rising edge
    and sample on falling edge.
    
    Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
    LaurentiuM1234 committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    409333f View commit details
    Browse the repository at this point in the history