Advanced Technology Attachment (ATA)
23-22
Freescale Semiconductor
•
The drive deasserts its DMA request signal, ATA_DMARQ.
•
The ATA_CR[DMAPEND] bit is cleared.
When the cause of the transfer pausing is removed, the transfer restarts. The end of the 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 indicates if the transfer has ended.
The host system DMA manages the transfer of data from FIFO into the memory. When the FIFO filling is
above the alarm threshold, the DMA should read one packet of data from the FIFO and store this in main
memory. In doing so, the DMA prevents the FIFO from getting full and keeps the transfer from drive to
FIFO 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 receive. Every time ATA receive DMA request is
asserted, the DMA should read <packetsize> longwords from the FIFO and store them to main
memory. (typical packetsize is eight longwords)
4. Write 2 * <packetsize> to the FIFO_ALARM register. In this way, the FIFO requests attention to
DMA when there is at least one packet ready for transfer.
5. To make the ATA ready for a DMA transfer from device to host, take the following steps:
a) Make sure the FIFO is enabled by setting the ATACR[FEN] bit.
b) Set the ATA_CR[FEMPTY] bit which enables the FIFO to by emptied by the DMA.
c) Program ATA_CR[DMAPEND] equals 1 and ATA_CR[DMADIR] equals 0. Also, select the
DMA mode; ATA_CR[DMAMODE] equals 0 for multiword DMA or ATA_CR[DMAMODE]
equals 1 for ultra DMA.
6. Now, the host side of the DMA is ready. Send commands to the drive in PIO mode causing 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 a DMA transfer by asserting ATA_DMARQ, the ATA interface
acknowledges with ATA_DMACK and transfer starts. Data transfers automatically to the FIFO
and to the host memory from there.
8. During the transfer, the host can monitor for end-of-transfer by reading some device ATA registers.
These reads cause the running DMA to pause; after the read completes and the DMA resumes. The
host can also wait unit the drive asserts ATA_INTRQ. This also indicates end-of-transfer.
9. On end-of-transfer, the host or host DMA should wait until ATA_ISR[IDLE] is set; next read, the
remaining halfwords from the FIFO and transfer these to memory.
NOTE
There may be less than <packetsize> remaining bytes, so the transfer is not
automatic by the DMA.
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 ...