1 /*
2 * Copyright (c) 2012-2013, 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 */
33 /*
34 * The SysMin used here vs StdMin, as trace buffer address is required for
35 * Linux trace debug driver, plus provides better performance.
36 */
37 var System = xdc.useModule('xdc.runtime.System');
38 var SysMin = xdc.useModule('ti.trace.SysMin');
39 System.SupportProxy = SysMin;
40 SysMin.bufSize = 0x8000;
42 /* Define default memory heap properties */
43 var Memory = xdc.useModule('xdc.runtime.Memory');
44 Memory.defaultHeapSize = 0x20000;
46 /* Modules used in the virtqueue/MessageQCopy/ServiceMgr libraries: */
47 var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
48 var BIOS = xdc.useModule('ti.sysbios.BIOS');
50 /* Reduces code size, by only pulling in modules explicitly referenced: */
51 BIOS.libType = BIOS.LibType_Custom;
53 xdc.loadPackage('ti.ipc.rpmsg');
54 xdc.loadPackage('ti.ipc.family.omap54xx');
56 /* TBD:
57 xdc.loadPackage('ti.srvmgr');
58 xdc.useModule('ti.srvmgr.omx.OmxSrvMgr');
59 xdc.loadPackage('ti.resmgr');
60 */
62 /* Enable Memory Translation module that operates on the BIOS Resource Table */
63 var IpcMemory = xdc.useModule('ti.resources.IpcMemory');
65 /* HwSpinlock Module */
66 xdc.loadPackage('ti.gates.hwspinlock');
68 var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
69 var List = xdc.useModule('ti.sdo.utils.List');
71 /* ti.grcm Configuration */
72 /* TBD:
73 var rcmSettings = xdc.useModule('ti.grcm.Settings');
74 rcmSettings.ipc = rcmSettings.IpcSupport_ti_sdo_ipc;
75 xdc.useModule('ti.grcm.RcmServer');
76 */
77 xdc.useModule('ti.sysbios.xdcruntime.GateThreadSupport');
78 var GateSwi = xdc.useModule('ti.sysbios.gates.GateSwi');
80 var Task = xdc.useModule('ti.sysbios.knl.Task');
81 Task.common$.namedInstance = true;
83 var Assert = xdc.useModule('xdc.runtime.Assert');
84 var Defaults = xdc.useModule('xdc.runtime.Defaults');
85 var Diags = xdc.useModule('xdc.runtime.Diags');
86 var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
87 var LoggerSysParams = new LoggerSys.Params();
89 /* Enable Logger: */
90 Defaults.common$.logger = LoggerSys.create(LoggerSysParams);
92 /* Enable runtime Diags_setMask() for non-XDC spec'd modules: */
93 var Text = xdc.useModule('xdc.runtime.Text');
94 Text.isLoaded = true;
95 var Registry = xdc.useModule('xdc.runtime.Registry');
96 Registry.common$.diags_ENTRY = Diags.RUNTIME_OFF;
97 Registry.common$.diags_EXIT = Diags.RUNTIME_OFF;
98 Registry.common$.diags_USER1 = Diags.ALWAYS_ON;
99 Registry.common$.diags_INFO = Diags.ALWAYS_ON;
100 Registry.common$.diags_LIFECYCLE = Diags.ALWAYS_ON;
101 Registry.common$.diags_STATUS = Diags.ALWAYS_ON;
102 Diags.setMaskEnabled = true;
104 var Main = xdc.useModule('xdc.runtime.Main');
105 Main.common$.diags_ASSERT = Diags.ALWAYS_ON;
106 Main.common$.diags_INTERNAL = Diags.ALWAYS_ON;
108 var Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
109 //TBD: var Deh = xdc.useModule('ti.deh.Deh');
110 Hwi.enableException = true;
111 Hwi.nvicCCR.DIV_0_TRP = 1;
113 /* Include stack debug helper */
114 /* TBD:
115 var StackDbg = xdc.useModule('ti.trace.StackDbg');
116 */
118 var dmTimer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
119 /* dmTimer 0 mapped to GPT3 */
120 dmTimer.timerSettings[0].baseAddr = 0xA8034000;
121 /* dmTimer 1 mapped to GPT4 */
122 dmTimer.timerSettings[1].baseAddr = 0xA8036000;
123 /* dmTimer 2 mapped to GPT9 */
124 dmTimer.timerSettings[2].baseAddr = 0xA803E000;
125 /* dmTimer 3 mapped to GPT11 */
126 dmTimer.timerSettings[3].baseAddr = 0xA8088000;
128 /* Skip the Timer frequency verification check. Need to remove this later */
129 dmTimer.checkFrequency = false;
131 /* Match this to the SYS_CLK frequency sourcing the dmTimers.
132 * Not needed once the SYS/BIOS family settings is updated. */
133 dmTimer.intFreq.hi = 0;
134 dmTimer.intFreq.lo = 19200000;
136 /* Override the internal sysTick timer with dmTimer for Bios Timer */
137 var halTimer = xdc.useModule('ti.sysbios.hal.Timer');
138 halTimer.TimerProxy = dmTimer;
140 /* Version module */
141 /* ???
142 xdc.useModule('ti.utils.Version');
143 */