[Pdbg] [PATCH 05/10] libpdbg/p9chip.c: implement core target release to de-assert special wakeup

Nicholas Piggin npiggin at gmail.com
Thu May 3 16:26:57 AEST 2018


Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
 libpdbg/p9chip.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/libpdbg/p9chip.c b/libpdbg/p9chip.c
index e64c73c..d9fcf5f 100644
--- a/libpdbg/p9chip.c
+++ b/libpdbg/p9chip.c
@@ -24,6 +24,13 @@
 #include "operations.h"
 #include "bitutils.h"
 
+/*
+ * NOTE!
+ * All timeouts and scom procedures in general through the file should be kept
+ * in synch with skiboot (e.g., core/direct-controls.c) as far as possible.
+ * If you fix a bug here, fix it in skiboot, and vice versa.
+ */
+
 #define P9_RAS_STATUS 0x10a02
 #define P9_CORE_THREAD_STATE 0x10ab3
 #define P9_THREAD_INFO 0x10a9b
@@ -450,12 +457,20 @@ static int p9_core_probe(struct pdbg_target *target)
 	return 0;
 }
 
+static void p9_core_release(struct pdbg_target *target)
+{
+	usleep(1); /* enforce small delay before and after it is cleared */
+	pib_write(target, PPM_SPWKUP_OTR, 0);
+	usleep(10000);
+}
+
 static struct core p9_core = {
 	.target = {
 		.name = "POWER9 Core",
 		.compatible = "ibm,power9-core",
 		.class = "core",
 		.probe = p9_core_probe,
+		.release = p9_core_release,
 	},
 };
 DECLARE_HW_UNIT(p9_core);
-- 
2.17.0



More information about the Pdbg mailing list