[processor-sdk/pdk.git] / packages / ti / transport / ndk / nimu / example / CCLink / am571x / armv7 / bios / cclink_idkAM571x.cfg
1 /**
2 * \file nimu_idk.cfg
3 *
4 * \brief Sysbios config file for nimu example project on AM571X IDK EVM.
5 *
6 */
8 /*
9 * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 *
15 * Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 *
18 * Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the
21 * distribution.
22 *
23 * Neither the name of Texas Instruments Incorporated nor the names of
24 * its contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 *
39 */
40 /* ================ General configuration ================ */
41 var enableStaticIP = 1;
42 var mode = Program.build.cfgArgs.MODE;
44 /* use modules */
45 var Defaults = xdc.useModule('xdc.runtime.Defaults');
46 var Diags = xdc.useModule('xdc.runtime.Diags');
47 var Error = xdc.useModule('xdc.runtime.Error');
48 var Log = xdc.useModule('xdc.runtime.Log');
49 var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
50 var Main = xdc.useModule('xdc.runtime.Main');
51 var System = xdc.useModule('xdc.runtime.System');
52 var Text = xdc.useModule('xdc.runtime.Text');
53 var IntXbar = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
54 var Clock = xdc.useModule('ti.sysbios.knl.Clock');
55 var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
56 var Swi = xdc.useModule('ti.sysbios.knl.Swi');
57 var Task = xdc.useModule('ti.sysbios.knl.Task');
58 var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
59 var ti_sysbios_hal_Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
60 var SysMin = xdc.useModule('xdc.runtime.SysMin');
61 var SemiHostSupport = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
63 /* NDK modules */
64 var Global = xdc.useModule('ti.ndk.config.Global');
65 var Ip = xdc.useModule('ti.ndk.config.Ip');
66 var Tcp = xdc.useModule('ti.ndk.config.Tcp');
67 var Udp = xdc.useModule('ti.ndk.config.Udp');
68 var Telnet = xdc.useModule('ti.ndk.config.Telnet');
70 /*
71 * Program.argSize sets the size of the .args section.
72 * The examples don't use command line args so argSize is set to 0.
73 */
74 /* Program.argSize = 0x0; */
75 /* System stack size (used by ISRs and Swis) */
76 Program.stack = 0x10000;
78 /*
79 * Uncomment this line to globally disable Asserts.
80 * All modules inherit the default from the 'Defaults' module. You
81 * can override these defaults on a per-module basis using Module.common$.
82 * Disabling Asserts will save code space and improve runtime performance.
83 Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
84 */
86 /*
87 * Uncomment this line to keep module names from being loaded on the target.
88 * The module name strings are placed in the .const section. Setting this
89 * parameter to false will save space in the .const section. Error and
90 * Assert messages will contain an "unknown module" prefix instead
91 * of the actual module name.
92 Defaults.common$.namedModule = false;
93 */
95 /*
96 * Minimize exit handler array in System. The System module includes
97 * an array of functions that are registered with System_atexit() to be
98 * called by System_exit().
99 */
100 System.maxAtexitHandlers = 4;
102 /*
103 * Uncomment this line to disable the Error print function.
104 * We lose error information when this is disabled since the errors are
105 * not printed. Disabling the raiseHook will save some code space if
106 * your app is not using System_printf() since the Error_print() function
107 * calls System_printf().
108 Error.raiseHook = null;
109 */
111 /*
112 * Uncomment this line to keep Error, Assert, and Log strings from being
113 * loaded on the target. These strings are placed in the .const section.
114 * Setting this parameter to false will save space in the .const section.
115 * Error, Assert and Log message will print raw ids and args instead of
116 * a formatted message.
117 Text.isLoaded = false;
118 */
120 /*
121 * Uncomment this line to disable the output of characters by SysMin
122 * when the program exits. SysMin writes characters to a circular buffer.
123 * This buffer can be viewed using the SysMin Output view in ROV.
124 SysMin.flushAtExit = false;
125 */
127 System.SupportProxy = SysMin;
128 /* Circular buffer size for System_printf() */
129 SysMin.bufSize = 0x200;
132 /* ================ BIOS configuration ================ */
134 var BIOS = xdc.useModule('ti.sysbios.BIOS');
135 /*
136 * Build a custom SYS/BIOS library from sources.
137 */
138 BIOS.libType = BIOS.LibType_Custom;
141 /*
142 * The BIOS module will create the default heap for the system.
143 * Specify the size of this default heap.
144 */
145 BIOS.heapSize = 0xA0000;
147 /*
148 * Create and install logger for the whole system
149 */
150 var loggerBufParams = new LoggerBuf.Params();
151 loggerBufParams.numEntries = 16;
152 var logger0 = LoggerBuf.create(loggerBufParams);
153 Defaults.common$.logger = logger0;
154 Main.common$.diags_INFO = Diags.ALWAYS_ON;
157 if (enableStaticIP)
158 {
159 /* Settings for static IP configuration */
160 Ip.ResolveIP = false;
161 Ip.CallByIP = false;
162 Ip.autoIp = false;
163 if (mode == "master")
164 {
165 Ip.address = "192.168.3.100";
166 }
167 else
168 {
169 Ip.address = "192.168.3.4";
170 }
171 Ip.mask = "255.255.255.0";
172 Ip.gatewayIpAddr = "192.168.3.1";
173 }
174 else
175 {
176 Ip.dhcpClientMode = Ip.CIS_FLG_IFIDXVALID;
177 }
179 Global.ndkTickPeriod = 100;
180 Global.kernTaskPriLevel = 11;
181 Global.serviceReportHook = null;
182 Global.IPv6 = false;
184 Task.defaultStackSize = 4096;
185 Task.idleTaskStackSize = 4096;
187 /* ================ Driver configuration ================ */
189 var deviceType = "am571x";
190 var socType = "am571x";
192 var Csl = xdc.loadPackage('ti.csl');
193 Csl.Settings.deviceType = deviceType;
195 /* Load the OSAL package */
196 var osType = "tirtos"
197 var Osal = xdc.useModule('ti.osal.Settings');
198 Osal.osType = osType;
200 /* Load the Board package and set the board name */
201 var Board = xdc.loadPackage('ti.board');
202 Board.Settings.boardName = "idkAM571x";
204 /* Load the EMAC packages */
205 var Emac = xdc.loadPackage('ti.drv.emac');
206 Emac.Settings.socType = socType;
207 /* Load the UART package */
208 var UART = xdc.loadPackage('ti.drv.uart');
210 /* Load the I2C package */
211 var I2C = xdc.loadPackage('ti.drv.i2c');
216 var Nimu = xdc.loadPackage('ti.transport.ndk.nimu');
217 Nimu.Settings.socType = socType;
220 /* ================ Cache and MMU configuration ================ */
222 var Cache1 = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
223 Cache1.enableCache = true;
225 /***********************************************
226 * MMU Configuration *
227 ***********************************************/
228 var Mmu = xdc.useModule('ti.sysbios.family.arm.a15.Mmu');
229 Mmu.enableMMU = true;
231 /******************************************************************************
232 *
233 * SYS/BIOS assigns the following defaults to MAIR0 ATTR0, ATTR1 and ATTR2:
234 *
235 * ATTR0 -> 0x44 (mark memory region as non-cacheable normal memory)
236 * ATTR1 -> 0x04 (mark memory region as device memory, i.e. strongly
237 * ordered and non-cacheable)
238 * ATTR2 -> 0xFF (mark memory region as normal memory, RW cacheable and
239 * RW allocate)
240 ******************************************************************************
241 */
244 // descriptor attribute structure
245 var attrs0 = new Mmu.DescriptorAttrs();
247 Mmu.initDescAttrsMeta(attrs0);
248 attrs0.type = Mmu.DescriptorType_BLOCK; // BLOCK descriptor
249 attrs0.shareable = 2; // sharerable
250 attrs0.attrIndx = 1; // Non-cache, device memory
251 attrs0.noExecute = true; // Not executable
253 // Set the descriptor for each entry in the address range
254 for (var i=0x40600000; i < 0x60000000; i = i + 0x00200000) {
255 // Each 'BLOCK' descriptor entry spans a 2MB address range
256 Mmu.setSecondLevelDescMeta(i, i, attrs0);
257 }
259 // descriptor attribute structure
260 var attrs1 = new Mmu.DescriptorAttrs();
262 Mmu.initDescAttrsMeta(attrs1);
263 attrs1.type = Mmu.DescriptorType_BLOCK; // BLOCK descriptor
264 attrs1.shareable = 2; // sharerable
265 attrs1.attrIndx = 2; // Cached, normal memory
267 // Set the descriptor for each entry in the address range
268 for (var i=0x80000000; i < 0xA0000000; i = i + 0x00200000) {
269 // Each 'BLOCK' descriptor entry spans a 2MB address range
270 Mmu.setSecondLevelDescMeta(i, i, attrs1);
271 }
273 /* ================ Memory sections configuration ================ */
274 Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
275 Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";