soc/intel/cmn/block/pmc: Add pmc_or_mmio32 utility function

Change-Id: I5f9845dd3ea098d990710eaaa2d5db495f876cdd
Signed-off-by: Tim Chu <Tim.Chu@quantatw.com>
Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71099
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
diff --git a/src/soc/intel/common/block/include/intelblocks/pmclib.h b/src/soc/intel/common/block/include/intelblocks/pmclib.h
index 62f27a9..36049ba 100644
--- a/src/soc/intel/common/block/include/intelblocks/pmclib.h
+++ b/src/soc/intel/common/block/include/intelblocks/pmclib.h
@@ -135,6 +135,8 @@
 /* Clear STD and GPIO GPE status registers. */
 void pmc_clear_all_gpe_status(void);
 
+/* Write PMC MMIO register value with the provided bitmask. */
+void pmc_or_mmio32(uint32_t offset, uint32_t ormask);
 /* Clear status bits in Power and Reset Status (PRSTS) register */
 void pmc_clear_prsts(void);
 
diff --git a/src/soc/intel/common/block/pmc/pmclib.c b/src/soc/intel/common/block/pmc/pmclib.c
index 68bde41..4786fc1 100644
--- a/src/soc/intel/common/block/pmc/pmclib.c
+++ b/src/soc/intel/common/block/pmc/pmclib.c
@@ -367,6 +367,17 @@
 {
 }
 
+void pmc_or_mmio32(uint32_t offset, uint32_t ormask)
+{
+	uint32_t reg;
+	uintptr_t pmc_bar;
+
+	pmc_bar = soc_read_pmc_base();
+	reg = read32p(pmc_bar + offset);
+	reg |= ormask;
+	write32p(pmc_bar + offset, reg);
+}
+
 void pmc_clear_prsts(void)
 {
 	uint32_t prsts;