diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 302a9f0e..cf8b328a 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,5 +1,8 @@ 2009-07-15 Arnim Laeuger + * src/bus/ejtag_dma.c: [ 2815726 ] Fix HALFWORD and BYTE DMA read access + (Jochen Friedrich) + * src/flash/amd_flash.c: [ 2821629 ] Can't find flash_info : amd_flash.c (MURANAKA Masaki) * src/flash/amd_flash.c: [ 2821646 ] Possible buffer overrun in amd_detect diff --git a/urjtag/THANKS b/urjtag/THANKS index 169e8009..326c246d 100644 --- a/urjtag/THANKS +++ b/urjtag/THANKS @@ -25,6 +25,7 @@ Andrew Dyer Chris Ellec Ralf Engels Steve Franks +Jochen Friedrich Thomas Fröhlich Mike Frysinger Robin Getz diff --git a/urjtag/src/bus/ejtag_dma.c b/urjtag/src/bus/ejtag_dma.c index d81130c0..986fbabc 100644 --- a/urjtag/src/bus/ejtag_dma.c +++ b/urjtag/src/bus/ejtag_dma.c @@ -342,10 +342,20 @@ ejtag_dma_read (urj_bus_t *bus, unsigned int addr, int sz) switch (sz) { case DMA_HALFWORD: - ret &= ret & 0xffff; + if (addr & 2) + ret = (ret >> 16) & 0xffff; + else + ret = ret & 0xffff; break; case DMA_BYTE: - ret &= ret & 0xff; + if ((addr & 3) == 3) + ret = (ret >> 24) & 0xff; + else if ((addr & 3) == 2) + ret = (ret >> 16) & 0xff; + else if ((addr & 3) == 1) + ret = (ret >> 8) & 0xff; + else + ret = ret & 0xff; break; case DMA_WORD: default: