1    /*
     2     * Copyright (c) 2016, 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     *  ======== Boot.xdc ========
    35     *
    36     */
    37    
    38    package ti.catalog.c2800.concertoInit;
    39    
    40    /*!
    41     *  ======== Boot ========
    42     *  Concerto C28 Boot Support.
    43     *
    44     *  This Boot module can be used to generate a small section that supports
    45     *  booting the C28 processor from Flash.  It consists of a single
    46     *  "LB _c_int00" instruction.
    47     *
    48     *  When `{@link #bootFromFlash}` is true, the instruction will be placed
    49     *  at "BEGIN", as defined in the linker command file.
    50     *
    51     *  Boot also supports initializing Flash controller wait states, enabling
    52     *  program prefetches, and data caching within the Flash controller.
    53     */
    54    @Template("./Boot.xdt")
    55    @NoRuntime
    56    module Boot
    57    {
    58        /*!
    59         *  Boot from Flash flag.  Default is true.
    60         *
    61         *  Set to true to enable booting the C28 from Flash.
    62         */
    63        metaonly config Bool bootFromFlash = true;
    64    
    65        /*!
    66         *  Flash controller configuration flag, default is true.
    67         *
    68         *  Set to true to enable the configuration of the Flash controller
    69         *  wait states, program and data cache.
    70         */
    71        metaonly config Bool configureFlashController = true;
    72    
    73        /*!
    74         *  Flash controller wait states configuration flag, default is true.
    75         *
    76         *  Set to true to configure the Flash controller wait states.  The number
    77         *  of wait states is computed based upon the CPU frequency.
    78         */
    79        metaonly config Bool configureFlashWaitStates = true;
    80    
    81        /*!
    82         *  Flash controller program prefetch enable flag, default is false.
    83         *
    84         *  Set to true to enable the Flash controller's program prefetch.
    85         *
    86         *  WARNING: Program prefetch must not be enabled on pre Revision A devices
    87         *  if there are any fast branch instructions in the program image.  See
    88         *  the device errata for more information.
    89         */
    90        metaonly config Bool enableFlashProgramPrefetch = false;
    91    
    92        /*!
    93         *  Flash controller data cache enable flag, default is true.
    94         *
    95         *  Set to true to enable the Flash controller's data cache.
    96         */
    97        metaonly config Bool enableFlashDataCache = true;
    98    
    99        /*!
   100         *  ======== loadSegment ========
   101         *  Specifies where to load the flash function (include the 'PAGE' number)
   102         *
   103         *  If 'configureFlashWaitStates' is true, then this parameter
   104         *  determines where the ".ti_catalog_c2800_initF2837x_flashfuncs"
   105         *  section gets loaded.
   106         */
   107        metaonly config String loadSegment;
   108    
   109        /*!
   110         *  ======== runSegment ========
   111         *  Specifies where to run the flash function (include the 'PAGE' number)
   112         *
   113         *  If 'configureFlashWaitStates' is true then this parameter
   114         *  determines where the ".ti_catalog_c2800_initF2837x_flashfuncs"
   115         *  section gets executed at runtime.
   116         */
   117        metaonly config String runSegment;
   118    
   119    internal:
   120    
   121        /* The computed Flash wait states */
   122        metaonly config UInt flashWaitStates = 3;
   123    };