From a025e2989284951a2416044613e61cbad167d774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnim=20L=C3=A4uger?= Date: Thu, 11 Jun 2009 20:32:57 +0000 Subject: [PATCH] [ 2804509 ] bf533_stamp bus driver enchancement (MURANAKA Masaki) git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1650 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 5 +++++ urjtag/src/bus/bf533_stamp.c | 15 +++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index c7637e51..c8523ebd 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,8 @@ +2009-06-11 Arnim Laeuger + + * src/bus/bf533_stamp.c: [ 2804509 ] bf533_stamp bus driver enchancement + (MURANAKA Masaki) + 2009-06-05 Rutger Hofman * src/tap/cable.c: sanity check on driver device type at connect time diff --git a/urjtag/src/bus/bf533_stamp.c b/urjtag/src/bus/bf533_stamp.c index cb767e0d..f873e3a9 100644 --- a/urjtag/src/bus/bf533_stamp.c +++ b/urjtag/src/bus/bf533_stamp.c @@ -162,17 +162,22 @@ bf533_stamp_bus_area (urj_bus_t *bus, uint32_t adr, urj_bus_area_t *area) } static void -select_flash (urj_bus_t *bus) +select_flash (urj_bus_t *bus, uint32_t adr) { urj_part_t *p = bus->part; urj_part_set_signal (p, PF[0], 1, 0); urj_part_set_signal (p, PF[1], 1, 0); - urj_part_set_signal (p, AMS[0], 1, 0); + urj_part_set_signal (p, AMS[0], 1, 1); urj_part_set_signal (p, AMS[1], 1, 1); urj_part_set_signal (p, AMS[2], 1, 1); urj_part_set_signal (p, AMS[3], 1, 1); + if (adr >= 0x20000000 && adr <= 0x203fffff) { + uint32_t ams_idx; + ams_idx = (adr >> 20) & 0x3; + urj_part_set_signal (p, AMS[ams_idx], 1, 0); + } urj_part_set_signal (p, SRAS, 1, 1); urj_part_set_signal (p, SCAS, 1, 1); @@ -240,7 +245,7 @@ bf533_stamp_bus_read_start (urj_bus_t *bus, uint32_t adr) urj_part_t *p = bus->part; urj_chain_t *chain = bus->chain; - select_flash (bus); + select_flash (bus, adr); urj_part_set_signal (p, AOE, 1, 0); urj_part_set_signal (p, ARE, 1, 0); urj_part_set_signal (p, AWE, 1, 1); @@ -312,8 +317,10 @@ bf533_stamp_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) urj_log (URJ_LOG_LEVEL_COMM, "Writing %04lX to %08lX...\n", (long unsigned) data, (long unsigned) adr); - select_flash (bus); + select_flash (bus, adr); urj_part_set_signal (p, ARE, 1, 1); + urj_part_set_signal (p, AOE, 1, 1); + urj_part_set_signal (p, AWE, 1, 1); setup_address (bus, adr); setup_data (bus, data);