From 19896cd5a4d3a8b575a07ca366ed9820fbeac360 Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Fri, 20 Aug 2004 04:46:24 +0000 Subject: [PATCH] 2004-08-20 Marcel Telka * src/bus/pxa2x0.c (pxa2x0_bus_init): New function. (pxa250_bus_prepare): Replaced bus initialization sequence with pxa2x0_bus_init() call. (pxa2x0_bus_area): Added pxa2x0_bus_init() call. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@610 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 6 ++++++ jtag/src/bus/pxa2x0.c | 35 +++++++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index ec34bf07..3ad0cc97 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,9 @@ +2004-08-20 Marcel Telka + + * src/bus/pxa2x0.c (pxa2x0_bus_init): New function. + (pxa250_bus_prepare): Replaced bus initialization sequence with pxa2x0_bus_init() call. + (pxa2x0_bus_area): Added pxa2x0_bus_init() call. + 2004-08-20 Marcel Telka * src/tap/Makefile.am (libtap_a_SOURCES): Added cable/lattice.c. diff --git a/jtag/src/bus/pxa2x0.c b/jtag/src/bus/pxa2x0.c index c179c3f7..8ec52ca2 100644 --- a/jtag/src/bus/pxa2x0.c +++ b/jtag/src/bus/pxa2x0.c @@ -123,19 +123,32 @@ pxa2x0_bus_printinfo( bus_t *bus ) } static void -pxa250_bus_prepare( bus_t *bus ) +pxa2x0_bus_init( bus_t *bus ) { - if (INITED == 0) { - part_set_instruction( PART, "SAMPLE/PRELOAD" ); - chain_shift_instructions( chain ); - chain_shift_data_registers( chain, 1 ); + chain_t *chain = CHAIN; + part_t *p = PART; - BOOT_DEF = BOOT_DEF_PKG_TYPE | BOOT_DEF_BOOT_SEL(part_get_signal( PART, part_find_signal( PART, "BOOT_SEL[2]" ) ) << 2 - | part_get_signal( PART, part_find_signal( PART, "BOOT_SEL[1]" ) ) << 1 - | part_get_signal( PART, part_find_signal( PART, "BOOT_SEL[0]" ) )); + if (INITED == 1) + return; - INITED = 1; - } + part_set_instruction( p, "SAMPLE/PRELOAD" ); + chain_shift_instructions( chain ); + chain_shift_data_registers( chain, 1 ); + + BOOT_DEF = BOOT_DEF_PKG_TYPE | BOOT_DEF_BOOT_SEL(part_get_signal( p, part_find_signal( p, "BOOT_SEL[2]" ) ) << 2 + | part_get_signal( p, part_find_signal( p, "BOOT_SEL[1]" ) ) << 1 + | part_get_signal( p, part_find_signal( p, "BOOT_SEL[0]" ) )); + + part_set_instruction( p, "BYPASS" ); + chain_shift_instructions( chain ); + + INITED = 1; +} + +static void +pxa250_bus_prepare( bus_t *bus ) +{ + pxa2x0_bus_init( bus ); part_set_instruction( PART, "EXTEST" ); chain_shift_instructions( CHAIN ); @@ -288,6 +301,8 @@ pxa250_bus_write( bus_t *bus, uint32_t adr, uint32_t data ) static int pxa2x0_bus_area( bus_t *bus, uint32_t adr, bus_area_t *area ) { + pxa2x0_bus_init( bus ); + /* Static Chip Select 0 (64 MB) */ if (adr < UINT32_C(0x04000000)) { area->description = N_("Static Chip Select 0");