]> git.sur5r.net Git - openocd/blob - src/target/aarch64.h
aarch64: Add ARMv8 AARCH64 support files
[openocd] / src / target / aarch64.h
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
19 #ifndef AARCH64_H
20 #define AARCH64_H
21
22 #include "armv8.h"
23
24 #define AARCH64_COMMON_MAGIC 0x411fc082
25
26 #define CPUDBG_CPUID    0xD00
27 #define CPUDBG_CTYPR    0xD04
28 #define CPUDBG_TTYPR    0xD0C
29 #define ID_AA64PFR0_EL1 0xD20
30 #define ID_AA64DFR0_EL1 0xD28
31 #define CPUDBG_LOCKACCESS 0xFB0
32 #define CPUDBG_LOCKSTATUS 0xFB4
33
34 #define BRP_NORMAL 0
35 #define BRP_CONTEXT 1
36
37 #define AARCH64_PADDRDBG_CPU_SHIFT 13
38
39 struct aarch64_brp {
40         int used;
41         int type;
42         target_addr_t value;
43         uint32_t control;
44         uint8_t BRPn;
45 };
46
47 struct aarch64_common {
48         int common_magic;
49
50         /* Context information */
51         uint32_t cpudbg_dscr;
52
53         uint32_t system_control_reg;
54         uint32_t system_control_reg_curr;
55
56         enum arm_mode curr_mode;
57
58
59         /* Breakpoint register pairs */
60         int brp_num_context;
61         int brp_num;
62         int brp_num_available;
63         struct aarch64_brp *brp_list;
64
65         /* Use aarch64_read_regs_through_mem for fast register reads */
66         int fast_reg_read;
67
68         struct armv8_common armv8_common;
69
70 };
71
72 static inline struct aarch64_common *
73 target_to_aarch64(struct target *target)
74 {
75         return container_of(target->arch_info, struct aarch64_common, armv8_common.arm);
76 }
77
78 #endif /* AARCH64_H */