100 likes | 113 Views
A vxWorks driver for DMA on VMEbus. Babak Kalantari Paul Scherrer Institute Switzerland. Direct Memory Access. Processor board. Slave board (e.g. ADC). CPU. Memory. Memory. Memory. PCI-VME bridge. - Universe II - Tsi148 - etc. Transfer by CPU. Transfer using DMA. VMEbus.
E N D
A vxWorks driver for DMA on VMEbus Babak Kalantari Paul Scherrer Institute Switzerland
Direct Memory Access Processor board Slave board (e.g. ADC) CPU Memory Memory Memory PCI-VME bridge - Universe II - Tsi148 - etc. Transfer by CPU Transfer using DMA VMEbus
DMA: software support • DMA drivers in out-of-the-box BSP’s : • have differentAPI • from BSP to BSP depending on PCI-VME bus bridge controller • some use polling • to check transfer completion (MVME -23xx and -51xx boards have no interrupt handling, callback, …) • have single-requester API • while a transfer is on execution the next transfer request fails (DMA engine busy) application program has to keep retrying • assume a fixed transfer protocol per VME access window
DMA: software support • We’ve developed a driver that provides: • effective use of DMA engine • interrupt / Error handling, user callback, DMA engine control/monitor, etc. • multi-requester API • parallel request handling, reading status, cancelling, or stopping a transfer request • unique API • throughout several processor boards: (mvme-23xx, mvme-51xx, mvme-6100, mvme-4100, should also work for mvme-3100)
DMA: software support User application (drivers) API (dmaLib.h) implementation (dmaLib.c) BSP BSP universe II implementation (dmaLib.c) BSP BSP Tsi148 mvme23xx mvme51xx mvme61xx mvme41xx
DMA driver API • destination • source • size • addrMode • dataWidth • direction • timeout • *cb_routine • *cb_param • *dmaStat • dmaReqId = dmaTransferRequest(…) • dmaRequestStatRead(dmaReqId) • dmaRequestCancel(dmaReqId, forcedStop) • dmaStatReport()
DMA driver operation principle dmaReq_0 dmaReq_1 If queue non-empty then Handle dmaReq_x msgQueue dmaReq_n • Check if this request is not cancelled • Program DMA engine + initiate transfer • Block until completion or error occurrence • Call the user callback and pass the status client server
same dmaLib.h in standard vxWorks include path rebuild kernel with the right dmaLib.c added to the BSP Include the source code in configAll Make a call to “dmaHandlerInit()” in usrConfig API Documentaion: https://controls.web.psi.ch/cgi-bin/twiki/view/Main/VxWorksDmaDriver Usage: