diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-11-25 21:23:37 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-06-28 21:50:12 +0000 |
commit | 5b672d595411a50012d3d232db6d886818d44893 (patch) | |
tree | 06ead78b90df1ec04fe71c29f52068290821f115 /src/soc/amd/common/block/acpimmio | |
parent | b0ae42b5bb7fe7c9f6e8301bff8fbabe95294c62 (diff) |
soc/amd/common: Access ACPIMMIO via proper symbols
Using proper symbols for base addresses, it is possible to
only define the symbols for base addresses implemented for
the specific platform and executing stage.
Change-Id: Ib8599ee93bfb1c2d6d9b4accfca1ebbefe758e09
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37324
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/soc/amd/common/block/acpimmio')
-rw-r--r-- | src/soc/amd/common/block/acpimmio/biosram.c | 6 | ||||
-rw-r--r-- | src/soc/amd/common/block/acpimmio/mmio_util.c | 23 |
2 files changed, 26 insertions, 3 deletions
diff --git a/src/soc/amd/common/block/acpimmio/biosram.c b/src/soc/amd/common/block/acpimmio/biosram.c index a7bb9ffaf5..b01c196013 100644 --- a/src/soc/amd/common/block/acpimmio/biosram.c +++ b/src/soc/amd/common/block/acpimmio/biosram.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#include <amdblocks/acpimmio_map.h> +#include <amdblocks/acpimmio.h> #include <amdblocks/biosram.h> #include <cbmem.h> #include <device/mmio.h> @@ -14,12 +14,12 @@ static uint8_t biosram_read8(uint8_t reg) { - return read8((void *)(ACPIMMIO_BIOSRAM_BASE + reg)); + return read8(acpimmio_biosram + reg); } static void biosram_write8(uint8_t reg, uint8_t value) { - write8((void *)(ACPIMMIO_BIOSRAM_BASE + reg), value); + write8(acpimmio_biosram + reg, value); } static uint16_t biosram_read16(uint8_t reg) /* Must be 1 byte at a time */ diff --git a/src/soc/amd/common/block/acpimmio/mmio_util.c b/src/soc/amd/common/block/acpimmio/mmio_util.c index 7126851d50..b3d3332ea4 100644 --- a/src/soc/amd/common/block/acpimmio/mmio_util.c +++ b/src/soc/amd/common/block/acpimmio/mmio_util.c @@ -5,6 +5,29 @@ #include <amdblocks/acpimmio_map.h> #include <amdblocks/acpimmio.h> +uint8_t *const acpimmio_sm_pci = ACPIMMIO_BASE(SM_PCI); +uint8_t *const acpimmio_gpio_100 = ACPIMMIO_BASE(GPIO_100); +uint8_t *const acpimmio_smi = ACPIMMIO_BASE(SMI); +uint8_t *const acpimmio_pmio = ACPIMMIO_BASE(PMIO); +uint8_t *const acpimmio_pmio2 = ACPIMMIO_BASE(PMIO2); +uint8_t *const acpimmio_biosram = ACPIMMIO_BASE(BIOSRAM); +uint8_t *const acpimmio_cmosram = ACPIMMIO_BASE(CMOSRAM); +uint8_t *const acpimmio_cmos = ACPIMMIO_BASE(CMOS); +uint8_t *const acpimmio_acpi = ACPIMMIO_BASE(ACPI); +uint8_t *const acpimmio_asf = ACPIMMIO_BASE(ASF); +uint8_t *const acpimmio_smbus = ACPIMMIO_BASE(SMBUS); +uint8_t *const acpimmio_wdt = ACPIMMIO_BASE(WDT); +uint8_t *const acpimmio_hpet = ACPIMMIO_BASE(HPET); +uint8_t *const acpimmio_iomux = ACPIMMIO_BASE(IOMUX); +uint8_t *const acpimmio_misc = ACPIMMIO_BASE(MISC); +uint8_t *const acpimmio_dpvga = ACPIMMIO_BASE(DPVGA); +uint8_t *const acpimmio_gpio0 = ACPIMMIO_BASE(GPIO0); +uint8_t *const acpimmio_gpio1 = ACPIMMIO_BASE(GPIO1); +uint8_t *const acpimmio_gpio2 = ACPIMMIO_BASE(GPIO2); +uint8_t *const acpimmio_xhci_pm = ACPIMMIO_BASE(XHCIPM); +uint8_t *const acpimmio_acdc_tmr = ACPIMMIO_BASE(ACDCTMR); +uint8_t *const acpimmio_aoac = ACPIMMIO_BASE(AOAC); + void enable_acpimmio_decode_pm24(void) { uint32_t dw; |