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         * ======= createRMObj =======
    97         * Boolean value indicating if EDMA3 LLD RM object needs to be created by
    98         * FC or if it is going to be supplied by the driver or app etc.
    99         * TRUE by default. Should be set to FALSE in cases where the LLD is being
   100         * used, or if the app is supplying the semaphore functions for RM creation.
   101         */
   102        config bool createRMObj = true;
   103    
   104        /*!
   105         * ======== contiguousPaRams ========
   106         * Boolean value indicating if PaRams assigned to scratch groups need to be
   107         * contiguous or not
   108         */
   109        config bool contiguousPaRams = true;
   110    
   111        const UInt EDMA3_MAXGROUPS = 20;  /*! Maximum number of groups for sharing
   112                                     EDMA3 resources. */
   113        const UInt EDMA3_MAXTCS = 8;
   114    
   115        /*!
   116         * ======== globalInit ========
   117         * This flag decides if EDMA3 global registers and PaRam entries will be
   118         * initialized by this module.
   119         * 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
   120         * the ARM-side setup.
   121         *
   122         *  Note:- This is required to be supplied ONLY if application is built for
   123         *  DSP target.
   124         */
   125        config Bool globalInit = false;
   126    
   127    
   128        /*!
   129         * ======== maxTccs ========
   130         * Arrays containing the maximum number of TCCs that will be assigned to
   131         * groups for sharing.
   132         * Algorithms created within a given group ID will share the EDMA3 resources
   133         * assigned to that group
   134         *
   135         *  Note:- This is required to be supplied ONLY if application is built for
   136         *  DSP target.
   137         */
   138        config UInt maxTccs[EDMA3_MAXGROUPS];
   139    
   140        /*!
   141         * ======== maxPaRams ========
   142         * Arrays containing the maximum number of PaRams that will be assigned to
   143         * groups for sharing.
   144         * Algorithms created within a given group ID will share the EDMA3 resources
   145         * assigned to that group
   146         *
   147         *  Note:- This is required to be supplied ONLY if application is built for
   148         *  DSP target.
   149         */
   150        config UInt maxPaRams[EDMA3_MAXGROUPS];
   151    
   152        /*!
   153         * ======== maxEdmaChannels ========
   154         * Array containing the maximum number of Edma Channels that will be
   155         * assigned to groups for sharing.
   156         * Algorithms created within a given group ID will share the EDMA3 resources
   157         * assigned to that group
   158         * On devices where DCHMAP doesn't exist, it is recommended to request as
   159         * many channels as PaRams requested
   160         *
   161         *  Note:- This is required to be supplied ONLY if application is built for
   162         *  DSP target.
   163         */
   164        config UInt maxEdmaChannels[EDMA3_MAXGROUPS];
   165    
   166        /*!
   167         * ======== maxQdmaChannels ========
   168         * Array containing the maximum number of Qdma Channels that will be
   169         * assigned to groups for sharing.
   170         * Algorithms created within a given group ID will share the EDMA3 resources
   171         * assigned to that group
   172         *
   173         *  Note:- This is required to be supplied ONLY if application is built for
   174         *  DSP target.
   175         */
   176        config UInt maxQdmaChannels[EDMA3_MAXGROUPS];
   177    
   178        /*!
   179         *  ======== persistentAllocFxn ========
   180         *  Function for allocating persistent memory for RMAN's and other IRESMAN
   181         *  implementation's internal objects.
   182         *
   183         *  Note:- This is required to be supplied ONLY if
   184         *  {@link ti.sdo.fc.rman.RMAN#useDSKT2} is set to `false`.
   185         */
   186        config String persistentAllocFxn = null;
   187    
   188        /*!
   189         *  ======== persistentFreeFxn ========
   190         *  Function for freeing persistent memory used by RMAN and other IRESMAN
   191         *  implementation's internal objects.
   192         *
   193         *  Note:- This is required to be supplied ONLY if
   194         *  {@link ti.sdo.fc.rman.RMAN#useDSKT2} is set to `false`.
   195         */
   196        config String persistentFreeFxn = null;
   197    
   198        /*!
   199         *  ======== semCreateFxn ========
   200         * Function to create semaphores used by various individual resource
   201         * manager(s) registered with RMAN.
   202         *
   203         *  Function signature is:
   204         *  @p(code)
   205         * Void * _semCreate(Int key, Int count);
   206         */
   207        config String semCreateFxn = null;
   208    
   209        /*!
   210         *  ======== semDeleteFxn ========
   211         * Function to delete semaphores used by various individual resource
   212         * manager(s) registered with RMAN.
   213         *
   214         *  Function signature is:
   215         *  @p(code)
   216         *  Void _semDelete(Void * sem);
   217         */
   218        config String semDeleteFxn = null;
   219    
   220        /*!
   221         *  ======== semPendFxn ========
   222         * Function to pend on semaphores used by various resource manager(s)
   223         * registered with RMAN.
   224         *
   225         *  Function signature is:
   226         *  @p(code)
   227         *  Int _semPend(Void * sem, UInt32 timeout);
   228         */
   229        config String semPendFxn = null;
   230    
   231        /*!
   232         *  ======== semPostFxn ========
   233         * Function to post on Semaphores used by various resource manager(s)
   234         * registered with RMAN.
   235         *
   236         *  Function signature is:
   237         *  @p(code)
   238         * Void _semPost(Void * sem);
   239         */
   240        config String semPostFxn = null;
   241    
   242        /*!
   243         * ======== maxAlgs ========
   244         * Maximum number of algorithm instances that will be created
   245         */
   246        config UInt maxAlgs = 32;
   247    
   248        /*!
   249         * ========= maxRequests ======
   250         * Maximum number of "active" resource requests that will be
   251         * made by the algorithms in each scratch group
   252         */
   253        config UInt maxRequests = 64;
   254    
   255        /*!
   256         * ======= intMemoryQ =======
   257         * Configuration to setup Queue # to be used to internal memory writes,
   258         * Multiple Queues can be configured for same type of memory writes to allow
   259         * load balancing for performance.
   260         * This is required to be supplied ONLY if application is built for DSP
   261         * target .
   262         */
   263        config UInt intMemoryQ0;
   264        config UInt intMemoryQ1;
   265        config UInt intMemoryQ2;
   266    
   267        /*!
   268         * ======= extMemoryQ =======
   269         * Configuration to setup Queue # to be used to external memory writes
   270         * Multiple Queues can be configured for same type of memory writes to allow
   271         * load balancing for performance.
   272         * This is required to be supplied ONLY if application is built for DSP
   273         * target .
   274         */
   275        config UInt extMemoryQ0;
   276        config UInt extMemoryQ1;
   277        config UInt extMemoryQ2;
   278    
   279        /*
   280         * ======= otherQ =======
   281         * Configuration to setup Queue # for "Other", possibly peripheral, writes.
   282         * Multiple Queues can be configured for same type of memory writes to allow
   283         * load balancing for performance.
   284         * This is required to be supplied ONLY if application is built for DSP
   285         * target .
   286         */
   287        config UInt otherQ0;
   288        config UInt otherQ1;
   289    
   290        /*!
   291         * ======== eventQueueSetup ========
   292         * This flag decides if EDMA3 global registers related to Transfer
   293         * Controller/Queues should be programmed.
   294         * If using on a device where ARM-side drivers might perform the
   295         * intialization, set this to false so it doesn't overwrite the ARM-side
   296         * setup.
   297         * This is required to be supplied ONLY if application is built for
   298         * DSP target.
   299         */
   300        config Bool eventQueueSetup = false;
   301    
   302        /*!
   303         * ======= defaultQ =======
   304         * Default queue assignment for all channels allocated for this app. When
   305         * channels are first granted to the algorithm, they will be mapped to this
   306         * Event Queue.
   307         */
   308        config UInt defaultQ = 0;
   309    
   310        /*
   311         * ======= queueTCMap =======
   312         * Maps Event queues to TCs. Default mapping is from Queue #n to TC #n
   313         * If modifying this, please ensure that queue setup for different types
   314         * of writes has been adjusted accordingly.
   315         * By default Queue # N gets mapped to TC # N
   316         * If certain queue mappings are not to be overridden, set those entries in
   317         * array to -1.
   318         */
   319        config Int queueTCMap[EDMA3_MAXTCS];
   320    
   321        /*
   322         * ======= queuePriority =======
   323         * Assigns priority to different queues. This priority has an effect during
   324         * arbitration of transfers within the SCR.
   325         * For consistency, program the higher priority queues (lower #) with a
   326         * higher priority (lower #).
   327         * Note:- The higher priority queues (lower #) also get serviced first by
   328         * the transfer controller.
   329         * By default, Queue # N, has priority# N.
   330         * If certain queue priorities are not to be overridden, set entries in
   331         * array to -1.
   332         */
   333        config Int queuePriority[EDMA3_MAXTCS];
   334    
   335        /*!
   336         *  ======== ipcKeyBase ========
   337         *  Linux only. Base value of keys of Linux IPC objects used by
   338         *  EDMA3. The IPC objects created by EDMA3 will use keys starting
   339         *  at this
   340         *  value, and incrementing with each new object. There are currently
   341         *  three IPC objects, so keys in the range of ipcKeyBase to ipcKeyBase + 2
   342         *  will be reserved for EDMA3. The default value of ipcKeyBase is
   343         *  ascii code for "3AMD".
   344         *
   345         *  WARNING: This value should only be changed if it conflicts with
   346         *  another IPC key in the system that cannot be changed. If this value
   347         *  is changed, all programs using EDMA3 that will be run simultaneously
   348         *  must have the ipcKeyBase configured to the new value.
   349         *  @_nodoc
   350         */
   351        config UInt ipcKeyBase = 0x33414D44;
   352    }