|
发表于 2005-7-22 17:52:44
|
显示全部楼层
PCI总线所采用的DMA传输方式
1. First of all, bus mastering is NOT a something huge, it is simply saying this PCI device becomes the master and transfer data to the target.
2. DMA is a procedure that the master transfer a certain amount of data automatically without any assistance.
3. DMA engine will do applying for bus ownership, attempt to write / read data if get retried, write / read using single or burst, if disconnected, reapply for bus ownership, restart the data transfer from where it is stopped, stop transfer when it reaches the amount of data, sometimes, it also has a watermark to use the bus efficiently.
4. Do you have to understand all these in order to use it? NO!
5. All you need is how to set a group of registers in this PCI device. Normally, these registers include destination address, size of data, watermark if applicable, and the GO bit (to start the DMA transfer).
6. How to set these registers? Using single write several times. It should the base address + offset of these registers.
7. After DMA finishes the transfer, it will NORMALLY interrupt CPU, i.e., your SW has to service the interrupt. Normally, SW has to check DMA status registers, if it shown DONE bit == 1, then it is successfully done.
8. If it is some other error bits, then you have to clear the errors and restart the DMA engine for next round of DMA transfer.
9. The system works smoothly.
|
|