1    /* 
     2     * Copyright (c) 2012, Texas Instruments Incorporated
     3     * All rights reserved.
     4     *
     5     * Redistribution and use in source and binary forms, with or without
     6     * modification, are permitted provided that the following conditions
     7     * are met:
     8     *
     9     * *  Redistributions of source code must retain the above copyright
    10     *    notice, this list of conditions and the following disclaimer.
    11     *
    12     * *  Redistributions in binary form must reproduce the above copyright
    13     *    notice, this list of conditions and the following disclaimer in the
    14     *    documentation and/or other materials provided with the distribution.
    15     *
    16     * *  Neither the name of Texas Instruments Incorporated nor the names of
    17     *    its contributors may be used to endorse or promote products derived
    18     *    from this software without specific prior written permission.
    19     *
    20     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    21     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    22     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    23     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    24     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    25     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    26     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    27     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    28     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    29     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    30     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    31     * 
    32     */
    33    
    34    /*
    35     * ======== Settings.xdc ========
    36     * Configuration for the EDMA3 module to be able to create handles to the
    37     * resource handles for various scratch groups.
    38     */
    39    
    40    
    41    @Template("./Settings.xdt")
    42    
    43    metaonly module Settings {
    44    
    45        /*! 
    46         * ======== controllerId =======
    47         * Id of the EDMA3 instance that will be used to request resources from.
    48         * If this platform is natively supported by this module and the default
    49         * configurations are being used, this Id is used to determine, which EDMA3
    50         * instance to request resources from. 
    51         */
    52        config UInt controllerId = 0; 
    53    
    54        /*!
    55         * ======== region ========
    56         * Id of the EDMA3 Region we will program with the assigned Resources etc.
    57         * If this platform is natively supported by this module and the default
    58         * configurations are being used, region number is used to determine, 
    59         * which region of the EDMA3 configuration to request resources from. 
    60         * On most heterogenous devices: 
    61         * Region number 1 usually corresponds to DSP.
    62         * Region number 0 usually corresponds to ARM. 
    63         * On most multicore devices:
    64         * Region number n corresponds to Core number n. 
    65         */
    66        config UInt region = 1;
    67    
    68        /*!
    69         * ======== globalConfig ========
    70         * If a platform is not natively supported by this module or if the default 
    71         * number of EDMA3 hardware resources is to be overriden for some reason, 
    72         * this configuration is required to set the SOC specific details of EDMA3 
    73         * Set this parameter to the name of a structure of type 
    74         * EDMA3_GblConfigParams (defined in edma3_config.h). 
    75         * far EDMA3_GblConfigParams _globalConfig;
    76         * 
    77         *  Note:- This is required to be supplied ONLY if application is built for      *  DSP target.
    78         */
    79        config String globalConfig = null;
    80    
    81        /*!
    82         * ======== regionConfig ========
    83         * If a platform is not natively supported by this module or if the default 
    84         * number of resources available to a particular region are to be overriden,
    85         * region specific configuration can be specified directly via this 
    86         * parameter. 
    87         * Set this parameter to the name of a structure of type 
    88         * EDMA3_InstanceInitConfg (defined in edma3_config.h).
    89         * far EDMA3_InstanceInitConfg _regionConfig;
    90         *
    91         *  Note:- This is required to be supplied ONLY if application is built for      *  DSP target.
    92         */
    93        config String regionConfig = null;
    94    
    95        /*!
    96         * ======== contiguousPaRams ========
    97         * Boolean value indicating if PaRams assigned to scratch groups need to be
    98         * contiguous or not
    99         */
   100        config bool contiguousPaRams = true;
   101    
   102        const UInt EDMA3_MAXGROUPS = 20;  /*! Maximum number of groups for sharing
   103                                     EDMA3 resources. */
   104        const UInt EDMA3_MAXTCS = 8;
   105    
   106        /*!
   107         * ======== globalInit ========
   108         * This flag decides if EDMA3 global registers and PaRam entries will be 
   109         * initialized by this module. 
   110         * If building this app for a system where ARM-side (or other) drivers might     * perform EDMA3 intialization, set this to false so it doesn't overwrite 
   111         * the ARM-side setup.
   112         *
   113         *  Note:- This is required to be supplied ONLY if application is built for
   114         *  DSP target.
   115         */
   116        config Bool globalInit = false;
   117    
   118     
   119        /*!
   120         * ======== maxTccs ========
   121         * Arrays containing the maximum number of TCCs that will be assigned to
   122         * groups for sharing.
   123         * Algorithms created within a given group ID will share the EDMA3 resources
   124         * assigned to that group
   125         *
   126         *  Note:- This is required to be supplied ONLY if application is built for
   127         *  DSP target.
   128         */
   129        config UInt maxTccs[EDMA3_MAXGROUPS];
   130    
   131        /*!
   132         * ======== maxPaRams ========
   133         * Arrays containing the maximum number of PaRams that will be assigned to
   134         * groups for sharing.
   135         * Algorithms created within a given group ID will share the EDMA3 resources
   136         * assigned to that group
   137         *
   138         *  Note:- This is required to be supplied ONLY if application is built for
   139         *  DSP target.
   140         */
   141        config UInt maxPaRams[EDMA3_MAXGROUPS];
   142    
   143        /*!
   144         * ======== maxEdmaChannels ========
   145         * Array containing the maximum number of Edma Channels that will be
   146         * assigned to groups for sharing.
   147         * Algorithms created within a given group ID will share the EDMA3 resources
   148         * assigned to that group
   149         * On devices where DCHMAP doesn't exist, it is recommended to request as
   150         * many channels as PaRams requested
   151         *
   152         *  Note:- This is required to be supplied ONLY if application is built for 
   153         *  DSP target.
   154         */
   155        config UInt maxEdmaChannels[EDMA3_MAXGROUPS];
   156    
   157        /*!
   158         * ======== maxQdmaChannels ========
   159         * Array containing the maximum number of Qdma Channels that will be
   160         * assigned to groups for sharing.
   161         * Algorithms created within a given group ID will share the EDMA3 resources
   162         * assigned to that group
   163         *
   164         *  Note:- This is required to be supplied ONLY if application is built for
   165         *  DSP target.
   166         */
   167        config UInt maxQdmaChannels[EDMA3_MAXGROUPS];
   168    
   169        /*!
   170         *  ======== persistentAllocFxn ========
   171         *  Function for allocating persistent memory for RMAN's and other IRESMAN
   172         *  implementation's internal objects.
   173         *
   174         *  Note:- This is required to be supplied ONLY if
   175         *  {@link ti.sdo.fc.rman.RMAN#useDSKT2} is set to `false`.
   176         */
   177        config String persistentAllocFxn = null;
   178     
   179        /*!
   180         *  ======== persistentFreeFxn ========
   181         *  Function for freeing persistent memory used by RMAN and other IRESMAN
   182         *  implementation's internal objects.
   183         *
   184         *  Note:- This is required to be supplied ONLY if
   185         *  {@link ti.sdo.fc.rman.RMAN#useDSKT2} is set to `false`.
   186         */
   187        config String persistentFreeFxn = null;
   188     
   189        /*!
   190         *  ======== semCreateFxn ========
   191         * Function to create semaphores used by various individual resource
   192         * manager(s) registered with RMAN.
   193         *
   194         *  Function signature is:
   195         *  @p(code)
   196         * Void * _semCreate(Int key, Int count);
   197         */
   198        config String semCreateFxn = null;
   199     
   200        /*!
   201         *  ======== semDeleteFxn ========
   202         * Function to delete semaphores used by various individual resource
   203         * manager(s) registered with RMAN.
   204         *
   205         *  Function signature is:
   206         *  @p(code)
   207         *  Void _semDelete(Void * sem);
   208         */
   209        config String semDeleteFxn = null;
   210      
   211        /*!
   212         *  ======== semPendFxn ========
   213         * Function to pend on semaphores used by various resource manager(s)
   214         * registered with RMAN.
   215         *
   216         *  Function signature is:
   217         *  @p(code)
   218         *  Int _semPend(Void * sem, UInt32 timeout);
   219         */
   220        config String semPendFxn = null;
   221     
   222        /*!
   223         *  ======== semPostFxn ========
   224         * Function to post on Semaphores used by various resource manager(s)
   225         * registered with RMAN.
   226         *
   227         *  Function signature is:
   228         *  @p(code)
   229         * Void _semPost(Void * sem);
   230         */
   231        config String semPostFxn = null;
   232    
   233        /*!
   234         * ======== maxAlgs ========
   235         * Maximum number of algorithm instances that will be created  
   236         */
   237        config UInt maxAlgs = 32;
   238    
   239        /*!
   240         * ========= maxRequests ======
   241         * Maximum number of "active" resource requests that will be 
   242         * made by the algorithms in each scratch group
   243         */  
   244        config UInt maxRequests = 64;
   245    
   246        /*!
   247         * ======= intMemoryQ =======
   248         * Configuration to setup Queue # to be used to internal memory writes, 
   249         * Multiple Queues can be configured for same type of memory writes to allow
   250         * load balancing for performance.
   251         * This is required to be supplied ONLY if application is built for DSP 
   252         * target .
   253         */
   254        config UInt intMemoryQ0; 
   255        config UInt intMemoryQ1; 
   256        config UInt intMemoryQ2; 
   257    
   258        /*!
   259         * ======= extMemoryQ =======
   260         * Configuration to setup Queue # to be used to external memory writes
   261         * Multiple Queues can be configured for same type of memory writes to allow
   262         * load balancing for performance.
   263         * This is required to be supplied ONLY if application is built for DSP 
   264         * target .
   265         */
   266        config UInt extMemoryQ0; 
   267        config UInt extMemoryQ1; 
   268        config UInt extMemoryQ2; 
   269    
   270        /*
   271         * ======= otherQ ======= 
   272         * Configuration to setup Queue # for "Other", possibly peripheral, writes. 
   273         * Multiple Queues can be configured for same type of memory writes to allow
   274         * load balancing for performance.
   275         * This is required to be supplied ONLY if application is built for DSP 
   276         * target .
   277         */
   278        config UInt otherQ0; 
   279        config UInt otherQ1; 
   280    
   281        /*!
   282         * ======== eventQueueSetup ========
   283         * This flag decides if EDMA3 global registers related to Transfer 
   284         * Controller/Queues should be programmed.  
   285         * If using on a device where ARM-side drivers might perform the 
   286         * intialization, set this to false so it doesn't overwrite the ARM-side
   287         * setup.
   288         * This is required to be supplied ONLY if application is built for 
   289         * DSP target.
   290         */
   291        config Bool eventQueueSetup = false;
   292    
   293        /*!
   294         * ======= defaultQ =======
   295         * Default queue assignment for all channels allocated for this app. When
   296         * channels are first granted to the algorithm, they will be mapped to this
   297         * Event Queue. 
   298         */ 
   299        config UInt defaultQ = 0;
   300    
   301        /*
   302         * ======= queueTCMap =======
   303         * Maps Event queues to TCs. Default mapping is from Queue #n to TC #n 
   304         * If modifying this, please ensure that queue setup for different types 
   305         * of writes has been adjusted accordingly.
   306         * By default Queue # N gets mapped to TC # N 
   307         * If certain queue mappings are not to be overridden, set those entries in
   308         * array to -1.    
   309         */
   310        config Int queueTCMap[EDMA3_MAXTCS];
   311    
   312        /*
   313         * ======= queuePriority =======
   314         * Assigns priority to different queues. This priority has an effect during
   315         * arbitration of transfers within the SCR. 
   316         * For consistency, program the higher priority queues (lower #) with a 
   317         * higher priority (lower #).  
   318         * Note:- The higher priority queues (lower #) also get serviced first by 
   319         * the transfer controller. 
   320         * By default, Queue # N, has priority# N.
   321         * If certain queue priorities are not to be overridden, set entries in
   322         * array to -1.    
   323         */
   324        config Int queuePriority[EDMA3_MAXTCS];
   325    
   326        /*!
   327         *  ======== ipcKeyBase ========
   328         *  Linux only. Base value of keys of Linux IPC objects used by
   329         *  EDMA3. The IPC objects created by EDMA3 will use keys starting
   330         *  at this
   331         *  value, and incrementing with each new object. There are currently
   332         *  three IPC objects, so keys in the range of ipcKeyBase to ipcKeyBase + 2
   333         *  will be reserved for EDMA3. The default value of ipcKeyBase is
   334         *  ascii code for "3AMD".
   335         *
   336         *  WARNING: This value should only be changed if it conflicts with
   337         *  another IPC key in the system that cannot be changed. If this value
   338         *  is changed, all programs using EDMA3 that will be run simultaneously
   339         *  must have the ipcKeyBase configured to the new value.
   340         *  @_nodoc
   341         */
   342        config UInt ipcKeyBase = 0x33414D44;
   343    }
   344    /*
   345     *  @(#) ti.sdo.fc.edma3; 3, 0, 0,7; 8-14-2012 00:04:11; /db/atree/library/trees/fc/fc-r13/src/ xlibrary
   346    
   347     */
   348