soc/intel: Drop casts around soc_read_pmc_base()

The `soc_read_pmc_base()` function returns an `uintptr_t`, which is then
casted to a pointer type for use with `read32()` and/or `write32()`. But
since commit b324df6a54 (arch/x86: Provide
readXp/writeXp helpers in arch/mmio.h), the `read32p()` and `write32p()`
functions live in `arch/mmio.h`. These functions use the `uintptr_t type
for the address parameter instead of a pointer type, and using them with
the `soc_read_pmc_base()` function allows dropping the casts to pointer.

Change-Id: Iaf16e6f23d139e6f79360d9a29576406b7b15b07
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55840
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
This commit is contained in:
Angel Pons
2021-06-25 10:09:35 +02:00
committed by Werner Zeh
parent c44ffc3084
commit f585c6eeea
10 changed files with 18 additions and 25 deletions

View File

@ -227,13 +227,13 @@ uint16_t get_pmbase(void)
void pmc_soc_set_afterg3_en(const bool on)
{
void *const gen_pmcon1 = (void *)(soc_read_pmc_base() + GEN_PMCON1);
const uintptr_t gen_pmcon1 = soc_read_pmc_base() + GEN_PMCON1;
uint32_t reg32;
reg32 = read32(gen_pmcon1);
reg32 = read32p(gen_pmcon1);
if (on)
reg32 &= ~SLEEP_AFTER_POWER_FAIL;
else
reg32 |= SLEEP_AFTER_POWER_FAIL;
write32(gen_pmcon1, reg32);
write32p(gen_pmcon1, reg32);
}