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>
This commit is contained in:
committed by
Felix Held
parent
96cf680c3d
commit
10d522133e
@ -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,
|
||||
|
Reference in New Issue
Block a user