diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/npu2.h | 3 | ||||
-rw-r--r-- | include/pau-regs.h | 8 | ||||
-rw-r--r-- | include/pau.h | 4 |
3 files changed, 15 insertions, 0 deletions
diff --git a/include/npu2.h b/include/npu2.h index a12bf98..b302108 100644 --- a/include/npu2.h +++ b/include/npu2.h @@ -277,5 +277,8 @@ int64_t npu2_opencapi_spa_clear_cache(struct phb *phb, uint32_t __unused bdfn, uint64_t PE_handle); int64_t npu2_opencapi_tl_set(struct phb *phb, uint32_t __unused bdfn, long capabilities, char *rate); +int64_t npu2_opencapi_mem_alloc(struct phb *phb, uint32_t __unused bdfn, + uint64_t size, uint64_t *bar); +int64_t npu2_opencapi_mem_release(struct phb *phb, uint32_t __unused bdfn); #endif /* __NPU2_H */ diff --git a/include/pau-regs.h b/include/pau-regs.h index da83ad4..45c3603 100644 --- a/include/pau-regs.h +++ b/include/pau-regs.h @@ -64,6 +64,12 @@ #define PAU_SNP_MISC_CFG0_ENABLE_PBUS PPC_BIT(2) #define PAU_SNP_MISC_CFG0_OCAPI_MODE PPC_BITMASK(32, 36) #define PAU_SNP_MISC_CFG0_OCAPI_C2 PPC_BITMASK(45, 49) +#define PAU_GPU_MEM_BAR(brk) (PAU_BLOCK_CQ_SM(0) + 0x190 + (brk) * 8) +#define PAU_GPU_MEM_BAR_ENABLE PPC_BIT(0) +#define PAU_GPU_MEM_BAR_ADDR_MASK PPC_BITMASK(1, 35) +#define PAU_GPU_MEM_BAR_ADDR PPC_BITMASK(1, 21) +#define PAU_GPU_MEM_BAR_SIZE PPC_BITMASK(22, 35) +#define PAU_GPU_MEM_BAR_POISON PPC_BIT(45) #define PAU_NTL_BAR(brk) (PAU_BLOCK_CQ_SM(0) + 0x1b8 + (brk) * 8) #define PAU_NTL_BAR_ENABLE PPC_BIT(0) #define PAU_NTL_BAR_ADDR PPC_BITMASK(3, 35) @@ -88,6 +94,7 @@ #define PAU_CTL_MISC_CFG2_OCAPI_MEM_OS_BIT PPC_BITMASK(25, 29) #define PAU_CTL_MISC_STATUS(brk) (PAU_BLOCK_CQ_CTL + 0x060 + (brk) * 8) #define PAU_CTL_MISC_STATUS_AM_FENCED(brk) (PPC_BITMASK(41, 42) << ((brk)*32)) +#define PAU_CTL_MISC_GPU_MEM_BAR(brk) (PAU_BLOCK_CQ_CTL + 0x070 + (brk) * 8) #define PAU_CTL_MISC_MMIOPA_CONFIG(brk) (PAU_BLOCK_CQ_CTL + 0x098 + (brk) * 8) #define PAU_CTL_MISC_MMIOPA_CONFIG_BAR_ADDR PPC_BITMASK(1, 35) #define PAU_CTL_MISC_MMIOPA_CONFIG_BAR_SIZE PPC_BITMASK(39, 43) @@ -159,6 +166,7 @@ /* XSL block registers */ #define PAU_XSL_OSL_SPAP_AN(brk) (PAU_BLOCK_XSL + 0x000 + (brk) * 8) #define PAU_XSL_OSL_SPAP_AN_EN PPC_BIT(63) +#define PAU_XSL_GPU_MEM_BAR(brk) (PAU_BLOCK_XSL + 0x0D0 + (brk) * 8) #define PAU_XSL_WRAP_CFG (PAU_BLOCK_XSL + 0x100) #define PAU_XSL_WRAP_CFG_CLOCK_ENABLE PPC_BIT(0) #define PAU_XSL_OSL_XLATE_CFG(brk) (PAU_BLOCK_XSL + 0x040 + (brk) * 8) diff --git a/include/pau.h b/include/pau.h index a70058f..4a6087c 100644 --- a/include/pau.h +++ b/include/pau.h @@ -45,6 +45,7 @@ struct pau_dev { struct pau_bar ntl_bar; struct pau_bar genid_bar; + struct pau_bar memory_bar; /* Associated I2C information */ uint8_t i2c_bus_id; @@ -209,6 +210,9 @@ int64_t pau_opencapi_spa_clear_cache(struct phb *phb, uint64_t PE_handle); int64_t pau_opencapi_tl_set(struct phb *phb, uint32_t __unused bdfn, long capabilities, char *rate_buf); +int64_t pau_opencapi_mem_alloc(struct phb *phb, uint32_t __unused bdfn, + uint64_t size, uint64_t *bar); +int64_t pau_opencapi_mem_release(struct phb *phb, uint32_t __unused bdfn); /* PHY */ int pau_dev_phy_reset(struct pau_dev *dev); |