10ms timeout check on cp15 read/write
[openocd.git] / src / target / cortex_a8.h
blobd675ee4c64ebd67ae2f3efcbe6b4ca589257402e
1 /***************************************************************************
2 * Copyright (C) 2005 by Dominic Rath *
3 * Dominic.Rath@gmx.de *
4 * *
5 * Copyright (C) 2006 by Magnus Lundin *
6 * lundin@mlu.mine.nu *
7 * *
8 * Copyright (C) 2008 by Spencer Oliver *
9 * spen@spen-soft.co.uk *
10 * *
11 * Copyright (C) 2009 by Dirk Behme *
12 * dirk.behme@gmail.com - copy from cortex_m3 *
13 * *
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. *
18 * *
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. *
23 * *
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 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
28 ***************************************************************************/
29 #ifndef CORTEX_A8_H
30 #define CORTEX_A8_H
32 #include "register.h"
33 #include "target.h"
34 #include "armv7m.h"
36 extern char* cortex_a8_state_strings[];
38 #define CORTEX_A8_COMMON_MAGIC 0x411fc082
40 #define CPUID 0x54011D00
41 /* Debug Control Block */
42 #define DCB_DHCSR 0x54011DF0
43 #define DCB_DCRSR 0x54011DF4
44 #define DCB_DCRDR 0x54011DF8
45 #define DCB_DEMCR 0x54011DFC
47 typedef struct cortex_a8_fp_comparator_s
49 int used;
50 int type;
51 uint32_t fpcr_value;
52 uint32_t fpcr_address;
53 } cortex_a8_fp_comparator_t;
55 typedef struct cortex_a8_dwt_comparator_s
57 int used;
58 uint32_t comp;
59 uint32_t mask;
60 uint32_t function;
61 uint32_t dwt_comparator_address;
62 } cortex_a8_dwt_comparator_t;
64 typedef struct cortex_a8_common_s
66 int common_magic;
67 arm_jtag_t jtag_info;
69 /* Context information */
70 uint32_t dcb_dhcsr;
71 uint32_t nvic_dfsr; /* Debug Fault Status Register - shows reason for debug halt */
72 uint32_t nvic_icsr; /* Interrupt Control State Register - shows active and pending IRQ */
74 /* Flash Patch and Breakpoint (FPB) */
75 int fp_num_lit;
76 int fp_num_code;
77 int fp_code_available;
78 int fpb_enabled;
79 int auto_bp_type;
80 cortex_a8_fp_comparator_t *fp_comparator_list;
82 /* Data Watchpoint and Trace (DWT) */
83 int dwt_num_comp;
84 int dwt_comp_available;
85 cortex_a8_dwt_comparator_t *dwt_comparator_list;
87 /* Interrupts */
88 int intlinesnum;
89 uint32_t *intsetenable;
91 armv7m_common_t armv7m;
92 void *arch_info;
93 } cortex_a8_common_t;
95 extern int cortex_a8_init_arch_info(target_t *target, cortex_a8_common_t *cortex_a8, jtag_tap_t *tap);
96 int cortex_a8_read_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
97 int cortex_a8_write_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
99 #endif /* CORTEX_A8_H */