[PW_SID:1087180] ASoC: spacemit: bug fixes, refactoring, and K3 SoC support#1833
[PW_SID:1087180] ASoC: spacemit: bug fixes, refactoring, and K3 SoC support#1833linux-riscv-bot wants to merge 9 commits into
Conversation
…_TYPED_FUNC_START After commit 67bdd7b ("riscv: Split out measure_cycles() for reuse") and commit c03ad15 ("riscv: Reuse measure_cycles() in check_vector_unaligned_access()"), there are CFI failure when booting kernels with CONFIG_CFI=y: CFI failure at measure_cycles+0x38/0xe0 (target: __riscv_copy_words_unaligned+0x0/0x50; expected type: ...) CFI failure at measure_cycles+0x38/0xe0 (target: __riscv_copy_vec_words_unaligned+0x0/0x24; expected type: ...) The __riscv_copy_*_unaligned() functions are now called indirectly but they are not defined with SYM_TYPED_FUNC_START, which is required for assembly functions called indirectly from C to pass CFI checking. Switch to SYM_TYPED_FUNC_START to clear up the CFI failures. Fixes: 67bdd7b ("riscv: Split out measure_cycles() for reuse") Fixes: c03ad15 ("riscv: Reuse measure_cycles() in check_vector_unaligned_access()") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Sami Tolvanen <samitolvanen@google.com> Reviewed-by: Nam Cao <namcao@linutronix.de> Link: https://patch.msgid.link/20260406-measure_cycles-cfi-failure-v1-1-03e0234ae02f@kernel.org Signed-off-by: Paul Walmsley <pjw@kernel.org>
When TX is already running (SSCR_SSE is set), the hw_params callback returns early before setting up DMA parameters for the RX stream. This prevents the capture path from configuring its DMA data properly. Move the SSCR_SSE check after DMA parameter setup and format constraints, so both TX and RX streams get their DMA configuration regardless of whether the hardware is already enabled. The early return now only skips the register writes that would disrupt an active stream. Fixes: 955f7b4 ("ASoC: spacemit: add i2s support for K1 SoC") Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Hardware constraints should be applied in the startup callback rather than hw_params, as hw_params may be called too late for the constraints to take effect properly. Move the channel count and format constraints for I2S and DSP_A/DSP_B modes into a new startup callback. This also tightens the I2S mode channel constraint from 1-2 to exactly 2, matching the actual hardware behavior. Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Set both TX and RX FIFO trigger thresholds (TFT/RFT) to 0xF (half of the 32-entry FIFO) instead of 5. This provides better DMA efficiency by allowing more data to accumulate before triggering a DMA request, reducing the number of DMA transactions needed. Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add the spacemit,k3-i2s compatible string for the K3 SoC I2S controller. The K3 I2S IP is the same as K1 but requires additional clocks: sysclk_div, common_sysclk, and common_bclk. These common clocks are shared across multiple I2S controllers on K3. Also add the spacemit,fixed-sample-rate property which constrains the sample rate when multiple I2S controllers share a common bclk. Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add the optional spacemit,fixed-sample-rate property. When multiple I2S controllers share a common bclk, this property constrains all controllers to the same sample rate. This applies to both K1 and K3 SoCs and is only needed when two or more I2S controllers are active simultaneously. Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
When multiple I2S controllers share a common bclk, they must all use the same sample rate. Read the optional spacemit,fixed-sample-rate DT property and apply it as a hardware constraint in the startup callback, restricting the PCM rate to the specified value. This applies to both K1 and K3 SoCs and is only needed when two or more I2S controllers are active simultaneously. Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add support for the SpacemiT K3 SoC I2S controller, which shares the same IP as K1 but requires additional clocks: sysclk_div, c_sysclk, and c_bclk. These clocks only exist on K3 and are not present on K1. The sysclk_div clock is present on most K3 I2S controllers except I2S1. The c_sysclk and c_bclk clocks are shared across multiple I2S controllers on K3. Use devm_clk_get_optional_enabled() to acquire these clocks so that the driver works on both K1 (where they are absent) and K3 without needing SoC-specific match data. For K3, the sysclk_div rate is set before sysclk in set_sysclk, and the common clock rates are configured in hw_params based on the sample rate. Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[1/7] ASoC: spacemit: fix RX DMA params not set when TX is running" |
|
Patch 1: "[1/7] ASoC: spacemit: fix RX DMA params not set when TX is running" |
|
Patch 1: "[1/7] ASoC: spacemit: fix RX DMA params not set when TX is running" |
|
Patch 1: "[1/7] ASoC: spacemit: fix RX DMA params not set when TX is running" |
|
Patch 1: "[1/7] ASoC: spacemit: fix RX DMA params not set when TX is running" |
|
Patch 1: "[1/7] ASoC: spacemit: fix RX DMA params not set when TX is running" |
|
Patch 1: "[1/7] ASoC: spacemit: fix RX DMA params not set when TX is running" |
|
Patch 1: "[1/7] ASoC: spacemit: fix RX DMA params not set when TX is running" |
|
Patch 1: "[1/7] ASoC: spacemit: fix RX DMA params not set when TX is running" |
|
Patch 1: "[1/7] ASoC: spacemit: fix RX DMA params not set when TX is running" |
|
Patch 1: "[1/7] ASoC: spacemit: fix RX DMA params not set when TX is running" |
|
Patch 1: "[1/7] ASoC: spacemit: fix RX DMA params not set when TX is running" |
|
Patch 2: "[2/7] ASoC: spacemit: move hw constraints from hw_params to startup" |
|
Patch 2: "[2/7] ASoC: spacemit: move hw constraints from hw_params to startup" |
|
Patch 2: "[2/7] ASoC: spacemit: move hw constraints from hw_params to startup" |
|
Patch 2: "[2/7] ASoC: spacemit: move hw constraints from hw_params to startup" |
|
Patch 2: "[2/7] ASoC: spacemit: move hw constraints from hw_params to startup" |
|
Patch 2: "[2/7] ASoC: spacemit: move hw constraints from hw_params to startup" |
|
Patch 2: "[2/7] ASoC: spacemit: move hw constraints from hw_params to startup" |
|
Patch 2: "[2/7] ASoC: spacemit: move hw constraints from hw_params to startup" |
|
Patch 2: "[2/7] ASoC: spacemit: move hw constraints from hw_params to startup" |
|
Patch 5: "[5/7] ASoC: dt-bindings: add fixed-sample-rate property for SpacemiT K1/K3" |
|
Patch 5: "[5/7] ASoC: dt-bindings: add fixed-sample-rate property for SpacemiT K1/K3" |
|
Patch 5: "[5/7] ASoC: dt-bindings: add fixed-sample-rate property for SpacemiT K1/K3" |
|
Patch 6: "[6/7] ASoC: spacemit: add fixed-sample-rate constraint support" |
|
Patch 6: "[6/7] ASoC: spacemit: add fixed-sample-rate constraint support" |
|
Patch 6: "[6/7] ASoC: spacemit: add fixed-sample-rate constraint support" |
|
Patch 6: "[6/7] ASoC: spacemit: add fixed-sample-rate constraint support" |
|
Patch 6: "[6/7] ASoC: spacemit: add fixed-sample-rate constraint support" |
|
Patch 6: "[6/7] ASoC: spacemit: add fixed-sample-rate constraint support" |
|
Patch 6: "[6/7] ASoC: spacemit: add fixed-sample-rate constraint support" |
|
Patch 6: "[6/7] ASoC: spacemit: add fixed-sample-rate constraint support" |
|
Patch 6: "[6/7] ASoC: spacemit: add fixed-sample-rate constraint support" |
|
Patch 6: "[6/7] ASoC: spacemit: add fixed-sample-rate constraint support" |
|
Patch 6: "[6/7] ASoC: spacemit: add fixed-sample-rate constraint support" |
|
Patch 6: "[6/7] ASoC: spacemit: add fixed-sample-rate constraint support" |
|
Patch 7: "[7/7] ASoC: spacemit: add K3 SoC support with additional clocks" |
|
Patch 7: "[7/7] ASoC: spacemit: add K3 SoC support with additional clocks" |
|
Patch 7: "[7/7] ASoC: spacemit: add K3 SoC support with additional clocks" |
|
Patch 7: "[7/7] ASoC: spacemit: add K3 SoC support with additional clocks" |
|
Patch 7: "[7/7] ASoC: spacemit: add K3 SoC support with additional clocks" |
|
Patch 7: "[7/7] ASoC: spacemit: add K3 SoC support with additional clocks" |
|
Patch 7: "[7/7] ASoC: spacemit: add K3 SoC support with additional clocks" |
|
Patch 7: "[7/7] ASoC: spacemit: add K3 SoC support with additional clocks" |
|
Patch 7: "[7/7] ASoC: spacemit: add K3 SoC support with additional clocks" |
|
Patch 7: "[7/7] ASoC: spacemit: add K3 SoC support with additional clocks" |
|
Patch 7: "[7/7] ASoC: spacemit: add K3 SoC support with additional clocks" |
|
Patch 7: "[7/7] ASoC: spacemit: add K3 SoC support with additional clocks" |
01805bc to
94a07a2
Compare
PR for series 1087180 applied to workflow__riscv__fixes
Name: ASoC: spacemit: bug fixes, refactoring, and K3 SoC support
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1087180
Version: 1