Title: A vxWorks driver
1A vxWorks driver for DMA on VMEbus
Babak Kalantari Paul Scherrer Institute Switzerla
nd
2Direct Memory Access
Processor board
Slave board (e.g. ADC)
Memory
CPU
Memory
Memory
PCI-VME bridge
- Universe II - Tsi148 - etc.
Transfer using DMA
Transfer by CPU
VMEbus
3DMA software support
- DMA drivers in out-of-the-box BSPs
- have different API
- 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
4DMA software support
- Weve 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)
5DMA 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
6DMA driver API
- destination
- source
- size
- addrMode
- dataWidth
- direction
- timeout
- cb_routine
- cb_param
- dmaStat
- dmaReqId dmaTransferRequest ()
- dmaRequestStatRead (dmaReqId)
- dmaRequestCancel (dmaReqId, forcedStop)
- dmaStatReport()
7DMA 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
8Usage
- 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/Mai
n/VxWorksDmaDriver
9Thanks!
10DMA Processor Boards
SBC PCI-to-VME Bus Bridge Transfer protocols Direction of Transfer PSI controls support
mvme230x Universe II SCT, BLT, MBLT V2C, C2V supported
mvme51xx mvme5500 Universe II SCT, BLT, MBLT V2C, C2V supported
mvme6100 Tsi148 (Tempe) SCT, (M)BLT, 2eVME, 2eSST V2C, C2V, V2V, C2C supported
mvme4100 Tsi148 (Tempe) SCT, (M)BLT, 2eVME, 2eSST V2C, C2V, V2V, C2C supported