[Pdbg] [PATCH 5/5] libpdbg: Add sbe_dump() api to collect sbe dump data
Amitay Isaacs
amitay at ozlabs.org
Fri Dec 11 13:13:56 AEDT 2020
Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
libpdbg/libpdbg.h | 16 ++++++++++++++++
libpdbg/target.c | 16 ++++++++++++++++
2 files changed, 32 insertions(+)
diff --git a/libpdbg/libpdbg.h b/libpdbg/libpdbg.h
index 7b3b760..93c9e8b 100644
--- a/libpdbg/libpdbg.h
+++ b/libpdbg/libpdbg.h
@@ -1347,6 +1347,22 @@ int sbe_mpipl_continue(struct pdbg_target *target);
*/
int sbe_mpipl_get_ti_info(struct pdbg_target *target, uint8_t **data, uint32_t *data_len);
+/**
+ * @brief Get sbe dump
+ *
+ * The dump data must be freed by caller. It is allocated using malloc() and
+ * must be freed using free().
+ *
+ * @param[in] target pib target to operate on
+ * @param[in] type Type of dump
+ * @param[in] clock Clock on or off
+ * @param[out] data Dump information
+ * @param[out] data_len length of the data
+ *
+ * @return 0 on success, -1 on failure
+ */
+int sbe_dump(struct pdbg_target *target, uint8_t type, uint8_t clock, uint8_t **data, uint32_t *data_len);
+
/**
* @brief Read a OCMB SCOM register
*
diff --git a/libpdbg/target.c b/libpdbg/target.c
index 89006d0..f0cf3dc 100644
--- a/libpdbg/target.c
+++ b/libpdbg/target.c
@@ -455,6 +455,22 @@ int sbe_mpipl_get_ti_info(struct pdbg_target *target, uint8_t **data, uint32_t *
return chipop->mpipl_get_ti_info(chipop, data, data_len);
}
+int sbe_dump(struct pdbg_target *target, uint8_t type, uint8_t clock, uint8_t **data, uint32_t *data_len)
+{
+ struct chipop *chipop;
+
+ chipop = pib_to_chipop(target);
+ if (!chipop)
+ return -1;
+
+ if (!chipop->dump) {
+ PR_ERROR("dump() not implemented for the target\n");
+ return -1;
+ }
+
+ return chipop->dump(chipop, type, clock, data, data_len);
+}
+
int ocmb_getscom(struct pdbg_target *target, uint64_t addr, uint64_t *val)
{
struct ocmb *ocmb;
--
2.26.2
More information about the Pdbg
mailing list