CSL DAT Adapter CSL 2 x DAT Reference

  • Slides: 14
Download presentation
CSL DAT Adapter CSL 2. x DAT Reference Implementation on EDMA 3 hardware using

CSL DAT Adapter CSL 2. x DAT Reference Implementation on EDMA 3 hardware using EDMA 3 Low level driver.

EDMA 3 Low Level Driver (LLD) • EDMA 3 Driver APIs • EDMA 3

EDMA 3 Low Level Driver (LLD) • EDMA 3 Driver APIs • EDMA 3 Resource Manager CSL/DAT PSP Drivers Framework Components DMAN 3 EDMA 3 Driver Internally calls EDMA 3 Package ACPY 3 EDMA 3 Resource Manager DMA/ QDMA TCCs Pa. RAMs Channels EDMA 3 ISRs

EDMA 3 LLD Package § OS independent package § Registering and un-registering of EDMA

EDMA 3 LLD Package § OS independent package § Registering and un-registering of EDMA 3 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 EDMA 3 LLD Package. § edma 3 Os. Protect. Entry, edma 3 Os. Protect. Exit § Used to protect entry and exit into critical sections of code. § edma 3 Os. Sem. Give, edma 3 Os. Sem. Take § Used for proper sharing and management of EDMA 3 resources among multiple users. § Demo application provides sample implementation of these functions on BIOS

EDMA 3 LLD Initialization EDMA 3_DRV_create() • Creates EDMA 3 Driver Object associated with

EDMA 3 LLD Initialization EDMA 3_DRV_create() • Creates EDMA 3 Driver Object associated with the hardware • HW specific configuration information passed as argument. OS specific SEM_create() call 0 • Creates the EDMA 3 Driver Instance, associated with particular shadow region. • Takes region specific configuration information and a semaphore handle as argument • Returns handle to newly created instance. EDMA 3_DRV_Handle EDMA 3_DRV_open() EDMA 3_RM_create() EDMA 3_RM_open() Initializes the global and shadow regions and programs EDMA 3 H/W registers.

EDMA 3 LLD Sequence (Driver APIs) OS specific EDMA 3 ISR registration call EDMA

EDMA 3 LLD Sequence (Driver APIs) OS specific EDMA 3 ISR registration call EDMA 3_DRV_Handle EDMA 3_DRV_request. Channel() • Specify the channel type, channel number, tcc, event queue and the callback function. 0 EDMA 3_RM_alloc. Resource() EDMA 3_RM_register. Tcc. Cb() EDMA 3_RM_map. Edma. Channel() EDMA 3_RM_map. Qdma. Channel() Allocates a channel, param set, and a tcc. Registers the callback function and enable interrupts. Binds channel to the param set.

EDMA 3 LLD Sequence (cont’d. . ) EDMA 3_DRV_Handle EDMA 3_DRV_set. Src. Params() EDMA

EDMA 3 LLD Sequence (cont’d. . ) EDMA 3_DRV_Handle EDMA 3_DRV_set. Src. Params() EDMA 3_DRV_set. Dest. Params() EDMA 3_DRV_set. Src. Index() EDMA 3_DRV_set. Dest. Index() EDMA 3_DRV_set. Transfer. Params() EDMA 3_DRV_set. Opt. Field() EDMA 3_DRV_set. Qdma. Trig. Word() 0 Programs Pa. RAM Set

EDMA 3 LLD Sequence (cont’d. . ) EDMA 3_DRV_Handle EDMA 3_DRV_set. Param() EDMA 3_DRV_clear.

EDMA 3 LLD Sequence (cont’d. . ) EDMA 3_DRV_Handle EDMA 3_DRV_set. Param() EDMA 3_DRV_clear. Error. Bits() • Mode of data transfer (event, manual, QDMA) passed as an argument along with the channel id. EDMA 3_DRV_enable. Transfer() 0 After transfer completes, callback function is called (if registered)

EDMA 3 LLD Sequence (cont’d. . ) EDMA 3_DRV_Handle EDMA 3_DRV_free. Channel() EDMA 3_DRV_close()

EDMA 3 LLD Sequence (cont’d. . ) EDMA 3_DRV_Handle EDMA 3_DRV_free. Channel() EDMA 3_DRV_close() OS specific SEM_delete() and EDMA 3 ISR un-registration calls EDMA 3_DRV_delete() 0 EDMA 3_RM_free. Resource()… EDMA 3_RM_close() EDMA 3_RM_delete() 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

CSL DAT § CSL DAT consists of a small set of convenience APIs to move data around using the EDMA hardware. § DAT_open, DAT_copy 2 d, 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 (EDMA 2 to EDMA 3) § DAT_copy, DAT_copy 2 d 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

CSL DAT Adapter § CSL DAT wrapper OS independent. § CSL DAT adapter implements the CSL 2. x DAT on the EDMA 3 hardware § Uses the CSL 2. x header files § Behavior of the new API implementation, similar to that on EDMA 2 hardware § Uses the EDMA 3 Low Level Driver Package (only the Driver API was required) § Adds two APIs DAT_EDMA 3 LLD_init () and DAT_EDMA 3 LLD_exit() to set up the EDMA 3 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_copy DAT_open x x x DAT_copy DAT 2. x

CSL DAT adapter (cont’d) DAT_open DAT_copy DAT_open x x x DAT_copy DAT 2. x on EDMA 2 (hardware queue depth 4 on DM 642) DAT 3. x on EDMA 3 (no hardware queue)

CSL DAT adapter (cont’d) DAT_open DAT_copy DAT_open x x DAT_copy DAT 2. x on

CSL DAT adapter (cont’d) DAT_open DAT_copy DAT_open x x DAT_copy DAT 2. x on EDMA 2 (hardware queue depth 4 on DM 642) X x DAT_copy DAT 3. x on EDMA 3 (no hardware queue)

CSL DAT adapter (cont’d) DAT_open DAT_copy DAT_open x x DAT_copy x x num. Channels

CSL DAT adapter (cont’d) DAT_open DAT_copy DAT_open x x DAT_copy x x num. Channels =6 DAT_copy DAT 2. x on EDMA 2 (hardware queue depth 4 on DM 642) DAT using CSL Adapter on EDMA 3 (no hardware queue)

§ See DAT adapter code with example

§ See DAT adapter code with example