[Pdbg] [PATCH 2/2] libpdbg: Added new generic P9 chiplet type

Alistair Popple alistair at popple.id.au
Mon Dec 11 15:43:08 AEDT 2017


From: Jason Albert <albertj at us.ibm.com>

Add support for detection of generic POWER9 chiplets. Unlike cores they do
not support special wakeup.

Signed-off-by: Jason Albert <albertj at us.ibm.com>
Signed-off-by: Alistair Popple <alistair at popple.id.au>
---
 libpdbg/p9chip.c | 23 +++++++++++++++++++++++
 libpdbg/target.h |  4 ++++
 2 files changed, 27 insertions(+)

diff --git a/libpdbg/p9chip.c b/libpdbg/p9chip.c
index 720c166..8f7a86c 100644
--- a/libpdbg/p9chip.c
+++ b/libpdbg/p9chip.c
@@ -250,3 +250,26 @@ struct core p9_core = {
 	},
 };
 DECLARE_HW_UNIT(p9_core);
+
+static int p9_chiplet_probe(struct pdbg_target *target)
+{
+        uint64_t value;
+
+        if (pib_read(target, NET_CTRL0, &value))
+                return -1;
+
+        if (!(value & NET_CTRL0_CHIPLET_ENABLE))
+                return -1;
+
+        return 0;
+}
+
+struct chiplet p9_chiplet = {
+        .target = {
+                .name = "POWER9 Chiplet",
+                .compatible = "ibm,power9-chiplet",
+                .class = "chiplet",
+                .probe = p9_chiplet_probe,
+        },
+};
+DECLARE_HW_UNIT(p9_chiplet);
diff --git a/libpdbg/target.h b/libpdbg/target.h
index 857d23c..2ae0106 100644
--- a/libpdbg/target.h
+++ b/libpdbg/target.h
@@ -135,4 +135,8 @@ struct thread {
 };
 #define target_to_thread(x) container_of(x, struct thread, target)
 
+/* Place holder for chiplets which we just want translation for */
+struct chiplet {
+        struct pdbg_target target;
+};
 #endif
-- 
2.11.0



More information about the Pdbg mailing list