[processor-sdk/pdk.git] / packages / ti / drv / emac / test / EmacLoopbackTest / k2g / armv7 / bios / emac_example_ice_k2g.cfg
1 /*
2 * Copyright 2015 by Texas Instruments Incorporated.
3 *
4 * All rights reserved. Property of Texas Instruments Incorporated.
5 * Restricted rights to use, duplicate or disclose this code are
6 * granted through contract.
7 *
8 */
10 /*
11 * ======== cpsw_example.cfg ========
12 *
13 */
15 var Memory = xdc.useModule('xdc.runtime.Memory');
16 var BIOS = xdc.useModule('ti.sysbios.BIOS');
17 var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
18 var Task = xdc.useModule('ti.sysbios.knl.Task');
19 var Idle = xdc.useModule('ti.sysbios.knl.Idle');
20 var Swi = xdc.useModule('ti.sysbios.knl.Swi');
21 var Clock = xdc.useModule('ti.sysbios.knl.Clock');
22 var Event = xdc.useModule('ti.sysbios.knl.Event');
23 var Mailbox = xdc.useModule('ti.sysbios.knl.Mailbox');
24 var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
25 var Log = xdc.useModule('xdc.runtime.Log');
26 var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
27 var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
28 var Main = xdc.useModule('xdc.runtime.Main');
29 var Defaults = xdc.useModule('xdc.runtime.Defaults');
30 var Diags = xdc.useModule('xdc.runtime.Diags');
31 var SysMin = xdc.useModule('xdc.runtime.SysMin');
32 var System = xdc.useModule('xdc.runtime.System');
33 var Text = xdc.useModule('xdc.runtime.Text');
36 var CpIntc = xdc.useModule('ti.sysbios.family.arm.a15.tci66xx.CpIntc');
45 var devType = "k2g"
46 /* Load the CSL package */
47 var Csl = xdc.useModule('ti.csl.Settings');
48 Csl.deviceType = devType;
50 /* Load the OSAL package */
51 var osType = "tirtos"
52 var Osal = xdc.useModule('ti.osal.Settings');
53 Osal.osType = osType;
54 Osal.socType = devType;
56 /* Load the I2C package */
57 var I2c = xdc.loadPackage('ti.drv.i2c');
58 I2c.Settings.socType = devType;
60 /* Load the Board package and set the board name */
61 var Board = xdc.loadPackage('ti.board');
62 Board.Settings.boardName = "evmK2G";
63 /* Load the uart package */
64 var Uart = xdc.loadPackage('ti.drv.uart');
65 Uart.Settings.socType = devType;
67 var Diags = xdc.useModule('xdc.runtime.Diags');
68 var SysMin = xdc.useModule('xdc.runtime.SysMin');
69 var System = xdc.useModule('xdc.runtime.System');
70 var Text = xdc.useModule('xdc.runtime.Text');
72 /* Load the CPPI package */
73 var Cppi = xdc.loadPackage('ti.drv.cppi');
74 /* Load the QMSS package */
75 var Qmss = xdc.loadPackage('ti.drv.qmss');
77 /* Load the EMAC packages */
78 var Emac = xdc.loadPackage('ti.drv.emac');
79 Emac.Settings.socType = devType;
82 Task.defaultStackSize = 0x4000;
87 /*
88 * Program.argSize sets the size of the .args section.
89 * The examples don't use command line args so argSize is set to 0.
90 */
91 Program.argSize = 0x0;
93 /*
94 * The BIOS module will create the default heap for the system.
95 * Specify the size of this default heap.
96 */
97 BIOS.heapSize = 8192 * 30;
99 /*
100 * Build a custom SYS/BIOS library from sources.
101 */
102 BIOS.libType = BIOS.LibType_Custom;
104 /* System stack size (used by ISRs and Swis) */
105 Program.stack = 0x20000;
107 /* Circular buffer size for System_printf() */
108 SysMin.bufSize = 0x400;
110 /*
111 * Create and install logger for the whole system
112 */
113 var loggerBufParams = new LoggerBuf.Params();
114 loggerBufParams.numEntries = 32;
115 var logger0 = LoggerBuf.create(loggerBufParams);
116 Defaults.common$.logger = logger0;
117 Main.common$.diags_INFO = Diags.ALWAYS_ON;
119 System.SupportProxy = SysMin;
120 var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
122 var Cache = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
123 var Mmu = xdc.useModule('ti.sysbios.family.arm.a15.Mmu');
125 /* Enable the cache */
126 Cache.enableCache = true;
128 // Enable the MMU (Required for L1/L2 data caching)
129 Mmu.enableMMU = true;
131 // descriptor attribute structure
132 var peripheralAttrs = new Mmu.DescriptorAttrs();
134 Mmu.initDescAttrsMeta(peripheralAttrs);
136 peripheralAttrs.type = Mmu.DescriptorType_BLOCK; // BLOCK descriptor
137 peripheralAttrs.noExecute = true; // not executable
138 peripheralAttrs.accPerm = 0; // read/write at PL1
139 peripheralAttrs.attrIndx = 1; // MAIR0 Byte1 describes
140 // memory attributes for
141 // Define the base address of the 2 MB page
142 // the peripheral resides in.
143 var peripheralBaseAddrs = [
144 { base: 0x02620000, size: 0x00002000 }, // bootcfg
145 { base: 0x0bc00000, size: 0x00100000 }, // MSMC config
146 { base: 0x0c000000, size: 0x00100000 }, // MSMC memory
147 { base: 0x02000000, size: 0x00100000 }, // NETCP memory
148 { base: 0x04000000, size: 0x01000000 } // NAVSS memory
149 ];
151 // Configure the corresponding MMU page descriptor accordingly
152 for (var i =0; i < peripheralBaseAddrs.length; i++)
153 {
154 for (var j = 0; j < peripheralBaseAddrs[i].size; j += 0x200000)
155 {
156 var addr = peripheralBaseAddrs[i].base + j;
157 Mmu.setSecondLevelDescMeta(addr, addr, peripheralAttrs);
158 }
159 }
161 // Reconfigure DDR to use coherent address
162 Mmu.initDescAttrsMeta(peripheralAttrs);
164 peripheralAttrs.type = Mmu.DescriptorType_BLOCK;
165 peripheralAttrs.shareable = 2; // outer-shareable (3=inner, 0=none)
166 peripheralAttrs.accPerm = 1; // read/write at any privelege level
167 peripheralAttrs.attrIndx = 2; // normal cacheable (0=no cache, 1=strict order)
169 for (var vaddr = 0x80000000, paddr = 0x800000000; vaddr < 0x100000000; vaddr += 0x200000, paddr+= 0x200000)
170 {
171 Mmu.setSecondLevelDescMeta(vaddr, paddr, peripheralAttrs);
172 }
173 // Add MSMC as coherent
174 for (var addr = 0x0c000000; addr < 0x0c600000; addr += 0x200000)
175 {
176 Mmu.setSecondLevelDescMeta(addr, addr, peripheralAttrs);
177 }