You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

82 lines
2.5 KiB

  1. /***************************************************************************
  2. * Copyright (C) 2015 by David Ung *
  3. * *
  4. * This program is free software; you can redistribute it and/or modify *
  5. * it under the terms of the GNU General Public License as published by *
  6. * the Free Software Foundation; either version 2 of the License, or *
  7. * (at your option) any later version. *
  8. * *
  9. * This program is distributed in the hope that it will be useful, *
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  12. * GNU General Public License for more details. *
  13. * *
  14. * You should have received a copy of the GNU General Public License *
  15. * along with this program; if not, write to the *
  16. * Free Software Foundation, Inc., *
  17. ***************************************************************************/
  18. #ifndef OPENOCD_TARGET_AARCH64_H
  19. #define OPENOCD_TARGET_AARCH64_H
  20. #include "armv8.h"
  21. #define AARCH64_COMMON_MAGIC 0x411fc082
  22. #define CPUDBG_CPUID 0xD00
  23. #define CPUDBG_CTYPR 0xD04
  24. #define CPUDBG_TTYPR 0xD0C
  25. #define ID_AA64PFR0_EL1 0xD20
  26. #define ID_AA64DFR0_EL1 0xD28
  27. #define CPUDBG_LOCKACCESS 0xFB0
  28. #define CPUDBG_LOCKSTATUS 0xFB4
  29. #define BRP_NORMAL 0
  30. #define BRP_CONTEXT 1
  31. #define AARCH64_PADDRDBG_CPU_SHIFT 13
  32. enum aarch64_isrmasking_mode {
  33. AARCH64_ISRMASK_OFF,
  34. AARCH64_ISRMASK_ON,
  35. };
  36. struct aarch64_brp {
  37. int used;
  38. int type;
  39. target_addr_t value;
  40. uint32_t control;
  41. uint8_t brpn;
  42. };
  43. struct aarch64_common {
  44. int common_magic;
  45. /* Context information */
  46. uint32_t system_control_reg;
  47. uint32_t system_control_reg_curr;
  48. /* Breakpoint register pairs */
  49. int brp_num_context;
  50. int brp_num;
  51. int brp_num_available;
  52. struct aarch64_brp *brp_list;
  53. /* Watchpoint register pairs */
  54. int wp_num;
  55. int wp_num_available;
  56. struct aarch64_brp *wp_list;
  57. struct armv8_common armv8_common;
  58. enum aarch64_isrmasking_mode isrmasking_mode;
  59. };
  60. static inline struct aarch64_common *
  61. target_to_aarch64(struct target *target)
  62. {
  63. return container_of(target->arch_info, struct aarch64_common, armv8_common.arm);
  64. }
  65. #endif /* OPENOCD_TARGET_AARCH64_H */