1    /* --COPYRIGHT--,EPL
     2     *  Copyright (c) 2008 Texas Instruments and others.
     3     *  All rights reserved. This program and the accompanying materials
     4     *  are made available under the terms of the Eclipse Public License v1.0
     5     *  which accompanies this distribution, and is available at
     6     *  http://www.eclipse.org/legal/epl-v10.html
     7     * 
     8     *  Contributors:
     9     *      Texas Instruments - initial implementation
    10     * 
    11     * --/COPYRIGHT--*/
    12    /*
    13     *  ======== Boot.xdc ========
    14     */
    15    
    16    package ti.catalog.msp430.init;
    17    
    18    import xdc.rov.ViewInfo;
    19    
    20    /*!
    21     *  ======== Boot ========
    22     *  Boot time initialization code manager
    23     *
    24     *  The Boot module supports boot initialization for the MSP430 devices.
    25     *  A special boot init function is created based on the configuration
    26     *  settings for this module.  This function is hooked into the
    27     *  `{@link xdc.runtime.Reset#fxns xdc.runtime.Reset.fxns[]}` array and
    28     *  is called very early at boot time (prior to C runtime initialization).
    29     * 
    30     *  The code to support the boot module is placed in a separate section
    31     *  named `".text:bootCodeSection"` to allow placement of this section in
    32     *  the linker .cmd file if necessary. This section is a subsection of the
    33     *  `".text"` section so this code will be placed into the .text section
    34     *  unless explicitly placed, either through
    35     *  `{@link xdc.cfg.Program#sectMap Program.sectMap}` or through a linker
    36     *  command file.
    37     */
    38    @Template("./Boot.xdt")
    39    metaonly module Boot
    40    {
    41        metaonly struct ModuleView {
    42            Bool         disableWatchdog;
    43            UInt         watchdogAddress;
    44            Bool         configureDCO;
    45            Bool         useLFXT;
    46        }
    47    
    48        @Facet
    49        metaonly config ViewInfo.Instance rovViewInfo = 
    50            ViewInfo.create({
    51                viewMap: [
    52                [
    53                    'Module',
    54                    {
    55                        type: ViewInfo.MODULE,
    56                        viewInitFxn: 'viewInitModule',
    57                        structName: 'ModuleView'
    58                    }
    59                ],
    60                ]
    61            });
    62        
    63        /*! 
    64         *  ======== disableWatchdog ========
    65         *  Watchdog disable flag
    66         *
    67         *  The default is `true`.  Set to `false` to not automatically disable the
    68         *  watchdog timer.
    69         */
    70        config Bool disableWatchdog = true;
    71    
    72        /*! 
    73         *  ======== watchdogAddress ========
    74         *  Watchdog control register address
    75         *
    76         *  The default (0x15c) is set for MSP430F54xx and MSP430F552x devices.
    77         *  Change for other devices.
    78         */
    79        config UInt watchdogAddress = 0x15c;
    80    
    81        /*! 
    82         *  ======== configureDCO ========
    83         *  Configure DCO flag
    84         *
    85         *  The default is `false`.  Set to `true` to initialize the DCO at boot.
    86         *
    87         */
    88        config Bool configureDCO = false;
    89    
    90        /*! 
    91         *  ======== useLFXT ========
    92         *  Use a low frequency crystal (LFXT) reference
    93         *
    94         *  The default is `false`.  Set to `true` to indicate a 32768Hz low 
    95         *  frequency crystal is present, and available for configuring the clock
    96         *  system. 
    97         *
    98         *  This configuration parameter is utilized for only a subset of MSP430
    99         *  device types, and only when `configureDCO` is set to `true`. 
   100         *
   101         *  For FR58xx/FR59xx devices: if `useLFXT` is set to `true`, an LFXT
   102         *  will be used as reference, for generating more accurate clock 
   103         *  frequencies.  Othewise, and by default, MODOSC will be used as 
   104         *  reference.
   105         *
   106         *  For all other MSP430 device types: at present, the `useLFXT` parameter 
   107         *  will be ignored, and an internal reference will be used instead.
   108         */
   109        config Bool useLFXT = false;
   110    };