[Pdbg] [PATCH v2 2/6] libpdbg: Add sbefifo pba hardware unit
Amitay Isaacs
amitay at ozlabs.org
Thu Oct 31 17:39:26 AEDT 2019
Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
libpdbg/sbefifo.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/libpdbg/sbefifo.c b/libpdbg/sbefifo.c
index 75a3645..489d18e 100644
--- a/libpdbg/sbefifo.c
+++ b/libpdbg/sbefifo.c
@@ -197,6 +197,32 @@ static int sbefifo_op_putmem(struct mem *sbefifo_mem,
return _sbefifo_op_putmem(sbefifo_mem, addr, data, size, flags, "putmem");
}
+static int sbefifo_op_getmem_pba(struct mem *sbefifo_mem,
+ uint64_t addr, uint8_t *data, uint64_t size,
+ uint8_t block_size, bool ci)
+{
+ uint16_t flags;
+
+ flags = SBEFIFO_MEMORY_FLAG_PBA;
+ if (ci)
+ flags |= SBEFIFO_MEMORY_FLAG_CI;
+
+ return _sbefifo_op_getmem(sbefifo_mem, addr, data, size, flags, "getmempba");
+}
+
+static int sbefifo_op_putmem_pba(struct mem *sbefifo_mem,
+ uint64_t addr, uint8_t *data, uint64_t size,
+ uint8_t block_size, bool ci)
+{
+ uint16_t flags;
+
+ flags = SBEFIFO_MEMORY_FLAG_PBA;
+ if (ci)
+ flags |= SBEFIFO_MEMORY_FLAG_CI;
+
+ return _sbefifo_op_putmem(sbefifo_mem, addr, data, size, flags, "putmempba");
+}
+
static int sbefifo_op_control(struct sbefifo *sbefifo,
uint32_t core_id, uint32_t thread_id,
uint32_t oper)
@@ -320,6 +346,17 @@ struct mem sbefifo_mem = {
};
DECLARE_HW_UNIT(sbefifo_mem);
+struct mem sbefifo_pba = {
+ .target = {
+ .name = "SBE FIFO Chip-op based memory access",
+ .compatible = "ibm,sbefifo-mem-pba",
+ .class = "mem",
+ },
+ .read = sbefifo_op_getmem_pba,
+ .write = sbefifo_op_putmem_pba,
+};
+DECLARE_HW_UNIT(sbefifo_pba);
+
struct sbefifo sbefifo = {
.target = {
.name = "SBE FIFO Chip-op engine",
@@ -354,4 +391,5 @@ static void register_sbefifo(void)
pdbg_hwunit_register(&kernel_sft_hw_unit);
pdbg_hwunit_register(&sbefifo_hw_unit);
pdbg_hwunit_register(&sbefifo_mem_hw_unit);
+ pdbg_hwunit_register(&sbefifo_pba_hw_unit);
}
--
2.21.0
More information about the Pdbg
mailing list