1 /***************************************************************************
2 * Copyright (C) 2005 by Dominic Rath *
3 * Dominic.Rath@gmx.de *
5 * Copyright (C) 2006 by Magnus Lundin *
8 * Copyright (C) 2008 by Spencer Oliver *
9 * spen@spen-soft.co.uk *
11 * Copyright (C) 2009 by Dirk Behme *
12 * dirk.behme@gmail.com - copy from cortex_m3 *
14 * This program is free software; you can redistribute it and/or modify *
15 * it under the terms of the GNU General Public License as published by *
16 * the Free Software Foundation; either version 2 of the License, or *
17 * (at your option) any later version. *
19 * This program is distributed in the hope that it will be useful, *
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22 * GNU General Public License for more details. *
24 * You should have received a copy of the GNU General Public License *
25 * along with this program; if not, write to the *
26 * Free Software Foundation, Inc., *
27 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
28 ***************************************************************************/
35 #define CORTEX_A_COMMON_MAGIC 0x411fc082
36 #define CORTEX_A15_COMMON_MAGIC 0x413fc0f1
38 #define CORTEX_A7_PARTNUM 0xc07
39 #define CORTEX_A8_PARTNUM 0xc08
40 #define CORTEX_A9_PARTNUM 0xc09
41 #define CORTEX_A15_PARTNUM 0xc0f
42 #define CORTEX_A_MIDR_PARTNUM_MASK 0x0000fff0
43 #define CORTEX_A_MIDR_PARTNUM_SHIFT 4
45 #define CPUDBG_CPUID 0xD00
46 #define CPUDBG_CTYPR 0xD04
47 #define CPUDBG_TTYPR 0xD0C
48 #define CPUDBG_LOCKACCESS 0xFB0
49 #define CPUDBG_LOCKSTATUS 0xFB4
50 #define CPUDBG_OSLAR_LK_MASK (1 << 1)
55 #define CORTEX_A_PADDRDBG_CPU_SHIFT 13
65 struct cortex_a_common
{
67 struct arm_jtag jtag_info
;
69 /* Context information */
72 /* Saved cp15 registers */
73 uint32_t cp15_control_reg
;
74 /* latest cp15 register value written and cpsr processor mode */
75 uint32_t cp15_control_reg_curr
;
76 enum arm_mode curr_mode
;
79 /* Breakpoint register pairs */
82 int brp_num_available
;
83 struct cortex_a_brp
*brp_list
;
85 /* Use cortex_a_read_regs_through_mem for fast register reads */
93 struct armv7a_common armv7a_common
;
97 static inline struct cortex_a_common
*
98 target_to_cortex_a(struct target
*target
)
100 return container_of(target
->arch_info
, struct cortex_a_common
, armv7a_common
.arm
);
103 #endif /* CORTEX_A_H */