From 5b90c0f158ffa295cc03b7d846cd600ee47c34fa Mon Sep 17 00:00:00 2001 From: Tim Wawrzynczak Date: Mon, 22 Mar 2021 10:34:46 -0600 Subject: soc/intel/common/systemagent: Add macros to access REGBAR space Signed-off-by: Tim Wawrzynczak Change-Id: I97203aca377d4dd77e03b2c83fdd20a2874cc1c5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/51755 Reviewed-by: Furquan Shaikh Tested-by: build bot (Jenkins) --- src/soc/intel/common/block/include/intelblocks/systemagent.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/soc') diff --git a/src/soc/intel/common/block/include/intelblocks/systemagent.h b/src/soc/intel/common/block/include/intelblocks/systemagent.h index d70706256e..fe14c181fb 100644 --- a/src/soc/intel/common/block/include/intelblocks/systemagent.h +++ b/src/soc/intel/common/block/include/intelblocks/systemagent.h @@ -23,6 +23,13 @@ #define MCHBAR32(x) (*(volatile u32 *)(uintptr_t)(MCH_BASE_ADDRESS + x)) #define MCHBAR64(x) (*(volatile u64 *)(uintptr_t)(MCH_BASE_ADDRESS + x)) +/* REGBAR */ +#define REGBAR_OFFSET(pid, x) (REG_BASE_ADDRESS + ((pid) << 16) + (x)) +#define REGBAR8(pid, x) (*(volatile u8 *)(uintptr_t)REGBAR_OFFSET(pid, x)) +#define REGBAR16(pid, x) (*(volatile u16 *)(uintptr_t)REGBAR_OFFSET(pid, x)) +#define REGBAR32(pid, x) (*(volatile u32 *)(uintptr_t)REGBAR_OFFSET(pid, x)) +#define REGBAR64(pid, x) (*(volatile u64 *)(uintptr_t)REGBAR_OFFSET(pid, x)) + /* Perform System Agent Initialization during Bootblock phase */ void bootblock_systemagent_early_init(void); -- cgit v1.2.3