]> git.sur5r.net Git - openocd/commitdiff
read/write physical target fn's
authorØyvind Harboe <oyvind.harboe@zylin.com>
Wed, 21 Oct 2009 13:32:29 +0000 (15:32 +0200)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Wed, 21 Oct 2009 13:32:29 +0000 (15:32 +0200)
src/target/arm720t.c
src/target/arm920t.c

index 2ebd83a3ad894e6a5177401e1adebaa8e70e44fa..7bf181c0a612a99bcc8b53d7d3afda49755a0055 100644 (file)
@@ -44,6 +44,8 @@ int arm720t_quit(void);
 int arm720t_arch_state(struct target_s *target);
 int arm720t_read_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
 int arm720t_write_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
+int arm720t_read_phys_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
+int arm720t_write_phys_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
 int arm720t_soft_reset_halt(struct target_s *target);
 
 target_type_t arm720t_target =
@@ -65,6 +67,8 @@ target_type_t arm720t_target =
 
        .read_memory = arm720t_read_memory,
        .write_memory = arm720t_write_memory,
+       .read_phys_memory = arm720t_read_phys_memory,
+       .write_phys_memory = arm720t_write_phys_memory,
        .bulk_write_memory = arm7_9_bulk_write_memory,
        .checksum_memory = arm7_9_checksum_memory,
        .blank_check_memory = arm7_9_blank_check_memory,
@@ -81,6 +85,7 @@ target_type_t arm720t_target =
        .init_target = arm720t_init_target,
        .examine = arm7tdmi_examine,
        .quit = arm720t_quit
+
 };
 
 int arm720t_scan_cp15(target_t *target, uint32_t out, uint32_t *in, int instruction, int clock)
@@ -358,6 +363,28 @@ int arm720t_write_memory(struct target_s *target, uint32_t address, uint32_t siz
        return retval;
 }
 
+
+int arm720t_read_phys_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer)
+{
+       armv4_5_common_t *armv4_5 = target->arch_info;
+       arm7_9_common_t *arm7_9 = armv4_5->arch_info;
+       arm7tdmi_common_t *arm7tdmi = arm7_9->arch_info;
+       arm720t_common_t *arm720t = arm7tdmi->arch_info;
+
+       return armv4_5_mmu_read_physical(target, &arm720t->armv4_5_mmu, address, size, count, buffer);
+}
+
+int arm720t_write_phys_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer)
+{
+       armv4_5_common_t *armv4_5 = target->arch_info;
+       arm7_9_common_t *arm7_9 = armv4_5->arch_info;
+       arm7tdmi_common_t *arm7tdmi = arm7_9->arch_info;
+       arm720t_common_t *arm720t = arm7tdmi->arch_info;
+
+       return armv4_5_mmu_write_physical(target, &arm720t->armv4_5_mmu, address, size, count, buffer);
+}
+
+
 int arm720t_soft_reset_halt(struct target_s *target)
 {
        int retval = ERROR_OK;
index 5ade82bc9f3586a6b74fd089f264d9dd39153637..08c3b443fcfdb336d608c5f24d02298903831026 100644 (file)
@@ -36,6 +36,8 @@ int arm920t_handle_cp15i_command(struct command_context_s *cmd_ctx, char *cmd, c
 int arm920t_handle_cache_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 int arm920t_handle_md_phys_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 int arm920t_handle_mw_phys_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
+int arm920t_read_phys_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
+int arm920t_write_phys_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
 
 int arm920t_handle_read_cache_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 int arm920t_handle_read_mmu_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
@@ -68,6 +70,8 @@ target_type_t arm920t_target =
 
        .read_memory = arm920t_read_memory,
        .write_memory = arm920t_write_memory,
+       .read_phys_memory = arm920t_read_phys_memory,
+       .write_phys_memory = arm920t_write_phys_memory,
        .bulk_write_memory = arm7_9_bulk_write_memory,
        .checksum_memory = arm7_9_checksum_memory,
        .blank_check_memory = arm7_9_blank_check_memory,
@@ -520,6 +524,28 @@ int arm920t_read_memory(struct target_s *target, uint32_t address, uint32_t size
        return retval;
 }
 
+
+int arm920t_read_phys_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer)
+{
+       armv4_5_common_t *armv4_5 = target->arch_info;
+       arm7_9_common_t *arm7_9 = armv4_5->arch_info;
+       arm9tdmi_common_t *arm9tdmi = arm7_9->arch_info;
+       arm920t_common_t *arm920t = arm9tdmi->arch_info;
+
+       return armv4_5_mmu_read_physical(target, &arm920t->armv4_5_mmu, address, size, count, buffer);
+}
+
+int arm920t_write_phys_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer)
+{
+       armv4_5_common_t *armv4_5 = target->arch_info;
+       arm7_9_common_t *arm7_9 = armv4_5->arch_info;
+       arm9tdmi_common_t *arm9tdmi = arm7_9->arch_info;
+       arm920t_common_t *arm920t = arm9tdmi->arch_info;
+
+       return armv4_5_mmu_write_physical(target, &arm920t->armv4_5_mmu, address, size, count, buffer);
+}
+
+
 int arm920t_write_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer)
 {
        int retval;