debugv8p9.c 672 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright (c) 2024, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <arch.h>
  7. #include <arch_features.h>
  8. #include <arch_helpers.h>
  9. #include <lib/extensions/debug_v8p9.h>
  10. void debugv8p9_extended_bp_wp_enable(cpu_context_t *ctx)
  11. {
  12. el3_state_t *state = get_el3state_ctx(ctx);
  13. u_register_t mdcr_el3_val = read_ctx_reg(state, CTX_MDCR_EL3);
  14. /* When FEAT_Debugv8p9 is implemented:
  15. *
  16. * MDCR_EL3.EBWE: Set to 0b1
  17. * Enables use of additional breakpoints or watchpoints,
  18. * and disables trap to EL3 on accesses to debug register.
  19. */
  20. mdcr_el3_val |= MDCR_EBWE_BIT;
  21. write_ctx_reg(state, CTX_MDCR_EL3, mdcr_el3_val);
  22. }