140 likes | 374 Views
CSL DAT Adapter. CSL 2.x DAT Reference Implementation on EDMA3 hardware using EDMA3 Low level driver. EDMA3 Low Level Driver (LLD). EDMA3 Driver APIs EDMA3 Resource Manager. Framework Components. PSP Drivers. CSL/ DAT. CSL/DAT. DMAN3. ACPY3. EDMA3 Resource Manager. EDMA3 Driver.
E N D
CSL DAT Adapter CSL 2.x DAT Reference Implementation on EDMA3 hardware using EDMA3 Low level driver.
EDMA3 Low Level Driver (LLD) • EDMA3 Driver APIs • EDMA3 Resource Manager Framework Components PSP Drivers CSL/DAT CSL/DAT DMAN3 ACPY3 EDMA3 Resource Manager EDMA3 Driver EDMA3 Driver Internally calls DMA/ QDMA Channels TCCs PaRAMs EDMA3 ISRs EDMA3 Package
EDMA3 LLD Package • OS independent package • Registering and un-registering of EDMA3 Interrupt Service Routines with the underlying OS is responsibility of user. • User expected to provide implementation for the following functions to correctly link an application with the EDMA3 LLD Package. • edma3OsProtectEntry, edma3OsProtectExit • Used to protect entry and exit into critical sections of code. • edma3OsSemGive, edma3OsSemTake • Used for proper sharing and management of EDMA3 resources among multiple users. • Demo application provides sample implementation of these functions on BIOS
EDMA3 LLD Initialization • Creates the EDMA3 Driver Instance, associated with particular shadow region. • Takes region specific configuration information and a semaphore handle as argument • Returns handle to newly created instance. • Creates EDMA3 Driver Object associated with the hardware • HW specific configuration information passed as argument. EDMA3_DRV_create() OS specific SEM_create() call EDMA3_DRV_Handle EDMA3_DRV_open() 0 EDMA3_RM_create() EDMA3_RM_open() Initializes the global and shadow regions and programs EDMA3 H/W registers. Internally calls
EDMA3 LLD Sequence (driver APIs) OS specific EDMA3 ISR registration call • Specify the channel type, channel number, tcc, event queue and the callback function. EDMA3_DRV_Handle EDMA3_DRV_requestChannel() 0 EDMA3_RM_allocResource() EDMA3_RM_allocResource() EDMA3_RM_registerTccCb() EDMA3_RM_mapEdmaChannel() EDMA3_RM_mapQdmaChannel() Allocates a channel, param set, and a tcc. Registers the callback function and enable interrupts. Binds channel to the param set.
EDMA3 LLD Sequence (cont’d..) EDMA3_DRV_Handle EDMA3_DRV_setSrcParams() EDMA3_DRV_setDestParams() EDMA3_DRV_setSrcIndex() EDMA3_DRV_setDestIndex() Programs PaRAM Set EDMA3_DRV_setTransferParams() EDMA3_DRV_setOptField() EDMA3_DRV_setQdmaTrigWord() 0
EDMA3 LLD Sequence (cont’d..) EDMA3_DRV_Handle EDMA3_DRV_setParam() EDMA3_DRV_clearErrorBits() • Mode of data transfer (event, manual, QDMA) passed as an argument along with the channel id. EDMA3_DRV_enableTransfer() 0 After transfer completes, callback function is called (if registered)
EDMA3 LLD Sequence (cont’d..) EDMA3_DRV_Handle EDMA3_DRV_freeChannel() EDMA3_DRV_close() OS specific SEM_delete() and EDMA3 ISR un-registration calls EDMA3_DRV_delete() 0 EDMA3_RM_freeResource()… EDMA3_RM_freeResource()… EDMA3_RM_delete() EDMA3_RM_close() Resets the state of the RM Instance configuration. Unregisters interrupts if no other RM instance exists. Programs H/W registers
CSL DAT • CSL DAT consists of a small set of convenience APIs to move data around using the EDMA hardware. • DAT_open, DAT_copy, DAT_copy2d, DAT_fill, DAT_wait, DAT_busy, DAT_close. • CSL 2.x DAT and 3.x DAT implementations had different behavior as the underlying EDMA hardware changed (EDMA2 to EDMA3) • DAT_copy, DAT_copy2d are non-blocking calls on DAT 2.x, and blocking calls on DAT 3.x.
CSL DAT adapter • CSL DAT wrapper OS independent. • CSL DAT adapter implements the CSL 2.x DAT on the EDMA3 hardware • Uses the CSL 2.x header files • Behavior of the new API implementation, similar to that on EDMA2 hardware • Uses the EDMA3 Low Level Driver Package (only the Driver API was required) • Adds two APIs DAT_EDMA3LLD_init () and DAT_EDMA3LLD_exit() to set up the EDMA3 LLD. • Users of the package need to implement 2 functions • _dat_critical_section_enter() and _dat_critical_section_exit() • Demo application provides sample implementation of these functions on BIOS
CSL DAT adapter (cont’d) DAT_open DAT_open x x DAT_copy x DAT_copy DAT_copy x DAT_copy DAT_copy x DAT_copy DAT_copy DAT 2.x on EDMA2 (hardware queue depth 4 on DM642) DAT 3.x on EDMA3 (no hardware queue)
CSL DAT adapter (cont’d) X DAT_open DAT_open x x DAT_copy x DAT_copy DAT_copy x DAT_copy DAT_copy x DAT_copy DAT_copy DAT 2.x on EDMA2 (hardware queue depth 4 on DM642) DAT 3.x on EDMA3 (no hardware queue)
CSL DAT adapter (cont’d) DAT_open DAT_open x x DAT_copy x DAT_copy x numChannels = 6 DAT_copy x DAT_copy x DAT_copy x DAT_copy x DAT_copy DAT_copy DAT_copy DAT 2.x on EDMA2 (hardware queue depth 4 on DM642) DAT using CSL Adapter on EDMA3 (no hardware queue)