remoteproc: mediatek: Fix side effect of mt8195 sram power on
authorTinghan Shen <tinghan.shen@mediatek.com>
Mon, 21 Mar 2022 06:03:40 +0000 (14:03 +0800)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Mon, 11 Apr 2022 15:56:42 +0000 (09:56 -0600)
commitf20e232d74ee0ace386be0b7db1ff993ea69b4c4
treefac5b0eb61672976a8e32287dfaf08ba68eb047c
parentce522ba9ef7e2d9fb22a39eb3371c0c64e2a433e
remoteproc: mediatek: Fix side effect of mt8195 sram power on

The definition of L1TCM_SRAM_PDN bits on mt8195 is different to mt8192.

L1TCM_SRAM_PDN bits[3:0] control the power of mt8195 L1TCM SRAM.

L1TCM_SRAM_PDN bits[7:4] control the access path to EMI for SCP.
These bits have to be powered on to allow EMI access for SCP.

Bits[7:4] also affect audio DSP because audio DSP and SCP are
placed on the same hardware bus. If SCP cannot access EMI, audio DSP is
blocked too.

L1TCM_SRAM_PDN bits[31:8] are not used.

This fix removes modification of bits[7:4] when power on/off mt8195 SCP
L1TCM. It's because the modification introduces a short period of time
blocking audio DSP to access EMI. This was not a problem until we have
to load both SCP module and audio DSP module. audio DSP needs to access
EMI because it has source/data on DRAM. Audio DSP will have unexpected
behavior when it accesses EMI and the SCP driver blocks the EMI path at
the same time.

Fixes: 79111df414fc ("remoteproc: mediatek: Support mt8195 scp")
Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Link: https://lore.kernel.org/r/20220321060340.10975-1-tinghan.shen@mediatek.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/remoteproc/mtk_common.h
drivers/remoteproc/mtk_scp.c