diff options
author | Subrata Banik <subratabanik@google.com> | 2022-02-18 11:01:43 +0530 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-02-21 15:22:35 +0000 |
commit | e0ddea49d1cd6cf3137505c555f8a110ea8c89a8 (patch) | |
tree | 288bbb558fb2e6dc837963b41e957cff0294466a /src | |
parent | fac11d000ab73c306bba6798aff55bc73afa11dd (diff) |
soc/intel/denverton_ns: Add `pmc_mmio_regs` as public function
This patch adds `pmc_mmio_regs` a public function for other IA common
code may need to get access to this function.
BUG=none
TEST=none
Signed-off-by: Subrata Banik <subratabanik@google.com>
Change-Id: I67a0f7fdcd0827172426bc938569a5022eff16f2
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62166
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Mariusz Szafrański <mariuszx.szafranski@intel.com>
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/intel/denverton_ns/include/soc/pm.h | 3 | ||||
-rw-r--r-- | src/soc/intel/denverton_ns/pmutil.c | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/soc/intel/denverton_ns/include/soc/pm.h b/src/soc/intel/denverton_ns/include/soc/pm.h index 2dc40a5e6c..faf7f20506 100644 --- a/src/soc/intel/denverton_ns/include/soc/pm.h +++ b/src/soc/intel/denverton_ns/include/soc/pm.h @@ -28,6 +28,9 @@ struct chipset_power_state { uint32_t prev_sleep_state; } __attribute__((packed)); +/* Get base address PMC memory mapped registers. */ +uint8_t *pmc_mmio_regs(void); + struct chipset_power_state *fill_power_state(void); /* Power Management Utility Functions. */ diff --git a/src/soc/intel/denverton_ns/pmutil.c b/src/soc/intel/denverton_ns/pmutil.c index 822e50e397..b861513def 100644 --- a/src/soc/intel/denverton_ns/pmutil.c +++ b/src/soc/intel/denverton_ns/pmutil.c @@ -84,6 +84,18 @@ void enable_smi(uint32_t mask) outl(smi_en, (uint16_t)(pmbase + SMI_EN)); } +uint8_t *pmc_mmio_regs(void) +{ + uint32_t reg32; + + reg32 = pci_read_config32(PCH_DEV_PMC, PMC_PWRM_BASE); + + /* 4KiB alignment. */ + reg32 &= ~0xfff; + + return (void *)(uintptr_t) reg32; +} + void disable_smi(uint32_t mask) { uint16_t pmbase = get_pmbase(); |