diff options
| author | Michael Neuling <mikey@neuling.org> | 2018-09-04 16:12:30 +1000 |
|---|---|---|
| committer | Alistair Popple <alistair@popple.id.au> | 2018-09-07 13:51:20 +1000 |
| commit | c13ef4b94437f57152ebc235b3976f8c42a6dad8 (patch) | |
| tree | ac6bbcd180b301c9168eeb0a2232b7095da2316b | |
| parent | f801b5b21a805114556d2505a73c84f2c0c1de55 (diff) | |
| download | pdbg-c13ef4b94437f57152ebc235b3976f8c42a6dad8.tar.gz pdbg-c13ef4b94437f57152ebc235b3976f8c42a6dad8.zip | |
htm: Allow nest htm in htm_toggle_debug_bit()
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>
| -rw-r--r-- | libpdbg/htm.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libpdbg/htm.c b/libpdbg/htm.c index 6bc6b73..f9013e5 100644 --- a/libpdbg/htm.c +++ b/libpdbg/htm.c @@ -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"); |

