summaryrefslogtreecommitdiff
path: root/src/soc/intel/common
diff options
context:
space:
mode:
authorTim Wawrzynczak <twawrzynczak@chromium.org>2021-03-22 10:34:46 -0600
committerPatrick Georgi <pgeorgi@google.com>2021-03-28 16:04:54 +0000
commit5b90c0f158ffa295cc03b7d846cd600ee47c34fa (patch)
tree0369a575763848125e64d60a928f84970bd249d6 /src/soc/intel/common
parente2852579b8f889416c454a92b9c74b317fa508ae (diff)
downloadcoreboot-5b90c0f158ffa295cc03b7d846cd600ee47c34fa.tar.xz
soc/intel/common/systemagent: Add macros to access REGBAR space
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Change-Id: I97203aca377d4dd77e03b2c83fdd20a2874cc1c5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/51755 Reviewed-by: Furquan Shaikh <furquan@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/common')
-rw-r--r--src/soc/intel/common/block/include/intelblocks/systemagent.h7
1 files changed, 7 insertions, 0 deletions
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);