#include "target_request.h"
#include "target_type.h"
-/* cli handling */
-int cortex_a8_register_commands(struct command_context_s *cmd_ctx);
-
-/* forward declarations */
-int cortex_a8_target_create(struct target_s *target, Jim_Interp *interp);
-int cortex_a8_init_target(struct command_context_s *cmd_ctx,
- struct target_s *target);
-int cortex_a8_examine(struct target_s *target);
-int cortex_a8_poll(target_t *target);
-int cortex_a8_halt(target_t *target);
-int cortex_a8_resume(struct target_s *target, int current, uint32_t address,
- int handle_breakpoints, int debug_execution);
-int cortex_a8_step(struct target_s *target, int current, uint32_t address,
- int handle_breakpoints);
-int cortex_a8_debug_entry(target_t *target);
-int cortex_a8_restore_context(target_t *target);
-int cortex_a8_bulk_write_memory(target_t *target, uint32_t address,
- uint32_t count, uint8_t *buffer);
-int cortex_a8_set_breakpoint(struct target_s *target,
+static int cortex_a8_poll(target_t *target);
+static int cortex_a8_debug_entry(target_t *target);
+static int cortex_a8_restore_context(target_t *target);
+static int cortex_a8_set_breakpoint(struct target_s *target,
breakpoint_t *breakpoint, uint8_t matchmode);
-int cortex_a8_unset_breakpoint(struct target_s *target, breakpoint_t *breakpoint);
-int cortex_a8_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint);
-int cortex_a8_remove_breakpoint(struct target_s *target, breakpoint_t *breakpoint);
-int cortex_a8_dap_read_coreregister_u32(target_t *target,
+static int cortex_a8_unset_breakpoint(struct target_s *target,
+ breakpoint_t *breakpoint);
+static int cortex_a8_dap_read_coreregister_u32(target_t *target,
uint32_t *value, int regnum);
-int cortex_a8_dap_write_coreregister_u32(target_t *target,
+static int cortex_a8_dap_write_coreregister_u32(target_t *target,
uint32_t value, int regnum);
-int cortex_a8_assert_reset(target_t *target);
-int cortex_a8_deassert_reset(target_t *target);
-
-static int cortex_a8_mrc(target_t *target, int cpnum, uint32_t op1,
- uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value);
-static int cortex_a8_mcr(target_t *target, int cpnum, uint32_t op1,
- uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t value);
-
-target_type_t cortexa8_target =
-{
- .name = "cortex_a8",
-
- .poll = cortex_a8_poll,
- .arch_state = armv7a_arch_state,
-
- .target_request_data = NULL,
-
- .halt = cortex_a8_halt,
- .resume = cortex_a8_resume,
- .step = cortex_a8_step,
-
- .assert_reset = cortex_a8_assert_reset,
- .deassert_reset = cortex_a8_deassert_reset,
- .soft_reset_halt = NULL,
-
- .get_gdb_reg_list = armv4_5_get_gdb_reg_list,
-
- .read_memory = cortex_a8_read_memory,
- .write_memory = cortex_a8_write_memory,
- .bulk_write_memory = cortex_a8_bulk_write_memory,
- .checksum_memory = arm7_9_checksum_memory,
- .blank_check_memory = arm7_9_blank_check_memory,
-
- .run_algorithm = armv4_5_run_algorithm,
-
- .add_breakpoint = cortex_a8_add_breakpoint,
- .remove_breakpoint = cortex_a8_remove_breakpoint,
- .add_watchpoint = NULL,
- .remove_watchpoint = NULL,
-
- .register_commands = cortex_a8_register_commands,
- .target_create = cortex_a8_target_create,
- .init_target = cortex_a8_init_target,
- .examine = cortex_a8_examine,
- .mrc = cortex_a8_mrc,
- .mcr = cortex_a8_mcr,
-};
-
/*
* FIXME do topology discovery using the ROM; don't
* assume this is an OMAP3.
/*
* Cortex-A8 Basic debug access, very low level assumes state is saved
*/
-int cortex_a8_init_debug_access(target_t *target)
+static int cortex_a8_init_debug_access(target_t *target)
{
struct armv7a_common_s *armv7a = target_to_armv7a(target);
swjdp_common_t *swjdp = &armv7a->swjdp_info;
Read core register with very few exec_opcode, fast but needs work_area.
This can cause problems with MMU active.
**************************************************************************/
-int cortex_a8_read_regs_through_mem(target_t *target, uint32_t address,
+static int cortex_a8_read_regs_through_mem(target_t *target, uint32_t address,
uint32_t * regfile)
{
int retval = ERROR_OK;
return retval;
}
-int cortex_a8_read_cp(target_t *target, uint32_t *value, uint8_t CP,
+static int cortex_a8_read_cp(target_t *target, uint32_t *value, uint8_t CP,
uint8_t op1, uint8_t CRn, uint8_t CRm, uint8_t op2)
{
int retval;
return retval;
}
-int cortex_a8_write_cp(target_t *target, uint32_t value,
+static int cortex_a8_write_cp(target_t *target, uint32_t value,
uint8_t CP, uint8_t op1, uint8_t CRn, uint8_t CRm, uint8_t op2)
{
int retval;
return retval;
}
-int cortex_a8_read_cp15(target_t *target, uint32_t op1, uint32_t op2,
+static int cortex_a8_read_cp15(target_t *target, uint32_t op1, uint32_t op2,
uint32_t CRn, uint32_t CRm, uint32_t *value)
{
return cortex_a8_read_cp(target, value, 15, op1, CRn, CRm, op2);
}
-int cortex_a8_write_cp15(target_t *target, uint32_t op1, uint32_t op2,
+static int cortex_a8_write_cp15(target_t *target, uint32_t op1, uint32_t op2,
uint32_t CRn, uint32_t CRm, uint32_t value)
{
return cortex_a8_write_cp(target, value, 15, op1, CRn, CRm, op2);
-int cortex_a8_dap_read_coreregister_u32(target_t *target,
+static int cortex_a8_dap_read_coreregister_u32(target_t *target,
uint32_t *value, int regnum)
{
int retval = ERROR_OK;
return retval;
}
-int cortex_a8_dap_write_coreregister_u32(target_t *target, uint32_t value, int regnum)
+static int cortex_a8_dap_write_coreregister_u32(target_t *target, uint32_t value, int regnum)
{
int retval = ERROR_OK;
uint8_t Rd = regnum&0xFF;
}
/* Write to memory mapped registers directly with no cache or mmu handling */
-int cortex_a8_dap_write_memap_register_u32(target_t *target, uint32_t address, uint32_t value)
+static int cortex_a8_dap_write_memap_register_u32(target_t *target, uint32_t address, uint32_t value)
{
int retval;
struct armv7a_common_s *armv7a = target_to_armv7a(target);
* Cortex-A8 Run control
*/
-int cortex_a8_poll(target_t *target)
+static int cortex_a8_poll(target_t *target)
{
int retval = ERROR_OK;
uint32_t dscr;
return retval;
}
-int cortex_a8_halt(target_t *target)
+static int cortex_a8_halt(target_t *target)
{
int retval = ERROR_OK;
uint32_t dscr;
return retval;
}
-int cortex_a8_resume(struct target_s *target, int current,
+static int cortex_a8_resume(struct target_s *target, int current,
uint32_t address, int handle_breakpoints, int debug_execution)
{
struct armv7a_common_s *armv7a = target_to_armv7a(target);
return ERROR_OK;
}
-int cortex_a8_debug_entry(target_t *target)
+static int cortex_a8_debug_entry(target_t *target)
{
int i;
uint32_t regfile[16], pc, cpsr, dscr;
}
-void cortex_a8_post_debug_entry(target_t *target)
+static void cortex_a8_post_debug_entry(target_t *target)
{
struct cortex_a8_common_s *cortex_a8 = target_to_cortex_a8(target);
struct armv7a_common_s *armv7a = &cortex_a8->armv7a_common;
}
-int cortex_a8_step(struct target_s *target, int current, uint32_t address,
+static int cortex_a8_step(struct target_s *target, int current, uint32_t address,
int handle_breakpoints)
{
struct armv7a_common_s *armv7a = target_to_armv7a(target);
return ERROR_OK;
}
-int cortex_a8_restore_context(target_t *target)
+static int cortex_a8_restore_context(target_t *target)
{
int i;
uint32_t value;
}
+#if 0
/*
* Cortex-A8 Core register functions
*/
-
-int cortex_a8_load_core_reg_u32(struct target_s *target, int num,
+static int cortex_a8_load_core_reg_u32(struct target_s *target, int num,
armv4_5_mode_t mode, uint32_t * value)
{
int retval;
return ERROR_OK;
}
-int cortex_a8_store_core_reg_u32(struct target_s *target, int num,
+static int cortex_a8_store_core_reg_u32(struct target_s *target, int num,
armv4_5_mode_t mode, uint32_t value)
{
int retval;
return ERROR_OK;
}
+#endif
-int cortex_a8_read_core_reg(struct target_s *target, int num,
+static int cortex_a8_read_core_reg(struct target_s *target, int num,
enum armv4_5_mode mode)
{
uint32_t value;
*/
/* Setup hardware Breakpoint Register Pair */
-int cortex_a8_set_breakpoint(struct target_s *target,
+static int cortex_a8_set_breakpoint(struct target_s *target,
breakpoint_t *breakpoint, uint8_t matchmode)
{
int retval;
return ERROR_OK;
}
-int cortex_a8_unset_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+static int cortex_a8_unset_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
{
int retval;
struct cortex_a8_common_s *cortex_a8 = target_to_cortex_a8(target);
return ERROR_OK;
}
-int cortex_a8_remove_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
+static int cortex_a8_remove_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
{
struct cortex_a8_common_s *cortex_a8 = target_to_cortex_a8(target);
* Cortex-A8 Reset fuctions
*/
-int cortex_a8_assert_reset(target_t *target)
+static int cortex_a8_assert_reset(target_t *target)
{
LOG_DEBUG(" ");
return ERROR_OK;
}
-int cortex_a8_deassert_reset(target_t *target)
+static int cortex_a8_deassert_reset(target_t *target)
{
LOG_DEBUG(" ");
* ap number for every access.
*/
-int cortex_a8_read_memory(struct target_s *target, uint32_t address,
+static int cortex_a8_read_memory(struct target_s *target, uint32_t address,
uint32_t size, uint32_t count, uint8_t *buffer)
{
struct armv7a_common_s *armv7a = target_to_armv7a(target);
return retval;
}
-int cortex_a8_bulk_write_memory(target_t *target, uint32_t address,
+static int cortex_a8_bulk_write_memory(target_t *target, uint32_t address,
uint32_t count, uint8_t *buffer)
{
return cortex_a8_write_memory(target, address, 4, count, buffer);
}
-int cortex_a8_dcc_read(swjdp_common_t *swjdp, uint8_t *value, uint8_t *ctrl)
+static int cortex_a8_dcc_read(swjdp_common_t *swjdp, uint8_t *value, uint8_t *ctrl)
{
#if 0
u16 dcrdr;
}
-int cortex_a8_handle_target_request(void *priv)
+static int cortex_a8_handle_target_request(void *priv)
{
target_t *target = priv;
if (!target->type->examined)
* Cortex-A8 target information and configuration
*/
-int cortex_a8_examine(struct target_s *target)
+static int cortex_a8_examine(struct target_s *target)
{
struct cortex_a8_common_s *cortex_a8 = target_to_cortex_a8(target);
struct armv7a_common_s *armv7a = &cortex_a8->armv7a_common;
* Cortex-A8 target creation and initialization
*/
-void cortex_a8_build_reg_cache(target_t *target)
+static void cortex_a8_build_reg_cache(target_t *target)
{
reg_cache_t **cache_p = register_get_last_cache_p(&target->reg_cache);
struct armv4_5_common_s *armv4_5 = target_to_armv4_5(target);
}
-int cortex_a8_init_target(struct command_context_s *cmd_ctx,
+static int cortex_a8_init_target(struct command_context_s *cmd_ctx,
struct target_s *target)
{
cortex_a8_build_reg_cache(target);
return ERROR_OK;
}
-int cortex_a8_target_create(struct target_s *target, Jim_Interp *interp)
+static int cortex_a8_target_create(struct target_s *target, Jim_Interp *interp)
{
cortex_a8_common_t *cortex_a8 = calloc(1, sizeof(cortex_a8_common_t));
}
-int cortex_a8_register_commands(struct command_context_s *cmd_ctx)
+static int cortex_a8_register_commands(struct command_context_s *cmd_ctx)
{
command_t *cortex_a8_cmd;
int retval = ERROR_OK;
return retval;
}
+
+target_type_t cortexa8_target = {
+ .name = "cortex_a8",
+
+ .poll = &cortex_a8_poll,
+ .arch_state = &armv7a_arch_state,
+
+ .target_request_data = NULL,
+
+ .halt = &cortex_a8_halt,
+ .resume = &cortex_a8_resume,
+ .step = &cortex_a8_step,
+
+ .assert_reset = &cortex_a8_assert_reset,
+ .deassert_reset = &cortex_a8_deassert_reset,
+ .soft_reset_halt = NULL,
+
+ .get_gdb_reg_list = &armv4_5_get_gdb_reg_list,
+
+ .read_memory = &cortex_a8_read_memory,
+ .write_memory = &cortex_a8_write_memory,
+ .bulk_write_memory = &cortex_a8_bulk_write_memory,
+ .checksum_memory = &arm7_9_checksum_memory,
+ .blank_check_memory = &arm7_9_blank_check_memory,
+
+ .run_algorithm = &armv4_5_run_algorithm,
+
+ .add_breakpoint = &cortex_a8_add_breakpoint,
+ .remove_breakpoint = &cortex_a8_remove_breakpoint,
+ .add_watchpoint = NULL,
+ .remove_watchpoint = NULL,
+
+ .register_commands = &cortex_a8_register_commands,
+ .target_create = &cortex_a8_target_create,
+ .init_target = &cortex_a8_init_target,
+ .examine = &cortex_a8_examine,
+ .mrc = &cortex_a8_mrc,
+ .mcr = &cortex_a8_mcr,
+ };