@@ -730,9 +730,15 @@ static int do_htm_reset(struct htm *htm, bool wrap)
static int htm_toggle_debug_bit(struct htm *htm)
{
struct pdbg_target *target;
- struct pdbg_target *core = pdbg_target_require_parent("core", &htm->target);
+ struct pdbg_target *core;
uint64_t reg;
+ /* NHTM doesn't have a core as a parent but donesn't need this
+ * bit toggled */
+ core = pdbg_target_parent("core", &htm->target);
+ if (!core)
+ return 0; /* nhtm case */
+
/* FIXME: this is a hack for P8 */
if (!dt_node_is_compatible(core, "ibm,power8-core")) {
PR_ERROR("HTM is POWER8 only currently\n");
Currently htm_toggle_debug_bit() assumes the target's parent is a core but this is only the case for core htm. For nest htm, the target's parent is a chip. Also for nest, we don't need to toggle this bit. This detects the nest htm case and just returns. Signed-off-by: Michael Neuling <mikey@neuling.org> --- libpdbg/htm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)