summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/amd/common/block/include/amdblocks/espi.h8
-rw-r--r--src/soc/amd/common/block/lpc/espi_util.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/soc/amd/common/block/include/amdblocks/espi.h b/src/soc/amd/common/block/include/amdblocks/espi.h
index cfba50bd2d..45a220ef7c 100644
--- a/src/soc/amd/common/block/include/amdblocks/espi.h
+++ b/src/soc/amd/common/block/include/amdblocks/espi.h
@@ -25,10 +25,10 @@
#define ESPI_MMIO_SIZE_REG0 0x60
#define ESPI_MMIO_SIZE_REG1 0x64
-#define ESPI_IO_RANGE_BASE(range) (ESPI_IO_BASE_REG0 + ((range) & 3) * 2)
-#define ESPI_IO_RANGE_SIZE(range) (ESPI_IO_SIZE0 + ((range) & 3))
-#define ESPI_MMIO_RANGE_BASE(range) (ESPI_MMIO_BASE_REG0 + ((range) & 3) * 4)
-#define ESPI_MMIO_RANGE_SIZE(range) (ESPI_MMIO_SIZE_REG0 + ((range) & 3) * 2)
+#define ESPI_IO_RANGE_BASE_REG(base, range) ((base) + ((range) & 3) * 2)
+#define ESPI_IO_RANGE_SIZE_REG(base, range) ((base) + ((range) & 3))
+#define ESPI_MMIO_RANGE_BASE_REG(base, range) ((base) + ((range) & 3) * 4)
+#define ESPI_MMIO_RANGE_SIZE_REG(base, range) ((base) + ((range) & 3) * 2)
#define ESPI_GENERIC_IO_WIN_COUNT 4
#define ESPI_GENERIC_IO_MAX_WIN_SIZE 0x100
diff --git a/src/soc/amd/common/block/lpc/espi_util.c b/src/soc/amd/common/block/lpc/espi_util.c
index c4d15e4b70..a5f43f4a42 100644
--- a/src/soc/amd/common/block/lpc/espi_util.c
+++ b/src/soc/amd/common/block/lpc/espi_util.c
@@ -72,22 +72,22 @@ static inline uint32_t espi_decode_mmio_range_en_bit(unsigned int idx)
static inline unsigned int espi_io_range_base_reg(unsigned int idx)
{
- return ESPI_IO_RANGE_BASE(idx);
+ return ESPI_IO_RANGE_BASE_REG(ESPI_IO_BASE_REG0, idx);
}
static inline unsigned int espi_io_range_size_reg(unsigned int idx)
{
- return ESPI_IO_RANGE_SIZE(idx);
+ return ESPI_IO_RANGE_SIZE_REG(ESPI_IO_SIZE0, idx);
}
static inline unsigned int espi_mmio_range_base_reg(unsigned int idx)
{
- return ESPI_MMIO_RANGE_BASE(idx);
+ return ESPI_MMIO_RANGE_BASE_REG(ESPI_MMIO_BASE_REG0, idx);
}
static inline unsigned int espi_mmio_range_size_reg(unsigned int idx)
{
- return ESPI_MMIO_RANGE_SIZE(idx);
+ return ESPI_MMIO_RANGE_SIZE_REG(ESPI_MMIO_SIZE_REG0, idx);
}
static void espi_enable_decode(uint32_t decode_en)