[Pdbg] [PATCH 05/14] libpdbg/p9chip.c: Implement target release to lower special wakeup
Nicholas Piggin
npiggin at gmail.com
Mon Apr 9 17:35:13 AEST 2018
Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
libpdbg/libpdbg.h | 1 +
libpdbg/p9chip.c | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/libpdbg/libpdbg.h b/libpdbg/libpdbg.h
index 8c57193..e57058a 100644
--- a/libpdbg/libpdbg.h
+++ b/libpdbg/libpdbg.h
@@ -37,6 +37,7 @@ uint64_t pdbg_get_address(struct pdbg_target *target, uint64_t *size);
/* Misc. */
void pdbg_targets_init(void *fdt);
void pdbg_target_probe(void);
+void pdbg_target_release(void);
void pdbg_enable_target(struct pdbg_target *target);
void pdbg_disable_target(struct pdbg_target *target);
enum pdbg_target_status pdbg_target_status(struct pdbg_target *target);
diff --git a/libpdbg/p9chip.c b/libpdbg/p9chip.c
index 033e3eb..a969ef6 100644
--- a/libpdbg/p9chip.c
+++ b/libpdbg/p9chip.c
@@ -237,12 +237,20 @@ static int p9_core_probe(struct pdbg_target *target)
return 0;
}
+static void p9_core_release(struct pdbg_target *target)
+{
+ usleep(1000); /* enforce small delay before and after it is cleared */
+ pib_write(target, PPM_SPWKUP_OTR, 0);
+ usleep(10000);
+}
+
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