![Freescale Semiconductor MCF54455 Reference Manual Download Page 598](http://html1.mh-extra.com/html/freescale-semiconductor/mcf54455/mcf54455_reference-manual_2330541598.webp)
Advanced Technology Attachment (ATA)
Freescale Semiconductor
23-23
23.4.6
Using DMA Mode to Transmit Data to ATA Bus
Apart from PIO mode, the ATA interface supports also multiword DMA (MDMA) and ultra DMA
(UDMA) mode to transfer data. DMA mode can transmit data to the drive (DMA out transfer). In DMA
transmit mode, the protocol engine transfers data from the FIFO to the drive using multiword DMA or ultra
DMA protocol. The transfer pauses when:
•
The FIFO is empty.
•
The drive deasserts its DMA request signal, ATA_DMARQ.
•
The ATA_CR[DMAPEND] bit is cleared.
When the cause of transfer pausing is removed, the transfer restarts. The end of transfer is signalled by the
drive to the host by asserting the ATA_INTRQ signal. Alternatively, the host can read the device status
register. In this register, the drive also indicate if the transfer has ended.
The host system DMA manages the transfer of data from the memory to the FIFO. When the FIFO filling
is below the alarm threshold, the DMA must read one packet of data from the main memory and store this
in the FIFO. In doing so, the DMA prevents the FIFO from becoming empty and keeps the transfer from
FIFO to drive running.
The steps for setting up a DMA data transfer from device to host are:
1. Make sure the ATA bus is not in reset and all timing registers are programmed.
2. Make sure the FIFO is empty by reading it until empty or by resetting it.
3. Initialize the DMA channel associated with ATA transmit. Every time ATA transmit DMA request
asserts, the DMA should read <packetsize> longwords from the main memory, and write them to
the FIFO. (typical packetsize is 8 longwords). Program the DMA so it does not transfer more than
<sectorsize> longwords in total.
4. Write FIFO_SIZE - 2 * <packetsize> to the FIFO_ALARM register. In this way, the FIFO requests
attention to DMA when there is room for at least one extra packet. FIFO_SIZE should be given in
halfwords. (typical 64 halfwords)
5. To make the ATA ready for a DMA transfer from host to device, perform the following steps:
a) Make sure the FIFO is enabled by setting the ATA_CR[FEN] bit.
b) Set the ATA_CR[FREFILL] bit, which enables the DMA to fill FIFO.
c) Program ATA_CR[DMAPEND] equals 1 and ATA_CR[DMADIR] equals 1. Also, select the
DMA mode; ATA_CR[DMAMODE] equals 0 for multiword DMA or ATA_CR[DMAMODE]
equals 1 for ultra DMA.
6. The host side of the DMA is now ready. Send commands to the drive in PIO mode that cause it to
request DMA transfer on the ATA bus. The nature of these commands is beyond the scope of this
document. Consult the ATA specification for more information on how to communicate with the
drive.
7. When the drive now requests DMA transfer by asserting ATA_DMARQ, the ATA interface
acknowledges with ATA_DMACK, and the transfer starts. Data is transferred automatically from
the FIFO, and also from host memory to FIFO.
Summary of Contents for MCF54455
Page 33: ...xxviii Freescale Semiconductor ...
Page 67: ...Freescale Semiconductor 1 ...
Page 125: ...Freescale Semiconductor 1 ...
Page 145: ...Enhanced Multiply Accumulate Unit EMAC 5 21 Freescale Semiconductor ...
Page 173: ...Cache 6 28 Freescale Semiconductor ...
Page 179: ...Static RAM SRAM 7 6 Freescale Semiconductor ...
Page 207: ...Power Management 9 16 Freescale Semiconductor ...
Page 323: ...Reset Controller Module 13 8 Freescale Semiconductor ...
Page 389: ...Pin Multiplexing and Control 16 44 Freescale Semiconductor ...
Page 575: ...PCI Bus Controller 22 58 Freescale Semiconductor ...
Page 600: ...Advanced Technology Attachment ATA Freescale Semiconductor 23 25 ...
Page 601: ...Freescale Semiconductor 1 ...
Page 842: ...I2 C Interface Freescale Semiconductor 33 16 ...
Page 843: ...Freescale Semiconductor 1 ...
Page 921: ...Revision History A 6 Freescale Semiconductor ...