1 /***************************************************************************
2 * Copyright (C) 2005 by Dominic Rath *
3 * Dominic.Rath@gmx.de *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
26 #include "armv4_5_mmu.h"
30 #define XSCALE_COMMON_MAGIC 0x58534341
32 typedef struct xscale_jtag_s
34 /* position in JTAG scan chain */
37 /* IR length and instructions */
45 enum xscale_debug_reason
47 XSCALE_DBG_REASON_GENERIC,
48 XSCALE_DBG_REASON_RESET,
49 XSCALE_DBG_REASON_TB_FULL,
52 enum xscale_trace_entry_type
54 XSCALE_TRACE_MESSAGE = 0x0,
55 XSCALE_TRACE_ADDRESS = 0x1,
58 typedef struct xscale_trace_entry_s
61 enum xscale_trace_entry_type type;
62 } xscale_trace_entry_t;
64 typedef struct xscale_trace_data_s
66 xscale_trace_entry_t *entries;
71 struct xscale_trace_data_s *next;
72 } xscale_trace_data_t;
74 typedef struct xscale_trace_s
76 trace_status_t capture_status; /* current state of capture run */
77 image_t *image; /* source for target opcodes */
78 xscale_trace_data_t *data; /* linked list of collected trace data */
79 int buffer_enabled; /* whether trace buffer is enabled */
80 int buffer_fill; /* maximum number of trace runs to read (-1 for wrap-around) */
83 armv4_5_state_t core_state; /* current core state (ARM, Thumb, Jazelle) */
86 typedef struct xscale_common_s
90 /* XScale registers (CP15, DBG) */
91 reg_cache_t *reg_cache;
93 /* pxa250, pxa255, pxa27x, ixp42x, ... */
96 xscale_jtag_t jtag_info;
98 /* current state of the debug handler */
99 int handler_installed;
103 /* target-endian buffers with exception vectors */
107 /* static low vectors */
108 u8 static_low_vectors_set; /* bit field with static vectors set by the user */
109 u8 static_high_vectors_set; /* bit field with static vectors set by the user */
110 u32 static_low_vectors[8];
111 u32 static_high_vectors[8];
113 /* DCache cleaning */
114 u32 cache_clean_address;
116 /* whether hold_rst and ext_dbg_break should be set */
118 int external_debug_break;
120 /* breakpoint / watchpoint handling */
133 xscale_trace_t trace;
135 int arch_debug_reason;
137 /* armv4/5 common stuff */
138 armv4_5_common_t armv4_5_common;
141 armv4_5_mmu_common_t armv4_5_mmu;
142 u32 cp15_control_reg;
144 /* possible future enhancements that go beyond XScale common stuff */
147 int fast_memory_access;
150 typedef struct xscale_reg_s
152 int dbg_handler_number;
158 XSCALE_MAINID, /* 0 */
168 XSCALE_IBCR0, /* 10 */
182 #define ERROR_XSCALE_NO_TRACE_DATA (-1500)
184 #endif /* XSCALE_H */