aboutsummaryrefslogtreecommitdiff
path: root/include/npu2-regs.h
diff options
context:
space:
mode:
authorReza Arbab <arbab@linux.ibm.com>2018-08-01 15:01:16 -0500
committerStewart Smith <stewart@linux.ibm.com>2018-08-06 03:00:59 -0500
commit06e9970099459ad01f3cb4456baf94093165a183 (patch)
treed34077b96e26f07b5e07b753140532646e01cdd1 /include/npu2-regs.h
parent77f26507f1ea17f535522e93667ffd4a7cd06dbb (diff)
downloadskiboot-06e9970099459ad01f3cb4456baf94093165a183.zip
skiboot-06e9970099459ad01f3cb4456baf94093165a183.tar.gz
skiboot-06e9970099459ad01f3cb4456baf94093165a183.tar.bz2
npu2: Add NPU2_SM_REG_OFFSET()
Add a register offset calculation macro using SM block index, similar to the other NPU2_*_REG_OFFSET() macros. Signed-off-by: Alistair Popple <alistair@popple.id.au> [arbab@linux.ibm.com: Rebase/refactor original changes] Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Reviewed-By: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'include/npu2-regs.h')
-rw-r--r--include/npu2-regs.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/npu2-regs.h b/include/npu2-regs.h
index d797026..4a17ac8 100644
--- a/include/npu2-regs.h
+++ b/include/npu2-regs.h
@@ -55,6 +55,10 @@ void npu2_scom_write(uint64_t gcid, uint64_t scom_base,
NPU2_REG_OFFSET(((ndev)->index >> 1), \
8 + ((ndev)->index % 2)*2, offset)
+#define NPU2_SM_REG_OFFSET(ndev, sm, offset) \
+ NPU2_REG_OFFSET(NPU2_STACK_STCK_0 + ((ndev)->index >> 1), \
+ NPU2_BLOCK_SM_0 + (sm), offset)
+
/* Get the offset for this register */
#define NPU2_REG(reg) \
((reg) & 0xffff)