diff mbox series

[3/3] libpdbg: Add api to get ti info

Message ID 20200506054948.153723-4-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/libpdbg.h | 11 +++++++++++
 libpdbg/target.c  | 11 +++++++++++
 2 files changed, 22 insertions(+)
diff mbox series

Patch

diff --git a/libpdbg/libpdbg.h b/libpdbg/libpdbg.h
index bdc6cea..b16b3a9 100644
--- a/libpdbg/libpdbg.h
+++ b/libpdbg/libpdbg.h
@@ -1257,6 +1257,17 @@  int sbe_mpipl_enter(struct pdbg_target *target);
  */
 int sbe_mpipl_continue(struct pdbg_target *target);
 
+/**
+ * @brief Get ti info
+ *
+ * @param[in] target pib target to operate on
+ * @param[out] data TI information
+ * @param[out] data_len length of the data
+ *
+ * @return 0 on success, -1 on failure
+ */
+int sbe_mpipl_get_ti_info(struct pdbg_target *target, uint8_t **data, uint32_t *data_len);
+
 /**
  * @brief Type for specifying a progress callback for long running
  * operations
diff --git a/libpdbg/target.c b/libpdbg/target.c
index 501e019..99bce92 100644
--- a/libpdbg/target.c
+++ b/libpdbg/target.c
@@ -345,6 +345,17 @@  int sbe_mpipl_continue(struct pdbg_target *target)
 	return chipop->mpipl_continue(chipop);
 }
 
+int sbe_mpipl_get_ti_info(struct pdbg_target *target, uint8_t **data, uint32_t *data_len)
+{
+	struct chipop *chipop;
+
+	chipop = pib_to_chipop(target);
+	if (!chipop)
+		return -1;
+
+	return chipop->mpipl_get_ti_info(chipop, data, data_len);
+}
+
 uint32_t sbe_ffdc_get(struct pdbg_target *target, const uint8_t **ffdc, uint32_t *ffdc_len)
 {
 	struct chipop *chipop;