AM243x MCU+ SDK  11.00.00
SDL DPL

The SDL requires the application to provide an DPL implementation for various functionalities in order to keep SDL as OS-agnostic. Primarily, the SDL requires DPL implementations for interrupt registration and enable/disable, and also for a delay mechanism needed for POK programming.

Features Supported

The SDL DPL layer provides support for the application to define the following functionalities to be used by SDL:

  • Interrupt Enable/Disable
  • Interrupt Register/De-register
  • Address Translation
  • Delay

These features are provided by the application by calling SDL_DPL_init() with the appropriate function pointers.

SysConfig Features

  • None

Features NOT Supported

  • None

Important Usage Guidelines

  • SDL_DPL_init() must be called before using any SDL module that utilizes the SDL DPL APIs.

Example Usage

The SDL provides a sample implementation of these APIs as part of the SDL examples. The sample implementation re-uses PDK DPL APIs from the SDK in order to provide the services. This is verified with the following Operating Systems:

  • Non-OS (Baremetal)

The existing baremetal sample DPL interface can be used, or the application may implement it's own. To use the existing sample interface:

  1. Add the source file dpl_interface.c (located in example/dpl/src/) to the application's build
  2. Include the header dpl_interface.h (located in example/dpl/) to the application's source file
  3. Call the example's DPL initializtion function SDL_TEST_dplInit() to initialize the DPL. Do this before calling any SDL APIs.

Alternatively, the application may implement it's own DPL. An example of how to do this is shown below

Include the below file to access the APIs

#include <sdl/sdl_dpl.h>

Define the DPL APIs

HwiP_Object gHwiObject;

void* SDL_TEST_addrTranslate(uint64_t addr, uint32_t size)
{
uint32_t transAddr = (uint32_t)(-1);
transAddr = (uint32_t)AddrTranslateP_getLocalAddr(addr);
return (void *)transAddr;
}
int32_t SDL_TEST_deregisterInterrupt(pSDL_DPL_HwipHandle handle)
{
HwiP_destruct(handle);
return SDL_PASS;
}

Initalize the DPL Interface

SDL_DPL_Interface dpl_interface =
{
.enableInterrupt = (pSDL_DPL_InterruptFunction) SDL_TEST_enableInterrupt,
.disableInterrupt = (pSDL_DPL_InterruptFunction) SDL_TEST_disableInterrupt,
.registerInterrupt = (pSDL_DPL_RegisterFunction) SDL_TEST_registerInterrupt,
.deregisterInterrupt = (pSDL_DPL_DeregisterFunction) SDL_TEST_deregisterInterrupt,
.addrTranslate = (pSDL_DPL_AddrTranslateFunction) SDL_TEST_addrTranslate
};
int32_t main(void)
{
SDL_ErrType_t ret = SDL_PASS;
ret = SDL_DPL_init(&dpl_interface);
return ret;
}

API

APIs for SDL DPL

size
uint16_t size
Definition: tisci_boardcfg.h:1
HwiP_destruct
void HwiP_destruct(HwiP_Object *obj)
Cleanup, delete, destruct a Hwi object.
SDL_DPL_Interface::enableInterrupt
pSDL_DPL_InterruptFunction enableInterrupt
Definition: sdl_dpl.h:123
ClockP_sleep
void ClockP_sleep(uint32_t sec)
Sleep for user specified seconds.
SDL_DPL_init
int32_t SDL_DPL_init(SDL_DPL_Interface *dplInterface)
DPL init.
pSDL_DPL_InterruptFunction
int32_t(* pSDL_DPL_InterruptFunction)(int32_t intNum)
Prototype for the interrupt enable/disable functions.
Definition: sdl_dpl.h:84
pSDL_DPL_RegisterFunction
pSDL_DPL_HwipHandle(* pSDL_DPL_RegisterFunction)(SDL_DPL_HwipParams *pParams)
Prototype for the interrupt registration function.
Definition: sdl_dpl.h:89
pSDL_DPL_AddrTranslateFunction
void *(* pSDL_DPL_AddrTranslateFunction)(uint64_t addr, uint32_t size)
Prototype for address translation function.
Definition: sdl_dpl.h:104
addr
uint64_t addr
Definition: csl_udmap_tr.h:3
SDL_DPL_Interface
This structure contains the pointers for the DPL interfaces provided by the application to SDL_DPL_in...
Definition: sdl_dpl.h:121
AddrTranslateP_getLocalAddr
void * AddrTranslateP_getLocalAddr(uint64_t systemAddr)
Translate from system address to a CPU address as seen via the RAT module.
pSDL_DPL_DeregisterFunction
int32_t(* pSDL_DPL_DeregisterFunction)(pSDL_DPL_HwipHandle handle)
Prototype for the interrupt de-register function.
Definition: sdl_dpl.h:94
pSDL_DPL_HwipHandle
void * pSDL_DPL_HwipHandle
Definition: sdl_dpl.h:79
pSDL_DPL_DelayFunction
int32_t(* pSDL_DPL_DelayFunction)(int32_t ndelay)
Prototype for the delay function.
Definition: sdl_dpl.h:99