• Dietmar Eggemann's avatar
    ARM: hw_breakpoint: Debug powerdown support for self-hosted debug · 9a6eb310
    Dietmar Eggemann authored
    This patch introduces debug powerdown support for self-hosted debug for v7
    and v7.1 debug architecture for a SinglePower system, i.e. a system without a
    separate core and debug power domain. On a SinglePower system the OS Lock is
    lost over a powerdown.
    
    If CONFIG_CPU_PM is set the new function pm_init() registers hw_breakpoint
    with CPU PM for a system supporting OS Save and Restore.
    
    Receiving a CPU PM EXIT notifier indicates that a single CPU has exited a low
    power state. A call to reset_ctrl_regs() is hooked into the CPU PM EXIT
    notifier chain. This function makes sure that the sticky power-down is clear
    (only v7 debug), the OS Double Lock is clear (only v7.1 debug) and it clears
    the OS Lock for v7 debug (for a system supporting OS Save and Restore) and
    v7.1 debug. Furthermore, it clears any vector-catch events and all
    breakpoint/watchpoint control/value registers for v7 and v7.1 debug.
    Signed-off-by: default avatarDietmar Eggemann <dietmar.eggemann@arm.com>
    [will: removed redundant has_ossr check]
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    9a6eb310
hw_breakpoint.c 26.6 KB