diff mbox series

[2/3] libpdbg: Add mpipl_get_ti_info procedure to chipop

Message ID 20200506054948.153723-3-amitay@ozlabs.org
State Accepted
Headers show
Series Add new sbefifo chip-op (GET_TI_INFO) | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (6c10b68bf774a9fe21affd5ef0b40084cd49800d)
snowpatch_ozlabs/build-multiarch success Test build-multiarch on branch master

Commit Message

Amitay Isaacs May 6, 2020, 5:49 a.m. UTC
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
---
 libpdbg/hwunit.h  | 1 +
 libpdbg/sbefifo.c | 9 +++++++++
 2 files changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/libpdbg/hwunit.h b/libpdbg/hwunit.h
index c30c048..61aea0f 100644
--- a/libpdbg/hwunit.h
+++ b/libpdbg/hwunit.h
@@ -76,6 +76,7 @@  struct chipop {
 	int (*istep)(struct chipop *, uint32_t major, uint32_t minor);
 	int (*mpipl_enter)(struct chipop *);
 	int (*mpipl_continue)(struct chipop *);
+	int (*mpipl_get_ti_info)(struct chipop *, uint8_t **, uint32_t *);
 };
 #define target_to_chipop(x) container_of(x, struct chipop, target)
 
diff --git a/libpdbg/sbefifo.c b/libpdbg/sbefifo.c
index 3b2a786..eadce10 100644
--- a/libpdbg/sbefifo.c
+++ b/libpdbg/sbefifo.c
@@ -195,6 +195,14 @@  static int sbefifo_op_mpipl_enter(struct chipop *chipop)
 	return sbefifo_mpipl_enter(sctx);
 }
 
+static int sbefifo_op_mpipl_get_ti_info(struct chipop *chipop, uint8_t **data, uint32_t *data_len)
+{
+	struct sbefifo *sbefifo = target_to_sbefifo(chipop->target.parent);
+	struct sbefifo_context *sctx = sbefifo->get_sbefifo_context(sbefifo);
+
+	return sbefifo_mpipl_get_ti_info(sctx, data, data_len);
+}
+
 static struct sbefifo *pib_to_sbefifo(struct pdbg_target *pib)
 {
 	struct pdbg_target *target;
@@ -399,6 +407,7 @@  static struct chipop sbefifo_chipop = {
 	.istep = sbefifo_op_istep,
 	.mpipl_enter = sbefifo_op_mpipl_enter,
 	.mpipl_continue = sbefifo_op_mpipl_continue,
+	.mpipl_get_ti_info = sbefifo_op_mpipl_get_ti_info,
 };
 DECLARE_HW_UNIT(sbefifo_chipop);