evmK2L: Add board config for evmK2L
[processor-sdk/big-data-ipc-examples.git] / host_bios / simple_buffer_example / host / evmK2L / board.cfg.xs
1 var CpIntc =   xdc.useModule('ti.sysbios.family.arm.a15.tci66xx.CpIntc');
3 var devType = "k2l"
5 /* Load the OSAL package */ 
6 var osType = "tirtos"
7 var Osal = xdc.useModule('ti.osal.Settings');
8 Osal.osType = osType;
9 Osal.socType = devType;
11 /*use CSL package*/
12 var Csl = xdc.loadPackage('ti.csl');
13 Csl.Settings.deviceType = devType;
15 /* Load the uart package */
16 var Uart = xdc.loadPackage('ti.drv.uart');
17 Uart.Settings.socType = devType;
19 /* Load the I2C package */
20 var I2c                         = xdc.loadPackage('ti.drv.i2c');
21 I2c.Settings.socType = devType;
23 /* Load the Board package and set the board name */
24 var Board = xdc.loadPackage('ti.board');
25 Board.Settings.boardName = "evmK2L";
27 /* ================ Cache configuration ================ */
28 var Cache  = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
30 /* Enable the cache */
31 Cache.enableCache = true;
33 /* ================ MMU configuration ================ */
34 var Mmu = xdc.useModule('ti.sysbios.family.arm.a15.Mmu');
36 /* Enable the MMU (Required for L1/L2 data caching) */
37 Mmu.enableMMU = true;
39 /* descriptor attribute structure */
40 var peripheralAttrs = new Mmu.DescriptorAttrs();
42 Mmu.initDescAttrsMeta(peripheralAttrs);
44 peripheralAttrs.type = Mmu.DescriptorType_BLOCK;  // BLOCK descriptor
45 peripheralAttrs.noExecute = true;                 // not executable
46 peripheralAttrs.accPerm = 0;                      // read/write at PL1
47 peripheralAttrs.attrIndx = 1;                     // MAIR0 Byte1 describes
48                                                       // memory attributes for
49                                                       // each BLOCK MMU entry
51 /* Define the base address of the 2 MB page
52    the peripheral resides in.
53 */
54 var peripheralBaseAddrs = [ 
55   { base: 0x4ae00000, size: 0x00100000 },  // PRM
56   { base: 0x02530C00, size: 0x00000400 },  // UART 0 regs
57   { base: 0x02531000, size: 0x00000400 }   // UART 1 regs
58 ];
60 /* Configure the corresponding MMU page descriptor accordingly */
61 for (var i =0; i < peripheralBaseAddrs.length; i++)
62 {
63   for (var j = 0; j < peripheralBaseAddrs[i].size; j += 0x200000)
64   {
65       var addr = peripheralBaseAddrs[i].base + j;
66       Mmu.setSecondLevelDescMeta(addr, addr, peripheralAttrs);
67   }
68 }