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 AM572X
    36     */
    37    
    38    /*!
    39     *  ======== Platform ========
    40     *  Platform support for AM572X
    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 2 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:      "evmAM572X",
    58            boardFamily:    "evmAM572X",
    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.evmAM572X
    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) DSP2 (code, data)
   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 DSP2 = {
   148            externalMemoryMap: [
   149                [ "DSP2_PROG", {
   150                    name: "DSP2_PROG", space: "code/data", access: "RWX",
   151                    base: 0x8D000000, len: 0x1000000,
   152                    comment: "DSP2 Program Memory (16 MB)"
   153                }],
   154                [ "SR_0", SR_0 ]
   155            ],
   156            codeMemory:  "DSP2_PROG",
   157            dataMemory:  "DSP2_PROG",
   158            stackMemory: "DSP2_PROG",
   159            l1DMode: "32k",
   160            l1PMode: "32k",
   161            l2Mode: "128k"
   162        };
   163    
   164        readonly config Any IPU1 = {
   165            externalMemoryMap: [
   166                [ "IPU1_PROG", {
   167                    name: "IPU1_PROG", space: "code/data", access: "RWX",
   168                    base: 0x8A000000, len: 0x800000,
   169                    comment: "IPU1 Program Memory (8 MB)"
   170                }],
   171                [ "SR_0", SR_0 ]
   172            ],
   173            codeMemory:  "IPU1_PROG",
   174            dataMemory:  "IPU1_PROG",
   175            stackMemory: "IPU1_PROG"
   176        };
   177    
   178        readonly config Any IPU2 = {
   179            externalMemoryMap: [
   180                [ "IPU2_PROG", {
   181                    name: "IPU2_PROG", space: "code/data", access: "RWX",
   182                    base: 0x8A800000, len: 0x800000,
   183                    comment: "IPU2 Program Memory (8 MB)"
   184                }],
   185                [ "SR_0", SR_0 ]
   186            ],
   187            codeMemory:  "IPU2_PROG",
   188            dataMemory:  "IPU2_PROG",
   189            stackMemory: "IPU2_PROG"
   190        };
   191    
   192        readonly config Any HOST = {
   193            externalMemoryMap: [
   194                [ "HOST_PROG", {
   195                    name: "HOST_PROG", space: "code/data", access: "RWX",
   196                    base: 0x8B000000, len: 0x1000000,
   197                    comment: "HOST Program Memory (16 MB)"
   198                }],
   199                [ "SR_0", SR_0 ]
   200            ],
   201            codeMemory:  "HOST_PROG",
   202            dataMemory:  "HOST_PROG",
   203            stackMemory: "HOST_PROG"
   204        };
   205    
   206    instance:
   207    
   208        /*!
   209         *  ======== externalMemoryMap ========
   210         *  Memory regions as defined in the AM572X Specification
   211         */
   212        override readonly config xdc.platform.IPlatform.Memory
   213            externalMemoryMap[string] = [
   214                ["EXT_RAM", {
   215                    comment: "2 GB External RAM Memory",
   216                    name: "EXT_RAM",
   217                    base: 0x80000000,
   218                    len:  0x80000000
   219                }]
   220            ];
   221    
   222        /*
   223         *  ======== l1PMode ========
   224         *  Define the amount of L1P RAM used for L1 Program Cache.
   225         *
   226         *  Check the device documentation for valid values.
   227         */
   228        config String l1PMode = "32k";
   229    
   230        /*
   231         *  ======== l1DMode ========
   232         *  Define the amount of L1D RAM used for L1 Data Cache.
   233         *
   234         *  Check the device documentation for valid values.
   235         */
   236        config String l1DMode = "32k";
   237    
   238        /*
   239         *  ======== l2Mode ========
   240         *  Define the amount of L2 RAM used for L2 Cache.
   241         *
   242         *  Check the device documentation for valid values.
   243         */
   244        config String l2Mode = "0k";
   245    };