Commit 687a9553 authored by oharboe's avatar oharboe
Browse files

From Michael Bruck

- bugfix in server.c
- removed unused parameter from jtag_add_ir_scan et al. This
wasn't necessary in hindsight but anyway.
- arm11 source committed but not not in Makefile.am/target.c for now.

git-svn-id: svn://svn.berlios.de/openocd/trunk@341 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent 4edcbe0a
...@@ -148,7 +148,7 @@ int str9xpec_set_instr(int chain_pos, u32 new_instr, enum tap_state end_state) ...@@ -148,7 +148,7 @@ int str9xpec_set_instr(int chain_pos, u32 new_instr, enum tap_state end_state)
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_ir_scan(1, &field, end_state, NULL); jtag_add_ir_scan(1, &field, end_state);
free(field.out_value); free(field.out_value);
} }
...@@ -174,7 +174,7 @@ u8 str9xpec_isc_status(int chain_pos) ...@@ -174,7 +174,7 @@ u8 str9xpec_isc_status(int chain_pos)
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_dr_scan(1, &field, TAP_RTI, NULL); jtag_add_dr_scan(1, &field, TAP_RTI);
jtag_execute_queue(); jtag_execute_queue();
DEBUG("status: 0x%2.2x", status); DEBUG("status: 0x%2.2x", status);
...@@ -266,7 +266,7 @@ int str9xpec_read_config(struct flash_bank_s *bank) ...@@ -266,7 +266,7 @@ int str9xpec_read_config(struct flash_bank_s *bank)
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_dr_scan(1, &field, TAP_RTI, NULL); jtag_add_dr_scan(1, &field, TAP_RTI);
jtag_execute_queue(); jtag_execute_queue();
status = str9xpec_isc_status(chain_pos); status = str9xpec_isc_status(chain_pos);
...@@ -409,7 +409,7 @@ int str9xpec_blank_check(struct flash_bank_s *bank, int first, int last) ...@@ -409,7 +409,7 @@ int str9xpec_blank_check(struct flash_bank_s *bank, int first, int last)
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_dr_scan(1, &field, TAP_RTI, NULL); jtag_add_dr_scan(1, &field, TAP_RTI);
jtag_add_sleep(40000); jtag_add_sleep(40000);
/* read blank check result */ /* read blank check result */
...@@ -423,7 +423,7 @@ int str9xpec_blank_check(struct flash_bank_s *bank, int first, int last) ...@@ -423,7 +423,7 @@ int str9xpec_blank_check(struct flash_bank_s *bank, int first, int last)
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_dr_scan(1, &field, TAP_PI, NULL); jtag_add_dr_scan(1, &field, TAP_PI);
jtag_execute_queue(); jtag_execute_queue();
status = str9xpec_isc_status(chain_pos); status = str9xpec_isc_status(chain_pos);
...@@ -525,7 +525,7 @@ int str9xpec_erase_area(struct flash_bank_s *bank, int first, int last) ...@@ -525,7 +525,7 @@ int str9xpec_erase_area(struct flash_bank_s *bank, int first, int last)
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_dr_scan(1, &field, TAP_RTI, NULL); jtag_add_dr_scan(1, &field, TAP_RTI);
jtag_execute_queue(); jtag_execute_queue();
jtag_add_sleep(10); jtag_add_sleep(10);
...@@ -591,7 +591,7 @@ int str9xpec_lock_device(struct flash_bank_s *bank) ...@@ -591,7 +591,7 @@ int str9xpec_lock_device(struct flash_bank_s *bank)
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_dr_scan(1, &field, -1, NULL); jtag_add_dr_scan(1, &field, -1);
jtag_execute_queue(); jtag_execute_queue();
} while(!(status & ISC_STATUS_BUSY)); } while(!(status & ISC_STATUS_BUSY));
...@@ -677,7 +677,7 @@ int str9xpec_set_address(struct flash_bank_s *bank, u8 sector) ...@@ -677,7 +677,7 @@ int str9xpec_set_address(struct flash_bank_s *bank, u8 sector)
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_dr_scan(1, &field, -1, NULL); jtag_add_dr_scan(1, &field, -1);
return ERROR_OK; return ERROR_OK;
} }
...@@ -766,7 +766,7 @@ int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) ...@@ -766,7 +766,7 @@ int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_dr_scan(1, &field, TAP_RTI, NULL); jtag_add_dr_scan(1, &field, TAP_RTI);
/* small delay before polling */ /* small delay before polling */
jtag_add_sleep(50); jtag_add_sleep(50);
...@@ -784,7 +784,7 @@ int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) ...@@ -784,7 +784,7 @@ int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_dr_scan(1, &field, -1, NULL); jtag_add_dr_scan(1, &field, -1);
jtag_execute_queue(); jtag_execute_queue();
status = buf_get_u32(scanbuf, 0, 8); status = buf_get_u32(scanbuf, 0, 8);
...@@ -826,7 +826,7 @@ int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) ...@@ -826,7 +826,7 @@ int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_dr_scan(1, &field, TAP_RTI, NULL); jtag_add_dr_scan(1, &field, TAP_RTI);
/* small delay before polling */ /* small delay before polling */
jtag_add_sleep(50); jtag_add_sleep(50);
...@@ -844,7 +844,7 @@ int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count) ...@@ -844,7 +844,7 @@ int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_dr_scan(1, &field, -1, NULL); jtag_add_dr_scan(1, &field, -1);
jtag_execute_queue(); jtag_execute_queue();
status = buf_get_u32(scanbuf, 0, 8); status = buf_get_u32(scanbuf, 0, 8);
...@@ -908,7 +908,7 @@ int str9xpec_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd ...@@ -908,7 +908,7 @@ int str9xpec_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_dr_scan(1, &field, TAP_RTI, NULL); jtag_add_dr_scan(1, &field, TAP_RTI);
jtag_execute_queue(); jtag_execute_queue();
idcode = buf_get_u32(buffer, 0, 32); idcode = buf_get_u32(buffer, 0, 32);
...@@ -1033,7 +1033,7 @@ int str9xpec_write_options(struct flash_bank_s *bank) ...@@ -1033,7 +1033,7 @@ int str9xpec_write_options(struct flash_bank_s *bank)
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_dr_scan(1, &field, TAP_RTI, NULL); jtag_add_dr_scan(1, &field, TAP_RTI);
/* small delay before polling */ /* small delay before polling */
jtag_add_sleep(50); jtag_add_sleep(50);
...@@ -1051,7 +1051,7 @@ int str9xpec_write_options(struct flash_bank_s *bank) ...@@ -1051,7 +1051,7 @@ int str9xpec_write_options(struct flash_bank_s *bank)
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_dr_scan(1, &field, -1, NULL); jtag_add_dr_scan(1, &field, -1);
jtag_execute_queue(); jtag_execute_queue();
} while(!(status & ISC_STATUS_BUSY)); } while(!(status & ISC_STATUS_BUSY));
......
...@@ -379,7 +379,7 @@ void cmd_queue_free() ...@@ -379,7 +379,7 @@ void cmd_queue_free()
cmd_queue_pages = NULL; cmd_queue_pages = NULL;
} }
int jtag_add_ir_scan(int num_fields, scan_field_t *fields, enum tap_state state, void *dummy_anachronism) int jtag_add_ir_scan(int num_fields, scan_field_t *fields, enum tap_state state)
{ {
jtag_command_t **last_cmd; jtag_command_t **last_cmd;
jtag_device_t *device; jtag_device_t *device;
...@@ -472,7 +472,7 @@ int jtag_add_ir_scan(int num_fields, scan_field_t *fields, enum tap_state state, ...@@ -472,7 +472,7 @@ int jtag_add_ir_scan(int num_fields, scan_field_t *fields, enum tap_state state,
return ERROR_OK; return ERROR_OK;
} }
int jtag_add_plain_ir_scan(int num_fields, scan_field_t *fields, enum tap_state state, void *dummy_anachronism) int jtag_add_plain_ir_scan(int num_fields, scan_field_t *fields, enum tap_state state)
{ {
jtag_command_t **last_cmd; jtag_command_t **last_cmd;
int i; int i;
...@@ -526,7 +526,7 @@ int jtag_add_plain_ir_scan(int num_fields, scan_field_t *fields, enum tap_state ...@@ -526,7 +526,7 @@ int jtag_add_plain_ir_scan(int num_fields, scan_field_t *fields, enum tap_state
return ERROR_OK; return ERROR_OK;
} }
int jtag_add_dr_scan(int num_fields, scan_field_t *fields, enum tap_state state, void *dummy_anachronism) int jtag_add_dr_scan(int num_fields, scan_field_t *fields, enum tap_state state)
{ {
int i, j; int i, j;
int bypass_devices = 0; int bypass_devices = 0;
...@@ -625,7 +625,8 @@ int jtag_add_dr_scan(int num_fields, scan_field_t *fields, enum tap_state state, ...@@ -625,7 +625,8 @@ int jtag_add_dr_scan(int num_fields, scan_field_t *fields, enum tap_state state,
return ERROR_OK; return ERROR_OK;
} }
int jtag_add_plain_dr_scan(int num_fields, scan_field_t *fields, enum tap_state state, void *dummy_anachronism)
int jtag_add_plain_dr_scan(int num_fields, scan_field_t *fields, enum tap_state state)
{ {
int i; int i;
jtag_command_t **last_cmd = jtag_get_last_command_p(); jtag_command_t **last_cmd = jtag_get_last_command_p();
...@@ -1168,7 +1169,7 @@ int jtag_examine_chain() ...@@ -1168,7 +1169,7 @@ int jtag_examine_chain()
buf_set_u32(idcode_buffer, i * 32, 32, 0x000000FF); buf_set_u32(idcode_buffer, i * 32, 32, 0x000000FF);
} }
jtag_add_plain_dr_scan(1, &field, TAP_TLR, NULL); jtag_add_plain_dr_scan(1, &field, TAP_TLR);
jtag_execute_queue(); jtag_execute_queue();
for (i = 0; i < JTAG_MAX_CHAIN_SIZE * 4; i++) for (i = 0; i < JTAG_MAX_CHAIN_SIZE * 4; i++)
...@@ -1264,7 +1265,7 @@ int jtag_validate_chain() ...@@ -1264,7 +1265,7 @@ int jtag_validate_chain()
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_plain_ir_scan(1, &field, TAP_TLR, NULL); jtag_add_plain_ir_scan(1, &field, TAP_TLR);
jtag_execute_queue(); jtag_execute_queue();
device = jtag_devices; device = jtag_devices;
...@@ -1740,7 +1741,7 @@ int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **a ...@@ -1740,7 +1741,7 @@ int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **a
fields[i].in_handler_priv = NULL; fields[i].in_handler_priv = NULL;
} }
jtag_add_ir_scan(argc / 2, fields, -1, NULL); jtag_add_ir_scan(argc / 2, fields, -1);
jtag_execute_queue(); jtag_execute_queue();
for (i = 0; i < argc / 2; i++) for (i = 0; i < argc / 2; i++)
...@@ -1799,7 +1800,7 @@ int handle_drscan_command(struct command_context_s *cmd_ctx, char *cmd, char **a ...@@ -1799,7 +1800,7 @@ int handle_drscan_command(struct command_context_s *cmd_ctx, char *cmd, char **a
} }
} }
jtag_add_dr_scan(num_fields, fields, -1, NULL); jtag_add_dr_scan(num_fields, fields, -1);
jtag_execute_queue(); jtag_execute_queue();
for (i = 0; i < argc / 2; i++) for (i = 0; i < argc / 2; i++)
......
...@@ -244,10 +244,10 @@ extern int jtag_init(struct command_context_s *cmd_ctx); ...@@ -244,10 +244,10 @@ extern int jtag_init(struct command_context_s *cmd_ctx);
extern int jtag_register_commands(struct command_context_s *cmd_ctx); extern int jtag_register_commands(struct command_context_s *cmd_ctx);
/* JTAG interface, can be implemented with a software or hardware fifo */ /* JTAG interface, can be implemented with a software or hardware fifo */
extern int jtag_add_ir_scan(int num_fields, scan_field_t *fields, enum tap_state endstate, void *dummy_anachronism); extern int jtag_add_ir_scan(int num_fields, scan_field_t *fields, enum tap_state endstate);
extern int jtag_add_dr_scan(int num_fields, scan_field_t *fields, enum tap_state endstate, void *dummy_anachronism); extern int jtag_add_dr_scan(int num_fields, scan_field_t *fields, enum tap_state endstate);
extern int jtag_add_plain_ir_scan(int num_fields, scan_field_t *fields, enum tap_state endstate, void *dummy_anachronism); extern int jtag_add_plain_ir_scan(int num_fields, scan_field_t *fields, enum tap_state endstate);
extern int jtag_add_plain_dr_scan(int num_fields, scan_field_t *fields, enum tap_state endstate, void *dummy_anachronism); extern int jtag_add_plain_dr_scan(int num_fields, scan_field_t *fields, enum tap_state endstate);
/* execute a state transition within the JTAG standard, but the exact path /* execute a state transition within the JTAG standard, but the exact path
* path that is taken is undefined. Many implementations use precisely * path that is taken is undefined. Many implementations use precisely
* 7 clocks to perform a transition, but it could be more or less * 7 clocks to perform a transition, but it could be more or less
......
...@@ -62,7 +62,7 @@ int virtex2_set_instr(int chain_pos, u32 new_instr) ...@@ -62,7 +62,7 @@ int virtex2_set_instr(int chain_pos, u32 new_instr)
field.in_handler = NULL; field.in_handler = NULL;
field.in_handler_priv = NULL; field.in_handler_priv = NULL;
jtag_add_ir_scan(1, &field, TAP_RTI, NULL); jtag_add_ir_scan(1, &field, TAP_RTI);
free(field.out_value); free(field.out_value);
} }
...@@ -94,7 +94,7 @@ int virtex2_send_32(struct pld_device_s *pld_device, int num_words, u32 *words) ...@@ -94,7 +94,7 @@ int virtex2_send_32(struct pld_device_s *pld_device, int num_words, u32 *words)
virtex2_set_instr(virtex2_info->chain_pos, 0x5); /* CFG_IN */ virtex2_set_instr(virtex2_info->chain_pos, 0x5); /* CFG_IN */
jtag_add_dr_scan(1, &scan_field, TAP_PD, NULL); jtag_add_dr_scan(1, &scan_field, TAP_PD);
free(values); free(values);
...@@ -127,7 +127,7 @@ int virtex2_receive_32(struct pld_device_s *pld_device, int num_words, u32 *word ...@@ -127,7 +127,7 @@ int virtex2_receive_32(struct pld_device_s *pld_device, int num_words, u32 *word
while (num_words--) while (num_words--)
{ {
scan_field.in_handler_priv = words++; scan_field.in_handler_priv = words++;
jtag_add_dr_scan(1, &scan_field, TAP_PD, NULL); jtag_add_dr_scan(1, &scan_field, TAP_PD);
} }
return ERROR_OK; return ERROR_OK;
...@@ -189,7 +189,7 @@ int virtex2_load(struct pld_device_s *pld_device, char *filename) ...@@ -189,7 +189,7 @@ int virtex2_load(struct pld_device_s *pld_device, char *filename)
field.num_bits = bit_file.length * 8; field.num_bits = bit_file.length * 8;
field.out_value = bit_file.data; field.out_value = bit_file.data;
jtag_add_dr_scan(1, &field, TAP_PD, NULL); jtag_add_dr_scan(1, &field, TAP_PD);
jtag_execute_queue(); jtag_execute_queue();
jtag_add_statemove(TAP_TLR); jtag_add_statemove(TAP_TLR);
......
This diff is collapsed.
/***************************************************************************
* Copyright (C) 2008 digenius technology GmbH. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef ARM11_H
#define ARM11_H
#include "target.h"
#include "register.h"
#include "embeddedice.h"
#include "arm_jtag.h"
#define bool int
#define true 1
#define false 0
#define asizeof(x) (sizeof(x) / sizeof((x)[0]))
#define NEW(type, variable, items) \
type * variable = malloc(sizeof(type) * items)
#define ARM11_REGCACHE_MODEREGS 0
#define ARM11_REGCACHE_FREGS 0
#define ARM11_REGCACHE_COUNT (20 + \
23 * ARM11_REGCACHE_MODEREGS + \
9 * ARM11_REGCACHE_FREGS)
typedef struct arm11_register_history_s
{
u32 value;
u8 valid;
}arm11_register_history_t;
typedef struct arm11_common_s
{
target_t * target;
arm_jtag_t jtag_info;
/** \name Processor type detection */
/*@{*/
u32 device_id; /**< IDCODE readout */
u32 didr; /**< DIDR readout (debug capabilities) */
u8 implementor; /**< DIDR Implementor readout */
size_t brp; /**< Number of Breakpoint Register Pairs */
size_t wrp; /**< Number of Watchpoint Register Pairs */
/*@}*/
u32 last_dscr; /**< Last retrieved DSCR value;
* Can be used to detect changes */
u8 trst_active;
u8 halt_requested;
/** \name Shadow registers to save processor state */
/*@{*/
reg_t * reg_list; /**< target register list */
u32 reg_values[ARM11_REGCACHE_COUNT]; /**< data for registers */
/*@}*/
arm11_register_history_t
reg_history[ARM11_REGCACHE_COUNT]; /**< register state before last resume */
} arm11_common_t;
/**
* ARM11 DBGTAP instructions
*
* http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301f/I1006229.html
*/
enum arm11_instructions
{
ARM11_EXTEST = 0x00,
ARM11_SCAN_N = 0x02,
ARM11_RESTART = 0x04,
ARM11_HALT = 0x08,
ARM11_INTEST = 0x0C,
ARM11_ITRSEL = 0x1D,
ARM11_IDCODE = 0x1E,
ARM11_BYPASS = 0x1F,
};
enum arm11_dscr
{
ARM11_DSCR_CORE_HALTED = 1 << 0,
ARM11_DSCR_CORE_RESTARTED = 1 << 1,
ARM11_DSCR_METHOD_OF_DEBUG_ENTRY_MASK = 0x0F << 2,
ARM11_DSCR_METHOD_OF_DEBUG_ENTRY_HALT = 0x00 << 2,
ARM11_DSCR_METHOD_OF_DEBUG_ENTRY_BREAKPOINT = 0x01 << 2,
ARM11_DSCR_METHOD_OF_DEBUG_ENTRY_WATCHPOINT = 0x02 << 2,
ARM11_DSCR_METHOD_OF_DEBUG_ENTRY_BKPT_INSTRUCTION = 0x03 << 2,
ARM11_DSCR_METHOD_OF_DEBUG_ENTRY_EDBGRQ = 0x04 << 2,
ARM11_DSCR_METHOD_OF_DEBUG_ENTRY_VECTOR_CATCH = 0x05 << 2,
ARM11_DSCR_STICKY_PRECISE_DATA_ABORT = 1 << 6,
ARM11_DSCR_STICKY_IMPRECISE_DATA_ABORT = 1 << 7,
ARM11_DSCR_EXECUTE_ARM_INSTRUCTION_ENABLE = 1 << 13,
ARM11_DSCR_MODE_SELECT = 1 << 14,
ARM11_DSCR_WDTR_FULL = 1 << 29,
ARM11_DSCR_RDTR_FULL = 1 << 30,
};
enum arm11_cpsr
{
ARM11_CPSR_T = 1 << 5,
ARM11_CPSR_J = 1 << 24,
};
enum arm11_sc7
{
ARM11_SC7_NULL = 0,
ARM11_SC7_VCR = 7,
ARM11_SC7_PC = 8,
ARM11_SC7_BVR0 = 64,
ARM11_SC7_BCR0 = 80,
ARM11_SC7_WVR0 = 96,
ARM11_SC7_WCR0 = 112,
};
typedef struct arm11_reg_state_s
{
u32 def_index;
target_t * target;
} arm11_reg_state_t;
/* poll current target status */
int arm11_poll(struct target_s *target);
/* architecture specific status reply */
int arm11_arch_state(struct target_s *target);
/* target request support */
int arm11_target_request_data(struct target_s *target, u32 size, u8 *buffer);
/* target execution control */
int arm11_halt(struct target_s *target);
int arm11_resume(struct target_s *target, int current, u32 address, int handle_breakpoints, int debug_execution);
int arm11_step(struct target_s *target, int current, u32 address, int handle_breakpoints);
/* target reset control */
int arm11_assert_reset(struct target_s *target);
int arm11_deassert_reset(struct target_s *target);
int arm11_soft_reset_halt(struct target_s *target);
int arm11_prepare_reset_halt(struct target_s *target);
/* target register access for gdb */
int arm11_get_gdb_reg_list(struct target_s *target, struct reg_s **reg_list[], int *reg_list_size);
/* target memory access
* size: 1 = byte (8bit), 2 = half-word (16bit), 4 = word (32bit)
* count: number of items of <size>
*/
int arm11_read_memory(struct target_s *target, u32 address, u32 size, u32 count, u8 *buffer);
int arm11_write_memory(struct target_s *target, u32 address, u32 size, u32 count, u8 *buffer);
/* write target memory in multiples of 4 byte, optimized for writing large quantities of data */
int arm11_bulk_write_memory(struct target_s *target, u32 address, u32 count, u8 *buffer);
int arm11_checksum_memory(struct target_s *target, u32 address, u32 count, u32* checksum);
/* target break-/watchpoint control
* rw: 0 = write, 1 = read, 2 = access
*/
int arm11_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint);
int arm11_remove_breakpoint(struct target_s *target, breakpoint_t *breakpoint);
int arm11_add_watchpoint(struct target_s *target, watchpoint_t *watchpoint);
int arm11_remove_watchpoint(struct target_s *target, watchpoint_t *watchpoint);
/* target algorithm support */
int arm11_run_algorithm(struct target_s *target, int num_mem_params, mem_param_t *mem_params, int num_reg_params, reg_param_t *reg_param, u32 entry_point, u32 exit_point, int timeout_ms, void *arch_info);
int arm11_register_commands(struct command_context_s *cmd_ctx);
int arm11_target_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct target_s *target);
int arm11_init_target(struct command_context_s *cmd_ctx, struct target_s *target);
int arm11_quit(void);
/* helpers */
void arm11_build_reg_cache(target_t *target);
/* internals */
void arm11_setup_field (arm11_common_t * arm11, int num_bits, void * in_data, void * out_data, scan_field_t * field);
void arm11_add_IR (arm11_common_t * arm11, u8 instr, enum tap_state state);
void arm11_add_debug_SCAN_N (arm11_common_t * arm11, u8 chain, enum tap_state state);
void arm11_add_debug_INST (arm11_common_t * arm11, u32 inst, u8 * flag, enum tap_state state);
u32 arm11_read_DSCR (arm11_common_t * arm11);
void arm11_write_DSCR (arm11_common_t * arm11, u32 dscr);
enum target_debug_reason arm11_get_DSCR_debug_reason(u32 dscr);
void arm11_run_instr_data_prepare (arm11_common_t * arm11);
void arm11_run_instr_data_finish (arm11_common_t * arm11);
void arm11_run_instr_no_data (arm11_common_t * arm11, u32 * opcode, size_t count);
void arm11_run_instr_no_data1 (arm11_common_t * arm11, u32 opcode);
void arm11_run_instr_data_to_core (arm11_common_t * arm11, u32 opcode, u32 * data, size_t count);
void arm11_run_instr_data_to_core1 (arm11_common_t * arm11, u32 opcode, u32 data);
void arm11_run_instr_data_from_core (arm11_common_t * arm11, u32 opcode, u32 * data, size_t count);
void arm11_run_instr_data_from_core_via_r0 (arm11_common_t * arm11, u32 opcode, u32 * data);
void arm11_run_instr_data_to_core_via_r0 (arm11_common_t * arm11, u32 opcode, u32 data);
typedef struct arm11_sc7_action_s