EDMA3 Driver Error Codes
[EDMA3 Driver Interface Definition]

Usage of EDMA3 Driver. More...


Defines

#define EDMA3_DRV_E_BASE   (-128)
#define EDMA3_DRV_E_OBJ_NOT_DELETED   (EDMA3_DRV_E_BASE)
#define EDMA3_DRV_E_OBJ_NOT_CLOSED   (EDMA3_DRV_E_BASE-1)
#define EDMA3_DRV_E_OBJ_NOT_OPENED   (EDMA3_DRV_E_BASE-2)
#define EDMA3_DRV_E_RM_CLOSE_FAIL   (EDMA3_DRV_E_BASE-3)
#define EDMA3_DRV_E_DMA_CHANNEL_UNAVAIL   (EDMA3_DRV_E_BASE-4)
#define EDMA3_DRV_E_QDMA_CHANNEL_UNAVAIL   (EDMA3_DRV_E_BASE-5)
#define EDMA3_DRV_E_PARAM_SET_UNAVAIL   (EDMA3_DRV_E_BASE-6)
#define EDMA3_DRV_E_TCC_UNAVAIL   (EDMA3_DRV_E_BASE-7)
#define EDMA3_DRV_E_TCC_REGISTER_FAIL   (EDMA3_DRV_E_BASE-8)
#define EDMA3_DRV_E_CH_PARAM_BIND_FAIL   (EDMA3_DRV_E_BASE-9)
#define EDMA3_DRV_E_ADDRESS_NOT_ALIGNED   (EDMA3_DRV_E_BASE-10)
#define EDMA3_DRV_E_INVALID_PARAM   (EDMA3_DRV_E_BASE-11)
#define EDMA3_DRV_E_INVALID_STATE   (EDMA3_DRV_E_BASE-12)
#define EDMA3_DRV_E_INST_ALREADY_EXISTS   (EDMA3_DRV_E_BASE-13)
#define EDMA3_DRV_E_FIFO_WIDTH_NOT_SUPPORTED   (EDMA3_DRV_E_BASE-14)
#define EDMA3_DRV_E_SEMAPHORE   (EDMA3_DRV_E_BASE-15)
#define EDMA3_DRV_E_INST_NOT_OPENED   (EDMA3_DRV_E_BASE-16)


Detailed Description

