From 1bae12bb3b2a470cf9a434ab6b5175731eac65fd Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Mon, 26 May 2003 10:41:44 +0000 Subject: [PATCH] 2003-05-26 Marcel Telka * include/chain.h (chain_shift_data_registers): Added new parameter `capture_output' (idea from patch 743146, Matan Ziv-Av). * src/tap/chain.c (chain_shift_data_registers): Ditto. All chain_shift_data_registers() function callers updated. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@444 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 7 +++++++ jtag/include/chain.h | 2 +- jtag/src/bus/ixp425.c | 12 ++++++------ jtag/src/bus/pxa2x0.c | 12 ++++++------ jtag/src/bus/sa1110.c | 12 ++++++------ jtag/src/cmd/detect.c | 2 +- jtag/src/cmd/shift.c | 2 +- jtag/src/tap/chain.c | 5 +++-- 8 files changed, 31 insertions(+), 23 deletions(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 7e4e91ef..2d44dacf 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,10 @@ +2003-05-26 Marcel Telka + + * include/chain.h (chain_shift_data_registers): Added new parameter `capture_output' (idea from + patch 743146, Matan Ziv-Av). + * src/tap/chain.c (chain_shift_data_registers): Ditto. + All chain_shift_data_registers() function callers updated. + 2003-05-26 Marcel Telka * data/Makefile.am (nobase_dist_pkgdata_DATA): Added broadcom/bcm5421s/STEPPINGS diff --git a/jtag/include/chain.h b/jtag/include/chain.h index 74fe413d..5c9452f0 100644 --- a/jtag/include/chain.h +++ b/jtag/include/chain.h @@ -44,7 +44,7 @@ void chain_clock( chain_t *chain, int tms, int tdi ); int chain_set_trst( chain_t *chain, int trst ); int chain_get_trst( chain_t *chain ); void chain_shift_instructions( chain_t *chain ); -void chain_shift_data_registers( chain_t *chain ); +void chain_shift_data_registers( chain_t *chain, int capture_output ); typedef struct { chain_t **chains; diff --git a/jtag/src/bus/ixp425.c b/jtag/src/bus/ixp425.c index 31742db2..a36ae99f 100644 --- a/jtag/src/bus/ixp425.c +++ b/jtag/src/bus/ixp425.c @@ -132,7 +132,7 @@ ixp425_bus_read_start( bus_t *bus, uint32_t adr ) setup_address( bus, adr ); set_data_in( bus ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 0 ); } static uint32_t @@ -144,7 +144,7 @@ ixp425_bus_read_next( bus_t *bus, uint32_t adr ) uint32_t d = 0; setup_address( bus, adr ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 1 ); for (i = 0; i < 16; i++) d |= (uint32_t) (part_get_signal( p, EX_DATA[i] ) << i); @@ -164,7 +164,7 @@ ixp425_bus_read_end( bus_t *bus ) part_set_signal( p, EX_RD, 1, 1 ); part_set_signal( p, EX_WR, 1, 1 ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 1 ); for (i = 0; i < 16; i++) d |= (uint32_t) (part_get_signal( p, EX_DATA[i] ) << i); @@ -191,13 +191,13 @@ ixp425_bus_write( bus_t *bus, uint32_t adr, uint32_t data ) setup_address( bus, adr ); setup_data( bus, data ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 0 ); part_set_signal( p, EX_WR, 1, 0 ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 0 ); part_set_signal( p, EX_WR, 1, 1 ); unselect_flash( bus ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 0 ); } static int diff --git a/jtag/src/bus/pxa2x0.c b/jtag/src/bus/pxa2x0.c index 34396fc4..2bd528d1 100644 --- a/jtag/src/bus/pxa2x0.c +++ b/jtag/src/bus/pxa2x0.c @@ -128,7 +128,7 @@ pxa250_bus_read_start( bus_t *bus, uint32_t adr ) setup_address( bus, adr ); set_data_in( bus ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 0 ); } static uint32_t pxa250_bus_read_end( bus_t *bus ); @@ -149,7 +149,7 @@ pxa250_bus_read_next( bus_t *bus, uint32_t adr ) /* see Figure 6-13 in [1] */ setup_address( bus, adr ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 1 ); for (i = 0; i < 32; i++) d |= (uint32_t) (part_get_signal( p, MD[i] ) << i); @@ -173,7 +173,7 @@ pxa250_bus_read_end( bus_t *bus ) part_set_signal( p, nOE, 1, 1 ); part_set_signal( p, nSDCAS, 1, 1 ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 1 ); for (i = 0; i < 32; i++) d |= (uint32_t) (part_get_signal( p, MD[i] ) << i); @@ -211,12 +211,12 @@ pxa250_bus_write( bus_t *bus, uint32_t adr, uint32_t data ) setup_address( bus, adr ); setup_data( bus, data ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 0 ); part_set_signal( p, nWE, 1, 0 ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 0 ); part_set_signal( p, nWE, 1, 1 ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 0 ); } static int diff --git a/jtag/src/bus/sa1110.c b/jtag/src/bus/sa1110.c index 22c56da2..80746ca6 100644 --- a/jtag/src/bus/sa1110.c +++ b/jtag/src/bus/sa1110.c @@ -114,7 +114,7 @@ sa1110_bus_read_start( bus_t *bus, uint32_t adr ) setup_address( bus, adr ); set_data_in( bus ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 0 ); } static uint32_t @@ -127,7 +127,7 @@ sa1110_bus_read_next( bus_t *bus, uint32_t adr ) uint32_t d = 0; setup_address( bus, adr ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 1 ); for (i = 0; i < 32; i++) d |= (uint32_t) (part_get_signal( p, D[i] ) << i); @@ -151,7 +151,7 @@ sa1110_bus_read_end( bus_t *bus ) part_set_signal( p, nCS[4], 1, 1 ); part_set_signal( p, nCS[5], 1, 1 ); part_set_signal( p, nOE, 1, 1 ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 1 ); for (i = 0; i < 32; i++) d |= (uint32_t) (part_get_signal( p, D[i] ) << i); @@ -186,10 +186,10 @@ sa1110_bus_write( bus_t *bus, uint32_t adr, uint32_t data ) setup_address( bus, adr ); setup_data( bus, data ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 0 ); part_set_signal( p, nWE, 1, 0 ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 0 ); part_set_signal( p, nWE, 1, 1 ); part_set_signal( p, nCS[0], 1, 1 ); part_set_signal( p, nCS[1], 1, 1 ); @@ -197,7 +197,7 @@ sa1110_bus_write( bus_t *bus, uint32_t adr, uint32_t data ) part_set_signal( p, nCS[3], 1, 1 ); part_set_signal( p, nCS[4], 1, 1 ); part_set_signal( p, nCS[5], 1, 1 ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 0 ); } static int diff --git a/jtag/src/cmd/detect.c b/jtag/src/cmd/detect.c index faed7ff7..cdea964e 100644 --- a/jtag/src/cmd/detect.c +++ b/jtag/src/cmd/detect.c @@ -55,7 +55,7 @@ cmd_detect_run( char *params[] ) } parts_set_instruction( chain->parts, "SAMPLE/PRELOAD" ); chain_shift_instructions( chain ); - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 1 ); parts_set_instruction( chain->parts, "BYPASS" ); chain_shift_instructions( chain ); if (strcmp( chain->parts->parts[0]->part, "SA1110" ) == 0) diff --git a/jtag/src/cmd/shift.c b/jtag/src/cmd/shift.c index 5489cbc7..5bacebe9 100644 --- a/jtag/src/cmd/shift.c +++ b/jtag/src/cmd/shift.c @@ -46,7 +46,7 @@ cmd_shift_run( char *params[] ) return 1; } if (strcmp( params[1], "dr" ) == 0) { - chain_shift_data_registers( chain ); + chain_shift_data_registers( chain, 1 ); return 1; } diff --git a/jtag/src/tap/chain.c b/jtag/src/tap/chain.c index 97fdab72..6d28a8a2 100644 --- a/jtag/src/tap/chain.c +++ b/jtag/src/tap/chain.c @@ -116,7 +116,7 @@ chain_shift_instructions( chain_t *chain ) } void -chain_shift_data_registers( chain_t *chain ) +chain_shift_data_registers( chain_t *chain, int capture_output ) { int i; parts_t *ps; @@ -134,6 +134,7 @@ chain_shift_data_registers( chain_t *chain ) continue; } tap_shift_register( chain, ps->parts[i]->active_instruction->data_register->in, - ps->parts[i]->active_instruction->data_register->out, (i + 1) == ps->len ); + capture_output ? ps->parts[i]->active_instruction->data_register->out : NULL, + (i + 1) == ps->len ); } }