aboutsummaryrefslogtreecommitdiff
path: root/src/soc/amd/common/block/gpio_banks/gpio.c
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2019-11-25 21:23:37 +0200
committerPatrick Georgi <pgeorgi@google.com>2020-06-28 21:50:12 +0000
commit5b672d595411a50012d3d232db6d886818d44893 (patch)
tree06ead78b90df1ec04fe71c29f52068290821f115 /src/soc/amd/common/block/gpio_banks/gpio.c
parentb0ae42b5bb7fe7c9f6e8301bff8fbabe95294c62 (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/gpio_banks/gpio.c')
-rw-r--r--src/soc/amd/common/block/gpio_banks/gpio.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/soc/amd/common/block/gpio_banks/gpio.c b/src/soc/amd/common/block/gpio_banks/gpio.c
index 81ea72528c..d67e2d05f9 100644
--- a/src/soc/amd/common/block/gpio_banks/gpio.c
+++ b/src/soc/amd/common/block/gpio_banks/gpio.c
@@ -5,7 +5,6 @@
#include <console/console.h>
#include <gpio.h>
#include <amdblocks/acpimmio.h>
-#include <amdblocks/acpimmio_map.h>
#include <soc/gpio.h>
#include <soc/smi.h>
#include <assert.h>
@@ -181,8 +180,7 @@ void program_gpios(const struct soc_amd_gpio *gpio_list_ptr, size_t size)
const struct soc_amd_event *gev_tbl;
size_t gev_items;
- inter_master = (uint32_t *)(uintptr_t)(ACPIMMIO_GPIO0_BASE
- + GPIO_MASTER_SWITCH);
+ inter_master = (void *)(acpimmio_gpio0 + GPIO_MASTER_SWITCH);
direction = 0;
edge_level = 0;
mask = 0;
@@ -270,14 +268,10 @@ void program_gpios(const struct soc_amd_gpio *gpio_list_ptr, size_t size)
mem_read_write32(inter_master, GPIO_INTERRUPT_EN, GPIO_INTERRUPT_EN);
/* Set all SCI trigger direction (high/low) */
- mem_read_write32((uint32_t *)
- (uintptr_t)(ACPIMMIO_SMI_BASE + SMI_SCI_TRIG),
- direction, mask);
+ mem_read_write32((void *)(acpimmio_smi + SMI_SCI_TRIG), direction, mask);
/* Set all SCI trigger level (edge/level) */
- mem_read_write32((uint32_t *)
- (uintptr_t)(ACPIMMIO_SMI_BASE + SMI_SCI_LEVEL),
- edge_level, mask);
+ mem_read_write32((void *)(acpimmio_smi + SMI_SCI_LEVEL), edge_level, mask);
}
int gpio_interrupt_status(gpio_t gpio)