summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-08 06:45:27 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-08 06:45:27 +0000
commitdd673b0b5f58cb1f796c1026c4a628eb863327a0 (patch)
treeca3897508b74298d4b950225443989a3203be395
parent75f98d16494849f9e102a67e7820075b60aeb9b1 (diff)
downloadopenocd+libswd-dd673b0b5f58cb1f796c1026c4a628eb863327a0.tar.gz
openocd+libswd-dd673b0b5f58cb1f796c1026c4a628eb863327a0.tar.bz2
openocd+libswd-dd673b0b5f58cb1f796c1026c4a628eb863327a0.tar.xz
openocd+libswd-dd673b0b5f58cb1f796c1026c4a628eb863327a0.zip
first jtag_check_value_mask usage. tested by using "arm7_9 fast_memory_access enable" & "mdw 0 0x10"
git-svn-id: svn://svn.berlios.de/openocd/trunk@1664 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r--src/jtag/jtag.c16
-rw-r--r--src/target/embeddedice.c15
2 files changed, 16 insertions, 15 deletions
diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c
index 2432516a..eba09549 100644
--- a/src/jtag/jtag.c
+++ b/src/jtag/jtag.c
@@ -1417,11 +1417,23 @@ void jtag_set_check_value(scan_field_t *field, u8 *value, u8 *mask, struct inval
void jtag_check_value_mask(scan_field_t *field, u8 *value, u8 *mask)
{
+ if (field->in_value==NULL)
+ {
+ LOG_ERROR("remember to fill in in_value for jtag_check_value_mask() to work!");
+ return;
+ }
+
+ if (value==NULL)
+ {
+ /* no checking to do */
+ return;
+ }
+
jtag_execute_queue_noclear();
-
+
int retval=jtag_check_value_inner(field->in_value, field, value, mask);
jtag_set_error(retval);
-
+
}
diff --git a/src/target/embeddedice.c b/src/target/embeddedice.c
index aa5aacec..363d182e 100644
--- a/src/target/embeddedice.c
+++ b/src/target/embeddedice.c
@@ -251,39 +251,26 @@ int embeddedice_read_reg_w_check(reg_t *reg, u8* check_value, u8* check_mask)
fields[0].tap = ice_reg->jtag_info->tap;
fields[0].num_bits = 32;
fields[0].out_value = reg->value;
-
fields[0].in_value = NULL;
-
-
fields[0].in_handler = NULL;
-
fields[1].tap = ice_reg->jtag_info->tap;
fields[1].num_bits = 5;
fields[1].out_value = field1_out;
buf_set_u32(fields[1].out_value, 0, 5, reg_addr);
-
fields[1].in_value = NULL;
-
-
fields[1].in_handler = NULL;
-
fields[2].tap = ice_reg->jtag_info->tap;
fields[2].num_bits = 1;
fields[2].out_value = field2_out;
buf_set_u32(fields[2].out_value, 0, 1, 0);
-
fields[2].in_value = NULL;
-
-
fields[2].in_handler = NULL;
-
jtag_add_dr_scan(3, fields, TAP_INVALID);
fields[0].in_value = reg->value;
- jtag_set_check_value(fields+0, check_value, check_mask, NULL);
/* when reading the DCC data register, leaving the address field set to
* EICE_COMMS_DATA would read the register twice
@@ -293,6 +280,8 @@ int embeddedice_read_reg_w_check(reg_t *reg, u8* check_value, u8* check_mask)
jtag_add_dr_scan(3, fields, TAP_INVALID);
+ jtag_check_value_mask(fields+0, check_value, check_mask);
+
return ERROR_OK;
}