retire jtag_set_check_value

git-svn-id: svn://svn.berlios.de/openocd/trunk@1667 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
oharboe 2009-05-08 07:22:31 +00:00
parent 8173e02272
commit fe629829f4
1 changed files with 35 additions and 44 deletions

View File

@ -226,11 +226,13 @@ int xscale_jtag_set_instr(jtag_tap_t *tap, u32 new_instr)
field.out_value = calloc(CEIL(field.num_bits, 8), 1); field.out_value = calloc(CEIL(field.num_bits, 8), 1);
buf_set_u32(field.out_value, 0, field.num_bits, new_instr); buf_set_u32(field.out_value, 0, field.num_bits, new_instr);
field.in_value = NULL; u8 tmp[4];
jtag_set_check_value(&field, tap->expected, tap->expected_mask, NULL); field.in_value = tmp;
jtag_add_ir_scan(1, &field, TAP_INVALID); jtag_add_ir_scan(1, &field, TAP_INVALID);
jtag_check_value_mask(&field, tap->expected, tap->expected_mask);
free(field.out_value); free(field.out_value);
} }
@ -261,29 +263,26 @@ int xscale_read_dcsr(target_t *target)
fields[0].tap = xscale->jtag_info.tap; fields[0].tap = xscale->jtag_info.tap;
fields[0].num_bits = 3; fields[0].num_bits = 3;
fields[0].out_value = &field0; fields[0].out_value = &field0;
u8 tmp;
fields[0].in_value = NULL; fields[0].in_value = &tmp;
jtag_set_check_value(fields+0, &field0_check_value, &field0_check_mask, NULL);
fields[1].tap = xscale->jtag_info.tap; fields[1].tap = xscale->jtag_info.tap;
fields[1].num_bits = 32; fields[1].num_bits = 32;
fields[1].out_value = NULL; fields[1].out_value = NULL;
fields[1].in_value = xscale->reg_cache->reg_list[XSCALE_DCSR].value; fields[1].in_value = xscale->reg_cache->reg_list[XSCALE_DCSR].value;
fields[1].in_handler = NULL; fields[1].in_handler = NULL;
fields[2].tap = xscale->jtag_info.tap; fields[2].tap = xscale->jtag_info.tap;
fields[2].num_bits = 1; fields[2].num_bits = 1;
fields[2].out_value = &field2; fields[2].out_value = &field2;
u8 tmp2;
fields[2].in_value = NULL; fields[2].in_value = &tmp2;
jtag_set_check_value(fields+2, &field2_check_value, &field2_check_mask, NULL);
jtag_add_dr_scan(3, fields, TAP_INVALID); jtag_add_dr_scan(3, fields, TAP_INVALID);
jtag_check_value_mask(fields+0, &field0_check_value, &field0_check_mask);
jtag_check_value_mask(fields+2, &field2_check_value, &field2_check_mask);
if ((retval = jtag_execute_queue()) != ERROR_OK) if ((retval = jtag_execute_queue()) != ERROR_OK)
{ {
LOG_ERROR("JTAG error while reading DCSR"); LOG_ERROR("JTAG error while reading DCSR");
@ -339,8 +338,8 @@ int xscale_receive(target_t *target, u32 *buffer, int num_words)
fields[0].tap = xscale->jtag_info.tap; fields[0].tap = xscale->jtag_info.tap;
fields[0].num_bits = 3; fields[0].num_bits = 3;
fields[0].out_value = NULL; fields[0].out_value = NULL;
fields[0].in_value = NULL; u8 tmp2;
jtag_set_check_value(fields+0, &field0_check_value, &field0_check_mask, NULL); fields[0].in_value = &tmp2;
fields[1].tap = xscale->jtag_info.tap; fields[1].tap = xscale->jtag_info.tap;
fields[1].num_bits = 32; fields[1].num_bits = 32;
@ -352,8 +351,8 @@ int xscale_receive(target_t *target, u32 *buffer, int num_words)
fields[2].tap = xscale->jtag_info.tap; fields[2].tap = xscale->jtag_info.tap;
fields[2].num_bits = 1; fields[2].num_bits = 1;
fields[2].out_value = NULL; fields[2].out_value = NULL;
fields[2].in_value = NULL; u8 tmp3;
jtag_set_check_value(fields+2, &field2_check_value, &field2_check_mask, NULL); fields[2].in_value = &tmp3;
jtag_add_end_state(TAP_IDLE); jtag_add_end_state(TAP_IDLE);
xscale_jtag_set_instr(xscale->jtag_info.tap, xscale->jtag_info.dbgtx); xscale_jtag_set_instr(xscale->jtag_info.tap, xscale->jtag_info.dbgtx);
@ -372,6 +371,9 @@ int xscale_receive(target_t *target, u32 *buffer, int num_words)
jtag_add_pathmove(3, path); jtag_add_pathmove(3, path);
jtag_add_dr_scan_now(3, fields, TAP_IDLE); jtag_add_dr_scan_now(3, fields, TAP_IDLE);
jtag_check_value_mask(fields+0, &field0_check_value, &field0_check_mask);
jtag_check_value_mask(fields+2, &field2_check_value, &field2_check_mask);
field1[i]=buf_get_u32(tmp, 0, 32); field1[i]=buf_get_u32(tmp, 0, 32);
words_scheduled++; words_scheduled++;
@ -454,26 +456,19 @@ int xscale_read_tx(target_t *target, int consume)
fields[0].tap = xscale->jtag_info.tap; fields[0].tap = xscale->jtag_info.tap;
fields[0].num_bits = 3; fields[0].num_bits = 3;
fields[0].out_value = NULL; fields[0].out_value = NULL;
fields[0].in_value = &field0_in; fields[0].in_value = &field0_in;
jtag_set_check_value(fields+0, &field0_check_value, &field0_check_mask, NULL);
fields[1].tap = xscale->jtag_info.tap; fields[1].tap = xscale->jtag_info.tap;
fields[1].num_bits = 32; fields[1].num_bits = 32;
fields[1].out_value = NULL; fields[1].out_value = NULL;
fields[1].in_value = xscale->reg_cache->reg_list[XSCALE_TX].value; fields[1].in_value = xscale->reg_cache->reg_list[XSCALE_TX].value;
fields[1].in_handler = NULL; fields[1].in_handler = NULL;
fields[2].tap = xscale->jtag_info.tap; fields[2].tap = xscale->jtag_info.tap;
fields[2].num_bits = 1; fields[2].num_bits = 1;
fields[2].out_value = NULL; fields[2].out_value = NULL;
u8 tmp;
fields[2].in_value = NULL; fields[2].in_value = &tmp;
jtag_set_check_value(fields+2, &field2_check_value, &field2_check_mask, NULL);
gettimeofday(&timeout, NULL); gettimeofday(&timeout, NULL);
timeval_add_time(&timeout, 1, 0); timeval_add_time(&timeout, 1, 0);
@ -493,6 +488,9 @@ int xscale_read_tx(target_t *target, int consume)
jtag_add_dr_scan(3, fields, TAP_IDLE); jtag_add_dr_scan(3, fields, TAP_IDLE);
jtag_check_value_mask(fields+0, &field0_check_value, &field0_check_mask);
jtag_check_value_mask(fields+2, &field2_check_value, &field2_check_mask);
if ((retval = jtag_execute_queue()) != ERROR_OK) if ((retval = jtag_execute_queue()) != ERROR_OK)
{ {
LOG_ERROR("JTAG error while reading TX"); LOG_ERROR("JTAG error while reading TX");
@ -550,26 +548,19 @@ int xscale_write_rx(target_t *target)
fields[0].tap = xscale->jtag_info.tap; fields[0].tap = xscale->jtag_info.tap;
fields[0].num_bits = 3; fields[0].num_bits = 3;
fields[0].out_value = &field0_out; fields[0].out_value = &field0_out;
fields[0].in_value = &field0_in; fields[0].in_value = &field0_in;
jtag_set_check_value(fields+0, &field0_check_value, &field0_check_mask, NULL);
fields[1].tap = xscale->jtag_info.tap; fields[1].tap = xscale->jtag_info.tap;
fields[1].num_bits = 32; fields[1].num_bits = 32;
fields[1].out_value = xscale->reg_cache->reg_list[XSCALE_RX].value; fields[1].out_value = xscale->reg_cache->reg_list[XSCALE_RX].value;
fields[1].in_value = NULL; fields[1].in_value = NULL;
fields[1].in_handler = NULL; fields[1].in_handler = NULL;
fields[2].tap = xscale->jtag_info.tap; fields[2].tap = xscale->jtag_info.tap;
fields[2].num_bits = 1; fields[2].num_bits = 1;
fields[2].out_value = &field2; fields[2].out_value = &field2;
u8 tmp;
fields[2].in_value = NULL; fields[2].in_value = &tmp;
jtag_set_check_value(fields+2, &field2_check_value, &field2_check_mask, NULL);
gettimeofday(&timeout, NULL); gettimeofday(&timeout, NULL);
timeval_add_time(&timeout, 1, 0); timeval_add_time(&timeout, 1, 0);
@ -580,6 +571,9 @@ int xscale_write_rx(target_t *target)
{ {
jtag_add_dr_scan(3, fields, TAP_IDLE); jtag_add_dr_scan(3, fields, TAP_IDLE);
jtag_check_value_mask(fields+0, &field0_check_value, &field0_check_mask);
jtag_check_value_mask(fields+2, &field2_check_value, &field2_check_mask);
if ((retval = jtag_execute_queue()) != ERROR_OK) if ((retval = jtag_execute_queue()) != ERROR_OK)
{ {
LOG_ERROR("JTAG error while writing RX"); LOG_ERROR("JTAG error while writing RX");
@ -725,29 +719,26 @@ int xscale_write_dcsr(target_t *target, int hold_rst, int ext_dbg_brk)
fields[0].tap = xscale->jtag_info.tap; fields[0].tap = xscale->jtag_info.tap;
fields[0].num_bits = 3; fields[0].num_bits = 3;
fields[0].out_value = &field0; fields[0].out_value = &field0;
u8 tmp;
fields[0].in_value = NULL; fields[0].in_value = &tmp;
jtag_set_check_value(fields+0, &field0_check_value, &field0_check_mask, NULL);
fields[1].tap = xscale->jtag_info.tap; fields[1].tap = xscale->jtag_info.tap;
fields[1].num_bits = 32; fields[1].num_bits = 32;
fields[1].out_value = xscale->reg_cache->reg_list[XSCALE_DCSR].value; fields[1].out_value = xscale->reg_cache->reg_list[XSCALE_DCSR].value;
fields[1].in_value = NULL; fields[1].in_value = NULL;
fields[1].in_handler = NULL; fields[1].in_handler = NULL;
fields[2].tap = xscale->jtag_info.tap; fields[2].tap = xscale->jtag_info.tap;
fields[2].num_bits = 1; fields[2].num_bits = 1;
fields[2].out_value = &field2; fields[2].out_value = &field2;
u8 tmp2;
fields[2].in_value = NULL; fields[2].in_value = &tmp2;
jtag_set_check_value(fields+2, &field2_check_value, &field2_check_mask, NULL);
jtag_add_dr_scan(3, fields, TAP_INVALID); jtag_add_dr_scan(3, fields, TAP_INVALID);
jtag_check_value_mask(fields+0, &field0_check_value, &field0_check_mask);
jtag_check_value_mask(fields+2, &field2_check_value, &field2_check_mask);
if ((retval = jtag_execute_queue()) != ERROR_OK) if ((retval = jtag_execute_queue()) != ERROR_OK)
{ {
LOG_ERROR("JTAG error while writing DCSR"); LOG_ERROR("JTAG error while writing DCSR");