[Pdbg] [PATCH] p8chip: Enable SRESET for P8

Artem Senichev artemsen at gmail.com
Mon Feb 4 21:52:46 AEDT 2019


Add possibility to use NMI SRESET signal to initiate memory dumping
with kdump.
Despite broken implementation of SRESET handler in OPAL it's possible to use
this signal in case of crash of the host OS.
https://lists.ozlabs.org/pipermail/openpower-firmware/2018-April/000220.html

Signed-off-by: Artem Senichev <a.senichev at gmail.com>
---
 libpdbg/p8chip.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libpdbg/p8chip.c b/libpdbg/p8chip.c
index 914c335..5b52033 100644
--- a/libpdbg/p8chip.c
+++ b/libpdbg/p8chip.c
@@ -29,6 +29,7 @@
 #define RAS_STATUS_TIMEOUT	100
 
 #define DIRECT_CONTROLS_REG    		0x0
+#define  DIRECT_CONTROL_SP_SRESET	PPC_BIT(60)
 #define  DIRECT_CONTROL_SP_STEP		PPC_BIT(61)
 #define  DIRECT_CONTROL_SP_START 	PPC_BIT(62)
 #define  DIRECT_CONTROL_SP_STOP 	PPC_BIT(63)
@@ -339,8 +340,8 @@ static int p8_thread_start(struct thread *thread)
 
 static int p8_thread_sreset(struct thread *thread)
 {
-	/* Broken on p8 */
-	return 1;
+	CHECK_ERR(pib_write(&thread->target, DIRECT_CONTROLS_REG, DIRECT_CONTROL_SP_SRESET));
+	return 0;
 }
 
 static int p8_ram_setup(struct thread *thread)
-- 
2.20.1



More information about the Pdbg mailing list