1 /*
2 * Copyright (c) 2012-2014, 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 is used here instead of StdMin, as trace buffer address is
35 * required for 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/RPMessage/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 /* Use LibType_Debug option for now to avoid linking error due to bug in BIOS */
54 BIOS.libType = BIOS.LibType_Debug;
56 xdc.loadPackage('ti.ipc.rpmsg');
57 xdc.loadPackage('ti.ipc.family.omap54xx');
59 /* TBD: Not yet taken in from omapzoom:
60 xdc.loadPackage('ti.srvmgr');
61 xdc.useModule('ti.srvmgr.omx.OmxSrvMgr');
62 xdc.loadPackage('ti.resmgr');
63 */
65 /* Enable Memory Translation module that operates on the BIOS Resource Table */
66 var Resource = xdc.useModule('ti.ipc.remoteproc.Resource');
67 Resource.loadSegment = "EXT_CODE";
69 /* Modules used in Power Management */
70 xdc.loadPackage('ti.pm');
71 var Power = xdc.useModule('ti.sysbios.family.c64p.tesla.Power');
72 Power.loadSegment = "PM_DATA";
74 /* Idle function that periodically flushes the cache */
75 var Idle = xdc.useModule('ti.sysbios.knl.Idle');
76 Idle.addFunc('&VirtQueue_cacheWb');
78 //TBD: Idle.addFunc('&ti_deh_Deh_idleBegin'); /* Must be placed before pwr mgmt */
79 Idle.addFunc('&IpcPower_idle'); /* IpcPower_idle must be at the end */
81 var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
82 var List = xdc.useModule('ti.sdo.utils.List');
84 var GateSwi = xdc.useModule('ti.sysbios.gates.GateSwi');
86 var Task = xdc.useModule('ti.sysbios.knl.Task');
87 Task.common$.namedInstance = true;
89 var Assert = xdc.useModule('xdc.runtime.Assert');
90 var Defaults = xdc.useModule('xdc.runtime.Defaults');
91 var Diags = xdc.useModule('xdc.runtime.Diags');
92 var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
93 var LoggerSysParams = new LoggerSys.Params();
95 /* Enable Logger: */
96 Defaults.common$.logger = LoggerSys.create(LoggerSysParams);
98 /* Enable runtime Diags_setMask() for non-XDC spec'd modules: */
99 var Text = xdc.useModule('xdc.runtime.Text');
100 Text.isLoaded = true;
101 var Registry = xdc.useModule('xdc.runtime.Registry');
102 Registry.common$.diags_ENTRY = Diags.RUNTIME_OFF;
103 Registry.common$.diags_EXIT = Diags.RUNTIME_OFF;
104 Registry.common$.diags_USER1 = Diags.ALWAYS_ON;
105 Registry.common$.diags_INFO = Diags.ALWAYS_ON;
106 Registry.common$.diags_LIFECYCLE = Diags.ALWAYS_ON;
107 Registry.common$.diags_STATUS = Diags.ALWAYS_ON;
108 Diags.setMaskEnabled = true;
110 var Main = xdc.useModule('xdc.runtime.Main');
111 Main.common$.diags_ASSERT = Diags.ALWAYS_ON;
112 Main.common$.diags_INTERNAL = Diags.ALWAYS_ON;
114 var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi');
115 //TBD: var Deh = xdc.useModule('ti.deh.Deh');
116 Hwi.enableException = true;
118 /* -------------------------------- DSP ----------------------------------*/
119 var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
120 MultiProc.setConfig("DSP", ["HOST", "IPU", "DSP"]);
122 /* --------------------------- TICK --------------------------------------*/
123 var Clock = xdc.useModule('ti.sysbios.knl.Clock');
124 Clock.tickSource = Clock.TickSource_USER;
125 /* Configure BIOS clock source as GPTimer5 */
126 Clock.timerId = 0;
128 var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
130 /* Skip the Timer frequency verification check. Need to remove this later */
131 Timer.checkFrequency = false;
133 /* Match this to the SYS_CLK frequency sourcing the dmTimers.
134 * Not needed once the SYS/BIOS family settings is updated. */
135 Timer.intFreq.hi = 0;
136 Timer.intFreq.lo = 19200000;
138 var timerParams = new Timer.Params();
139 timerParams.period = Clock.tickPeriod;
140 timerParams.periodType = Timer.PeriodType_MICROSECS;
141 /* Switch off Software Reset to make the below settings effective */
142 timerParams.tiocpCfg.softreset = 0x0;
143 /* Smart-idle wake-up-capable mode */
144 timerParams.tiocpCfg.idlemode = 0x3;
145 /* Wake-up generation for Overflow */
146 timerParams.twer.ovf_wup_ena = 0x1;
147 Timer.create(Clock.timerId, Clock.doTick, timerParams);
149 Program.sectMap[".tracebuf"] = "TRACE_BUF";
150 Program.sectMap[".errorbuf"] = "EXC_DATA";
152 /* Version module */
153 /* ???
154 xdc.useModule('ti.utils.Version');
155 */