[processor-sdk/pdk.git] / packages / ti / drv / i2c / test / master_slave / k2g / armv7 / bios / i2c_arm_k2g_master.cfg
1 var Defaults = xdc.useModule('xdc.runtime.Defaults');
2 var Diags = xdc.useModule('xdc.runtime.Diags');
3 var Error = xdc.useModule('xdc.runtime.Error');
4 var Log = xdc.useModule('xdc.runtime.Log');
5 var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
6 var Main = xdc.useModule('xdc.runtime.Main');
7 var Memory = xdc.useModule('xdc.runtime.Memory')
8 var SysMin = xdc.useModule('xdc.runtime.SysMin');
9 var System = xdc.useModule('xdc.runtime.System');
10 var Text = xdc.useModule('xdc.runtime.Text');
12 var BIOS = xdc.useModule('ti.sysbios.BIOS');
13 var Clock = xdc.useModule('ti.sysbios.knl.Clock');
14 var Swi = xdc.useModule('ti.sysbios.knl.Swi');
15 var Task = xdc.useModule('ti.sysbios.knl.Task');
16 var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
17 var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
18 var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
19 var CpIntc = xdc.useModule('ti.sysbios.family.arm.a15.tci66xx.CpIntc');
21 var devType = "k2g"
23 /* Load the OSAL package */
24 var osType = "tirtos"
25 var Osal = xdc.useModule('ti.osal.Settings');
26 Osal.osType = osType;
27 Osal.socType = devType;
29 /*use CSL package*/
30 var Csl = xdc.loadPackage('ti.csl');
31 Csl.Settings.deviceType = devType;
33 /* Load the Board package and set the board name */
34 var Board = xdc.loadPackage('ti.board');
35 Board.Settings.boardName = "evmK2G";
37 /* Load Profiling package */
38 var Utils = xdc.loadPackage('ti.utils.profiling');
40 /* Load the i2c package */
41 var I2c = xdc.loadPackage('ti.drv.i2c');
42 I2c.Settings.enableProfiling = true;
44 /* Load the uart package */
45 var Uart = xdc.useModule('ti.drv.uart.Settings');
46 Uart.socType = devType;
48 /*var Clock.TimerProxy = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');*/
49 /*
50 * Program.argSize sets the size of the .args section.
51 * The examples don't use command line args so argSize is set to 0.
52 */
53 Program.argSize = 0x0;
55 /*
56 * Uncomment this line to globally disable Asserts.
57 * All modules inherit the default from the 'Defaults' module. You
58 * can override these defaults on a per-module basis using Module.common$.
59 * Disabling Asserts will save code space and improve runtime performance.
60 Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
61 */
63 /*
64 * Uncomment this line to keep module names from being loaded on the target.
65 * The module name strings are placed in the .const section. Setting this
66 * parameter to false will save space in the .const section. Error and
67 * Assert messages will contain an "unknown module" prefix instead
68 * of the actual module name.
69 Defaults.common$.namedModule = false;
70 */
72 /*
73 * Minimize exit handler array in System. The System module includes
74 * an array of functions that are registered with System_atexit() to be
75 * called by System_exit().
76 */
77 System.maxAtexitHandlers = 4;
79 /*
80 * Uncomment this line to disable the Error print function.
81 * We lose error information when this is disabled since the errors are
82 * not printed. Disabling the raiseHook will save some code space if
83 * your app is not using System_printf() since the Error_print() function
84 * calls System_printf().
85 Error.raiseHook = null;
86 */
88 /*
89 * Uncomment this line to keep Error, Assert, and Log strings from being
90 * loaded on the target. These strings are placed in the .const section.
91 * Setting this parameter to false will save space in the .const section.
92 * Error, Assert and Log message will print raw ids and args instead of
93 * a formatted message.
94 Text.isLoaded = false;
95 */
97 /*
98 * Uncomment this line to disable the output of characters by SysMin
99 * when the program exits. SysMin writes characters to a circular buffer.
100 * This buffer can be viewed using the SysMin Output view in ROV.
101 SysMin.flushAtExit = false;
102 */
105 /* No runtime stack checking is performed */
106 Task.checkStackFlag = false;
109 /* Reduce the number of task priorities */
110 Task.numPriorities = 4;
112 /* ================ Task configuration ================ */
113 var task0Params = new Task.Params();
114 task0Params.instance.name = "echo";
115 task0Params.stackSize = 0x1000;
116 Program.global.echo = Task.create("&masterTaskFxn", task0Params);
118 /*
119 * The BIOS module will create the default heap for the system.
120 * Specify the size of this default heap.
121 */
122 BIOS.heapSize = 0x10000;
124 /*
125 * Build a custom SYS/BIOS library from sources.
126 */
127 BIOS.libType = BIOS.LibType_Custom;
129 /* System stack size (used by ISRs and Swis) */
130 Program.stack = 0x20000;
132 /* Circular buffer size for System_printf() */
133 SysMin.bufSize = 0x400;
135 /*
136 * Create and install logger for the whole system
137 */
138 var loggerBufParams = new LoggerBuf.Params();
139 loggerBufParams.numEntries = 32;
140 var logger0 = LoggerBuf.create(loggerBufParams);
141 Defaults.common$.logger = logger0;
142 Main.common$.diags_INFO = Diags.ALWAYS_ON;
144 System.SupportProxy = SysMin;
145 var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
147 var Cache = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
148 var Mmu = xdc.useModule('ti.sysbios.family.arm.a15.Mmu');
150 /* Enable the cache */
151 Cache.enableCache = true;
153 // Enable the MMU (Required for L1/L2 data caching)
154 Mmu.enableMMU = true;
156 // descriptor attribute structure
157 var peripheralAttrs = new Mmu.DescriptorAttrs();
159 Mmu.initDescAttrsMeta(peripheralAttrs);
161 peripheralAttrs.type = Mmu.DescriptorType_BLOCK; // BLOCK descriptor
162 peripheralAttrs.noExecute = true; // not executable
163 peripheralAttrs.accPerm = 0; // read/write at PL1
164 peripheralAttrs.attrIndx = 1; // MAIR0 Byte1 describes
165 // memory attributes for
166 // each BLOCK MMU entry
168 // Define the base address of the 2 MB page
169 // the peripheral resides in.
170 var peripheralBaseAddrs = [
171 { base: 0x4ae00000, size: 0x00100000 }, // PRM
172 { base: 0x02530C00, size: 0x00000400 }, // UART 0 regs
173 { base: 0x02531000, size: 0x00000400 }, // UART 1 regs
174 { base: 0x02530000, size: 0x00000C00 } // I2C 0/1/2 regs
175 ];
177 // Configure the corresponding MMU page descriptor accordingly
178 for (var i =0; i < peripheralBaseAddrs.length; i++)
179 {
180 for (var j = 0; j < peripheralBaseAddrs[i].size; j += 0x200000)
181 {
182 var addr = peripheralBaseAddrs[i].base + j;
183 Mmu.setSecondLevelDescMeta(addr, addr, peripheralAttrs);
184 }
185 }
187 /* Define and add one Task Hook Set */
188 Task.addHookSet({
189 registerFxn: '&TaskRegisterId',
190 switchFxn: '&mySwitch',
191 });