summaryrefslogtreecommitdiffstats
path: root/util/inteltool/amb.c
diff options
context:
space:
mode:
authorMichael Niewöhner <foss@mniewoehner.de>2020-03-13 19:08:21 +0100
committerFelix Held <felix-coreboot@felixheld.de>2020-03-21 22:12:10 +0000
commit10d522133ef7531c1777c89b1a9ba3cdca5e25ee (patch)
tree32b4a98ed45c12b9a5fd586fb869c150070d2397 /util/inteltool/amb.c
parent96cf680c3d5e4f98ddc05ccb7d50f48452014d0b (diff)
downloadcoreboot-10d522133ef7531c1777c89b1a9ba3cdca5e25ee.tar.gz
coreboot-10d522133ef7531c1777c89b1a9ba3cdca5e25ee.tar.bz2
coreboot-10d522133ef7531c1777c89b1a9ba3cdca5e25ee.zip
util/inteltool: use read* macros instead of pointers
Switch to using read* macros instead of pointers. Change-Id: I1fe54b496a5998597b79cdd7108f3a4075744a78 Signed-off-by: Michael Niewöhner <foss@mniewoehner.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/39503 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'util/inteltool/amb.c')
-rw-r--r--util/inteltool/amb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/inteltool/amb.c b/util/inteltool/amb.c
index 26bece04e332..506ba5fa0f43 100644
--- a/util/inteltool/amb.c
+++ b/util/inteltool/amb.c
@@ -20,11 +20,11 @@
#define AMB_CONFIG_SPACE_SIZE 0x20000
-#define AMB_ADDR(base, fn, reg) (base | ((fn & 7) << 8) | ((reg & 0xff)))
+#define AMB_ADDR(fn, reg) (((fn & 7) << 8) | ((reg & 0xff)))
static uint32_t amb_read_config32(volatile void *base, int fn, int reg)
{
- return *(uint32_t *)(AMB_ADDR((intptr_t)base, fn, reg));
+ return read32(base + AMB_ADDR(fn, reg));
}
static void amb_printreg32(volatile void *base, int fn, int reg,
@@ -38,7 +38,7 @@ static void amb_printreg32(volatile void *base, int fn, int reg,
static uint16_t amb_read_config16(volatile void *base, int fn, int reg)
{
- return *(uint16_t *)(AMB_ADDR((intptr_t)base, fn, reg));
+ return read16(base + AMB_ADDR(fn, reg));
}
static void amb_printreg16(volatile void *base, int fn, int reg,
@@ -53,7 +53,7 @@ static void amb_printreg16(volatile void *base, int fn, int reg,
static uint8_t amb_read_config8(volatile void *base, int fn, int reg)
{
- return *(uint8_t *)(AMB_ADDR((intptr_t)base, fn, reg));
+ return read8(base + AMB_ADDR(fn, reg));
}
static void amb_printreg8(volatile void *base, int fn, int reg,