diff options
author | Yidi Lin <yidilin@chromium.org> | 2024-10-15 17:15:54 +0800 |
---|---|---|
committer | Yu-Ping Wu <yupingso@google.com> | 2024-10-23 06:35:55 +0000 |
commit | ba4d2ec8c5b00b3c228c3f5ec67c5d789619bc28 (patch) | |
tree | 1da399ab5adcb18bb40563dded6e8a99ec231d7f /src/soc/mediatek/common/include | |
parent | af3f8298d62832d1bb2bee4ef08097052e07c1a7 (diff) |
soc/mediatek/common: Maintain common pmif data in pmif_init.c
MT8196 has different pmif_spmi_arb and pmif_spi_arb configurations. Move
the common pmif data to a separate file in order to reuse common/pmif.c
as much as possible.
BUG=none
TEST=emerge-corsola coreboot; emerge-geralt coreboot
Change-Id: I24643ce58a57b9cc3c5220bc06a85b141b366eee
Signed-off-by: Yidi Lin <yidilin@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84772
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'src/soc/mediatek/common/include')
-rw-r--r-- | src/soc/mediatek/common/include/soc/pmif_common.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/soc/mediatek/common/include/soc/pmif_common.h b/src/soc/mediatek/common/include/soc/pmif_common.h index a8db658c06..ee0a2664b4 100644 --- a/src/soc/mediatek/common/include/soc/pmif_common.h +++ b/src/soc/mediatek/common/include/soc/pmif_common.h @@ -84,4 +84,20 @@ DEFINE_BIT(PMIFSPMI_MD_CTL_SRVOL_EN, 11) struct pmif *get_pmif_controller(int inf, int mstid); void pmwrap_interface_init(void); int mtk_pmif_init(void); +void pmif_spmi_read(struct pmif *arb, u32 slvid, u32 reg, u32 *data); +void pmif_spmi_write(struct pmif *arb, u32 slvid, u32 reg, u32 data); +u32 pmif_spmi_read_field(struct pmif *arb, u32 slvid, u32 reg, u32 mask, u32 shift); +void pmif_spmi_write_field(struct pmif *arb, u32 slvid, u32 reg, + u32 val, u32 mask, u32 shift); +void pmif_spi_read(struct pmif *arb, u32 slvid, u32 reg, u32 *data); +void pmif_spi_write(struct pmif *arb, u32 slvid, u32 reg, u32 data); +u32 pmif_spi_read_field(struct pmif *arb, u32 slvid, u32 reg, u32 mask, u32 shift); +void pmif_spi_write_field(struct pmif *arb, u32 slvid, u32 reg, + u32 val, u32 mask, u32 shift); +int pmif_check_init_done(struct pmif *arb); + +extern const struct pmif pmif_spmi_arb[]; +extern const size_t pmif_spmi_arb_count; +extern const struct pmif pmif_spi_arb[]; +extern const size_t pmif_spi_arb_count; #endif /*__MEDIATEK_SOC_PMIF_COMMON__*/ |