From 10147eff74cf09d9beddf9e976f49c90f8e72d3e Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Wed, 3 Sep 2003 21:01:58 +0000 Subject: [PATCH] 2003-09-03 Marcel Telka * src/bus/pxa2x0.c (set_data_in, setup_data): Added new 'adr' parameter. Used real data bus width for data reading (based on patch 792591, thanks to Guennadi Liakhovetski). All function callers updated. (pxa250_bus_read_next, pxa250_bus_read_end): Used real data bus width for data reading (based on patch 792591, thanks to Guennadi Liakhovetski). * src/bus/sa1110.c (set_data_in, setup_data, sa1110_bus_read_next, sa1110_bus_read_end): Ditto. * src/bus/sh7727.c (set_data_in, setup_data, sh7727_bus_read_next, sh7727_bus_read_end): Ditto. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@554 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 10 ++++++++++ jtag/NEWS | 2 ++ jtag/THANKS | 1 + jtag/src/bus/pxa2x0.c | 30 ++++++++++++++++++++++-------- jtag/src/bus/sa1110.c | 22 ++++++++++++++++++---- jtag/src/bus/sh7727.c | 22 ++++++++++++++++++---- 6 files changed, 71 insertions(+), 16 deletions(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 918a2e31..55d8d422 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,13 @@ +2003-09-03 Marcel Telka + + * src/bus/pxa2x0.c (set_data_in, setup_data): Added new 'adr' parameter. Used real data bus width + for data reading (based on patch 792591, thanks to Guennadi Liakhovetski). + All function callers updated. + (pxa250_bus_read_next, pxa250_bus_read_end): Used real data bus width for data reading (based on + patch 792591, thanks to Guennadi Liakhovetski). + * src/bus/sa1110.c (set_data_in, setup_data, sa1110_bus_read_next, sa1110_bus_read_end): Ditto. + * src/bus/sh7727.c (set_data_in, setup_data, sh7727_bus_read_next, sh7727_bus_read_end): Ditto. + 2003-08-28 Marcel Telka * src/bus/pxa2x0.c (pxa250_bus_read_next, pxa250_bus_read_end): Added support for BOOT_DEF register diff --git a/jtag/NEWS b/jtag/NEWS index d95fc295..cb0c4af6 100644 --- a/jtag/NEWS +++ b/jtag/NEWS @@ -7,6 +7,8 @@ See libbrux/NEWS for more news. - Altera EPM7128AETC100 (Rojhalat Ibrahim) * Added additional checks for valid ByteBlaster cable connection and enabled all variants of the cable (patch 793313, Rojhalat Ibrahim). + * Used real data bus width for data reading in PXA2x0, SA1110, and SH7727 bus drivers + (based on patch 792591, thanks to Guennadi Liakhovetski). * Added BOOT_DEF register emulation for PXA2x0 bus driver. * Fixed minor bugs. diff --git a/jtag/THANKS b/jtag/THANKS index 7ad2a221..95e640ac 100644 --- a/jtag/THANKS +++ b/jtag/THANKS @@ -12,6 +12,7 @@ Jachym Holecek August Hörandl Rojhalat Ibrahim Stas Khirman +Guennadi Liakhovetski Brad Parker Christian Pellegrin Ramses VI diff --git a/jtag/src/bus/pxa2x0.c b/jtag/src/bus/pxa2x0.c index a345e44a..5c1954a3 100644 --- a/jtag/src/bus/pxa2x0.c +++ b/jtag/src/bus/pxa2x0.c @@ -78,23 +78,31 @@ setup_address( bus_t *bus, uint32_t a ) part_set_signal( p, MA[i], 1, (a >> i) & 1 ); } +static int pxa2x0_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ); + static void -set_data_in( bus_t *bus ) +set_data_in( bus_t *bus, uint32_t adr ) { int i; part_t *p = PART; + bus_area_t area; + + pxa2x0_bus_area( bus, adr, &area ); - for (i = 0; i < 32; i++) + for (i = 0; i < area.width; i++) part_set_signal( p, MD[i], 0, 0 ); } static void -setup_data( bus_t *bus, uint32_t d ) +setup_data( bus_t *bus, uint32_t adr, uint32_t d ) { int i; part_t *p = PART; + bus_area_t area; + + pxa2x0_bus_area( bus, adr, &area ); - for (i = 0; i < 32; i++) + for (i = 0; i < area.width; i++) part_set_signal( p, MD[i], 1, (d >> i) & 1 ); } @@ -138,7 +146,7 @@ pxa250_bus_read_start( bus_t *bus, uint32_t adr ) part_set_signal( p, nSDCAS, 1, 0 ); setup_address( bus, adr ); - set_data_in( bus ); + set_data_in( bus, adr ); chain_shift_data_registers( chain, 0 ); } @@ -155,13 +163,16 @@ pxa250_bus_read_next( bus_t *bus, uint32_t adr ) if (adr < UINT32_C(0x04000000)) { int i; + bus_area_t area; + + pxa2x0_bus_area( bus, adr, &area ); /* see Figure 6-13 in [1] */ setup_address( bus, adr ); chain_shift_data_registers( chain, 1 ); d = 0; - for (i = 0; i < 32; i++) + for (i = 0; i < area.width; i++) d |= (uint32_t) (part_get_signal( p, MD[i] ) << i); return d; @@ -189,6 +200,9 @@ pxa250_bus_read_end( bus_t *bus ) if (LAST_ADR < UINT32_C(0x04000000)) { int i; uint32_t d = 0; + bus_area_t area; + + pxa2x0_bus_area( bus, LAST_ADR, &area ); /* see Figure 6-13 in [1] */ part_set_signal( p, nCS[0], 1, 1 ); @@ -197,7 +211,7 @@ pxa250_bus_read_end( bus_t *bus ) chain_shift_data_registers( chain, 1 ); - for (i = 0; i < 32; i++) + for (i = 0; i < area.width; i++) d |= (uint32_t) (part_get_signal( p, MD[i] ) << i); return d; @@ -244,7 +258,7 @@ pxa250_bus_write( bus_t *bus, uint32_t adr, uint32_t data ) part_set_signal( p, nSDCAS, 1, 0 ); setup_address( bus, adr ); - setup_data( bus, data ); + setup_data( bus, adr, data ); chain_shift_data_registers( chain, 0 ); diff --git a/jtag/src/bus/sa1110.c b/jtag/src/bus/sa1110.c index 60784b1d..03102efa 100644 --- a/jtag/src/bus/sa1110.c +++ b/jtag/src/bus/sa1110.c @@ -67,13 +67,18 @@ setup_address( bus_t *bus, uint32_t a ) part_set_signal( p, A[i], 1, (a >> i) & 1 ); } +static int sa1110_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ); + static void set_data_in( bus_t *bus ) { int i; part_t *p = PART; + bus_area_t area; + + sa1110_bus_area( bus, 0, &area ); - for (i = 0; i < 32; i++) + for (i = 0; i < area.width; i++) part_set_signal( p, D[i], 0, 0 ); } @@ -82,8 +87,11 @@ setup_data( bus_t *bus, uint32_t d ) { int i; part_t *p = PART; + bus_area_t area; + + sa1110_bus_area( bus, 0, &area ); - for (i = 0; i < 32; i++) + for (i = 0; i < area.width; i++) part_set_signal( p, D[i], 1, (d >> i) & 1 ); } @@ -136,11 +144,14 @@ sa1110_bus_read_next( bus_t *bus, uint32_t adr ) chain_t *chain = CHAIN; int i; uint32_t d = 0; + bus_area_t area; + + sa1110_bus_area( bus, adr, &area ); setup_address( bus, adr ); chain_shift_data_registers( chain, 1 ); - for (i = 0; i < 32; i++) + for (i = 0; i < area.width; i++) d |= (uint32_t) (part_get_signal( p, D[i] ) << i); return d; @@ -154,6 +165,9 @@ sa1110_bus_read_end( bus_t *bus ) chain_t *chain = CHAIN; int i; uint32_t d = 0; + bus_area_t area; + + sa1110_bus_area( bus, 0, &area ); part_set_signal( p, nCS[0], 1, 1 ); part_set_signal( p, nCS[1], 1, 1 ); @@ -164,7 +178,7 @@ sa1110_bus_read_end( bus_t *bus ) part_set_signal( p, nOE, 1, 1 ); chain_shift_data_registers( chain, 1 ); - for (i = 0; i < 32; i++) + for (i = 0; i < area.width; i++) d |= (uint32_t) (part_get_signal( p, D[i] ) << i); return d; diff --git a/jtag/src/bus/sh7727.c b/jtag/src/bus/sh7727.c index 3c241dfc..143f3f46 100644 --- a/jtag/src/bus/sh7727.c +++ b/jtag/src/bus/sh7727.c @@ -58,6 +58,8 @@ typedef struct { #define MD3 ((bus_params_t *) bus->params)->md3 #define MD4 ((bus_params_t *) bus->params)->md4 +static int sh7727_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ); + static void setup_address( bus_t *bus, uint32_t a ) { @@ -73,8 +75,11 @@ set_data_in( bus_t *bus ) { int i; part_t *p = PART; + bus_area_t area; + + sh7727_bus_area( bus, 0, &area ); - for (i = 0; i < 32; i++) + for (i = 0; i < area.width; i++) part_set_signal( p, D[i], 0, 0 ); } @@ -83,8 +88,11 @@ setup_data( bus_t *bus, uint32_t d ) { int i; part_t *p = PART; + bus_area_t area; + + sh7727_bus_area( bus, 0, &area ); - for (i = 0; i < 32; i++) + for (i = 0; i < area.width; i++) part_set_signal( p, D[i], 1, (d >> i) & 1 ); } @@ -142,11 +150,14 @@ sh7727_bus_read_next( bus_t *bus, uint32_t adr ) part_t *p = PART; int i; uint32_t d = 0; + bus_area_t area; + + sh7727_bus_area( bus, 0, &area ); setup_address( bus, adr ); chain_shift_data_registers( CHAIN, 1 ); - for (i = 0; i < 32; i++) + for (i = 0; i < area.width; i++) d |= (uint32_t) (part_get_signal( p, D[i] ) << i); return d; @@ -158,6 +169,9 @@ sh7727_bus_read_end( bus_t *bus ) part_t *p = PART; int i; uint32_t d = 0; + bus_area_t area; + + sh7727_bus_area( bus, 0, &area ); part_set_signal( p, CS[0], 1, 1 ); part_set_signal( p, CS[2], 1, 1 ); @@ -169,7 +183,7 @@ sh7727_bus_read_end( bus_t *bus ) part_set_signal( p, RD, 1, 1 ); chain_shift_data_registers( CHAIN, 1 ); - for (i = 0; i < 32; i++) + for (i = 0; i < area.width; i++) d |= (uint32_t) (part_get_signal( p, D[i] ) << i); return d;