[Pdbg] [PATCH] libpdbg: Split nhtm hardware units for p8 and p9

Amitay Isaacs amitay at ozlabs.org
Fri Nov 23 14:38:45 AEDT 2018


Even though device tree compatible property can hold multiple strings,
the struct pdbg_target definition can only take a single compatible
string.

Also, rename chtm hw unit to match nhtm.

Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
 libpdbg/htm.c | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/libpdbg/htm.c b/libpdbg/htm.c
index 1ca176d..070980b 100644
--- a/libpdbg/htm.c
+++ b/libpdbg/htm.c
@@ -1107,10 +1107,10 @@ static int chtm_probe(struct pdbg_target *target)
 	return is_debugfs_memtrace_ok() && is_debugfs_scom_ok() ? 0 : -1;
 }
 
-static struct htm nhtm = {
+static struct htm p8_nhtm = {
 	.target = {
-		.name =	"Nest HTM",
-		.compatible = "ibm,power8-nhtm", "ibm,power9-nhtm",
+		.name =	"POWER8 Nest HTM",
+		.compatible = "ibm,power8-nhtm",
 		.class = "nhtm",
 		.probe = nhtm_probe,
 	},
@@ -1120,9 +1120,24 @@ static struct htm nhtm = {
 	.status = do_htm_status,
 	.dump = do_htm_dump,
 };
-DECLARE_HW_UNIT(nhtm);
+DECLARE_HW_UNIT(p8_nhtm);
 
-static struct htm chtm = {
+static struct htm p9_nhtm = {
+	.target = {
+		.name =	"POWER9 Nest HTM",
+		.compatible = "ibm,power9-nhtm",
+		.class = "nhtm",
+		.probe = nhtm_probe,
+	},
+	.start = do_htm_start,
+	.stop = do_htm_stop,
+	.record = do_htm_record,
+	.status = do_htm_status,
+	.dump = do_htm_dump,
+};
+DECLARE_HW_UNIT(p9_nhtm);
+
+static struct htm p8_chtm = {
 	.target = {
 		.name = "POWER8 Core HTM",
 		.compatible = "ibm,power8-chtm",
@@ -1135,4 +1150,4 @@ static struct htm chtm = {
 	.status = do_htm_status,
 	.dump = do_htm_dump,
 };
-DECLARE_HW_UNIT(chtm);
+DECLARE_HW_UNIT(p8_chtm);
-- 
2.19.1



More information about the Pdbg mailing list