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 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 unicache */
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 /* ti.grcm Configuration */
85 /* TBD:
86 var rcmSettings = xdc.useModule('ti.grcm.Settings');
87 rcmSettings.ipc = rcmSettings.IpcSupport_ti_sdo_ipc;
88 xdc.useModule('ti.grcm.RcmServer');
89 */
90 xdc.useModule('ti.sysbios.xdcruntime.GateThreadSupport');
91 var GateSwi = xdc.useModule('ti.sysbios.gates.GateSwi');
93 var Task = xdc.useModule('ti.sysbios.knl.Task');
94 Task.common$.namedInstance = true;
96 var Assert = xdc.useModule('xdc.runtime.Assert');
97 var Defaults = xdc.useModule('xdc.runtime.Defaults');
98 var Diags = xdc.useModule('xdc.runtime.Diags');
99 var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
100 var LoggerSysParams = new LoggerSys.Params();
102 /* Enable Logger: */
103 Defaults.common$.logger = LoggerSys.create(LoggerSysParams);
105 /* Enable runtime Diags_setMask() for non-XDC spec'd modules: */
106 var Text = xdc.useModule('xdc.runtime.Text');
107 Text.isLoaded = true;
108 var Registry = xdc.useModule('xdc.runtime.Registry');
109 Registry.common$.diags_ENTRY = Diags.RUNTIME_OFF;
110 Registry.common$.diags_EXIT = Diags.RUNTIME_OFF;
111 Registry.common$.diags_USER1 = Diags.ALWAYS_ON;
112 Registry.common$.diags_INFO = Diags.ALWAYS_ON;
113 Registry.common$.diags_LIFECYCLE = Diags.ALWAYS_ON;
114 Registry.common$.diags_STATUS = Diags.ALWAYS_ON;
115 Diags.setMaskEnabled = true;
117 var Main = xdc.useModule('xdc.runtime.Main');
118 Main.common$.diags_ASSERT = Diags.ALWAYS_ON;
119 Main.common$.diags_INTERNAL = Diags.ALWAYS_ON;
121 var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi');
122 //TBD: var Deh = xdc.useModule('ti.deh.Deh');
123 Hwi.enableException = true;
125 /* -------------------------------- DSP ----------------------------------*/
126 var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
127 MultiProc.setConfig("DSP", ["HOST", "IPU", "DSP"]);
129 /* --------------------------- TICK --------------------------------------*/
130 var Clock = xdc.useModule('ti.sysbios.knl.Clock');
131 Clock.tickSource = Clock.TickSource_USER;
132 /* Configure BIOS clock source as GPTimer5 */
133 Clock.timerId = 0;
135 var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
137 /* Skip the Timer frequency verification check. Need to remove this later */
138 Timer.checkFrequency = false;
140 /* Match this to the SYS_CLK frequency sourcing the dmTimers.
141 * Not needed once the SYS/BIOS family settings is updated. */
142 Timer.intFreq.hi = 0;
143 Timer.intFreq.lo = 19200000;
145 var timerParams = new Timer.Params();
146 timerParams.period = Clock.tickPeriod;
147 timerParams.periodType = Timer.PeriodType_MICROSECS;
148 /* Switch off Software Reset to make the below settings effective */
149 timerParams.tiocpCfg.softreset = 0x0;
150 /* Smart-idle wake-up-capable mode */
151 timerParams.tiocpCfg.idlemode = 0x3;
152 /* Wake-up generation for Overflow */
153 timerParams.twer.ovf_wup_ena = 0x1;
154 Timer.create(Clock.timerId, Clock.doTick, timerParams);
156 Program.sectMap[".tracebuf"] = "TRACE_BUF";
157 Program.sectMap[".errorbuf"] = "EXC_DATA";
159 /* Version module */
160 /* ???
161 xdc.useModule('ti.utils.Version');
162 */