From 4fe5a010c20d7aecded0f0ccfaf4eeadb15d41d5 Mon Sep 17 00:00:00 2001 From: oharboe Date: Mon, 11 May 2009 07:48:26 +0000 Subject: switch to jtag_add_callback() - USB performance fix git-svn-id: svn://svn.berlios.de/openocd/trunk@1733 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/target/xscale.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/target/xscale.c b/src/target/xscale.c index 0497a478..11aca781 100644 --- a/src/target/xscale.c +++ b/src/target/xscale.c @@ -252,7 +252,7 @@ int xscale_read_dcsr(target_t *target) fields[1].num_bits = 32; fields[1].out_value = NULL; fields[1].in_value = xscale->reg_cache->reg_list[XSCALE_DCSR].value; - + fields[2].tap = xscale->jtag_info.tap; fields[2].num_bits = 1; @@ -290,6 +290,12 @@ int xscale_read_dcsr(target_t *target) return jtag_execute_queue(); } + +static void xscale_getbuf(u8 *in) +{ + *((u32 *)in)=buf_get_u32(in, 0, 32); +} + int xscale_receive(target_t *target, u32 *buffer, int num_words) { if (num_words==0) @@ -326,9 +332,7 @@ int xscale_receive(target_t *target, u32 *buffer, int num_words) fields[1].tap = xscale->jtag_info.tap; fields[1].num_bits = 32; fields[1].out_value = NULL; - u8 tmp[4]; - fields[1].in_value = tmp; - + fields[2].tap = xscale->jtag_info.tap; fields[2].num_bits = 1; @@ -351,13 +355,15 @@ int xscale_receive(target_t *target, u32 *buffer, int num_words) fields[0].in_value = &field0[i]; jtag_add_pathmove(3, path); - jtag_add_dr_scan_now(3, fields, TAP_IDLE); + + fields[1].in_value = (u8 *)(field1+i); + jtag_add_dr_scan(3, fields, TAP_IDLE); + + jtag_add_callback(xscale_getbuf, (u8 *)(field1+i)); 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); - words_scheduled++; } @@ -444,7 +450,7 @@ int xscale_read_tx(target_t *target, int consume) fields[1].num_bits = 32; fields[1].out_value = NULL; fields[1].in_value = xscale->reg_cache->reg_list[XSCALE_TX].value; - + fields[2].tap = xscale->jtag_info.tap; fields[2].num_bits = 1; @@ -536,7 +542,7 @@ int xscale_write_rx(target_t *target) fields[1].num_bits = 32; fields[1].out_value = xscale->reg_cache->reg_list[XSCALE_RX].value; fields[1].in_value = NULL; - + fields[2].tap = xscale->jtag_info.tap; fields[2].num_bits = 1; @@ -708,7 +714,7 @@ int xscale_write_dcsr(target_t *target, int hold_rst, int ext_dbg_brk) fields[1].num_bits = 32; fields[1].out_value = xscale->reg_cache->reg_list[XSCALE_DCSR].value; fields[1].in_value = NULL; - + fields[2].tap = xscale->jtag_info.tap; fields[2].num_bits = 1; @@ -778,7 +784,7 @@ int xscale_load_ic(target_t *target, int mini, u32 va, u32 buffer[8]) fields[0].in_value = NULL; - + fields[1].tap = xscale->jtag_info.tap; @@ -788,7 +794,7 @@ int xscale_load_ic(target_t *target, int mini, u32 va, u32 buffer[8]) fields[1].in_value = NULL; - + jtag_add_dr_scan(2, fields, TAP_INVALID); @@ -840,7 +846,7 @@ int xscale_invalidate_ic_line(target_t *target, u32 va) fields[0].in_value = NULL; - + fields[1].tap = xscale->jtag_info.tap; @@ -850,7 +856,7 @@ int xscale_invalidate_ic_line(target_t *target, u32 va) fields[1].in_value = NULL; - + jtag_add_dr_scan(2, fields, TAP_INVALID); -- cgit v1.2.3