]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/edma3_lld.git/commitdiff
Cleaned EDMA3 Driver Sample Initialization library
authorAnuj Aggarwal <anuj.aggarwal@ti.com>
Thu, 20 Aug 2009 05:36:52 +0000 (11:06 +0530)
committerAnuj Aggarwal <anuj.aggarwal@ti.com>
Thu, 20 Aug 2009 05:36:52 +0000 (11:06 +0530)
Cleaned the sample init library code
Renames files to have simpler names
Added support for TCI6498 and made the design generic so that any
platform can be added easily later

packages/ti/sdo/edma3/drv/sample/src/bios6_edma3_drv_sample_da830_cfg.c [deleted file]
packages/ti/sdo/edma3/drv/sample/src/bios6_edma3_drv_sample_init.c [deleted file]
packages/ti/sdo/edma3/drv/sample/src/platforms/sample_da830_cfg.c [new file with mode: 0644]
packages/ti/sdo/edma3/drv/sample/src/platforms/sample_da830_int_reg.c [new file with mode: 0644]
packages/ti/sdo/edma3/drv/sample/src/platforms/sample_tci6498_cfg.c [new file with mode: 0644]
packages/ti/sdo/edma3/drv/sample/src/platforms/sample_tci6498_int_reg.c [new file with mode: 0644]
packages/ti/sdo/edma3/drv/sample/src/sample_cs.c [moved from packages/ti/sdo/edma3/drv/sample/src/bios6_edma3_drv_sample_cs.c with 77% similarity]
packages/ti/sdo/edma3/drv/sample/src/sample_init.c [new file with mode: 0644]

