1 /*\r
2 * audioAnalogTest.cfg\r
3 *\r
4 * Memory Map and Program intializations for the audio analog test\r
5 *\r
6 * Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/ \r
7 * \r
8 * Redistribution and use in source and binary forms, with or without \r
9 * modification, are permitted provided that the following conditions \r
10 * are met:\r
11 *\r
12 * Redistributions of source code must retain the above copyright \r
13 * notice, this list of conditions and the following disclaimer.\r
14 *\r
15 * Redistributions in binary form must reproduce the above copyright\r
16 * notice, this list of conditions and the following disclaimer in the \r
17 * documentation and/or other materials provided with the \r
18 * distribution.\r
19 *\r
20 * Neither the name of Texas Instruments Incorporated nor the names of\r
21 * its contributors may be used to endorse or promote products derived\r
22 * from this software without specific prior written permission.\r
23 *\r
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \r
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \r
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
27 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT \r
28 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, \r
29 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT \r
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
31 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \r
34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
35 *\r
36 */\r
37 \r
38 /* load the required files and packages */\r
39 var Memory = xdc.useModule('xdc.runtime.Memory')\r
40 var Task = xdc.useModule ("ti.sysbios.knl.Task");\r
41 var BIOS = xdc.useModule ("ti.sysbios.BIOS");\r
42 var ECM = xdc.useModule ("ti.sysbios.family.c64p.EventCombiner");\r
43 var System = xdc.useModule ("xdc.runtime.System");\r
44 var SysStd = xdc.useModule('xdc.runtime.SysStd');\r
45 var cache = xdc.useModule ("ti.sysbios.hal.Cache");\r
46 var Timestamp = xdc.useModule ("xdc.runtime.Timestamp");\r
47 var Hwi = xdc.useModule ("ti.sysbios.family.c64p.Hwi");\r
48 var Sem = xdc.useModule("ti.sysbios.knl.Semaphore");\r
49 var Log = xdc.useModule('xdc.runtime.Log');\r
50 var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');\r
51 var SysMin = xdc.useModule('xdc.runtime.SysMin');\r
52 var System = xdc.useModule('xdc.runtime.System');\r
53 var Defaults = xdc.useModule('xdc.runtime.Defaults');\r
54 var Main = xdc.useModule('xdc.runtime.Main');\r
55 var Diags = xdc.useModule('xdc.runtime.Diags');\r
56 var HeapMem = xdc.useModule ("ti.sysbios.heaps.HeapMem");\r
57 var CpIntc = xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc');\r
58 \r
59 /* Add the drivers and libraries required */\r
60 //var mcasp = xdc.useModule('ti.drv.mcasp.Settings');\r
61 var devType = "k2g";\r
62 var Csl = xdc.useModule('ti.csl.Settings');\r
63 Csl.deviceType = devType;\r
64 //var PlatformLib = xdc.loadPackage('ti.platform.evmk2g');\r
65 var Edma = xdc.loadPackage('ti.sdo.edma3.drv');\r
66 \r
67 /* Load the uart package -- required by board */\r
68 var Uart = xdc.loadPackage('ti.drv.uart');\r
69 Uart.Settings.socType = devType;\r
70 \r
71 //var Board = xdc.loadPackage('ti.board');\r
72 //Board.Settings.boardName = "evmK2G";\r
73 \r
74 /* Load the osal package -- required by board & interrupt example */\r
75 var osType = "tirtos"\r
76 var Osal = xdc.loadPackage('ti.osal');\r
77 Osal.Settings.osType = osType;\r
78 Osal.Settings.socType = devType;\r
79 \r
80 /* \r
81 * The BIOS module will create the default heap for the system.\r
82 * Specify the size of this default heap.\r
83 */\r
84 BIOS.heapSize = 0x2000;\r
85 \r
86 /* System stack size (used by ISRs and Swis) */\r
87 Program.stack = 0x4000;\r
88 \r
89 System.SupportProxy = SysStd;\r
90 \r
91 var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');\r
92 var heapMemParams = new HeapMem.Params();\r
93 heapMemParams.size = 0x28000;\r
94 heapMemParams.sectionName = "systemHeap";\r
95 Program.global.heapHandle = HeapMem.create(heapMemParams);\r
96 \r
97 /* \r
98 * Create and install logger for the whole system\r
99 */\r
100 var loggerBufParams = new LoggerBuf.Params();\r
101 loggerBufParams.numEntries = 32;\r
102 var logger0 = LoggerBuf.create(loggerBufParams);\r
103 Defaults.common$.logger = logger0;\r
104 Main.common$.diags_INFO = Diags.ALWAYS_ON;\r
105 \r
106 Program.sectMap["systemHeap"] = "L2SRAM";\r
107 Program.sectMap[".sysmem"] = "L2SRAM";\r
108 Program.sectMap[".args"] = "L2SRAM";\r
109 Program.sectMap[".cio"] = "L2SRAM";\r
110 Program.sectMap[".far"] = "EXT_RAM";\r
111 Program.sectMap[".rodata"] = "L2SRAM";\r
112 Program.sectMap[".neardata"] = "L2SRAM";\r
113 Program.sectMap[".init_array"] = "L2SRAM";\r
114 Program.sectMap[".cinit"] = "L2SRAM";\r
115 Program.sectMap[".bss"] = "L2SRAM";\r
116 Program.sectMap[".const"] = "L2SRAM";\r
117 Program.sectMap[".text"] = "L2SRAM";\r
118 Program.sectMap[".code"] = "L2SRAM";\r
119 Program.sectMap[".switch"] = "L2SRAM";\r
120 Program.sectMap[".data"] = "L2SRAM";\r
121 Program.sectMap[".fardata"] = "L2SRAM";\r
122 Program.sectMap[".vecs"] = "L2SRAM";\r
123 Program.sectMap["platform_lib"] = "L2SRAM";\r
124 Program.sectMap[".stack"] = "L2SRAM";\r
125 \r
126 var task0Params = new Task.Params();\r
127 task0Params.priority = 5;\r
128 task0Params.instance.name = "task0";\r
129 \r
130 Program.global.task0 = Task.create("&Audio_echo_Task", task0Params);\r
131 \r
132 /* Enable BIOS Task Scheduler */\r
133 BIOS.taskEnabled = true;\r
134 \r
135 /*\r
136 * Enable Event Groups here and registering of ISR for specific GEM INTC is done\r
137 * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs\r
138 */\r
139 \r
140 ECM.eventGroupHwiNum[0] = 7;\r
141 ECM.eventGroupHwiNum[1] = 8;\r
142 ECM.eventGroupHwiNum[2] = 9;\r
143 ECM.eventGroupHwiNum[3] = 10;\r
144 \r
145 \r