[Pdbg] [PATCH v3 3/4] libpdbg: Add sbefifo transport driver for cronus backend
Amitay Isaacs
amitay at ozlabs.org
Thu Oct 31 17:43:00 AEDT 2019
Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
libpdbg/cronus.c | 28 ++++++++++++++++++++++++----
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/libpdbg/cronus.c b/libpdbg/cronus.c
index 7931611..a0e099e 100644
--- a/libpdbg/cronus.c
+++ b/libpdbg/cronus.c
@@ -14,15 +14,14 @@
* limitations under the License.
*/
#include <stdint.h>
+#include <inttypes.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+#include <errno.h>
#include <libcronus/libcronus.h>
+#include <libsbefifo/libsbefifo.h>
#include "hwunit.h"
#include "debug.h"
@@ -138,6 +137,14 @@ static int cronus_fsi_write(struct fsi *fsi, uint32_t addr, uint32_t value)
return 0;
}
+static int cronus_sft_msg(struct sbefifo_transport *sft,
+ uint8_t *msg, uint32_t msg_len,
+ uint8_t *out, uint32_t *out_len)
+{
+ return cronus_submit(cctx, pdbg_target_index(&sft->target),
+ msg, msg_len, out, out_len);
+}
+
static struct pib cronus_pib = {
.target = {
.name = "Cronus Client based PIB",
@@ -164,9 +171,22 @@ static struct fsi cronus_fsi = {
};
DECLARE_HW_UNIT(cronus_fsi);
+struct sbefifo_transport cronus_sft = {
+ .target = {
+ .name = "Cronus Client based SBE FIFO",
+ .compatible = "ibm,cronus-sbefifo-transport",
+ .class = "sbefifo_transport",
+ .probe = cronus_probe,
+ .release = cronus_release,
+ },
+ .msg = cronus_sft_msg,
+};
+DECLARE_HW_UNIT(cronus_sft);
+
__attribute__((constructor))
static void register_cronus(void)
{
pdbg_hwunit_register(&cronus_pib_hw_unit);
pdbg_hwunit_register(&cronus_fsi_hw_unit);
+ pdbg_hwunit_register(&cronus_sft_hw_unit);
}
--
2.21.0
More information about the Pdbg
mailing list