diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2020-06-04 13:36:53 +0300 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-06-28 21:50:38 +0000 |
commit | be1ff7eb724bc674eb0f501b4b42675a679adbab (patch) | |
tree | 800da225e06e9d63f5ab45fa0f24dd3f3271c58f /src/soc/amd/common/block/include | |
parent | 5b672d595411a50012d3d232db6d886818d44893 (diff) |
soc/amd/common: Allow runtime mapping of ACPIMMIO banks
Future implementation of verstage running on PSP will have access
to some of the ACPIMMIO banks, but banks will be mapped runtime
at non-deterministic addresses. Provide preprocessor helpers to
accomplish this.
Change-Id: I8d50de60bb1ea1b3a521ab535a5637c4de8c3559
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42073
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/soc/amd/common/block/include')
-rw-r--r-- | src/soc/amd/common/block/include/amdblocks/acpimmio.h | 55 | ||||
-rw-r--r-- | src/soc/amd/common/block/include/amdblocks/acpimmio_map.h | 3 |
2 files changed, 33 insertions, 25 deletions
diff --git a/src/soc/amd/common/block/include/amdblocks/acpimmio.h b/src/soc/amd/common/block/include/amdblocks/acpimmio.h index 3d0cf06688..d3deff1153 100644 --- a/src/soc/amd/common/block/include/amdblocks/acpimmio.h +++ b/src/soc/amd/common/block/include/amdblocks/acpimmio.h @@ -23,28 +23,39 @@ #define PM_04_BIOSRAM_DECODE_EN BIT(0) #define PM_04_ACPIMMIO_DECODE_EN BIT(1) -extern uint8_t *const acpimmio_gpio_100; -extern uint8_t *const acpimmio_sm_pci; -extern uint8_t *const acpimmio_smi; -extern uint8_t *const acpimmio_pmio; -extern uint8_t *const acpimmio_pmio2; -extern uint8_t *const acpimmio_biosram; -extern uint8_t *const acpimmio_cmosram; -extern uint8_t *const acpimmio_cmos; -extern uint8_t *const acpimmio_acpi; -extern uint8_t *const acpimmio_asf; -extern uint8_t *const acpimmio_smbus; -extern uint8_t *const acpimmio_wdt; -extern uint8_t *const acpimmio_hpet; -extern uint8_t *const acpimmio_iomux; -extern uint8_t *const acpimmio_misc; -extern uint8_t *const acpimmio_dpvga; -extern uint8_t *const acpimmio_gpio0; -extern uint8_t *const acpimmio_gpio1; -extern uint8_t *const acpimmio_gpio2; -extern uint8_t *const acpimmio_xhci_pm; -extern uint8_t *const acpimmio_acdc_tmr; -extern uint8_t *const acpimmio_aoac; +/* For x86 base is constant, while PSP does mapping runtime. */ +#define CONSTANT_ACPIMMIO_BASE_ADDRESS ENV_X86 + +#if CONSTANT_ACPIMMIO_BASE_ADDRESS +#define MAYBE_CONST const +#else +#define MAYBE_CONST +#endif + +extern uint8_t *MAYBE_CONST acpimmio_gpio_100; +extern uint8_t *MAYBE_CONST acpimmio_sm_pci; +extern uint8_t *MAYBE_CONST acpimmio_smi; +extern uint8_t *MAYBE_CONST acpimmio_pmio; +extern uint8_t *MAYBE_CONST acpimmio_pmio2; +extern uint8_t *MAYBE_CONST acpimmio_biosram; +extern uint8_t *MAYBE_CONST acpimmio_cmosram; +extern uint8_t *MAYBE_CONST acpimmio_cmos; +extern uint8_t *MAYBE_CONST acpimmio_acpi; +extern uint8_t *MAYBE_CONST acpimmio_asf; +extern uint8_t *MAYBE_CONST acpimmio_smbus; +extern uint8_t *MAYBE_CONST acpimmio_wdt; +extern uint8_t *MAYBE_CONST acpimmio_hpet; +extern uint8_t *MAYBE_CONST acpimmio_iomux; +extern uint8_t *MAYBE_CONST acpimmio_misc; +extern uint8_t *MAYBE_CONST acpimmio_dpvga; +extern uint8_t *MAYBE_CONST acpimmio_gpio0; +extern uint8_t *MAYBE_CONST acpimmio_gpio1; +extern uint8_t *MAYBE_CONST acpimmio_gpio2; +extern uint8_t *MAYBE_CONST acpimmio_xhci_pm; +extern uint8_t *MAYBE_CONST acpimmio_acdc_tmr; +extern uint8_t *MAYBE_CONST acpimmio_aoac; + +#undef MAYBE_CONST /* For older discrete FCHs */ void enable_acpimmio_decode_pm24(void); diff --git a/src/soc/amd/common/block/include/amdblocks/acpimmio_map.h b/src/soc/amd/common/block/include/amdblocks/acpimmio_map.h index d230d541a9..758a55622e 100644 --- a/src/soc/amd/common/block/include/amdblocks/acpimmio_map.h +++ b/src/soc/amd/common/block/include/amdblocks/acpimmio_map.h @@ -126,9 +126,6 @@ #define ACPIMMIO_ACDCTMR_BANK 0x1d00 #define ACPIMMIO_AOAC_BANK 0x1e00 -#define ACPIMMIO_BASE(x) \ - (void *)(AMD_SB_ACPI_MMIO_ADDR + ACPIMMIO_ ## x ## _BANK) - /* FIXME: Passing host base for SMBUS is not long-term solution. */ #define ACPIMMIO_ASF_BASE (AMD_SB_ACPI_MMIO_ADDR + ACPIMMIO_ASF_BANK) #define ACPIMMIO_SMBUS_BASE (AMD_SB_ACPI_MMIO_ADDR + ACPIMMIO_SMBUS_BANK) |