summaryrefslogtreecommitdiff
path: root/src/target/arm926ejs.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/arm926ejs.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/arm926ejs.c')
-rw-r--r--src/target/arm926ejs.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/target/arm926ejs.c b/src/target/arm926ejs.c
index 9c9628a3..90611747 100644
--- a/src/target/arm926ejs.c
+++ b/src/target/arm926ejs.c
@@ -2,7 +2,7 @@
* Copyright (C) 2007 by Dominic Rath *
* Dominic.Rath@gmx.de *
* *
- * Copyright (C) 2009 by Øyvind Harboe *
+ * Copyright (C) 2007,2008,2009 by Øyvind Harboe *
* oyvind.harboe@zylin.com *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -35,7 +35,6 @@
/* cli handling */
int arm926ejs_handle_cp15_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-int arm926ejs_handle_cp15i_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
int arm926ejs_handle_cache_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
int arm926ejs_handle_read_cache_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
@@ -52,6 +51,29 @@ int arm926ejs_write_phys_memory(struct target_s *target, uint32_t address, uint3
static int arm926ejs_virt2phys(struct target_s *target, uint32_t virtual, uint32_t *physical);
static int arm926ejs_mmu(struct target_s *target, int *enabled);
+int arm926ejs_cp15_read(target_t *target, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t *value);
+int arm926ejs_cp15_write(target_t *target, uint32_t op1, uint32_t op2, uint32_t CRn, uint32_t CRm, uint32_t value);
+
+static int arm926ejs_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 arm926ejs_cp15_read(target, op1, op2, CRn, CRm, value);
+}
+
+static int arm926ejs_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 arm926ejs_cp15_write(target, op1, op2, CRn, CRm, value);
+}
+
target_type_t arm926ejs_target =
{
.name = "arm926ejs",
@@ -94,6 +116,8 @@ target_type_t arm926ejs_target =
.read_phys_memory = arm926ejs_read_phys_memory,
.write_phys_memory = arm926ejs_write_phys_memory,
+ .mrc = arm926ejs_mrc,
+ .mcr = arm926ejs_mcr,
};
int arm926ejs_catch_broken_irscan(uint8_t *captured, void *priv, scan_field_t *field)