summaryrefslogtreecommitdiff
path: root/src/target/arm720t.c
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2009-10-23 12:38:19 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2009-10-23 12:39:00 +0200
commit0a1356c9ccff42e2c41af3a3c0ae8b1330aa970b (patch)
treeb769d296e2032240291978b4f8a035c97fd8183a /src/target/arm720t.c
parent18aad44f7121a4fa76d53a4ae653b047cd9ad916 (diff)
downloadopenocd_libswd-0a1356c9ccff42e2c41af3a3c0ae8b1330aa970b.tar.gz
openocd_libswd-0a1356c9ccff42e2c41af3a3c0ae8b1330aa970b.tar.bz2
openocd_libswd-0a1356c9ccff42e2c41af3a3c0ae8b1330aa970b.tar.xz
openocd_libswd-0a1356c9ccff42e2c41af3a3c0ae8b1330aa970b.zip
mcr/mrc interface work. Implemented for arm926ejs and arm720t. mcr/mrc commands added.
Diffstat (limited to 'src/target/arm720t.c')
-rw-r--r--src/target/arm720t.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/target/arm720t.c b/src/target/arm720t.c
index 71440ebe..6ed66cd6 100644
--- a/src/target/arm720t.c
+++ b/src/target/arm720t.c
@@ -2,6 +2,9 @@
* Copyright (C) 2005 by Dominic Rath *
* Dominic.Rath@gmx.de *
* *
+ * Copyright (C) 2009 by Øyvind Harboe *
+ * oyvind.harboe@zylin.com *
+ * *
* 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 *
@@ -46,6 +49,9 @@ int arm720t_read_phys_memory(struct target_s *target, uint32_t address, uint32_t
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);
+static int arm720t_mrc(target_t *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value);
+static int arm720t_mcr(target_t *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t value);
+
target_type_t arm720t_target =
{
.name = "arm720t",
@@ -82,7 +88,9 @@ target_type_t arm720t_target =
.target_create = arm720t_target_create,
.init_target = arm720t_init_target,
.examine = arm7tdmi_examine,
- .quit = arm720t_quit
+ .quit = arm720t_quit,
+ .mrc = arm720t_mrc,
+ .mcr = arm720t_mcr,
};
@@ -574,3 +582,29 @@ int arm720t_handle_cp15_command(struct command_context_s *cmd_ctx, char *cmd, ch
return ERROR_OK;
}
+
+
+static int arm720t_mrc(target_t *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value)
+{
+ if (cpnum!=15)
+ {
+ LOG_ERROR("Only cp15 is supported");
+ return ERROR_FAIL;
+ }
+
+ return arm720t_read_cp15(target, mrc_opcode(cpnum, op1, op2, CRn, CRm), value);
+
+}
+
+static int arm720t_mcr(target_t *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t value)
+{
+ if (cpnum!=15)
+ {
+ LOG_ERROR("Only cp15 is supported");
+ return ERROR_FAIL;
+ }
+
+ return arm720t_write_cp15(target, mrc_opcode(cpnum, op1, op2, CRn, CRm), value);
+}
+
+