Usage of EDMA3 Driver.

  1. Create EDMA3 Driver Object (one for each EDMA3 hardware instance)
    • EDMA3_DRV_Result result = EDMA3_DRV_SOK;
    • unsigned int edma3HwInstanceId = 0;
    • EDMA3_DRV_GblConfigParams *gblCfgParams = NULL;
    • Init-time Configuration structure for EDMA3 controller, to provide Global SoC specific Information. This could be NULL also. In that case, static configuration will be taken.
    • result = EDMA3_DRV_create (edma3HwInstanceId, gblCfgParams, NULL);

  1. Open EDMA3 driver Instance
    • Steps
      • EDMA3_DRV_InitConfig initCfg;
      • EDMA3_DRV_Handle hEdma = NULL;
      • EDMA3_OS_SemAttrs semAttrs = {EDMA3_OS_SEMTYPE_FIFO, NULL};
      • EDMA3_DRV_Result edmaResult; -To get the error code while opening driver instance

  1. initCfg.regionId = One of the possible regions available for eg, (EDMA3_RM_RegionId)0 or (EDMA3_RM_RegionId)1 etc, for different masters.

  1. initCfg.isMaster = TRUE/FALSE (Whether this EDMA3 DRV instance is Master or not. The EDMA3 Shadow Region tied to the Master DRV Instance will ONLY receive the EDMA3 interrupts (error or completion), if enabled).

  1. initCfg.drvSemHandle = EDMA3 DRV Instance specific semaphore handle. It should be provided by the user for proper sharing of resources.
    • edma3Result = edma3OsSemCreate(1, &semAttrs, &initCfg.drvSemHandle);

  1. initCfg.drvInstInitConfig = Init-time Region Specific Configuration Structure. It can be provided by the user at run-time. If not provided by the user, this info would be taken from the platform specific config file, if it exists.

  1. initCfg.drvInstInitConfig->ownDmaChannels[] = The bitmap(s) which indicate the DMA channels owned by this instance of the EDMA3 Driver
    E.g. A '1' at bit position 24 indicates that this instance of the EDMA3 Driver owns DMA Channel Id 24
    Later when a request is made based on a particular Channel Id, the EDMA3 Driver will check first if it owns that channel. If it doesnot own it, EDMA3 Driver returns error.
  2. initCfg.drvInstInitConfig->ownQdmaChannels[] = The bitmap(s) which indicate the QDMA channels owned by this instance of the EDMA3 Driver
  3. initCfg.drvInstInitConfig->ownPaRAMSets[] = The bitmap(s) which indicate the PaRAM Sets owned by this instance of the EDMA3 Driver
  4. initCfg.drvInstInitConfig->ownTccs[] = The bitmap(s) which indicate the TCCs owned by this instance of the EDMA3 Driver

  1. initCfg.drvInstInitConfig->resvdDmaChannels[] = The bitmap(s) which indicate the DMA channels reserved by this instance of the EDMA3 Driver
    E.g. A '1' at bit position 24 indicates that this instance of the EDMA3 Driver reserves Channel Id 24
    These channels are reserved and may be mapped to HW events, these are not given to 'EDMA3_DRV_DMA_CHANNEL_ANY' requests.
  2. initCfg.drvInstInitConfig->resvdQdmaChannels[] = The bitmap(s) which indicate the QDMA channels reserved by this instance of the EDMA3 Driver
    E.g. A '1' at bit position 1 indicates that this instance of the EDMA3 Driver reserves QDMA Channel Id 1
    These channels are reserved for some specific purpose, these are not given to 'EDMA3_DRV_QDMA_CHANNEL_ANY' request
  3. initCfg.drvInstInitConfig->resvdPaRAMSets[] = PaRAM Sets which are reserved by this Region;
  4. initCfg.drvInstInitConfig->resvdTccs[] = TCCs which are reserved by this Region;

  1. initCfg.gblerrCb = Instance wide callback function to catch non-channel specific errors;
  2. initCfg.gblerrData = Application data to be passed back to the callback function;

  1. hEdma = EDMA3_DRV_open(edma3HwInstanceId, &initCfg, &edmaResult);

  1. EDMA3 driver APIs
    • EDMA3_RM_ResDesc resObj;
    • EDMA3_DRV_Result result;
    • unsigned int ch1Id = 0;
    • unsigned int ch2Id = 0;
    • unsigned int tcc1 = 0;
    • unsigned int tcc2 = 0;
    • unsigned int qCh1Id = 0;
    • unsigned int qTcc1 = 0;
    • unsigned int qCh2Id = 0;
    • unsigned int qTcc2 = 0;
    • unsigned int paRAMId;
    • int srcbidx = 0;
    • int desbidx = 0;
    • int srccidx = 0;
    • int descidx = 0;
    • unsigned int acnt = 0;
    • unsigned int bcnt = 0;
    • unsigned int ccnt = 0;
    • unsigned int bcntreload = 0;
    • EDMA3_DRV_SyncType synctype;
    • EDMA3_RM_TccCallback tccCb;
    • void *cbData;
    • Use Case 1: Memory to memory transfer on any available
    • DMA Channel

      • tcc1 = EDMA3_DRV_TCC_ANY;
      • ch1Id = EDMA3_DRV_DMA_CHANNEL_ANY;
      • result = EDMA3_DRV_requestChannel (hEdma, &ch1Id, &tcc1, (EDMA3_RM_EventQueue)0, &callback1, NULL);

Error Codes returned by the EDMA3 Driver


Define Documentation

