From 6d449e005c5fc3f5bd54214de0a6d4a04989b042 Mon Sep 17 00:00:00 2001 From: Rex-BC Chen Date: Wed, 19 Oct 2022 18:51:39 +0800 Subject: soc/mediatek/mt8186: Add PWRAP_WITH_PMIF_SPMI Kconfig option On MT8186, PMIC interface supports PWRAP and PMIF_SPMI while other MediaTek SoCs support PMIF_SPMI and PMIF_SPI. BUG=b:249436110 TEST=build pass. BRANCH=corsola Signed-off-by: Bo-Chen Chen Change-Id: I20efa6d84975d781972af9143c0c7e3a272653e0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/68577 Reviewed-by: Yidi Lin Reviewed-by: Yu-Ping Wu Tested-by: build bot (Jenkins) --- src/soc/mediatek/common/Kconfig | 7 +++++++ src/soc/mediatek/common/pmif.c | 2 +- src/soc/mediatek/mt8186/Kconfig | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/soc/mediatek/common/Kconfig b/src/soc/mediatek/common/Kconfig index 119746b497..ce9f883356 100644 --- a/src/soc/mediatek/common/Kconfig +++ b/src/soc/mediatek/common/Kconfig @@ -63,4 +63,11 @@ config FLASH_DUAL_IO_READ When this option is enabled, the flash controller provides the ability to dual IO read mode. +config PWRAP_WITH_PMIF_SPMI + bool + default n + help + When this option is enabled, the PMIC interface only supports PWRAP + and PMIF_SPMI. + endif diff --git a/src/soc/mediatek/common/pmif.c b/src/soc/mediatek/common/pmif.c index a7ab4e5fa5..a7076eead2 100644 --- a/src/soc/mediatek/common/pmif.c +++ b/src/soc/mediatek/common/pmif.c @@ -297,7 +297,7 @@ int mtk_pmif_init(void) ret = pmif_clk_init(); if (!ret) ret = pmif_spmi_init(get_pmif_controller(PMIF_SPMI, SPMI_MASTER_0)); - if (!ret) + if (!ret && !CONFIG(PWRAP_WITH_PMIF_SPMI)) ret = pmif_spi_init(get_pmif_controller(PMIF_SPI, 0)); return ret; diff --git a/src/soc/mediatek/mt8186/Kconfig b/src/soc/mediatek/mt8186/Kconfig index db5bed217f..bac220e89e 100644 --- a/src/soc/mediatek/mt8186/Kconfig +++ b/src/soc/mediatek/mt8186/Kconfig @@ -12,6 +12,7 @@ config SOC_MEDIATEK_MT8186 select MEDIATEK_BLOB_FAST_INIT select USE_CBMEM_DRAM_INFO select FLASH_DUAL_IO_READ + select PWRAP_WITH_PMIF_SPMI if SOC_MEDIATEK_MT8186 -- cgit v1.2.3