diff --git a/src/soc/mediatek/mt8189/Makefile.mk b/src/soc/mediatek/mt8189/Makefile.mk index 7f9b86834b..32c76cc6d5 100644 --- a/src/soc/mediatek/mt8189/Makefile.mk +++ b/src/soc/mediatek/mt8189/Makefile.mk @@ -17,6 +17,7 @@ bootblock-y += ../common/pll.c pll.c bootblock-y += ../common/wdt.c ../common/wdt_req.c wdt.c romstage-y += ../common/cbmem.c +romstage-y += ../common/cpu_id.c ../common/cpu_segment_id.c romstage-y += ../common/dram_init.c romstage-y += ../common/dramc_param.c romstage-y += ../common/emi.c diff --git a/src/soc/mediatek/mt8189/pmif_spmi.c b/src/soc/mediatek/mt8189/pmif_spmi.c index 2cc4e114a3..aeda6e6f71 100644 --- a/src/soc/mediatek/mt8189/pmif_spmi.c +++ b/src/soc/mediatek/mt8189/pmif_spmi.c @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -43,5 +44,15 @@ void pmif_spmi_iocfg(void) size_t spmi_dev_cnt(void) { - return ARRAY_SIZE(spmi_dev); + static size_t cached_cnt; + + if (cached_cnt) + return cached_cnt; + + cached_cnt = ARRAY_SIZE(spmi_dev); + if (get_cpu_id() == MTK_CPU_ID_MT8189 && + get_cpu_segment_id() == MTK_CPU_SEG_ID_MT8189G) + cached_cnt = 1; + + return cached_cnt; }