diff -ru rockbox-19602-dma/firmware/target/arm/ata-pp5020.c rockbox-19602-dmabl/firmware/target/arm/ata-pp5020.c --- rockbox-19602-dma/firmware/target/arm/ata-pp5020.c 2008-12-27 22:47:31.950000000 -0500 +++ rockbox-19602-dmabl/firmware/target/arm/ata-pp5020.c 2008-12-27 22:48:12.473600000 -0500 @@ -170,10 +170,14 @@ IDE_DMA_CONTROL |= 2; IDE_DMA_LENGTH = bytes - 4; - /* Rockbox remaps RAM from 0x10000000 to 0. The DMA - hardware needs a physical address. - */ - IDE_DMA_ADDR = (unsigned long)addr + 0x10000000; + +#ifndef BOOTLOADER + if ((unsigned long)addr < DRAM_START) + /* Rockbox remaps DRAM to start at 0 */ + IDE_DMA_ADDR = (unsigned long)addr + DRAM_START; + else +#endif + IDE_DMA_ADDR = (unsigned long)addr; if (write) IDE_DMA_CONTROL &= ~IDE_DMA_CONTROL_READ; diff -ru rockbox-19602-dma/firmware/target/arm/ata-target.h rockbox-19602-dmabl/firmware/target/arm/ata-target.h --- rockbox-19602-dma/firmware/target/arm/ata-target.h 2008-12-27 22:47:31.950000000 -0500 +++ rockbox-19602-dmabl/firmware/target/arm/ata-target.h 2008-12-27 22:54:21.542400000 -0500 @@ -92,10 +92,16 @@ /* Maximum multi-word DMA mode supported by the controller */ #define ATA_MAX_MWDMA 2 + +#ifndef BOOTLOADER /* The PP5020 supports UDMA 4, but it needs cpu boosting and doesn't - improve test_disk results. + improve test_disk results. UDMA 2 is stable at 30 Mhz. */ #define ATA_MAX_UDMA 2 +#else +/* The bootloader runs at 24 Mhz and needs a slower mode */ +#define ATA_MAX_UDMA 1 +#endif void ata_dma_set_mode(unsigned char mode); bool ata_dma_setup(void *addr, unsigned long bytes, bool write);