Attention is currently required from: Hung-Te Lin, Yu-Ping Wu.
Yidi Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/84774?usp=email )
Change subject: soc/mediatek/common: Add read16/write16 support for PMIF ......................................................................
soc/mediatek/common: Add read16/write16 support for PMIF
This patch is prepared for MT8196 PMIF driver.
BUG=none TEST=emerge-corsola coreboot; emerge-geralt coreboot
Change-Id: I3adbbaaf247a8bbd99627cf089b5b55fcf4fb115 Signed-off-by: Yidi Lin yidilin@chromium.org --- M src/soc/mediatek/common/include/soc/pmif_common.h M src/soc/mediatek/common/pmif.c 2 files changed, 15 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/84774/1
diff --git a/src/soc/mediatek/common/include/soc/pmif_common.h b/src/soc/mediatek/common/include/soc/pmif_common.h index d94d871..f7403df 100644 --- a/src/soc/mediatek/common/include/soc/pmif_common.h +++ b/src/soc/mediatek/common/include/soc/pmif_common.h @@ -30,6 +30,8 @@ u32 pmifid; void (*read)(struct pmif *arb, u32 slvid, u32 reg, u32 *data); void (*write)(struct pmif *arb, u32 slvid, u32 reg, u32 data); + void (*read16)(struct pmif *arb, u32 slvid, u32 reg, u32 *data); + void (*write16)(struct pmif *arb, u32 slvid, u32 reg, u32 data); u32 (*read_field)(struct pmif *arb, u32 slvid, u32 reg, u32 mask, u32 shift); void (*write_field)(struct pmif *arb, u32 slvid, u32 reg, u32 val, u32 mask, u32 shift); int (*is_pmif_init_done)(struct pmif *arb); @@ -86,6 +88,8 @@ 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); +void pmif_spmi_read16(struct pmif *arb, u32 slvid, u32 reg, u32 *data); +void pmif_spmi_write16(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); diff --git a/src/soc/mediatek/common/pmif.c b/src/soc/mediatek/common/pmif.c index 925612d..fd7e956 100644 --- a/src/soc/mediatek/common/pmif.c +++ b/src/soc/mediatek/common/pmif.c @@ -75,6 +75,17 @@ pmif_send_cmd(arb, 1, PMIF_CMD_EXT_REG_LONG, slvid, reg, NULL, data, 1); }
+void pmif_spmi_read16(struct pmif *arb, u32 slvid, u32 reg, u32 *data) +{ + *data = 0; + pmif_send_cmd(arb, 0, PMIF_CMD_EXT_REG_LONG, slvid, reg, data, 0, 2); +} + +void pmif_spmi_write16(struct pmif *arb, u32 slvid, u32 reg, u32 data) +{ + pmif_send_cmd(arb, 1, PMIF_CMD_EXT_REG_LONG, slvid, reg, NULL, data, 2); +} + u32 pmif_spmi_read_field(struct pmif *arb, u32 slvid, u32 reg, u32 mask, u32 shift) { u32 data;