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

[RFC] soundwire: cadence_master: set frame shape and divider based on actual clk freq #5179

Draft
wants to merge 13 commits into
base: topic/sof-dev
Choose a base branch
from

Commits on Sep 10, 2024

  1. Revert "soundwire: generic_bandwidth_allocation: add lane in sdw_grou…

    …p_params"
    
    This reverts commit 72e43ef.
    bardliao committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    59e0cdb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e62ba77 View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2024

  1. soundwire: stream: set DEPREPARED state earlier

    The existing logic is problematic in that we deprepare all the ports,
    but still take into account the stream for bit allocation by just
    walking through the bus->m_rt list.
    
    This patch sets the state earlier, so that such DEPREPARED streams can
    be skipped in the bandwidth allocation (to be implemented in a
    follow-up patch).
    
    Signed-off-by: Pierre-Louis Bossart <[email protected]>
    plbossart authored and bardliao committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    7f4a054 View commit details
    Browse the repository at this point in the history
  2. soundwire: generic_bandwidth_allocation: skip DEPREPARED streams

    We should not blindly walk through all the m_rt list, since it will
    have the side effect of accounting for deprepared streams.
    
    This behavior is the result of the split implementation where the
    dailink hw_free() handles the stream state change and the bit
    allocation, and the dai hw_free() modifies the m_rt list. The bit
    allocation ends-up using m_rt entries in zoombie state, not longer
    relevant but still used.
    
    Signed-off-by: Pierre-Louis Bossart <[email protected]>
    plbossart authored and bardliao committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    939849e View commit details
    Browse the repository at this point in the history
  3. Soundwire: add sdw_slave_get_scale_index helper

    Currently, we only set peripheral frequency when the peripheral is
    initialized. However, curr_dr_freq may change to get required bandwidth.
    For example, curr_dr_freq may increase from 4.8MHz to 9.6MHz when the
    4th stream is opened. Add a helper to get the scale index so that we can
    get the scale index and program it.
    
    Signed-off-by: Bard Liao <[email protected]>
    bardliao committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    a36ddcc View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2024

  1. Soundwire: stream: program BUSCLOCK_SCALE

    We need to program bus clock scale to adjust the bus clock if current
    bus clock doesn't fit the bandwidth.
    
    Signed-off-by: Bard Liao <[email protected]>
    bardliao committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    7477a39 View commit details
    Browse the repository at this point in the history
  2. Soundwire: generic_bandwidth_allocation: set frame shape on fly

    We need to recalculate frame shape when sdw bus clock is changed.
    And need to make sure all Peripherals connected to the Manager support
    dynamic clock change.
    
    Signed-off-by: Bard Liao <[email protected]>
    bardliao committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    b82d5e9 View commit details
    Browse the repository at this point in the history
  3. soundwire: generic_bandwidth_allocation: correct clk_freq check in sd…

    …w_select_row_col
    
    The bits in Column 0 of Rows 0 to 47 are for control word and can not be
    used for audio. In practice, entire Column 0 is skipped.
    
    Signed-off-by: Bard Liao <[email protected]>
    bardliao committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    6c6076e View commit details
    Browse the repository at this point in the history
  4. soundwire: generic_bandwidth_allocation: check required freq accurately

    Currently, we check curr_dr_freq roughly by "if (curr_dr_freq <=
    bus->params.bandwidth)" in sdw_compute_bus_params() and check it
    accurately in sdw_select_row_col(). It works if we only support one
    freq. But, we need to check it accurately in sdw_select_row_col() to
    give it a chance to use a higher freq or use multi-lane.
    
    Signed-off-by: Bard Liao <[email protected]>
    bardliao committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    e9499e2 View commit details
    Browse the repository at this point in the history
  5. soundwire: generic_bandwidth_allocation: select data lane

    If a peripheral supports multi-lane, we can use data lane x to extend
    the bandwidth. The patch suggests to select data lane x where x > 0
    when bandwidth is not enough on data lane 0.
    
    Signed-off-by: Bard Liao <[email protected]>
    bardliao committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    9306fca View commit details
    Browse the repository at this point in the history
  6. soundwire: generic_bandwidth_allocation: add lane in sdw_group_params

    All active streams with the same parameters are grouped together and the
    params are store in the sdw_group struct. We compute the required
    bandwidth for each group. However, each lane has individual bandwidth.
    Therefore, we should separate different lanes in different params groups.
    Add lane variable to separate params groups.
    
    Signed-off-by: Bard Liao <[email protected]>
    bardliao committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    ffc7d87 View commit details
    Browse the repository at this point in the history
  7. soundwire: cadence_master: set frame shape and divider based on actua…

    …l clk freq
    
    Frame shap and curr_dr_freq could be updated by sdw_compute_bus_params().
    And Peripherals will set curr_dr_freq as their frequency. Managers
    should do the same. Then update frame shape according to the actual
    bus frequency.
    
    Signed-off-by: Bard Liao <[email protected]>
    bardliao committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    60f5a6b View commit details
    Browse the repository at this point in the history
  8. Revert "soundwire: intel_auxdevice: start the bus at default frequency"

    Now, we can support more than 1 soundwire bus clock frequency.
    
    This reverts commit c326356.
    
    Signed-off-by: Bard Liao <[email protected]>
    bardliao committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    aed6edb View commit details
    Browse the repository at this point in the history