#define EDMA3_DRV_E_ADDRESS_NOT_ALIGNED   (EDMA3_DRV_E_BASE-10)

The address of the memory location passed as argument is not properly aligned. It should be 32 bytes aligned.

Referenced by EDMA3_DRV_setDestParams(), and EDMA3_DRV_setSrcParams().

#define EDMA3_DRV_E_BASE   (-128)

EDMA3 Driver Error Codes Base define

#define EDMA3_DRV_E_CH_PARAM_BIND_FAIL   (EDMA3_DRV_E_BASE-9)

The binding of Channel and PaRAM Set failed

Referenced by EDMA3_DRV_requestChannel().

#define EDMA3_DRV_E_DMA_CHANNEL_UNAVAIL   (EDMA3_DRV_E_BASE-4)

The requested DMA Channel not available

Referenced by EDMA3_DRV_requestChannel().

#define EDMA3_DRV_E_FIFO_WIDTH_NOT_SUPPORTED   (EDMA3_DRV_E_BASE-14)

FIFO width not supported by the requested TC

Referenced by EDMA3_DRV_setDestParams(), and EDMA3_DRV_setSrcParams().

#define EDMA3_DRV_E_INST_ALREADY_EXISTS   (EDMA3_DRV_E_BASE-13)

EDMA3 Driver instance already exists for the specified region

Referenced by EDMA3_DRV_open().

#define EDMA3_DRV_E_INST_NOT_OPENED   (EDMA3_DRV_E_BASE-16)

EDMA3 Driver Instance does not exist, it is not opened yet

Referenced by EDMA3_DRV_getInstHandle().

#define EDMA3_DRV_E_INVALID_PARAM   (EDMA3_DRV_E_BASE-11)

#define EDMA3_DRV_E_INVALID_STATE   (EDMA3_DRV_E_BASE-12)

Invalid State of EDMA3 HW Obj

Referenced by EDMA3_DRV_delete(), and EDMA3_DRV_open().

#define EDMA3_DRV_E_OBJ_NOT_CLOSED   (EDMA3_DRV_E_BASE-1)

EDMA3 Driver Object Not Closed yet. So it cannot be deleted.

Referenced by EDMA3_DRV_delete().

#define EDMA3_DRV_E_OBJ_NOT_DELETED   (EDMA3_DRV_E_BASE)

EDMA3 Driver Object Not Deleted yet. So it cannot be created.

Referenced by EDMA3_DRV_create().

#define EDMA3_DRV_E_OBJ_NOT_OPENED   (EDMA3_DRV_E_BASE-2)

EDMA3 Driver Object Not Opened yet So it cannot be closed.

Referenced by EDMA3_DRV_close().

#define EDMA3_DRV_E_PARAM_SET_UNAVAIL   (EDMA3_DRV_E_BASE-6)

The requested PaRAM Set not available

#define EDMA3_DRV_E_QDMA_CHANNEL_UNAVAIL   (EDMA3_DRV_E_BASE-5)

The requested QDMA Channel not available

Referenced by EDMA3_DRV_requestChannel().

#define EDMA3_DRV_E_RM_CLOSE_FAIL   (EDMA3_DRV_E_BASE-3)

While closing EDMA3 Driver, Resource Manager Close Failed.

Referenced by EDMA3_DRV_close().

#define EDMA3_DRV_E_SEMAPHORE   (EDMA3_DRV_E_BASE-15)

Semaphore related error

#define EDMA3_DRV_E_TCC_REGISTER_FAIL   (EDMA3_DRV_E_BASE-8)

The registration of TCC failed

Referenced by EDMA3_DRV_requestChannel().

#define EDMA3_DRV_E_TCC_UNAVAIL   (EDMA3_DRV_E_BASE-7)

The requested TCC not available

Referenced by EDMA3_DRV_requestChannel().


Generated on Tue Jul 7 19:18:47 2009 for EDMA3 Driver by  doxygen 1.5.9