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     *  ======== Platform.xdc ========
    35     *  Platform support for idkAM571X
    36     */
    37    
    38    /*!
    39     *  ======== Platform ========
    40     *  Platform support for idkAM571X
    41     *
    42     *  This module implements xdc.platform.IPlatform and defines configuration
    43     *  parameters that correspond to this platform's Cpu's, Board's, etc.
    44     *
    45     *  The configuration parameters are initialized in this package's
    46     *  configuration script (package.cfg) and "bound" to the TCOM object
    47     *  model.  Once they are part of the model, these parameters are
    48     *  queried by a program's configuration script.
    49     *
    50     *  This particular platform has 1 Cortex-A15, 2 Benelli/IPU
    51     *  Sub-system (Dual M4's) and 1 C66x DSP's.
    52     */
    53    metaonly module Platform inherits xdc.platform.IPlatform
    54    {
    55        readonly config xdc.platform.IPlatform.Board BOARD = {
    56            id:             "0",
    57            boardName:      "idkAM571X",
    58            boardFamily:    "idkAM571X",
    59            boardRevision:  null,
    60        };
    61    
    62        readonly config xdc.platform.IExeContext.Cpu DSP = {
    63            id:             "0",
    64            clockRate:      700,
    65            catalogName:    "ti.catalog.c6000",
    66            deviceName:     "DRA7XX",
    67            revision:       "1.0",
    68        };
    69    
    70        /* Benelli M4 Subsystem */
    71        readonly config xdc.platform.IExeContext.Cpu M4 = {
    72            id:             "1",
    73            clockRate:      212.8,
    74            catalogName:    "ti.catalog.arm.cortexm4",
    75            deviceName:     "DRA7XX",
    76            revision:       "1.0",
    77        };
    78    
    79        /* GPP */
    80        readonly config xdc.platform.IExeContext.Cpu GPP = {
    81            id:             "3",
    82            clockRate:      1500.0,  /* Typically set by the HLOS */
    83            catalogName:    "ti.catalog.arm.cortexa15",
    84            deviceName:     "DRA7XX",
    85            revision:       "1.0"
    86        };
    87    
    88    /*  Memory Map for ti.platforms.idkAM571X
    89     *
    90     *  Virtual     Physical        Size            Comment
    91     *  ------------------------------------------------------------------------
    92     *              8000_0000  1000_0000  ( 256 MB) External Memory
    93     *
    94     *  0000_0000 0 8000_0000        100  ( 256  B) --------
    95     *              8000_0100       FF00  ( ~64 KB) --------
    96     *  0000_0000   8001_0000        100  ( 256  B) --------
    97     *              8001_0100       FF00  ( ~64 KB) --------
    98     *  0000_0000   8002_0000        100  ( 256  B) --------
    99     *              8002_0100       FF00  ( ~64 KB) --------
   100     *  0000_0000   8003_0000        100  ( 256  B) --------
   101     *              8003_0100    FE_FF00  ( ~16 MB) --------
   102     *            1 8100_0000    40_0000  (   4 MB) --------
   103     *              8140_0000    C0_0000  (  12 MB) --------
   104     *            2 8200_0000    40_0000  (   4 MB) --------
   105     *              8240_0000    C0_0000  (  12 MB) --------
   106     *            3 8300_0000    40_0000  (   4 MB) --------
   107     *              8340_0000    C0_0000  (  12 MB) --------
   108     *            4 8400_0000    40_0000  (   4 MB) --------
   109     *              8440_0000    C0_0000  (  12 MB) --------
   110     *            5 8500_0000   100_0000  (  16 MB) --------
   111     *            6 8600_0000   100_0000  (  16 MB) --------
   112     *            7 8700_0000   100_0000  (  16 MB) --------
   113     *            8 8800_0000   100_0000  (  16 MB) --------
   114     *            9 8900_0000   100_0000  (  16 MB) --------
   115     *            A 8A00_0000    80_0000  (   8 MB) IPU1 (code, data), benelli
   116     *              8A80_0000    80_0000  (   8 MB) IPU2 (code, data), benelli
   117     *            B 8B00_0000   100_0000  (  16 MB) HOST (code, data)
   118     *            C 8C00_0000   100_0000  (  16 MB) DSP1 (code, data)
   119     *            D 8D00_0000   100_0000  (  16 MB) --------
   120     *            E 8E00_0000   100_0000  (  16 MB) SR_0 (ipc)
   121     *            F 8F00_0000   100_0000  (  16 MB) --------
   122     */
   123    
   124        readonly config Any SR_0 = {
   125            name: "SR_0", space: "data", access: "RWX",
   126            base: 0x8E000000, len: 0x1000000,
   127            comment: "SR#0 Memory (16 MB)"
   128        };
   129    
   130        readonly config Any DSP1 = {
   131            externalMemoryMap: [
   132                [ "DSP1_PROG", {
   133                    name: "DSP1_PROG", space: "code/data", access: "RWX",
   134                    base: 0x8C000000, len: 0x1000000,
   135                    comment: "DSP1 Program Memory (16 MB)"
   136                }],
   137                [ "SR_0", SR_0 ]
   138            ],
   139            codeMemory:  "DSP1_PROG",
   140            dataMemory:  "DSP1_PROG",
   141            stackMemory: "DSP1_PROG",
   142            l1DMode: "32k",
   143            l1PMode: "32k",
   144            l2Mode: "128k"
   145        };
   146    
   147        readonly config Any IPU1 = {
   148            externalMemoryMap: [
   149                [ "IPU1_PROG", {
   150                    name: "IPU1_PROG", space: "code/data", access: "RWX",
   151                    base: 0x8A000000, len: 0x800000,
   152                    comment: "IPU1 Program Memory (8 MB)"
   153                }],
   154                [ "SR_0", SR_0 ]
   155            ],
   156            codeMemory:  "IPU1_PROG",
   157            dataMemory:  "IPU1_PROG",
   158            stackMemory: "IPU1_PROG"
   159        };
   160    
   161        readonly config Any IPU2 = {
   162            externalMemoryMap: [
   163                [ "IPU2_PROG", {
   164                    name: "IPU2_PROG", space: "code/data", access: "RWX",
   165                    base: 0x8A800000, len: 0x800000,
   166                    comment: "IPU2 Program Memory (8 MB)"
   167                }],
   168                [ "SR_0", SR_0 ]
   169            ],
   170            codeMemory:  "IPU2_PROG",
   171            dataMemory:  "IPU2_PROG",
   172            stackMemory: "IPU2_PROG"
   173        };
   174    
   175        readonly config Any HOST = {
   176            externalMemoryMap: [
   177                [ "HOST_PROG", {
   178                    name: "HOST_PROG", space: "code/data", access: "RWX",
   179                    base: 0x8B000000, len: 0x1000000,
   180                    comment: "HOST Program Memory (16 MB)"
   181                }],
   182                [ "SR_0", SR_0 ]
   183            ],
   184            codeMemory:  "HOST_PROG",
   185            dataMemory:  "HOST_PROG",
   186            stackMemory: "HOST_PROG"
   187        };
   188    
   189    instance:
   190    
   191        /*!
   192         *  ======== externalMemoryMap ========
   193         *  Memory regions as defined in the idkAM571X Specification
   194         */
   195        override readonly config xdc.platform.IPlatform.Memory
   196            externalMemoryMap[string] = [
   197                ["EXT_RAM", {
   198                    comment: "2 GB External RAM Memory",
   199                    name: "EXT_RAM",
   200                    base: 0x80000000,
   201                    len:  0x80000000
   202                }]
   203            ];
   204    
   205        /*
   206         *  ======== l1PMode ========
   207         *  Define the amount of L1P RAM used for L1 Program Cache.
   208         *
   209         *  Check the device documentation for valid values.
   210         */
   211        config String l1PMode = "32k";
   212    
   213        /*
   214         *  ======== l1DMode ========
   215         *  Define the amount of L1D RAM used for L1 Data Cache.
   216         *
   217         *  Check the device documentation for valid values.
   218         */
   219        config String l1DMode = "32k";
   220    
   221        /*
   222         *  ======== l2Mode ========
   223         *  Define the amount of L2 RAM used for L2 Cache.
   224         *
   225         *  Check the device documentation for valid values.
   226         */
   227        config String l2Mode = "0k";
   228    };