Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/69089 )
Change subject: soc/mediatek/mt8188: Disable input-gating for big-core SRAM ......................................................................
soc/mediatek/mt8188: Disable input-gating for big-core SRAM
The input-gating is an experimental feature (but unfortunately default enabled) and would lead to crash on MT8188, so we have to disable it in the firmware stage.
BUG=b:233720142 TEST=CPUfreq in kernel test pass.
Change-Id: Ifd68fe9362587955cdb8598c4cc5c2d0eefe53ca Signed-off-by: Liju-Clr Chen liju-clr.chen@mediatek.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/69089 Reviewed-by: Yidi Lin yidilin@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Yu-Ping Wu yupingso@google.com Reviewed-by: Rex-BC Chen rex-bc.chen@mediatek.com Reviewed-by: Angel Pons th3fanbus@gmail.com --- M src/soc/mediatek/mt8188/Makefile.inc A src/soc/mediatek/mt8188/cpu_input_gating.c A src/soc/mediatek/mt8188/include/soc/cpu_input_gating.h M src/soc/mediatek/mt8188/soc.c 4 files changed, 51 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, but someone else must approve Yu-Ping Wu: Looks good to me, approved Yidi Lin: Looks good to me, but someone else must approve Rex-BC Chen: Looks good to me, but someone else must approve
diff --git a/src/soc/mediatek/mt8188/Makefile.inc b/src/soc/mediatek/mt8188/Makefile.inc index fc56eb3..52fc861 100644 --- a/src/soc/mediatek/mt8188/Makefile.inc +++ b/src/soc/mediatek/mt8188/Makefile.inc @@ -31,6 +31,7 @@
ramstage-y += ../common/auxadc.c ramstage-$(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE) += ../common/bl31.c +ramstage-y += cpu_input_gating.c ramstage-y += ../common/ddp.c ddp.c ramstage-y += ../common/devapc.c devapc.c ramstage-y += ../common/dfd.c diff --git a/src/soc/mediatek/mt8188/cpu_input_gating.c b/src/soc/mediatek/mt8188/cpu_input_gating.c new file mode 100644 index 0000000..10f6338 --- /dev/null +++ b/src/soc/mediatek/mt8188/cpu_input_gating.c @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR MIT */ + +#include <device/mmio.h> +#include <soc/addressmap.h> +#include <soc/cpu_input_gating.h> + +#define CPU6_IG_EN_REG (MCUSYS_BASE + 0x3308) +#define CPU7_IG_EN_REG (MCUSYS_BASE + 0x3b08) +#define DISABLE_CPU_IG 0xfc000001 + +void disable_cpu_input_gating(void) +{ + write32p(CPU6_IG_EN_REG, DISABLE_CPU_IG); + write32p(CPU7_IG_EN_REG, DISABLE_CPU_IG); +} diff --git a/src/soc/mediatek/mt8188/include/soc/cpu_input_gating.h b/src/soc/mediatek/mt8188/include/soc/cpu_input_gating.h new file mode 100644 index 0000000..fe07457 --- /dev/null +++ b/src/soc/mediatek/mt8188/include/soc/cpu_input_gating.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR MIT */ + +#ifndef SOC_MEDIATEK_MT8188_CPU_INPUT_GATING_H +#define SOC_MEDIATEK_MT8188_CPU_INPUT_GATING_H + +void disable_cpu_input_gating(void); + +#endif /* SOC_MEDIATEK_MT8188_CPU_INPUT_GATING_H */ diff --git a/src/soc/mediatek/mt8188/soc.c b/src/soc/mediatek/mt8188/soc.c index bcbea03..c63b5ca 100644 --- a/src/soc/mediatek/mt8188/soc.c +++ b/src/soc/mediatek/mt8188/soc.c @@ -3,6 +3,7 @@ #include <bootmem.h> #include <console/console.h> #include <device/device.h> +#include <soc/cpu_input_gating.h> #include <soc/devapc.h> #include <soc/dfd.h> #include <soc/dpm.h> @@ -27,6 +28,9 @@ static void soc_init(struct device *dev) { mtk_mmu_disable_l2c_sram(); + + disable_cpu_input_gating(); + dapc_init(); mcupm_init(); sspm_init();