diff --git a/packages/ti/sdo/edma3/drv/sample/src/bios6_edma3_drv_sample_da830_cfg.c b/packages/ti/sdo/edma3/drv/sample/src/bios6_edma3_drv_sample_da830_cfg.c
deleted file mode 100644 (file)
index b740942..0000000
+++ /dev/null
@@ -1,403 +0,0 @@
-/*******************************************************************************
-**+--------------------------------------------------------------------------+**
-**|                            ****                                          |**
-**|                            ****                                          |**
-**|                            ******o***                                    |**
-**|                      ********_///_****                                   |**
-**|                      ***** /_//_/ ****                                   |**
-**|                       ** ** (__/ ****                                    |**
-**|                           *********                                      |**
-**|                            ****                                          |**
-**|                            ***                                           |**
-**|                                                                          |**
-**|         Copyright (c) 1998-2006 Texas Instruments Incorporated           |**
-**|                        ALL RIGHTS RESERVED                               |**
-**|                                                                          |**
-**| Permission is hereby granted to licensees of Texas Instruments           |**
-**| Incorporated (TI) products to use this computer program for the sole     |**
-**| purpose of implementing a licensee product based on TI products.         |**
-**| No other rights to reproduce, use, or disseminate this computer          |**
-**| program, whether in part or in whole, are granted.                       |**
-**|                                                                          |**
-**| TI makes no representation or warranties with respect to the             |**
-**| performance of this computer program, and specifically disclaims         |**
-**| any responsibility for any damages, special or consequential,            |**
-**| connected with the use of this program.                                  |**
-**|                                                                          |**
-**+--------------------------------------------------------------------------+**
-*******************************************************************************/
-
-/** \file   bios6_edma3_drv_sample_da830_cfg.c
-
-    \brief  SoC specific EDMA3 hardware related information like number of
-            transfer controllers, various interrupt ids etc. It is used while
-            interrupts enabling / disabling. It needs to be ported for different
-            SoCs.
-
-    (C) Copyright 2008, Texas Instruments, Inc
-
-    \version    1.0   Anuj Aggarwal         - Created
-
- */
-
-#include <ti/sdo/edma3/drv/edma3_drv.h>
-
-
-/* DA830 Specific EDMA3 Information */
-
-/** Number of PaRAM Sets available */
-#define EDMA3_NUM_PARAMSET                             (128u)
-
-/** Number of TCCS available */
-#define EDMA3_NUM_TCC                                  (32u)
-
-/** Number of Event Queues available */
-#define EDMA3_NUM_EVTQUE                                (2u)
-
-/** Number of Transfer Controllers available */
-#define EDMA3_NUM_TC                                    (2u)
-
-/** Interrupt no. for Transfer Completion */
-#define EDMA3_CC_XFER_COMPLETION_INT                    (8u)
-
-/** Interrupt no. for CC Error */
-#define EDMA3_CC_ERROR_INT                              (56u)
-
-/** Interrupt no. for TCs Error */
-#define EDMA3_TC0_ERROR_INT                             (57u)
-#define EDMA3_TC1_ERROR_INT                             (58u)
-#define EDMA3_TC2_ERROR_INT                             (0u)
-#define EDMA3_TC3_ERROR_INT                             (0u)
-#define EDMA3_TC4_ERROR_INT                             (0u)
-#define EDMA3_TC5_ERROR_INT                             (0u)
-#define EDMA3_TC6_ERROR_INT                             (0u)
-#define EDMA3_TC7_ERROR_INT                             (0u)
-
-/**
-* EDMA3 interrupts (transfer completion, CC error etc.) correspond to different
-* ECM events (SoC specific). These ECM events come
-* under ECM block XXX (handling those specific ECM events). Normally, block
-* 0 handles events 4-31 (events 0-3 are reserved), block 1 handles events
-* 32-63 and so on. This ECM block XXX (or interrupt selection number XXX)
-* is mapped to a specific HWI_INT YYY in the tcf file.
-* Define EDMA3_HWI_INT_XFER_COMP to specific HWI_INT, corresponding
-* to transfer completion interrupt.
-* Define EDMA3_HWI_INT_CC_ERR to specific HWI_INT, corresponding
-* to CC error interrupts.
-* Define EDMA3_HWI_INT_TC_ERR to specific HWI_INT, corresponding
-* to TC error interrupts.
-*/
-#define EDMA3_HWI_INT_XFER_COMP                                                        (7u)
-#define EDMA3_HWI_INT_CC_ERR                                                   (8u)
-#define EDMA3_HWI_INT_TC_ERR                                                   (8u)
-
-
-/**
- * \brief Mapping of DMA channels 0-31 to Hardware Events from
- * various peripherals, which use EDMA for data transfer.
- * All channels need not be mapped, some can be free also.
- * 1: Mapped
- * 0: Not mapped
- *
- * This mapping will be used to allocate DMA channels when user passes
- * EDMA3_DRV_DMA_CHANNEL_ANY as dma channel id (for eg to do memory-to-memory
- * copy). The same mapping is used to allocate the TCC when user passes
- * EDMA3_DRV_TCC_ANY as tcc id (for eg to do memory-to-memory copy).
- *
- * To allocate more DMA channels or TCCs, one has to modify the event mapping.
- */
-                                                                                                         /* 31     0 */
-#define EDMA3_DMA_CHANNEL_TO_EVENT_MAPPING_0          (0xCF3FFFFFu)
-
-/**
- * \brief Mapping of DMA channels 32-63 to Hardware Events from
- * various peripherals, which use EDMA for data transfer.
- * All channels need not be mapped, some can be free also.
- * 1: Mapped
- * 0: Not mapped
- *
- * This mapping will be used to allocate DMA channels when user passes
- * EDMA3_DRV_DMA_CHANNEL_ANY as dma channel id (for eg to do memory-to-memory
- * copy). The same mapping is used to allocate the TCC when user passes
- * EDMA3_DRV_TCC_ANY as tcc id (for eg to do memory-to-memory copy).
- *
- * To allocate more DMA channels or TCCs, one has to modify the event mapping.
- */
-/* DMA channels 32-63 DOES NOT exist in DA830. */
-#define EDMA3_DMA_CHANNEL_TO_EVENT_MAPPING_1          (0x0u)
-
-
-/* Variable which will be used internally for referring number of Event Queues. */
-unsigned int numEdma3EvtQue = EDMA3_NUM_EVTQUE;
-
-/* Variable which will be used internally for referring number of TCs. */
-unsigned int numEdma3Tc = EDMA3_NUM_TC;
-
-/**
- * Variable which will be used internally for referring transfer completion
- * interrupt.
- */
-unsigned int ccXferCompInt = EDMA3_CC_XFER_COMPLETION_INT;
-
-/**
- * Variable which will be used internally for referring channel controller's
- * error interrupt.
- */
-unsigned int ccErrorInt = EDMA3_CC_ERROR_INT;
-
-/**
- * Variable which will be used internally for referring transfer controllers'
- * error interrupts.
- */
-unsigned int tcErrorInt[8] =    {
-                                EDMA3_TC0_ERROR_INT, EDMA3_TC1_ERROR_INT,
-                                EDMA3_TC2_ERROR_INT, EDMA3_TC3_ERROR_INT,
-                                EDMA3_TC4_ERROR_INT, EDMA3_TC5_ERROR_INT,
-                                EDMA3_TC6_ERROR_INT, EDMA3_TC7_ERROR_INT
-                                };
-
-/**
- * Variables which will be used internally for referring the hardware interrupt
- * for various EDMA3 interrupts.
- */
-unsigned int hwIntXferComp = EDMA3_HWI_INT_XFER_COMP;
-unsigned int hwIntCcErr = EDMA3_HWI_INT_CC_ERR;
-unsigned int hwIntTcErr = EDMA3_HWI_INT_TC_ERR;
-
-
-/* Driver Object Initialization Configuration */
-EDMA3_DRV_GblConfigParams sampleEdma3GblCfgParams =
-    {
-    /** Total number of DMA Channels supported by the EDMA3 Controller */
-    32u,
-    /** Total number of QDMA Channels supported by the EDMA3 Controller */
-    8u,
-    /** Total number of TCCs supported by the EDMA3 Controller */
-    32u,
-    /** Total number of PaRAM Sets supported by the EDMA3 Controller */
-    128u,
-    /** Total number of Event Queues in the EDMA3 Controller */
-    2u,
-    /** Total number of Transfer Controllers (TCs) in the EDMA3 Controller */
-    2u,
-    /** Number of Regions on this EDMA3 controller */
-    4u,
-
-    /**
-     * \brief Channel mapping existence
-     * A value of 0 (No channel mapping) implies that there is fixed association
-     * for a channel number to a parameter entry number or, in other words,
-     * PaRAM entry n corresponds to channel n.
-     */
-    0u,
-
-    /** Existence of memory protection feature */
-    0u,
-
-    /** Global Register Region of CC Registers */
-    (void *)0x01C00000u,
-    /** Transfer Controller (TC) Registers */
-        {
-        (void *)0x01C08000u,
-        (void *)0x01C08400u,
-        (void *)NULL,
-        (void *)NULL,
-        (void *)NULL,
-        (void *)NULL,
-        (void *)NULL,
-        (void *)NULL
-        },
-    /** Interrupt no. for Transfer Completion */
-    EDMA3_CC_XFER_COMPLETION_INT,
-    /** Interrupt no. for CC Error */
-    EDMA3_CC_ERROR_INT,
-    /** Interrupt no. for TCs Error */
-        {
-        EDMA3_TC0_ERROR_INT,
-        EDMA3_TC1_ERROR_INT,
-        EDMA3_TC2_ERROR_INT,
-        EDMA3_TC3_ERROR_INT,
-        EDMA3_TC4_ERROR_INT,
-        EDMA3_TC5_ERROR_INT,
-        EDMA3_TC6_ERROR_INT,
-        EDMA3_TC7_ERROR_INT
-        },
-
-    /**
-     * \brief EDMA3 TC priority setting
-     *
-     * User can program the priority of the Event Queues
-     * at a system-wide level.  This means that the user can set the
-     * priority of an IO initiated by either of the TCs (Transfer Controllers)
-     * relative to IO initiated by the other bus masters on the
-     * device (ARM, DSP, USB, etc)
-     */
-        {
-        0u,
-        1u,
-        0u,
-        0u,
-        0u,
-        0u,
-        0u,
-        0u
-        },
-    /**
-     * \brief To Configure the Threshold level of number of events
-     * that can be queued up in the Event queues. EDMA3CC error register
-     * (CCERR) will indicate whether or not at any instant of time the
-     * number of events queued up in any of the event queues exceeds
-     * or equals the threshold/watermark value that is set
-     * in the queue watermark threshold register (QWMTHRA).
-     */
-        {
-        16u,
-        16u,
-        0u,
-        0u,
-        0u,
-        0u,
-        0u,
-        0u
-        },
-
-    /**
-     * \brief To Configure the Default Burst Size (DBS) of TCs.
-     * An optimally-sized command is defined by the transfer controller
-     * default burst size (DBS). Different TCs can have different
-     * DBS values. It is defined in Bytes.
-     */
-        {
-        16u,
-        16u,
-        0u,
-        0u,
-        0u,
-        0u,
-        0u,
-        0u
-        },
-
-    /**
-     * \brief Mapping from each DMA channel to a Parameter RAM set,
-     * if it exists, otherwise of no use.
-     */
-        {
-        0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u,
-        8u, 9u, 10u, 11u, 12u, 13u, 14u, 15u,
-        16u, 17u, 18u, 19u, 20u, 21u, 22u, 23u,
-        24u, 25u, 26u, 27u, 28u, 29u, 30u, 31u,
-        /* DMA channels 32-63 DOES NOT exist in DA830. */
-        EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
-        EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
-        EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
-        EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
-        EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
-        EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
-        EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
-        EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
-        EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
-        EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
-        EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
-        EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
-        EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
-        EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
-        EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
-        EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS
-        },
-
-     /**
-      * \brief Mapping from each DMA channel to a TCC. This specific
-      * TCC code will be returned when the transfer is completed
-      * on the mapped channel.
-      */
-        {
-        0u, 1u, 2u, 3u,
-        4u, 5u, 6u, 7u,
-        8u, 9u, 10u, 11u,
-        12u, 13u, 14u, 15u,
-        16u, 17u, 18u, 19u,
-        20u, 21u, EDMA3_RM_CH_NO_TCC_MAP, EDMA3_RM_CH_NO_TCC_MAP,
-        24u, 25u, 26u, 27u,
-        EDMA3_RM_CH_NO_TCC_MAP, EDMA3_RM_CH_NO_TCC_MAP, 30, 31,
-        /* DMA channels 32-63 DOES NOT exist in DA830. */
-        EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
-        EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
-        EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
-        EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
-        EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
-        EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
-        EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
-        EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC
-        },
-
-    /**
-     * \brief Mapping of DMA channels to Hardware Events from
-     * various peripherals, which use EDMA for data transfer.
-     * All channels need not be mapped, some can be free also.
-     */
-        {
-        EDMA3_DMA_CHANNEL_TO_EVENT_MAPPING_0,
-        EDMA3_DMA_CHANNEL_TO_EVENT_MAPPING_1
-        }
-    };
-
-
-/* Driver Instance Initialization Configuration */
-EDMA3_DRV_InstanceInitConfig sampleInstInitConfig =
-    {
-        /* Resources owned by Region 1 */
-        /* ownPaRAMSets */
-        /* 31     0     63    32     95    64     127   96 */
-        {0xFFFFFFFFu, 0xFFFFFFFFu, 0xFFFFFFFFu, 0xFFFFFFFFu,
-        /* 159  128     191  160     223  192     255  224 */
-         0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
-        /* 287  256     319  288     351  320     383  352 */
-         0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
-        /* 415  384     447  416     479  448     511  480 */
-         0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
-
-        /* ownDmaChannels */
-        /* 31     0     63    32 */
-               {0xFFFFFFFFu, 0x00000000u},
-
-        /* ownQdmaChannels */
-        /* 31     0 */
-        {0x000000FFu},
-
-        /* ownTccs */
-        /* 31     0     63    32 */
-        {0xFFFFFFFFu, 0x00000000u},
-
-        /* Resources reserved by Region 1 */
-        /* resvdPaRAMSets */
-        /* 31     0     63    32     95    64     127   96 */
-        {0xFFFFFFFFu, 0x00000000u, 0x00000000u, 0x00000000u,
-        /* 159  128     191  160     223  192     255  224 */
-         0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
-        /* 287  256     319  288     351  320     383  352 */
-         0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
-        /* 415  384     447  416     479  448     511  480 */
-         0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
-
-        /* resvdDmaChannels */
-        /* 31                                                      0 */
-        {EDMA3_DMA_CHANNEL_TO_EVENT_MAPPING_0,
-        /* 63                                                    32 */
-            EDMA3_DMA_CHANNEL_TO_EVENT_MAPPING_1},
-
-        /* resvdQdmaChannels */
-        /* 31     0 */
-        {0x00000000u},
-
-        /* resvdTccs */
-        /* 31                                                      0 */
-        {EDMA3_DMA_CHANNEL_TO_EVENT_MAPPING_0,
-        /* 63                                                    32 */
-            EDMA3_DMA_CHANNEL_TO_EVENT_MAPPING_1}
-    };
-
-
-/* End of File */
-
-
diff --git a/packages/ti/sdo/edma3/drv/sample/src/bios6_edma3_drv_sample_init.c b/packages/ti/sdo/edma3/drv/sample/src/bios6_edma3_drv_sample_init.c
deleted file mode 100644 (file)
index bb3a348..0000000
+++ /dev/null
@@ -1,318 +0,0 @@
-/*******************************************************************************
-**+--------------------------------------------------------------------------+**
-**|                            ****                                          |**
-**|                            ****                                          |**
-**|                            ******o***                                    |**
-**|                      ********_///_****                                   |**
-**|                      ***** /_//_/ ****                                   |**
-**|                       ** ** (__/ ****                                    |**
-**|                           *********                                      |**
-**|                            ****                                          |**
-**|                            ***                                           |**
-**|                                                                          |**
-**|         Copyright (c) 1998-2006 Texas Instruments Incorporated           |**
-**|                        ALL RIGHTS RESERVED                               |**
-**|                                                                          |**
-**| Permission is hereby granted to licensees of Texas Instruments           |**
-**| Incorporated (TI) products to use this computer program for the sole     |**
-**| purpose of implementing a licensee product based on TI products.         |**
-**| No other rights to reproduce, use, or disseminate this computer          |**
-**| program, whether in part or in whole, are granted.                       |**
-**|                                                                          |**
-**| TI makes no representation or warranties with respect to the             |**
-**| performance of this computer program, and specifically disclaims         |**
-**| any responsibility for any damages, special or consequential,            |**
-**| connected with the use of this program.                                  |**
-**|                                                                          |**
-**+--------------------------------------------------------------------------+**
-*******************************************************************************/
-
-/** \file   bios6_edma3_drv_sample_init.c
-
-    \brief  Sample Initialization for the EDMA3 Driver for BIOS 6 based
-               applications. It should be MANDATORILY done once before EDMA3 usage.
-
-    (C) Copyright 2006, Texas Instruments, Inc
-
-    \version    1.0   Anuj Aggarwal         - Created
-
- */
-
-#include <ti/sysbios/hal/Hwi.h>
-#include <ti/sysbios/ipc/Semaphore.h>
-#include <ti/sysbios/family/c64p/EventCombiner.h>
-
-#include <ti/sdo/edma3/drv/sample/bios6_edma3_drv_sample.h>
-
-/** @brief EDMA3 Driver Handle, used to call all the Driver APIs */
-EDMA3_DRV_Handle hEdma = NULL;
-
-/** @brief EDMA3 Driver Instance specific Semaphore handle */
-static EDMA3_OS_Sem_Handle semHandle = NULL;
-
-/**
-  * EDMA3 TC ISRs which need to be registered with the underlying OS by the user
-  * (Not all TC error ISRs need to be registered, register only for the
-  * available Transfer Controllers).
-  */
-void (*ptrEdma3TcIsrHandler[EDMA3_MAX_TC])(unsigned int arg) =
-                                                {
-                                                &lisrEdma3TC0ErrHandler0,
-                                                &lisrEdma3TC1ErrHandler0,
-                                                &lisrEdma3TC2ErrHandler0,
-                                                &lisrEdma3TC3ErrHandler0,
-                                                &lisrEdma3TC4ErrHandler0,
-                                                &lisrEdma3TC5ErrHandler0,
-                                                &lisrEdma3TC6ErrHandler0,
-                                                &lisrEdma3TC7ErrHandler0,
-                                                };
-
-
-/**  To Register the ISRs with the underlying OS, if required. */
-static void registerEdma3Interrupts (void);
-/**  To Unregister the ISRs with the underlying OS, if previously registered. */
-static void unregisterEdma3Interrupts (void);
-
-/* External Global Configuration Structure */
-extern EDMA3_DRV_GblConfigParams sampleEdma3GblCfgParams;
-
-/* External Instance Specific Configuration Structure */
-extern EDMA3_DRV_InstanceInitConfig sampleInstInitConfig;
-
-
-/**
- * \brief   EDMA3 Initialization
- *
- * This function initializes the EDMA3 Driver and registers the
- * interrupt handlers.
- *
-  * \return  EDMA3_DRV_SOK if success, else error code
- */
- EDMA3_DRV_Result edma3init (void)
-    {
-    unsigned int edma3InstanceId = 0;
-    EDMA3_DRV_InitConfig initCfg;
-    EDMA3_DRV_Result    edma3Result = EDMA3_DRV_SOK;
-    Semaphore_Params semParams;
-    EDMA3_DRV_GblConfigParams *globalConfig = &sampleEdma3GblCfgParams;
-    EDMA3_DRV_InstanceInitConfig *instanceConfig = &sampleInstInitConfig;
-    EDMA3_RM_MiscParam miscParam;
-
-    if (NULL == hEdma)
-        {
-        /* configuration structure for the Driver */
-        initCfg.isMaster    =    TRUE;
-        initCfg.regionId = (EDMA3_RM_RegionId)1u;
-        initCfg.drvSemHandle = NULL;
-
-        /* Driver instance specific config NULL */
-        initCfg.drvInstInitConfig = instanceConfig;
-        initCfg.gblerrCb = NULL;
-        initCfg.gblerrData = NULL;
-
-        miscParam.isSlave = FALSE;
-
-        /* Create EDMA3 Driver Object first. */
-        edma3Result = EDMA3_DRV_create (edma3InstanceId, globalConfig, (void *)&miscParam);
-
-        if (edma3Result != EDMA3_DRV_SOK)
-            {
-#ifdef EDMA3_DRV_DEBUG
-            EDMA3_DRV_PRINTF("edma3init: EDMA3_DRV_create FAILED\r\n");
-#endif
-            }
-        else
-            {
-            /**
-              * Driver Object created successfully.
-              * Create a semaphore now for driver instance.
-              */
-                       Semaphore_Params_init(&semParams);
-
-            edma3Result = edma3OsSemCreate(1, &semParams, &initCfg.drvSemHandle);
-            if (edma3Result != EDMA3_DRV_SOK)
-                {
-#ifdef EDMA3_DRV_DEBUG
-                EDMA3_DRV_PRINTF("edma3init: edma3OsSemCreate FAILED\r\n");
-#endif
-                }
-            else
-                {
-                /* Save the semaphore handle for future use */
-                semHandle = initCfg.drvSemHandle;
-
-                /* Open the Driver Instance */
-                hEdma = EDMA3_DRV_open (edma3InstanceId, (void *) &initCfg,
-                                        &edma3Result);
-                if(NULL == hEdma)
-                    {
-#ifdef EDMA3_DRV_DEBUG
-                    EDMA3_DRV_PRINTF("edma3init: EDMA3_DRV_open FAILED\r\n");
-#endif
-                    }
-                else
-                    {
-                    /**
-                     * Register Interrupt Handlers for various interrupts
-                     * like transfer completion interrupt, CC error
-                     * interrupt, TC error interrupts etc, if required.
-                     */
-                    registerEdma3Interrupts();
-                    }
-               }
-            }
-        }
-    else
-        {
-        /* EDMA3 Driver already initialized, no need to do that again. */
-#ifdef EDMA3_DRV_DEBUG
-        EDMA3_DRV_PRINTF("edma3init: EDMA3 Driver Already Initialized...Init failed\r\n");
-#endif
-        edma3Result = EDMA3_DRV_E_INVALID_STATE;
-        }
-
-     return edma3Result;
-    }
-
-
-/**  To Register the ISRs with the underlying OS, if required. */
-static void registerEdma3Interrupts (void)
-    {
-       static UInt32 cookie = 0;
-    unsigned int numTc = 0;
-
-    /* Disabling the global interrupts */
-    cookie = Hwi_disable();
-
-    /* Enable the Xfer Completion Event Interrupt */
-    EventCombiner_dispatchPlug(ccXferCompInt, (EventCombiner_FuncPtr)(&lisrEdma3ComplHandler0),
-                                               NULL, 0);
-    EventCombiner_enableEvent(ccXferCompInt);
-
-    /* Enable the CC Error Event Interrupt */
-    EventCombiner_dispatchPlug(ccErrorInt, (EventCombiner_FuncPtr)(&lisrEdma3CCErrHandler0),
-                                                               NULL, 0);
-    EventCombiner_enableEvent(ccErrorInt);
-
-    /* Enable the TC Error Event Interrupt, according to the number of TCs. */
-    while (numTc < numEdma3Tc)
-           {
-        EventCombiner_dispatchPlug(tcErrorInt[numTc],
-                            (EventCombiner_FuncPtr)(ptrEdma3TcIsrHandler[numTc]),
-                            NULL, 0);
-        EventCombiner_enableEvent(tcErrorInt[numTc]);
-        numTc++;
-       }
-
-
-   /**
-    * Enabling the HWI_ID.
-    * EDMA3 interrupts (transfer completion, CC error etc.)
-    * correspond to different ECM events (SoC specific). These ECM events come
-    * under ECM block XXX (handling those specific ECM events). Normally, block
-    * 0 handles events 4-31 (events 0-3 are reserved), block 1 handles events
-    * 32-63 and so on. This ECM block XXX (or interrupt selection number XXX)
-    * is mapped to a specific HWI_INT YYY in the tcf file. So to enable this
-    * mapped HWI_INT YYY, one should use the corresponding bitmask in the
-    * API C64_enableIER(), in which the YYY bit is SET.
-    */
-       Hwi_enableInterrupt(hwIntXferComp);
-       Hwi_enableInterrupt(hwIntCcErr);
-       Hwi_enableInterrupt(hwIntTcErr);
-
-    /* Restore interrupts */
-    Hwi_restore(cookie);
-    }
-
-
-/**
- * \brief   EDMA3 De-initialization
- *
- * This function removes the EDMA3 Driver instance and unregisters the
- * interrupt handlers.
- *
-  * \return  EDMA3_DRV_SOK if success, else error code
- */
- EDMA3_DRV_Result edma3deinit (void)
-    {
-    unsigned int edmaInstanceId = 0;
-    EDMA3_DRV_Result    edma3Result = EDMA3_DRV_SOK;
-
-    /* Unregister Interrupt Handlers first */
-    unregisterEdma3Interrupts();
-
-    /* Delete the semaphore */
-    edma3Result = edma3OsSemDelete(semHandle);
-    if (EDMA3_DRV_SOK != edma3Result )
-        {
-#ifdef EDMA3_DRV_DEBUG
-        EDMA3_DRV_PRINTF("edma3deinit: edma3OsSemDelete FAILED\r\n");
-#endif
-        }
-    else
-        {
-        /* Make the semaphore handle as NULL. */
-        semHandle = NULL;
-
-        /* Now, close the EDMA3 Driver Instance */
-        edma3Result = EDMA3_DRV_close (hEdma, NULL);
-        if (EDMA3_DRV_SOK != edma3Result )
-            {
-#ifdef EDMA3_DRV_DEBUG
-            EDMA3_DRV_PRINTF("edma3deinit: EDMA3_DRV_close FAILED\r\n");
-#endif
-            }
-        else
-            {
-            /* Make the Drv handle as NULL. */
-            hEdma = NULL;
-
-            /* Now, delete the EDMA3 Driver Object */
-            edma3Result = EDMA3_DRV_delete (edmaInstanceId, NULL);
-            if (EDMA3_DRV_SOK != edma3Result )
-                {
-#ifdef EDMA3_DRV_DEBUG
-                EDMA3_DRV_PRINTF("edma3deinit: EDMA3_DRV_delete FAILED\r\n");
-#endif
-                }
-            else
-                {
-#ifdef EDMA3_DRV_DEBUG
-                EDMA3_DRV_PRINTF("edma3deinit: EDMA3 Deinitialization" \
-                                    " Completed...\r\n");
-#endif
-                }
-            }
-       }
-
-    return edma3Result;
-    }
-
-
-/**  To Unregister the ISRs with the underlying OS, if previously registered. */
-static void unregisterEdma3Interrupts (void)
-    {
-       static UInt32 cookie = 0;
-    unsigned int numTc = 0;
-
-    /* Disabling the global interrupts */
-    cookie = Hwi_disable();
-
-    /* Disable the Xfer Completion Event Interrupt */
-       EventCombiner_disableEvent(ccXferCompInt);
-
-    /* Disable the CC Error Event Interrupt */
-       EventCombiner_disableEvent(ccErrorInt);
-
-    /* Enable the TC Error Event Interrupt, according to the number of TCs. */
-    while (numTc < numEdma3Tc)
-       {
-        EventCombiner_disableEvent(tcErrorInt[numTc]);
-        numTc++;
-       }
-
-    /* Restore interrupts */
-    Hwi_restore(cookie);
-    }
-
-/* End of File */
diff --git a/packages/ti/sdo/edma3/drv/sample/src/platforms/sample_da830_cfg.c b/packages/ti/sdo/edma3/drv/sample/src/platforms/sample_da830_cfg.c
new file mode 100644 (file)
index 0000000..067e80b
--- /dev/null
@@ -0,0 +1,768 @@
+/*
+ * sample_da830_cfg.c
+ *
+ * SoC specific EDMA3 hardware related information like number of transfer
+ * controllers, various interrupt ids etc. It is used while interrupts
+ * enabling / disabling. It needs to be ported for different SoCs.
+ *
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+#include <ti/sdo/edma3/drv/edma3_drv.h>
+
+/* Number of EDMA3 controllers present in the system */
+#define NUM_EDMA3_INSTANCES                    1u
+const unsigned int numEdma3Instances = NUM_EDMA3_INSTANCES;
+
+/* Number of DSPs present in the system */
+#define NUM_DSPS                                       1u
+const unsigned int numDsps = NUM_DSPS;
+
+/* Determine the processor id by reading DNUM register. */
+unsigned short determineProcId()
+       {
+#if 0  
+       volatile unsigned int *addr;
+       unsigned int core_no;
+
+    /* Identify the core number */
+    addr = (unsigned int *)(CGEM_REG_START+0x40000);
+    core_no = ((*addr) & 0x000F0000)>>16;
+
+       return core_no;
+#endif
+       return 1;
+       }
+
+unsigned short isGblConfigRequired(unsigned int dspNum)
+       {
+       (void) dspNum;
+       
+       return 1;
+       }
+
+/* Semaphore handles */
+EDMA3_OS_Sem_Handle semHandle[NUM_EDMA3_INSTANCES] = {NULL};
+
+/** Number of PaRAM Sets available */
+#define EDMA3_NUM_PARAMSET                             (128u)
+/** Number of TCCS available */
+#define EDMA3_NUM_TCC                                  (32u)
+/** Number of Event Queues available */
+#define EDMA3_NUM_EVTQUE                                (2u)
+/** Number of Transfer Controllers available */
+#define EDMA3_NUM_TC                                    (2u)
+/** Interrupt no. for Transfer Completion */
+#define EDMA3_CC_XFER_COMPLETION_INT                    (8u)
+/** Interrupt no. for CC Error */
+#define EDMA3_CC_ERROR_INT                              (56u)
+/** Interrupt no. for TCs Error */
+#define EDMA3_TC0_ERROR_INT                             (57u)
+#define EDMA3_TC1_ERROR_INT                             (58u)
+#define EDMA3_TC2_ERROR_INT                             (0u)
+#define EDMA3_TC3_ERROR_INT                             (0u)
+#define EDMA3_TC4_ERROR_INT                             (0u)
+#define EDMA3_TC5_ERROR_INT                             (0u)
+#define EDMA3_TC6_ERROR_INT                             (0u)
+#define EDMA3_TC7_ERROR_INT                             (0u)
+
+/**
+* EDMA3 interrupts (transfer completion, CC error etc.) correspond to different
+* ECM events (SoC specific). These ECM events come
+* under ECM block XXX (handling those specific ECM events). Normally, block
+* 0 handles events 4-31 (events 0-3 are reserved), block 1 handles events
+* 32-63 and so on. This ECM block XXX (or interrupt selection number XXX)
+* is mapped to a specific HWI_INT YYY in the tcf file.
+* Define EDMA3_HWI_INT_XFER_COMP to specific HWI_INT, corresponding
+* to transfer completion interrupt.
+* Define EDMA3_HWI_INT_CC_ERR to specific HWI_INT, corresponding
+* to CC error interrupts.
+* Define EDMA3_HWI_INT_TC_ERR to specific HWI_INT, corresponding
+* to TC error interrupts.
+*/
+#define EDMA3_HWI_INT_XFER_COMP                                                        (7u)
+#define EDMA3_HWI_INT_CC_ERR                                                   (8u)
+#define EDMA3_HWI_INT_TC_ERR                                                   (8u)
+
+
+/**
+ * \brief Mapping of DMA channels 0-31 to Hardware Events from
+ * various peripherals, which use EDMA for data transfer.
+ * All channels need not be mapped, some can be free also.
+ * 1: Mapped
+ * 0: Not mapped
+ *
+ * This mapping will be used to allocate DMA channels when user passes
+ * EDMA3_DRV_DMA_CHANNEL_ANY as dma channel id (for eg to do memory-to-memory
+ * copy). The same mapping is used to allocate the TCC when user passes
+ * EDMA3_DRV_TCC_ANY as tcc id (for eg to do memory-to-memory copy).
+ *
+ * To allocate more DMA channels or TCCs, one has to modify the event mapping.
+ */
+                                                                                                         /* 31     0 */
+#define EDMA3_DMA_CHANNEL_TO_EVENT_MAPPING_0          (0xCF3FFFFFu)
+
+/**
+ * \brief Mapping of DMA channels 32-63 to Hardware Events from
+ * various peripherals, which use EDMA for data transfer.
+ * All channels need not be mapped, some can be free also.
+ * 1: Mapped
+ * 0: Not mapped
+ *
+ * This mapping will be used to allocate DMA channels when user passes
+ * EDMA3_DRV_DMA_CHANNEL_ANY as dma channel id (for eg to do memory-to-memory
+ * copy). The same mapping is used to allocate the TCC when user passes
+ * EDMA3_DRV_TCC_ANY as tcc id (for eg to do memory-to-memory copy).
+ *
+ * To allocate more DMA channels or TCCs, one has to modify the event mapping.
+ */
+/* DMA channels 32-63 DOES NOT exist in DA830. */
+#define EDMA3_DMA_CHANNEL_TO_EVENT_MAPPING_1          (0x0u)
+
+/* Variable which will be used internally for referring number of Event Queues. */
+unsigned int numEdma3EvtQue[NUM_EDMA3_INSTANCES] = {EDMA3_NUM_EVTQUE};
+
+/* Variable which will be used internally for referring number of TCs. */
+unsigned int numEdma3Tc[NUM_EDMA3_INSTANCES] = {EDMA3_NUM_TC};
+
+/**
+ * Variable which will be used internally for referring transfer completion
+ * interrupt.
+ */
+unsigned int ccXferCompInt[NUM_EDMA3_INSTANCES][EDMA3_MAX_REGIONS] = {
+                                                       {
+                                                       0u, EDMA3_CC_XFER_COMPLETION_INT, 0u, 0u,
+                                                       0u, 0u, 0u, 0u,
+                                                       },
+                        };
+
+/**
+ * Variable which will be used internally for referring channel controller's
+ * error interrupt.
+ */
+unsigned int ccErrorInt[NUM_EDMA3_INSTANCES] = {EDMA3_CC_ERROR_INT};
+
+/**
+ * Variable which will be used internally for referring transfer controllers'
+ * error interrupts.
+ */
+unsigned int tcErrorInt[NUM_EDMA3_INSTANCES][8] =    {
+                                {
+                                EDMA3_TC0_ERROR_INT, EDMA3_TC1_ERROR_INT,
+                                EDMA3_TC2_ERROR_INT, EDMA3_TC3_ERROR_INT,
+                                EDMA3_TC4_ERROR_INT, EDMA3_TC5_ERROR_INT,
+                                EDMA3_TC6_ERROR_INT, EDMA3_TC7_ERROR_INT,
+                                }
+                            };
+
+/**
+ * Variables which will be used internally for referring the hardware interrupt
+ * for various EDMA3 interrupts.
+ */
+unsigned int hwIntXferComp = EDMA3_HWI_INT_XFER_COMP;
+unsigned int hwIntCcErr = EDMA3_HWI_INT_CC_ERR;
+unsigned int hwIntTcErr = EDMA3_HWI_INT_TC_ERR;
+
+
+/* Driver Object Initialization Configuration */
+EDMA3_DRV_GblConfigParams sampleEdma3GblCfgParams[NUM_EDMA3_INSTANCES] =
+       {
+           {
+           /** Total number of DMA Channels supported by the EDMA3 Controller */
+           32u,
+           /** Total number of QDMA Channels supported by the EDMA3 Controller */
+           8u,
+           /** Total number of TCCs supported by the EDMA3 Controller */
+           32u,
+           /** Total number of PaRAM Sets supported by the EDMA3 Controller */
+           128u,
+           /** Total number of Event Queues in the EDMA3 Controller */
+           2u,
+           /** Total number of Transfer Controllers (TCs) in the EDMA3 Controller */
+           2u,
+           /** Number of Regions on this EDMA3 controller */
+           4u,
+
+           /**
+            * \brief Channel mapping existence
+            * A value of 0 (No channel mapping) implies that there is fixed association
+            * for a channel number to a parameter entry number or, in other words,
+            * PaRAM entry n corresponds to channel n.
+            */
+           0u,
+
+           /** Existence of memory protection feature */
+           0u,
+
+           /** Global Register Region of CC Registers */
+           (void *)0x01C00000u,
+           /** Transfer Controller (TC) Registers */
+               {
+               (void *)0x01C08000u,
+               (void *)0x01C08400u,
+               (void *)NULL,
+               (void *)NULL,
+               (void *)NULL,
+               (void *)NULL,
+               (void *)NULL,
+               (void *)NULL
+               },
+           /** Interrupt no. for Transfer Completion */
+           EDMA3_CC_XFER_COMPLETION_INT,
+           /** Interrupt no. for CC Error */
+           EDMA3_CC_ERROR_INT,
+           /** Interrupt no. for TCs Error */
+               {
+               EDMA3_TC0_ERROR_INT,
+               EDMA3_TC1_ERROR_INT,
+               EDMA3_TC2_ERROR_INT,
+               EDMA3_TC3_ERROR_INT,
+               EDMA3_TC4_ERROR_INT,
+               EDMA3_TC5_ERROR_INT,
+               EDMA3_TC6_ERROR_INT,
+               EDMA3_TC7_ERROR_INT
+               },
+
+           /**
+            * \brief EDMA3 TC priority setting
+            *
+            * User can program the priority of the Event Queues
+            * at a system-wide level.  This means that the user can set the
+            * priority of an IO initiated by either of the TCs (Transfer Controllers)
+            * relative to IO initiated by the other bus masters on the
+            * device (ARM, DSP, USB, etc)
+            */
+               {
+               0u,
+               1u,
+               0u,
+               0u,
+               0u,
+               0u,
+               0u,
+               0u
+               },
+           /**
+            * \brief To Configure the Threshold level of number of events
+            * that can be queued up in the Event queues. EDMA3CC error register
+            * (CCERR) will indicate whether or not at any instant of time the
+            * number of events queued up in any of the event queues exceeds
+            * or equals the threshold/watermark value that is set
+            * in the queue watermark threshold register (QWMTHRA).
+            */
+               {
+               16u,
+               16u,
+               0u,
+               0u,
+               0u,
+               0u,
+               0u,
+               0u
+               },
+
+           /**
+            * \brief To Configure the Default Burst Size (DBS) of TCs.
+            * An optimally-sized command is defined by the transfer controller
+            * default burst size (DBS). Different TCs can have different
+            * DBS values. It is defined in Bytes.
+            */
+               {
+               16u,
+               16u,
+               0u,
+               0u,
+               0u,
+               0u,
+               0u,
+               0u
+               },
+
+           /**
+            * \brief Mapping from each DMA channel to a Parameter RAM set,
+            * if it exists, otherwise of no use.
+            */
+               {
+               0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u,
+               8u, 9u, 10u, 11u, 12u, 13u, 14u, 15u,
+               16u, 17u, 18u, 19u, 20u, 21u, 22u, 23u,
+               24u, 25u, 26u, 27u, 28u, 29u, 30u, 31u,
+               /* DMA channels 32-63 DOES NOT exist in DA830. */
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS
+               },
+
+            /**
+             * \brief Mapping from each DMA channel to a TCC. This specific
+             * TCC code will be returned when the transfer is completed
+             * on the mapped channel.
+             */
+               {
+               0u, 1u, 2u, 3u,
+               4u, 5u, 6u, 7u,
+               8u, 9u, 10u, 11u,
+               12u, 13u, 14u, 15u,
+               16u, 17u, 18u, 19u,
+               20u, 21u, EDMA3_RM_CH_NO_TCC_MAP, EDMA3_RM_CH_NO_TCC_MAP,
+               24u, 25u, 26u, 27u,
+               EDMA3_RM_CH_NO_TCC_MAP, EDMA3_RM_CH_NO_TCC_MAP, 30, 31,
+               /* DMA channels 32-63 DOES NOT exist in DA830. */
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC
+               },
+
+           /**
+            * \brief Mapping of DMA channels to Hardware Events from
+            * various peripherals, which use EDMA for data transfer.
+            * All channels need not be mapped, some can be free also.
+            */
+               {
+               EDMA3_DMA_CHANNEL_TO_EVENT_MAPPING_0,
+               EDMA3_DMA_CHANNEL_TO_EVENT_MAPPING_1
+               },
+               },
+       };
+
+
+/* Driver Instance Initialization Configuration */
+EDMA3_DRV_InstanceInitConfig sampleInstInitConfig[NUM_EDMA3_INSTANCES][EDMA3_MAX_REGIONS] =
+       {
+               /* EDMA3 INSTANCE# 0 */
+               {
+                       /* Resources owned/reserved by region 0 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x0000F000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+                   
+               /* Resources owned/reserved by region 1 */
+                   {
+                       /* ownPaRAMSets */
+                       /* 31     0     63    32     95    64     127   96 */
+                       {0xFFFFFFFFu, 0xFFFFFFFFu, 0xFFFFFFFFu, 0xFFFFFFFFu,
+                       /* 159  128     191  160     223  192     255  224 */
+                        0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                       /* 287  256     319  288     351  320     383  352 */
+                        0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                       /* 415  384     447  416     479  448     511  480 */
+                        0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                       /* ownDmaChannels */
+                       /* 31     0     63    32 */
+                       {0xFFFFFFFFu, 0x00000000u},
+
+                       /* ownQdmaChannels */
+                       /* 31     0 */
+                       {0x000000FFu},
+
+                       /* ownTccs */
+                       /* 31     0     63    32 */
+                       {0xFFFFFFFFu, 0x00000000u},
+
+                       /* resvdPaRAMSets */
+                       /* 31     0     63    32     95    64     127   96 */
+                       {0xFFFFFFFFu, 0x00000000u, 0x00000000u, 0x00000000u,
+                       /* 159  128     191  160     223  192     255  224 */
+                        0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                       /* 287  256     319  288     351  320     383  352 */
+                        0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                       /* 415  384     447  416     479  448     511  480 */
+                        0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                       /* resvdDmaChannels */
+                       /* 31                                                       0 */
+                       {EDMA3_DMA_CHANNEL_TO_EVENT_MAPPING_0,
+                       /* 63                                                     32 */
+                           EDMA3_DMA_CHANNEL_TO_EVENT_MAPPING_1},
+
+                       /* resvdQdmaChannels */
+                       /* 31     0 */
+                       {0x00000000u},
+
+                       /* resvdTccs */
+                       /* 31                                                       0 */
+                       {EDMA3_DMA_CHANNEL_TO_EVENT_MAPPING_0,
+                       /* 63                                                     32 */
+                           EDMA3_DMA_CHANNEL_TO_EVENT_MAPPING_1}
+                   },
+
+               /* Resources owned/reserved by region 2 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x0000F000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 3 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x0000F000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 4 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x0000F000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 5 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 6 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 7 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+           },
+       };
+                   
+
+
+/* End of File */
+
+
diff --git a/packages/ti/sdo/edma3/drv/sample/src/platforms/sample_da830_int_reg.c b/packages/ti/sdo/edma3/drv/sample/src/platforms/sample_da830_int_reg.c
new file mode 100644 (file)
index 0000000..731c093
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ * bios6_int_register_tci_6498.c
+ *
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+#include <ti/sysbios/ipc/Semaphore.h>
+#include <ti/sysbios/family/c64p/EventCombiner.h>
+#include <ti/sysbios/family/c64p/Hwi.h>
+
+#include <ti/sdo/edma3/drv/sample/bios6_edma3_drv_sample.h>
+
+// #include <stdio.h>
+/**
+  * EDMA3 TC ISRs which need to be registered with the underlying OS by the user
+  * (Not all TC error ISRs need to be registered, register only for the
+  * available Transfer Controllers).
+  */
+void (*ptrEdma3TcIsrHandler[EDMA3_MAX_TC])(unsigned int arg) =
+                                                {
+                                                &lisrEdma3TC0ErrHandler0,
+                                                &lisrEdma3TC1ErrHandler0,
+                                                &lisrEdma3TC2ErrHandler0,
+                                                &lisrEdma3TC3ErrHandler0,
+                                                &lisrEdma3TC4ErrHandler0,
+                                                &lisrEdma3TC5ErrHandler0,
+                                                &lisrEdma3TC6ErrHandler0,
+                                                &lisrEdma3TC7ErrHandler0,
+                                                };
+
+extern unsigned int ccXferCompInt[][EDMA3_MAX_REGIONS];
+extern unsigned int ccErrorInt[];
+extern unsigned int tcErrorInt[][EDMA3_MAX_TC];
+extern unsigned int numEdma3Tc[];
+
+/**
+ * Variables which will be used internally for referring the hardware interrupt
+ * for various EDMA3 interrupts.
+ */
+extern unsigned int hwIntXferComp;
+extern unsigned int hwIntCcErr;
+extern unsigned int hwIntTcErr;
+
+extern unsigned int dsp_num;
+
+/**  To Register the ISRs with the underlying OS, if required. */
+void registerEdma3Interrupts (unsigned int edma3Id)
+    {
+    static UInt32 cookie = 0;
+    unsigned int numTc = 0;
+
+    /* Disabling the global interrupts */
+    cookie = Hwi_disable();
+
+    /* Enable the Xfer Completion Event Interrupt */
+    EventCombiner_dispatchPlug(ccXferCompInt[edma3Id][dsp_num],
+                                               (EventCombiner_FuncPtr)(&lisrEdma3ComplHandler0),
+                               NULL, 1);
+    EventCombiner_enableEvent(ccXferCompInt[edma3Id][dsp_num]);
+
+    /* Enable the CC Error Event Interrupt */
+    EventCombiner_dispatchPlug(ccErrorInt[edma3Id],
+                                               (EventCombiner_FuncPtr)(&lisrEdma3CCErrHandler0),
+                                               NULL, 1);
+    EventCombiner_enableEvent(ccErrorInt[edma3Id]);
+
+    /* Enable the TC Error Event Interrupt, according to the number of TCs. */
+    while (numTc < numEdma3Tc[edma3Id])
+           {
+        EventCombiner_dispatchPlug(tcErrorInt[edma3Id][numTc],
+                            (EventCombiner_FuncPtr)(ptrEdma3TcIsrHandler[numTc]),
+                            NULL, 1);
+        EventCombiner_enableEvent(tcErrorInt[edma3Id][numTc]);
+        numTc++;
+       }
+
+   /**
+    * Enabling the HWI_ID.
+    * EDMA3 interrupts (transfer completion, CC error etc.)
+    * correspond to different ECM events (SoC specific). These ECM events come
+    * under ECM block XXX (handling those specific ECM events). Normally, block
+    * 0 handles events 4-31 (events 0-3 are reserved), block 1 handles events
+    * 32-63 and so on. This ECM block XXX (or interrupt selection number XXX)
+    * is mapped to a specific HWI_INT YYY in the tcf file. So to enable this
+    * mapped HWI_INT YYY, one should use the corresponding bitmask in the
+    * API C64_enableIER(), in which the YYY bit is SET.
+    */
+       Hwi_enableInterrupt(hwIntXferComp);
+       Hwi_enableInterrupt(hwIntCcErr);
+       Hwi_enableInterrupt(hwIntTcErr);
+
+    /* Restore interrupts */
+    Hwi_restore(cookie);
+    }
+
+/**  To Unregister the ISRs with the underlying OS, if previously registered. */
+void unregisterEdma3Interrupts (unsigned int edma3Id)
+    {
+       static UInt32 cookie = 0;
+    unsigned int numTc = 0;
+
+    /* Disabling the global interrupts */
+    cookie = Hwi_disable();
+
+    /* Disable the Xfer Completion Event Interrupt */
+       EventCombiner_disableEvent(ccXferCompInt[edma3Id][dsp_num]);
+
+    /* Disable the CC Error Event Interrupt */
+       EventCombiner_disableEvent(ccErrorInt[edma3Id]);
+
+    /* Enable the TC Error Event Interrupt, according to the number of TCs. */
+    while (numTc < numEdma3Tc[edma3Id])
+       {
+        EventCombiner_disableEvent(tcErrorInt[edma3Id][numTc]);
+        numTc++;
+       }
+
+    /* Restore interrupts */
+    Hwi_restore(cookie);
+    }
+
diff --git a/packages/ti/sdo/edma3/drv/sample/src/platforms/sample_tci6498_cfg.c b/packages/ti/sdo/edma3/drv/sample/src/platforms/sample_tci6498_cfg.c
new file mode 100644 (file)
index 0000000..a7a00ab
--- /dev/null
@@ -0,0 +1,1773 @@
+/*
+ * sample_tci6498_cfg.c
+ *
+ * SoC specific EDMA3 hardware related information like number of transfer
+ * controllers, various interrupt ids etc. It is used while interrupts
+ * enabling / disabling. It needs to be ported for different SoCs.
+ *
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+#include <ti/sdo/edma3/drv/edma3_drv.h>
+
+/* Number of EDMA3 controllers present in the system */
+#define NUM_EDMA3_INSTANCES                    3u
+const unsigned int numEdma3Instances = NUM_EDMA3_INSTANCES;
+
+/* Number of DSPs present in the system */
+#define NUM_DSPS                                       4u
+//const unsigned int numDsps = NUM_DSPS;
+
+#define CGEM_REG_START                  (0x01800000)
+
+/* Determine the processor id by reading DNUM register. */
+unsigned short determineProcId()
+       {
+       volatile unsigned int *addr;
+       unsigned int core_no;
+
+    /* Identify the core number */
+    addr = (unsigned int *)(CGEM_REG_START+0x40000);
+    core_no = ((*addr) & 0x000F0000)>>16;
+
+       return core_no;
+       }
+
+/** Whether global configuration required for EDMA3 or not.
+ * This configuration should be done only once for the EDMA3 hardware by
+ * any one of the masters (i.e. DSPs).
+ * It can be changed depending on the use-case.
+ */
+unsigned int gblCfgReqdArray [NUM_DSPS] = {
+                                                                       0,      /* DSP#0 is Master, will do the global init */
+                                                                       1,      /* DSP#1 is Slave, will not do the global init  */
+                                                                       1,      /* DSP#2 is Slave, will not do the global init  */
+                                                                       1,      /* DSP#3 is Slave, will not do the global init  */
+                                                                       };
+
+unsigned short isGblConfigRequired(unsigned int dspNum)
+       {
+       return gblCfgReqdArray[dspNum];
+       }
+
+/* Semaphore handles */
+EDMA3_OS_Sem_Handle semHandle[NUM_EDMA3_INSTANCES] = {NULL,NULL,NULL};
+
+
+/* Variable which will be used internally for referring number of Event Queues. */
+unsigned int numEdma3EvtQue[NUM_EDMA3_INSTANCES] = {2u, 4u, 4u};
+
+/* Variable which will be used internally for referring number of TCs. */
+unsigned int numEdma3Tc[NUM_EDMA3_INSTANCES] = {2u, 4u, 4u};
+
+/**
+ * Variable which will be used internally for referring transfer completion
+ * interrupt. Completion interrupts for all the shadow regions and all the
+ * EDMA3 controllers are captured since it is a multi-DSP platform.
+ */
+unsigned int ccXferCompInt[NUM_EDMA3_INSTANCES][EDMA3_MAX_REGIONS] = {
+                                                                                                       {
+                                                                                                       38u, 39u, 40u, 41u,
+                                                                                                       42u, 43u, 44u, 45u,
+                                                                                                       },
+                                                                                                       {
+                                                                                                       8u, 9u, 10u, 11u,
+                                                                                                       12u, 13u, 14u, 15u,
+                                                                                                       },
+                                                                                                       {
+                                                                                                       24u, 25u, 26u, 27u,
+                                                                                                       28u, 29u, 30u, 31u,
+                                                                                                       },
+                                                                                               };
+
+
+/**
+ * Variable which will be used internally for referring channel controller's
+ * error interrupt.
+ */
+unsigned int ccErrorInt[NUM_EDMA3_INSTANCES] = {32u, 0u, 16u};
+
+/**
+ * Variable which will be used internally for referring transfer controllers'
+ * error interrupts.
+ */
+unsigned int tcErrorInt[NUM_EDMA3_INSTANCES][EDMA3_MAX_TC] =    {
+                                                                                                       {
+                                                                                                       34u, 35u, 0u, 0u,
+                                                                                                       0u, 0u, 0u, 0u,
+                                                                                                       },
+                                                                                                       {
+                                                                                                       2u, 3u, 4u, 5u,
+                                                                                                       0u, 0u, 0u, 0u,
+                                                                                                       },
+                                                                                                       {
+                                                                                                       18u, 19u, 20u, 21u,
+                                                                                                       0u, 0u, 0u, 0u,
+                                                                                                       },
+                                                                                               };
+
+/* Driver Object Initialization Configuration */
+EDMA3_DRV_GblConfigParams sampleEdma3GblCfgParams[NUM_EDMA3_INSTANCES] =
+       {
+               {
+               /* EDMA3 INSTANCE# 0 */
+               /** Total number of DMA Channels supported by the EDMA3 Controller */
+               16u,
+               /** Total number of QDMA Channels supported by the EDMA3 Controller */
+               8u,
+               /** Total number of TCCs supported by the EDMA3 Controller */
+               16u,
+               /** Total number of PaRAM Sets supported by the EDMA3 Controller */
+               128u,
+               /** Total number of Event Queues in the EDMA3 Controller */
+               2u,
+               /** Total number of Transfer Controllers (TCs) in the EDMA3 Controller */
+               2u,
+               /** Number of Regions on this EDMA3 controller */
+               8u,
+
+               /**
+                * \brief Channel mapping existence
+                * A value of 0 (No channel mapping) implies that there is fixed association
+                * for a channel number to a parameter entry number or, in other words,
+                * PaRAM entry n corresponds to channel n.
+                */
+               1u,
+
+               /** Existence of memory protection feature */
+               1u,
+
+               /** Global Register Region of CC Registers */
+               (void *)0x02700000u,
+               /** Transfer Controller (TC) Registers */
+               {
+               (void *)0x02760000u,
+               (void *)0x02768000u,
+               (void *)NULL,
+               (void *)NULL,
+               (void *)NULL,
+               (void *)NULL,
+               (void *)NULL,
+               (void *)NULL
+               },
+               /** Interrupt no. for Transfer Completion */
+               38u,
+               /** Interrupt no. for CC Error */
+               32u,
+               /** Interrupt no. for TCs Error */
+               {
+               34u,
+               35u,
+               0u,
+               0u,
+               0u,
+               0u,
+               0u,
+               0u,
+               },
+
+               /**
+                * \brief EDMA3 TC priority setting
+                *
+                * User can program the priority of the Event Queues
+                * at a system-wide level.  This means that the user can set the
+                * priority of an IO initiated by either of the TCs (Transfer Controllers)
+                * relative to IO initiated by the other bus masters on the
+                * device (ARM, DSP, USB, etc)
+                */
+               {
+               0u,
+               1u,
+               0u,
+               0u,
+               0u,
+               0u,
+               0u,
+               0u
+               },
+               /**
+                * \brief To Configure the Threshold level of number of events
+                * that can be queued up in the Event queues. EDMA3CC error register
+                * (CCERR) will indicate whether or not at any instant of time the
+                * number of events queued up in any of the event queues exceeds
+                * or equals the threshold/watermark value that is set
+                * in the queue watermark threshold register (QWMTHRA).
+                */
+               {
+               16u,
+               16u,
+               0u,
+               0u,
+               0u,
+               0u,
+               0u,
+               0u
+               },
+
+               /**
+                * \brief To Configure the Default Burst Size (DBS) of TCs.
+                * An optimally-sized command is defined by the transfer controller
+                * default burst size (DBS). Different TCs can have different
+                * DBS values. It is defined in Bytes.
+                */
+               {
+               16u,
+               16u,
+               0u,
+               0u,
+               0u,
+               0u,
+               0u,
+               0u
+               },
+
+               /**
+                * \brief Mapping from each DMA channel to a Parameter RAM set,
+                * if it exists, otherwise of no use.
+                */
+               {
+               0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u,
+               8u, 9u, 10u, 11u, 12u, 13u, 14u, 15u,
+               /* DMA channels 16-63 DOES NOT exist */
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS,
+               EDMA3_MAX_PARAM_SETS, EDMA3_MAX_PARAM_SETS
+               },
+
+                /**
+                 * \brief Mapping from each DMA channel to a TCC. This specific
+                 * TCC code will be returned when the transfer is completed
+                 * on the mapped channel.
+                 */
+               {
+               0u, 1u, EDMA3_RM_CH_NO_TCC_MAP, EDMA3_RM_CH_NO_TCC_MAP,
+               4u, 5u, EDMA3_RM_CH_NO_TCC_MAP, EDMA3_RM_CH_NO_TCC_MAP,
+               8u, 9u, EDMA3_RM_CH_NO_TCC_MAP, EDMA3_RM_CH_NO_TCC_MAP,
+               12u, 13u, EDMA3_RM_CH_NO_TCC_MAP, EDMA3_RM_CH_NO_TCC_MAP,
+               /* DMA channels 16-63 DOES NOT exist */
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC,
+               EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC, EDMA3_MAX_TCC
+               },
+
+               /**
+                * \brief Mapping of DMA channels to Hardware Events from
+                * various peripherals, which use EDMA for data transfer.
+                * All channels need not be mapped, some can be free also.
+                */
+               {
+               0x00003333u,
+               0x00000000u
+               }
+               },
+
+               {
+               /* EDMA3 INSTANCE# 1 */
+               /** Total number of DMA Channels supported by the EDMA3 Controller */
+               64u,
+               /** Total number of QDMA Channels supported by the EDMA3 Controller */
+               8u,
+               /** Total number of TCCs supported by the EDMA3 Controller */
+               64u,
+               /** Total number of PaRAM Sets supported by the EDMA3 Controller */
+               512u,
+               /** Total number of Event Queues in the EDMA3 Controller */
+               4u,
+               /** Total number of Transfer Controllers (TCs) in the EDMA3 Controller */
+               4u,
+               /** Number of Regions on this EDMA3 controller */
+               8u,
+
+               /**
+                * \brief Channel mapping existence
+                * A value of 0 (No channel mapping) implies that there is fixed association
+                * for a channel number to a parameter entry number or, in other words,
+                * PaRAM entry n corresponds to channel n.
+                */
+               1u,
+
+               /** Existence of memory protection feature */
+               1u,
+
+               /** Global Register Region of CC Registers */
+               (void *)0x02720000u,
+               /** Transfer Controller (TC) Registers */
+               {
+               (void *)0x02770000u,
+               (void *)0x02778000u,
+               (void *)0x02780000u,
+               (void *)0x02788000u,
+               (void *)NULL,
+               (void *)NULL,
+               (void *)NULL,
+               (void *)NULL
+               },
+               /** Interrupt no. for Transfer Completion */
+               8u,
+               /** Interrupt no. for CC Error */
+               0u,
+               /** Interrupt no. for TCs Error */
+               {
+               2u,
+               3u,
+               4u,
+               5u,
+               0u,
+               0u,
+               0u,
+               0u,
+               },
+
+               /**
+                * \brief EDMA3 TC priority setting
+                *
+                * User can program the priority of the Event Queues
+                * at a system-wide level.  This means that the user can set the
+                * priority of an IO initiated by either of the TCs (Transfer Controllers)
+                * relative to IO initiated by the other bus masters on the
+                * device (ARM, DSP, USB, etc)
+                */
+               {
+               0u,
+               1u,
+               2u,
+               3u,
+               0u,
+               0u,
+               0u,
+               0u
+               },
+               /**
+                * \brief To Configure the Threshold level of number of events
+                * that can be queued up in the Event queues. EDMA3CC error register
+                * (CCERR) will indicate whether or not at any instant of time the
+                * number of events queued up in any of the event queues exceeds
+                * or equals the threshold/watermark value that is set
+                * in the queue watermark threshold register (QWMTHRA).
+                */
+               {
+               16u,
+               16u,
+               16u,
+               16u,
+               0u,
+               0u,
+               0u,
+               0u
+               },
+
+               /**
+                * \brief To Configure the Default Burst Size (DBS) of TCs.
+                * An optimally-sized command is defined by the transfer controller
+                * default burst size (DBS). Different TCs can have different
+                * DBS values. It is defined in Bytes.
+                */
+               {
+               8u,
+               8u,
+               8u,
+               8u,
+               0u,
+               0u,
+               0u,
+               0u
+               },
+
+               /**
+                * \brief Mapping from each DMA channel to a Parameter RAM set,
+                * if it exists, otherwise of no use.
+                */
+               {
+               0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u,
+               8u, 9u, 10u, 11u, 12u, 13u, 14u, 15u,
+               16u, 17u, 18u, 19u, 20u, 21u, 22u, 23u,
+               24u, 25u, 26u, 27u, 28u, 29u, 30u, 31u,
+               32u, 33u, 34u, 35u, 36u, 37u, 38u, 39u,
+               40u, 41u, 42u, 43u, 44u, 45u, 46u, 47u,
+               48u, 49u, 50u, 51u, 52u, 53u, 54u, 55u,
+               56u, 57u, 58u, 59u, 60u, 61u, 62u, 63u
+               },
+
+                /**
+                 * \brief Mapping from each DMA channel to a TCC. This specific
+                 * TCC code will be returned when the transfer is completed
+                 * on the mapped channel.
+                 */
+               {
+               0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u,
+               8u, 9u, 10u, 11u, 12u, 13u, EDMA3_RM_CH_NO_TCC_MAP, EDMA3_RM_CH_NO_TCC_MAP,
+               16u, 17u, 18u, 19u, 20u, 21u, 22u, 23u,
+               24u, 25u, 26u, 27u, 28u, 29u, EDMA3_RM_CH_NO_TCC_MAP, EDMA3_RM_CH_NO_TCC_MAP,
+               32u, 33u, 34u, 35u, 36u, 37u, 38u, 39u,
+               40u, 41u, 42u, 43u, 44u, 45u, EDMA3_RM_CH_NO_TCC_MAP, EDMA3_RM_CH_NO_TCC_MAP,
+               48u, 49u, 50u, 51u, 52u, 53u, 54u, 55u,
+               56u, 57u, 58u, 59u, 60u, 61u, EDMA3_RM_CH_NO_TCC_MAP, EDMA3_RM_CH_NO_TCC_MAP
+               },
+
+               /**
+                * \brief Mapping of DMA channels to Hardware Events from
+                * various peripherals, which use EDMA for data transfer.
+                * All channels need not be mapped, some can be free also.
+                */
+               {
+               0x3FFF3FFFu,
+               0x3FFF3FFFu
+               }
+               },
+
+               {
+               /* EDMA3 INSTANCE# 2 */
+               /** Total number of DMA Channels supported by the EDMA3 Controller */
+               64u,
+               /** Total number of QDMA Channels supported by the EDMA3 Controller */
+               8u,
+               /** Total number of TCCs supported by the EDMA3 Controller */
+               64u,
+               /** Total number of PaRAM Sets supported by the EDMA3 Controller */
+               512u,
+               /** Total number of Event Queues in the EDMA3 Controller */
+               4u,
+               /** Total number of Transfer Controllers (TCs) in the EDMA3 Controller */
+               4u,
+               /** Number of Regions on this EDMA3 controller */
+               8u,
+
+               /**
+                * \brief Channel mapping existence
+                * A value of 0 (No channel mapping) implies that there is fixed association
+                * for a channel number to a parameter entry number or, in other words,
+                * PaRAM entry n corresponds to channel n.
+                */
+               1u,
+
+               /** Existence of memory protection feature */
+               1u,
+
+               /** Global Register Region of CC Registers */
+               (void *)0x02740000u,
+               /** Transfer Controller (TC) Registers */
+               {
+               (void *)0x02790000u,
+               (void *)0x02798000u,
+               (void *)0x027A0000u,
+               (void *)0x027A8000u,
+               (void *)NULL,
+               (void *)NULL,
+               (void *)NULL,
+               (void *)NULL
+               },
+               /** Interrupt no. for Transfer Completion */
+               24u,
+               /** Interrupt no. for CC Error */
+               16u,
+               /** Interrupt no. for TCs Error */
+               {
+               18u,
+               19u,
+               20u,
+               21u,
+               0u,
+               0u,
+               0u,
+               0u,
+               },
+
+               /**
+                * \brief EDMA3 TC priority setting
+                *
+                * User can program the priority of the Event Queues
+                * at a system-wide level.  This means that the user can set the
+                * priority of an IO initiated by either of the TCs (Transfer Controllers)
+                * relative to IO initiated by the other bus masters on the
+                * device (ARM, DSP, USB, etc)
+                */
+               {
+               0u,
+               1u,
+               2u,
+               3u,
+               0u,
+               0u,
+               0u,
+               0u
+               },
+               /**
+                * \brief To Configure the Threshold level of number of events
+                * that can be queued up in the Event queues. EDMA3CC error register
+                * (CCERR) will indicate whether or not at any instant of time the
+                * number of events queued up in any of the event queues exceeds
+                * or equals the threshold/watermark value that is set
+                * in the queue watermark threshold register (QWMTHRA).
+                */
+               {
+               16u,
+               16u,
+               16u,
+               16u,
+               0u,
+               0u,
+               0u,
+               0u
+               },
+
+               /**
+                * \brief To Configure the Default Burst Size (DBS) of TCs.
+                * An optimally-sized command is defined by the transfer controller
+                * default burst size (DBS). Different TCs can have different
+                * DBS values. It is defined in Bytes.
+                */
+               {
+               8u,
+               8u,
+               8u,
+               8u,
+               0u,
+               0u,
+               0u,
+               0u
+               },
+
+               /**
+                * \brief Mapping from each DMA channel to a Parameter RAM set,
+                * if it exists, otherwise of no use.
+                */
+               {
+               0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u,
+               8u, 9u, 10u, 11u, 12u, 13u, 14u, 15u,
+               16u, 17u, 18u, 19u, 20u, 21u, 22u, 23u,
+               24u, 25u, 26u, 27u, 28u, 29u, 30u, 31u,
+               32u, 33u, 34u, 35u, 36u, 37u, 38u, 39u,
+               40u, 41u, 42u, 43u, 44u, 45u, 46u, 47u,
+               48u, 49u, 50u, 51u, 52u, 53u, 54u, 55u,
+               56u, 57u, 58u, 59u, 60u, 61u, 62u, 63u
+               },
+
+                /**
+                 * \brief Mapping from each DMA channel to a TCC. This specific
+                 * TCC code will be returned when the transfer is completed
+                 * on the mapped channel.
+                 */
+               {
+               0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u,
+               8u, 9u, 10u, 11u, 12u, 13u, EDMA3_RM_CH_NO_TCC_MAP, EDMA3_RM_CH_NO_TCC_MAP,
+               16u, 17u, 18u, 19u, 20u, 21u, 22u, 23u,
+               24u, 25u, 26u, 27u, 28u, 29u, EDMA3_RM_CH_NO_TCC_MAP, EDMA3_RM_CH_NO_TCC_MAP,
+               32u, 33u, 34u, 35u, 36u, 37u, 38u, 39u,
+               40u, 41u, 42u, 43u, 44u, 45u, EDMA3_RM_CH_NO_TCC_MAP, EDMA3_RM_CH_NO_TCC_MAP,
+               48u, 49u, 50u, 51u, 52u, 53u, 54u, 55u,
+               56u, 57u, 58u, 59u, 60u, 61u, EDMA3_RM_CH_NO_TCC_MAP, EDMA3_RM_CH_NO_TCC_MAP
+               },
+
+               /**
+                * \brief Mapping of DMA channels to Hardware Events from
+                * various peripherals, which use EDMA for data transfer.
+                * All channels need not be mapped, some can be free also.
+                */
+               {
+               0x3FFF3FFFu,
+               0x3FFF3FFFu
+               }
+               },
+       };
+
+EDMA3_DRV_InstanceInitConfig sampleInstInitConfig[NUM_EDMA3_INSTANCES][EDMA3_MAX_REGIONS] =
+       {
+               /* EDMA3 INSTANCE# 0 */
+               {
+                       /* Resources owned/reserved by region 0 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0xFFFF000Fu, 0x00000FFFu, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x0000000Fu, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000003u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x0000000Fu, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000003u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                               /* resvdDmaChannels */
+                               /* 31           0 */
+                               {0x00000003u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31           0 */
+                               {0x00000003u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 1 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x000000F0u, 0xFFFFF000u, 0x000000FFu, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x000000F0u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x0000000Cu},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x000000F0u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000030u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000030u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000030u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 2 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000F00u, 0x00000000u, 0xFFFFFF00u, 0x0000000Fu,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000F00u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000030u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000F00u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000300u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000300u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000300u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 3 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x0000F000u, 0x00000000u, 0x00000000u, 0xFFFFFFF0u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x0000F000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x000000C0u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x0000F000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00003000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00003000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00003000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 4 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x0000F000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 5 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x0000F000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 6 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x0000F000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 7 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x0000F000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+           },
+
+               /* EDMA3 INSTANCE# 1 */
+           {
+               /* Resources owned/reserved by region 0 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x0000FFFFu, 0x00000000u, 0xFFFFFFFFu, 0xFFFFFFFFu,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0xFFFFFFFFu, 0x0000FFFFu, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x0000FFFFu, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000003u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x0000FFFFu, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00003FFFu, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00003FFFu, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00003FFFu, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 1 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0xFFFF0000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0xFFFF0000u, 0xFFFFFFFFu, 0xFFFFFFFFu,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0xFFFFFFFFu, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0xFFFF0000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x0000000Cu},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0xFFFF0000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x3FFF0000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x3FFF0000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x3FFF0000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 2 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x0000FFFFu, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0xFFFFFFFFu, 0xFFFFFFFFu, 0xFFFFFFFFu,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x0000FFFFu, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x0000FFFFu},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000030u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x0000FFFFu},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00003FFFu, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00003FFFu},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00003FFFu},
+                       },
+
+               /* Resources owned/reserved by region 3 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0xFFFF0000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0xFFFF0000u, 0xFFFFFFFFu, 0xFFFFFFFFu, 0xFFFFFFFFu,},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0xFFFF0000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x000000C0u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0xFFFF0000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x3FFF0000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x3FFF0000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x3FFF0000u},
+                       },
+
+               /* Resources owned/reserved by region 4 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 5 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 6 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 7 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+           },
+
+               /* EDMA3 INSTANCE# 2 */
+               {
+               /* Resources owned/reserved by region 0 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x0000FFFFu, 0x00000000u, 0xFFFFFFFFu, 0xFFFFFFFFu,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0xFFFFFFFFu, 0x0000FFFFu, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x0000FFFFu, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000003u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x0000FFFFu, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00003FFFu, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00003FFFu, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00003FFFu, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 1 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0xFFFF0000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0xFFFF0000u, 0xFFFFFFFFu, 0xFFFFFFFFu,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0xFFFFFFFFu, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0xFFFF0000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x0000000Cu},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0xFFFF0000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x3FFF0000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x3FFF0000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x3FFF0000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 2 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x0000FFFFu, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0xFFFFFFFFu, 0xFFFFFFFFu, 0xFFFFFFFFu,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x0000FFFFu, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x0000FFFFu},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000030u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x0000FFFFu},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00003FFFu, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00003FFFu},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00003FFFu},
+                       },
+
+               /* Resources owned/reserved by region 3 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0xFFFF0000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0xFFFF0000u, 0xFFFFFFFFu, 0xFFFFFFFFu, 0xFFFFFFFFu,},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0xFFFF0000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x000000C0u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0xFFFF0000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x3FFF0000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x3FFF0000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x3FFF0000u},
+                       },
+
+               /* Resources owned/reserved by region 4 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x0000F000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 5 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x0000F000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 6 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x0000F000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+
+               /* Resources owned/reserved by region 7 */
+                       {
+                               /* ownPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x0000F000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* ownDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* ownQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* ownTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdPaRAMSets */
+                               /* 31     0     63    32     95    64     127   96 */
+                               {0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 159  128     191  160     223  192     255  224 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 287  256     319  288     351  320     383  352 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
+                               /* 415  384     447  416     479  448     511  480 */
+                                0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
+
+                               /* resvdDmaChannels */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+
+                               /* resvdQdmaChannels */
+                               /* 31     0 */
+                               {0x00000000u},
+
+                               /* resvdTccs */
+                               /* 31     0     63    32 */
+                               {0x00000000u, 0x00000000u},
+                       },
+           },
+       };
+
+/* End of File */
diff --git a/packages/ti/sdo/edma3/drv/sample/src/platforms/sample_tci6498_int_reg.c b/packages/ti/sdo/edma3/drv/sample/src/platforms/sample_tci6498_int_reg.c
new file mode 100644 (file)
index 0000000..7093697
--- /dev/null
@@ -0,0 +1,257 @@
+/*
+ * bios6_int_register_tci_6498.c
+ *
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+#include <ti/sysbios/ipc/Semaphore.h>
+#include <ti/sysbios/family/c64p/EventCombiner.h>
+#include <ti/sysbios/family/c64p/Hwi.h>
+
+#include <ti/sdo/edma3/drv/sample/bios6_edma3_drv_sample.h>
+
+#include <stdio.h>
+#include <csl_intc.h>
+#include <csl_cpIntcAux.h>
+
+/** CSL handles for interrupt registration */
+CSL_CPINTC_Handle hnd = NULL;
+
+void cpintc0_isr(UArg arg0);
+
+extern unsigned int ccXferCompInt[][EDMA3_MAX_REGIONS];
+extern unsigned int ccErrorInt[];
+extern unsigned int tcErrorInt[][EDMA3_MAX_TC];
+extern unsigned int numEdma3Tc[];
+
+unsigned int cp_intc0_channel_mapping[3] = {3,4,5};
+unsigned int gem_event_id[3] = {59,60,61};
+unsigned int hwiInterrupt = 8;
+
+/* gem_event_to_intc0_event_map[EDMA3 #][DSP #] */
+unsigned int gem_event_to_intc0_event_map[3][4] = {
+                                                                                       {3, 19, 35, 51},
+                                                                                       {4, 20, 36, 52},
+                                                                                       {5, 21, 37, 53},
+                                                                                       };
+
+extern unsigned int dsp_num;
+
+void init_cp_intc (unsigned int edma3Id)
+       {
+       unsigned int numTc = 0;
+
+       /* Open the handle to the CPINT Instance */
+       if (hnd == 0)
+               {       
+               hnd = CSL_CPINTC_open(0);
+               if (hnd == 0)
+                       {
+                       printf ("Error: Unable to open CPINTC-0\n");
+                       return;
+                       }
+               }
+
+       /* Disable all host interrupts. */
+       CSL_CPINTC_disableAllHostInterrupt(hnd);
+
+       /* Configure no nesting support in the CPINTC Module. */
+       CSL_CPINTC_setNestingMode (hnd, CPINTC_NO_NESTING);
+
+       /* We now map CP_INTC Channel to Host Interrupt */
+       CSL_CPINTC_mapChannelToHostInterrupt (hnd, 
+                                                                       cp_intc0_channel_mapping[edma3Id],
+                                                                       gem_event_to_intc0_event_map[edma3Id][dsp_num]);
+
+       /* We now map System Interrupt ccXferCompInt to CP_INTC channel */
+       CSL_CPINTC_mapSystemIntrToChannel (hnd, 
+                                                                       ccXferCompInt[edma3Id][dsp_num], 
+                                                                       cp_intc0_channel_mapping[edma3Id]);
+
+       /* We now enable system interrupt ccXferCompInt  */
+       CSL_CPINTC_enableSysInterrupt (hnd, ccXferCompInt[edma3Id][dsp_num]);
+
+       /* We now map System Interrupt ccErrorInt to CP_INTC channel */
+       CSL_CPINTC_mapSystemIntrToChannel (hnd,ccErrorInt[edma3Id],
+                                                                               cp_intc0_channel_mapping[edma3Id]);
+
+       /* We now enable system interrupt ccErrorInt */
+       CSL_CPINTC_enableSysInterrupt (hnd, ccErrorInt[edma3Id]);
+
+       /* Enable the TC Error Event Interrupt, according to the number of TCs. */
+       while (numTc < numEdma3Tc[edma3Id])
+               {
+               /* We now map System Interrupt tcErrorInt to CP_INTC channel */
+               CSL_CPINTC_mapSystemIntrToChannel (hnd, 
+                                                                               tcErrorInt[edma3Id][numTc], 
+                                                                               cp_intc0_channel_mapping[edma3Id]);
+
+               /* We now enable system interrupt tcErrorInt */
+               CSL_CPINTC_enableSysInterrupt (hnd, tcErrorInt[edma3Id][numTc]);
+
+               numTc++;
+               }
+
+       /* We enable host interrupts. */
+       CSL_CPINTC_enableHostInterrupt (hnd, 
+                                                               gem_event_to_intc0_event_map[edma3Id][dsp_num]);
+
+       /* Enable all host interrupts also. */
+       CSL_CPINTC_enableAllHostInterrupt(hnd);
+       }
+
+void deinit_cp_intc (unsigned int edma3Id)
+       {
+       unsigned int numTc = 0;
+
+       /* Disable all host interrupts. */
+       CSL_CPINTC_disableAllHostInterrupt(hnd);
+
+       /* Disable system interrupt ccXferCompInt  */
+       CSL_CPINTC_disableSysInterrupt (hnd, ccXferCompInt[edma3Id][dsp_num]);
+
+       /* Disable system interrupt ccErrorInt */
+       CSL_CPINTC_disableSysInterrupt (hnd, ccErrorInt[edma3Id]);
+
+       /* Enable the TC Error Event Interrupt, according to the number of TCs. */
+       while (numTc < numEdma3Tc[edma3Id])
+               {
+               /* Disable system interrupt tcErrorInt */
+               CSL_CPINTC_disableSysInterrupt (hnd, tcErrorInt[edma3Id][numTc]);
+
+               numTc++;
+               }
+
+       /* Disable host interrupt */
+       CSL_CPINTC_disableHostInterrupt (hnd, 
+                                                               gem_event_to_intc0_event_map[edma3Id][dsp_num]);
+
+       /* Enable all host interrupts  */
+       CSL_CPINTC_enableAllHostInterrupt(hnd);
+       }
+
+void cpintc0_isr(UArg arg0)
+       {
+    CSL_CPINTCSystemInterrupt sysIntr;
+       unsigned int edma3Id = (unsigned int)arg0;
+
+    /* We enable host interrupts. */
+    CSL_CPINTC_disableHostInterrupt (hnd, gem_event_to_intc0_event_map[edma3Id][dsp_num]);
+
+    if (CSL_CPINTC_isInterruptPending(hnd) == TRUE)
+       {
+        /* Step 1: Get the Source of the interrupt */
+        sysIntr = CSL_CPINTC_getPendingInterrupt(hnd);
+
+        /* Step 2: Clear the status of the interrupt. */
+        CSL_CPINTC_clearSysInterrupt(hnd, sysIntr);
+
+        /* Step 2: Call the appropriate ISR handler */
+        if ( sysIntr == ccXferCompInt[edma3Id][dsp_num] ) {
+            lisrEdma3ComplHandler0(arg0);
+        }
+        else if ( sysIntr == ccErrorInt[edma3Id] ) {
+            lisrEdma3CCErrHandler0(arg0);
+        }
+        else if ( sysIntr == tcErrorInt[edma3Id][0] ) {
+            lisrEdma3TC0ErrHandler0(arg0);
+        }
+        else if ( sysIntr == tcErrorInt[edma3Id][1] ) {
+            lisrEdma3TC1ErrHandler0(arg0);
+        }
+        else if ( sysIntr == tcErrorInt[edma3Id][2] ) {
+            lisrEdma3TC2ErrHandler0(arg0);
+        }
+        else if ( sysIntr == tcErrorInt[edma3Id][3] ) {
+            lisrEdma3TC3ErrHandler0(arg0);
+        }
+        else if ( sysIntr == tcErrorInt[edma3Id][4] ) {
+            lisrEdma3TC4ErrHandler0(arg0);
+        }
+        else if ( sysIntr == tcErrorInt[edma3Id][5] ) {
+            lisrEdma3TC5ErrHandler0(arg0);
+        }
+        else if ( sysIntr == tcErrorInt[edma3Id][6] ) {
+            lisrEdma3TC6ErrHandler0(arg0);
+        }
+        else if ( sysIntr == tcErrorInt[edma3Id][7] ) {
+            lisrEdma3TC7ErrHandler0(arg0);
+        }
+       } /* while */
+
+    /* We enable host interrupts. */
+    CSL_CPINTC_enableHostInterrupt (hnd, 
+                                                               gem_event_to_intc0_event_map[edma3Id][dsp_num]);
+       }
+
+/**  To Register the ISRs with the underlying OS, if required. */
+void registerEdma3Interrupts (unsigned int edma3Id)
+    {
+    static UInt32 cookie = 0;
+
+       /* Initialize the CP_INTC module for the EDMA3 hardware first */
+       init_cp_intc(edma3Id);
+       
+    /* Disabling the global interrupts */
+    cookie = Hwi_disable();
+
+    /* Enable the global cp_intc0 isr, which will handle all the EDMA3 interrupts */
+    EventCombiner_dispatchPlug (gem_event_id[edma3Id],
+                                                       (EventCombiner_FuncPtr)(&cpintc0_isr),
+                                edma3Id, 1);
+       EventCombiner_enableEvent(gem_event_id[edma3Id]);
+
+    Hwi_enableInterrupt(hwiInterrupt);
+
+    /* Restore interrupts */
+    Hwi_restore(cookie);
+    }
+
+/**  To Unregister the ISRs with the underlying OS, if previously registered. */
+void unregisterEdma3Interrupts (unsigned int edma3Id)
+    {
+    static UInt32 cookie = 0;
+
+    /* Disabling the global interrupts */
+    cookie = Hwi_disable();
+
+    /* Disable the global cp_intc0 isr, which will handle all the EDMA3 interrupts */
+    EventCombiner_disableEvent(gem_event_id[edma3Id]);
+
+    /* Restore interrupts */
+    Hwi_restore(cookie);
+
+       /* De-initialize the CP_INTC module too */
+       deinit_cp_intc(edma3Id);
+    }
+
similarity index 77%
rename from packages/ti/sdo/edma3/drv/sample/src/bios6_edma3_drv_sample_cs.c
rename to packages/ti/sdo/edma3/drv/sample/src/sample_cs.c
index 4646e7644bb6b8d12232eb403798ed565a6d34b1..58afaf01379da30cf7d231b8f9d53160a8ca0d3b 100644 (file)
@@ -1,44 +1,43 @@
-/*******************************************************************************
-**+--------------------------------------------------------------------------+**
-**|                            ****                                          |**
-**|                            ****                                          |**
-**|                            ******o***                                    |**
-**|                      ********_///_****                                   |**
-**|                      ***** /_//_/ ****                                   |**
-**|                       ** ** (__/ ****                                    |**
-**|                           *********                                      |**
-**|                            ****                                          |**
-**|                            ***                                           |**
-**|                                                                          |**
-**|         Copyright (c) 1998-2006 Texas Instruments Incorporated           |**
-**|                        ALL RIGHTS RESERVED                               |**
-**|                                                                          |**
-**| Permission is hereby granted to licensees of Texas Instruments           |**
-**| Incorporated (TI) products to use this computer program for the sole     |**
-**| purpose of implementing a licensee product based on TI products.         |**
-**| No other rights to reproduce, use, or disseminate this computer          |**
-**| program, whether in part or in whole, are granted.                       |**
-**|                                                                          |**
-**| TI makes no representation or warranties with respect to the             |**
-**| performance of this computer program, and specifically disclaims         |**
-**| any responsibility for any damages, special or consequential,            |**
-**| connected with the use of this program.                                  |**
-**|                                                                          |**
-**+--------------------------------------------------------------------------+**
-*******************************************************************************/
-
-/** \file   bios6_edma3_drv_sample_cs.c
-
-    \brief  Sample functions showing the implementation of Critical section
-            entry/exit routines and various semaphore related routines (all BIOS6
-            depenedent). These implementations MUST be provided by the user /
-            application, using the EDMA3 driver, for its correct functioning.
-
-    (C) Copyright 2006, Texas Instruments, Inc
-
-    \version    1.0   Anuj Aggarwal         - Created
-
- */
+/*
+ * bios6_edma3_drv_sample_cs.c
+ *
+ * Sample functions showing the implementation of critical section entry/exit
+ * routines and various semaphore related routines (all BIOS6 depenedent).
+ * These implementations MUST be provided by the user / application, using the
+ * EDMA3 driver, for its correct functioning.
+ *
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
 
 #include <ti/sysbios/family/c64p/EventCombiner.h>
 #include <ti/sysbios/hal/Cache.h>
 
 #include <ti/sdo/edma3/drv/sample/bios6_edma3_drv_sample.h>
 
+extern unsigned int ccXferCompInt[][EDMA3_MAX_REGIONS];
+extern unsigned int ccErrorInt[];
+extern unsigned int tcErrorInt[][EDMA3_MAX_TC];
+
+/**
+ * DSP instance number on which the executable is running. Its value is
+ * determined by reading the processor specific register DNUM.
+ */
+extern unsigned int dsp_num;
+
 /**
  * \brief   EDMA3 OS Protect Entry
  *
@@ -67,8 +76,9 @@
  *      for EDMA3_OS_PROTECT_INTERRUPT protection level).
  * \return  None
  */
-void edma3OsProtectEntry (int level, unsigned int *intState)
-    {
+void edma3OsProtectEntry (unsigned int edma3InstanceId, 
+                                                       int level, unsigned int *intState)
+    {    
     if (((level == EDMA3_OS_PROTECT_INTERRUPT)
         || (level == EDMA3_OS_PROTECT_INTERRUPT_TC_ERROR))
         && (intState == NULL))
@@ -86,17 +96,17 @@ void edma3OsProtectEntry (int level, unsigned int *intState)
 
             /* Disable scheduler */
             case EDMA3_OS_PROTECT_SCHEDULER :
-                               Task_disable();
+                                       Task_disable();
                 break;
 
             /* Disable EDMA3 transfer completion interrupt only */
             case EDMA3_OS_PROTECT_INTERRUPT_XFER_COMPLETION :
-                EventCombiner_disableEvent(ccXferCompInt);
+                EventCombiner_disableEvent(ccXferCompInt[edma3InstanceId][dsp_num]);
                 break;
 
             /* Disable EDMA3 CC error interrupt only */
             case EDMA3_OS_PROTECT_INTERRUPT_CC_ERROR :
-                EventCombiner_disableEvent(ccErrorInt);
+                EventCombiner_disableEvent(ccErrorInt[edma3InstanceId]);
                 break;
 
             /* Disable EDMA3 TC error interrupt only */
@@ -113,7 +123,7 @@ void edma3OsProtectEntry (int level, unsigned int *intState)
                     case 7:
                         /* Fall through... */
                         /* Disable the corresponding interrupt */
-                        EventCombiner_disableEvent(tcErrorInt[*intState]);
+                        EventCombiner_disableEvent(tcErrorInt[edma3InstanceId][*intState]);
                         break;
 
                      default:
@@ -146,7 +156,8 @@ void edma3OsProtectEntry (int level, unsigned int *intState)
  *      for EDMA3_OS_PROTECT_INTERRUPT protection level).
  * \return  None
  */
-void edma3OsProtectExit (int level, unsigned int intState)
+void edma3OsProtectExit (unsigned int edma3InstanceId,
+                        int level, unsigned int intState)
     {
     switch (level)
         {
@@ -162,12 +173,12 @@ void edma3OsProtectExit (int level, unsigned int intState)
 
         /* Enable EDMA3 transfer completion interrupt only */
         case EDMA3_OS_PROTECT_INTERRUPT_XFER_COMPLETION :
-            EventCombiner_enableEvent(ccXferCompInt);
+            EventCombiner_enableEvent(ccXferCompInt[edma3InstanceId][dsp_num]);
             break;
 
         /* Enable EDMA3 CC error interrupt only */
         case EDMA3_OS_PROTECT_INTERRUPT_CC_ERROR :
-            EventCombiner_enableEvent(ccErrorInt);
+            EventCombiner_enableEvent(ccErrorInt[edma3InstanceId]);
             break;
 
         /* Enable EDMA3 TC error interrupt only */
@@ -184,7 +195,7 @@ void edma3OsProtectExit (int level, unsigned int intState)
                 case 7:
                     /* Fall through... */
                     /* Enable the corresponding interrupt */
-                    EventCombiner_enableEvent(tcErrorInt[intState]);
+                    EventCombiner_enableEvent(tcErrorInt[edma3InstanceId][intState]);
                     break;
 
                  default:
@@ -406,6 +417,3 @@ EDMA3_DRV_Result edma3OsSemGive(EDMA3_OS_Sem_Handle hSem)
     }
 
 
-
-
-
diff --git a/packages/ti/sdo/edma3/drv/sample/src/sample_init.c b/packages/ti/sdo/edma3/drv/sample/src/sample_init.c
new file mode 100644 (file)
index 0000000..9565f9f
--- /dev/null
@@ -0,0 +1,196 @@
+/*
+ * sample_init.c
+ *
+ * Sample Initialization for the EDMA3 Driver for BIOS 6 based applications.
+ * It should be MANDATORILY done once before EDMA3 usage.
+ *
+ * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+#include <ti/sysbios/hal/Hwi.h>
+#include <ti/sysbios/ipc/Semaphore.h>
+#include <ti/sysbios/family/c64p/EventCombiner.h>
+
+#include <ti/sdo/edma3/drv/sample/bios6_edma3_drv_sample.h>
+
+/** @brief EDMA3 Driver Instance specific Semaphore handle */
+extern EDMA3_OS_Sem_Handle semHandle[];
+
+/**  To Register the ISRs with the underlying OS, if required. */
+extern void registerEdma3Interrupts (unsigned int edma3Id);
+/**  To Unregister the ISRs with the underlying OS, if previously registered. */
+extern void unregisterEdma3Interrupts (unsigned int edma3Id);
+
+/* To find out the DSP# */
+extern unsigned short determineProcId();
+
+/**
+ * To check whether the global EDMA3 configuration is required or not.
+ * It should be done ONCE by any of the masters present in the system.
+ * This function checks whether the global configuration is required by the
+ * current master or not. In case of many masters, it should be done only
+ * by one of the masters. Hence this function will return TRUE only once
+ * and FALSE for all other masters. 
+ */
+extern unsigned short isGblConfigRequired(unsigned int dspNum);
+
+/**
+ * DSP instance number on which the executable is running. Its value is
+ * determined by reading the processor specific register DNUM.
+ */
+unsigned int dsp_num;
+
+/* Number of EDMA3 controllers present in the system */
+extern const unsigned int numEdma3Instances;
+
+/* External Global Configuration Structure */
+extern EDMA3_DRV_GblConfigParams sampleEdma3GblCfgParams[];
+
+/* External Instance Specific Configuration Structure */
+extern EDMA3_DRV_InstanceInitConfig sampleInstInitConfig[][EDMA3_MAX_REGIONS];
+
+/**
+ * \brief   EDMA3 Initialization
+ *
+ * This function initializes the EDMA3 Driver and registers the
+ * interrupt handlers.
+ *
+  * \return  EDMA3_DRV_SOK if success, else error code
+ */
+EDMA3_DRV_Handle edma3init (unsigned int edma3Id, EDMA3_DRV_Result *errorCode)
+    {
+    EDMA3_DRV_Result edma3Result = EDMA3_DRV_E_INVALID_PARAM;
+    Semaphore_Params semParams;
+    EDMA3_DRV_GblConfigParams *globalConfig = NULL;
+    EDMA3_DRV_InstanceInitConfig *instanceConfig = NULL;
+       EDMA3_DRV_InitConfig initCfg;
+       EDMA3_RM_MiscParam miscParam;
+       EDMA3_DRV_Handle hEdma = NULL;
+
+       globalConfig = &sampleEdma3GblCfgParams[edma3Id];
+       instanceConfig = &sampleInstInitConfig[edma3Id][dsp_num];
+
+       if ((edma3Id >= numEdma3Instances) || (errorCode == NULL))
+               return hEdma;
+
+    /* DSP instance number */
+    dsp_num = determineProcId();
+
+       /* Configure it as master, if required */
+       miscParam.isSlave = isGblConfigRequired(dsp_num);
+       edma3Result = EDMA3_DRV_create (edma3Id, globalConfig ,
+                                                                       (void *)&miscParam);
+
+       if (edma3Result == EDMA3_DRV_SOK)
+               {
+               /**
+               * Driver Object created successfully.
+               * Create a semaphore now for driver instance.
+               */
+               Semaphore_Params_init(&semParams);
+
+               initCfg.drvSemHandle = NULL;
+               edma3Result = edma3OsSemCreate(1, &semParams, &initCfg.drvSemHandle);
+               }
+
+       if (edma3Result == EDMA3_DRV_SOK)
+               {
+               /* Save the semaphore handle for future use */
+               semHandle[edma3Id] = initCfg.drvSemHandle;
+
+               /* configuration structure for the Driver */
+               initCfg.isMaster = TRUE;
+               /* Choose shadow region according to the DSP# */
+               initCfg.regionId = (EDMA3_RM_RegionId)dsp_num;
+               /* Driver instance specific config NULL */
+               initCfg.drvInstInitConfig = instanceConfig;
+
+               initCfg.gblerrCb = NULL;
+               initCfg.gblerrData = NULL;
+
+               /* Open the Driver Instance */
+               hEdma = EDMA3_DRV_open (edma3Id, (void *) &initCfg, &edma3Result);
+               }
+
+       if(hEdma && (edma3Result == EDMA3_DRV_SOK))
+               {
+               /**
+               * Register Interrupt Handlers for various interrupts
+               * like transfer completion interrupt, CC error
+               * interrupt, TC error interrupts etc, if required.
+               */
+               registerEdma3Interrupts(edma3Id);
+               }
+
+       *errorCode = edma3Result;       
+       return hEdma;
+    }
+
+
+/**
+ * \brief   EDMA3 De-initialization
+ *
+ * This function removes the EDMA3 Driver instance and unregisters the
+ * interrupt handlers.
+ *
+  * \return  EDMA3_DRV_SOK if success, else error code
+ */
+EDMA3_DRV_Result edma3deinit (unsigned int edma3Id, EDMA3_DRV_Handle hEdma)
+    {
+    EDMA3_DRV_Result edma3Result = EDMA3_DRV_E_INVALID_PARAM;
+
+    /* Unregister Interrupt Handlers first */
+    unregisterEdma3Interrupts(edma3Id);
+
+    /* Delete the semaphore */
+    edma3Result = edma3OsSemDelete(semHandle[edma3Id]);
+
+    if (EDMA3_DRV_SOK == edma3Result )
+        {
+        /* Make the semaphore handle as NULL. */
+        semHandle[edma3Id] = NULL;
+
+        /* Now, close the EDMA3 Driver Instance */
+        edma3Result = EDMA3_DRV_close (hEdma, NULL);
+       }
+
+       if (EDMA3_DRV_SOK == edma3Result )
+        {
+        /* Now, delete the EDMA3 Driver Object */
+        edma3Result = EDMA3_DRV_delete (edma3Id, NULL);
+        }
+
+    return edma3Result;
+    }
+
+/* End of File */