aboutsummaryrefslogtreecommitdiff
path: root/hw/phys-map.c
diff options
context:
space:
mode:
authorAndrew Donnellan <ajd@linux.ibm.com>2019-05-14 11:10:33 +1000
committerStewart Smith <stewart@linux.ibm.com>2019-05-20 14:20:29 +1000
commit1a548857ce1f02f43585b326a891eed18a7b43b3 (patch)
tree1032e9242e08254bb1264c77624e59470bc0580b /hw/phys-map.c
parenta00971e1946bf184c2f38e16123bdb3537602a9c (diff)
downloadskiboot-1a548857ce1f02f43585b326a891eed18a7b43b3.zip
skiboot-1a548857ce1f02f43585b326a891eed18a7b43b3.tar.gz
skiboot-1a548857ce1f02f43585b326a891eed18a7b43b3.tar.bz2
hw/npu2-opencapi: Add initial support for allocating OpenCAPI LPC memory
Lowest Point of Coherency (LPC) memory allows the host to access memory on an OpenCAPI device. Define 2 OPAL calls, OPAL_NPU_MEM_ALLOC and OPAL_NPU_MEM_RELEASE, for assigning and clearing the memory BAR. (We try to avoid using the term "LPC" to avoid confusion with Low Pin Count.) At present, we use a fixed location in the address space, which means we are restricted to a single range of 4TB, on a single OpenCAPI device per chip. In future, we'll use some chip ID extension magic to give us more space, and some sort of allocator to assign ranges to more than one device. Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com> Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'hw/phys-map.c')
-rw-r--r--hw/phys-map.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/phys-map.c b/hw/phys-map.c
index fe949e4..7583629 100644
--- a/hw/phys-map.c
+++ b/hw/phys-map.c
@@ -52,6 +52,17 @@ static const struct phys_map_entry phys_map_table_nimbus[] = {
{ GPU_MEM_4T_UP, 2, 0x0000044000000000ull, 0x0000002000000000ull },
{ GPU_MEM_4T_UP, 3, 0x0000046000000000ull, 0x0000002000000000ull },
+ /*
+ * OpenCAPI LPC Memory - single 4TB range per chip, fills
+ * whole second non-mirrored region.
+ *
+ * Longer term, we're going to use chip address extension to
+ * enable >4TB to be allocated per chip. At that point, we
+ * may have to find another way of assigning these ranges
+ * outside of phys-map.
+ */
+ { OCAPI_MEM, 0, 0x0002000000000000ull, 0x0000040000000000ull },
+
/* 0 TB offset @ MMIO 0x0006000000000000ull */
{ PHB4_64BIT_MMIO, 0, 0x0006000000000000ull, 0x0000004000000000ull },
{ PHB4_64BIT_MMIO, 1, 0x0006004000000000ull, 0x0000004000000000ull },