aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep Nair2011-06-17 15:38:28 -0500
committerSandeep Nair2011-06-17 15:38:28 -0500
commit564ea69559fd85d3bb0dcdffb7598f461c6ceeb5 (patch)
tree701b757dc6cbb11a36bf7e921159a31d1169af3c
parent246eb3ebf166c0b28dbb4086c4d417c8c17d6c27 (diff)
downloadmad-utils-564ea69559fd85d3bb0dcdffb7598f461c6ceeb5.tar.gz
mad-utils-564ea69559fd85d3bb0dcdffb7598f461c6ceeb5.tar.xz
mad-utils-564ea69559fd85d3bb0dcdffb7598f461c6ceeb5.zip
Added support for C6670
Removed C6616
-rw-r--r--mad-loader/README.txt8
-rwxr-xr-xmad-loader/examples/app_1/Makefile2
-rwxr-xr-xmad-loader/examples/app_2/Makefile2
-rwxr-xr-xmad-loader/examples/shlibs/Makefile2
-rw-r--r--mad-loader/mal/malApp/build/Makefile8
-rw-r--r--mad-loader/mal/malApp/build/lnk_C6670.cmd (renamed from mad-loader/mal/malApp/build/lnk_C6616.cmd)4
-rw-r--r--mad-loader/mal/malApp/build/prelink_mal_app_C6670.cmd (renamed from mad-loader/mal/malApp/build/prelink_mal_app_C6616.cmd)0
-rw-r--r--mad-loader/mal/malApp/src/mal_app.c2
-rw-r--r--mad-loader/mal/malLib/build/Makefile8
-rw-r--r--mad-loader/mal/malLib/malApis/device_C6670.h (renamed from mad-loader/mal/malLib/malApis/device_C6616.h)9
-rw-r--r--mad-loader/mal/malLib/malApis/mal_lib_loader.c18
-rw-r--r--mad-loader/nmlLoader/build/Makefile8
-rw-r--r--mad-loader/nmlLoader/build/lnk_C6670.cmd (renamed from mad-loader/nmlLoader/build/lnk_C6616.cmd)4
-rw-r--r--mad-loader/nmlLoader/build/prelink_nml_C6670.cmd (renamed from mad-loader/nmlLoader/build/prelink_nml_C6616.cmd)0
-rw-r--r--mad-loader/nmlLoader/src/device_C6472.h2
-rw-r--r--mad-loader/nmlLoader/src/device_C6670.h (renamed from mad-loader/nmlLoader/src/device_C6616.h)10
-rw-r--r--mad-loader/nmlLoader/src/device_C6678.h2
-rw-r--r--mad-loader/nmlLoader/src/nml_ar_utils.c24
-rw-r--r--mad-loader/nmlLoader/src/nml_loader.c18
-rw-r--r--map-tool/config-files/deployment_template_C6670.json (renamed from map-tool/config-files/deployment_template_C6616.json)6
-rw-r--r--map-tool/config-files/maptoolCfg_C6670.json (renamed from map-tool/config-files/maptoolCfg_C6616.json)4
-rwxr-xr-xmap-tool/maptool.py6
22 files changed, 80 insertions, 67 deletions
diff --git a/mad-loader/README.txt b/mad-loader/README.txt
index 085b9c0..ebec11e 100644
--- a/mad-loader/README.txt
+++ b/mad-loader/README.txt
@@ -27,7 +27,7 @@ Example applications:
27 make DEVICE=<device number> 27 make DEVICE=<device number>
28 supported device numbers are 28 supported device numbers are
29 C6472 29 C6472
30 C6616 30 C6670
31 C6678 31 C6678
32 32
33MAD loader library: 33MAD loader library:
@@ -37,7 +37,7 @@ MAD loader library:
37 make DEVICE=<device number> 37 make DEVICE=<device number>
38 supported device numbers are 38 supported device numbers are
39 C6472 39 C6472
40 C6616 40 C6670
41 C6678 41 C6678
42 42
43MAD loader application: 43MAD loader application:
@@ -48,7 +48,7 @@ MAD loader application:
48 make DEVICE=<device number> 48 make DEVICE=<device number>
49 supported device numbers are 49 supported device numbers are
50 C6472 50 C6472
51 C6616 51 C6670
52 C6678 52 C6678
53 53
54 NOTE: MAD loader application needs to be XIP in DDR. The linker command file "lnk_<device number>.cmd" 54 NOTE: MAD loader application needs to be XIP in DDR. The linker command file "lnk_<device number>.cmd"
@@ -61,7 +61,7 @@ NML:
61 make DEVICE=<device number> 61 make DEVICE=<device number>
62 supported device numbers are 62 supported device numbers are
63 C6472 63 C6472
64 C6616 64 C6670
65 C6678 65 C6678
66 66
67 NOTE: Since NML is XIP in DDR, it has to be ensured that the NML code segments are bound to virtual address 67 NOTE: Since NML is XIP in DDR, it has to be ensured that the NML code segments are bound to virtual address
diff --git a/mad-loader/examples/app_1/Makefile b/mad-loader/examples/app_1/Makefile
index ee2e37d..a758888 100755
--- a/mad-loader/examples/app_1/Makefile
+++ b/mad-loader/examples/app_1/Makefile
@@ -7,7 +7,7 @@ C_OPTS = --abi=elfabi
7ifeq ($(DEVICE),C6472) 7ifeq ($(DEVICE),C6472)
8C_OPTS += -mv6400+ 8C_OPTS += -mv6400+
9else 9else
10ifeq ($(DEVICE),C6616) 10ifeq ($(DEVICE),C6670)
11C_OPTS += -mv6600 11C_OPTS += -mv6600
12else 12else
13ifeq ($(DEVICE),C6678) 13ifeq ($(DEVICE),C6678)
diff --git a/mad-loader/examples/app_2/Makefile b/mad-loader/examples/app_2/Makefile
index 1e6c29c..30d13d3 100755
--- a/mad-loader/examples/app_2/Makefile
+++ b/mad-loader/examples/app_2/Makefile
@@ -7,7 +7,7 @@ C_OPTS = --abi=elfabi
7ifeq ($(DEVICE),C6472) 7ifeq ($(DEVICE),C6472)
8C_OPTS += -mv6400+ 8C_OPTS += -mv6400+
9else 9else
10ifeq ($(DEVICE),C6616) 10ifeq ($(DEVICE),C6670)
11C_OPTS += -mv6600 11C_OPTS += -mv6600
12else 12else
13ifeq ($(DEVICE),C6678) 13ifeq ($(DEVICE),C6678)
diff --git a/mad-loader/examples/shlibs/Makefile b/mad-loader/examples/shlibs/Makefile
index 0e97801..40ada87 100755
--- a/mad-loader/examples/shlibs/Makefile
+++ b/mad-loader/examples/shlibs/Makefile
@@ -7,7 +7,7 @@ C_OPTS = --abi=elfabi
7ifeq ($(DEVICE),C6472) 7ifeq ($(DEVICE),C6472)
8C_OPTS += -mv6400+ 8C_OPTS += -mv6400+
9else 9else
10ifeq ($(DEVICE),C6616) 10ifeq ($(DEVICE),C6670)
11C_OPTS += -mv6600 11C_OPTS += -mv6600
12else 12else
13ifeq ($(DEVICE),C6678) 13ifeq ($(DEVICE),C6678)
diff --git a/mad-loader/mal/malApp/build/Makefile b/mad-loader/mal/malApp/build/Makefile
index b9a45fc..14eea93 100644
--- a/mad-loader/mal/malApp/build/Makefile
+++ b/mad-loader/mal/malApp/build/Makefile
@@ -37,13 +37,13 @@ HOST_PRFX = C60
37APP_EXT = exe 37APP_EXT = exe
38 38
39ifeq ($(DEVICE),C6472) 39ifeq ($(DEVICE),C6472)
40C_OPTS = -DDEVICE=6472 ## Tomahawk 40C_OPTS = -DDEVICE=6472
41else 41else
42ifeq ($(DEVICE),C6616) 42ifeq ($(DEVICE),C6670)
43C_OPTS = -DDEVICE=6616 ## Nyquist 43C_OPTS = -DDEVICE=6670
44else 44else
45ifeq ($(DEVICE),C6678) 45ifeq ($(DEVICE),C6678)
46C_OPTS = -DDEVICE=6678 ## Shannon 46C_OPTS = -DDEVICE=6678
47else 47else
48DEFAULT: 48DEFAULT:
49 @echo "Device '$(DEVICE)' not supported" 49 @echo "Device '$(DEVICE)' not supported"
diff --git a/mad-loader/mal/malApp/build/lnk_C6616.cmd b/mad-loader/mal/malApp/build/lnk_C6670.cmd
index 72388d6..e8193d2 100644
--- a/mad-loader/mal/malApp/build/lnk_C6616.cmd
+++ b/mad-loader/mal/malApp/build/lnk_C6670.cmd
@@ -11,8 +11,8 @@
11MEMORY 11MEMORY
12{ 12{
13 BLOB_ENTER: o = 0x80001040 l = 0x0020 13 BLOB_ENTER: o = 0x80001040 l = 0x0020
14 PMEM0: o = 0x80001060 l = 0x7a6c 14 PMEM0: o = 0x80001060 l = 0x7a8c
15 URW0: o = 0x8ffdb800 l = 0x22000 15 URW0: o = 0x9ffdb800 l = 0x22000
16} 16}
17 17
18SECTIONS 18SECTIONS
diff --git a/mad-loader/mal/malApp/build/prelink_mal_app_C6616.cmd b/mad-loader/mal/malApp/build/prelink_mal_app_C6670.cmd
index e6cf4b7..e6cf4b7 100644
--- a/mad-loader/mal/malApp/build/prelink_mal_app_C6616.cmd
+++ b/mad-loader/mal/malApp/build/prelink_mal_app_C6670.cmd
diff --git a/mad-loader/mal/malApp/src/mal_app.c b/mad-loader/mal/malApp/src/mal_app.c
index 9274b32..315ccdd 100644
--- a/mad-loader/mal/malApp/src/mal_app.c
+++ b/mad-loader/mal/malApp/src/mal_app.c
@@ -20,7 +20,7 @@
20#if (DEVICE==6472) 20#if (DEVICE==6472)
21 #define __LOAD_PARTITION__ 0xE0000000 21 #define __LOAD_PARTITION__ 0xE0000000
22 #define NUM_CORES 6 22 #define NUM_CORES 6
23#elif (DEVICE==6616) 23#elif (DEVICE==6670)
24 #define __LOAD_PARTITION__ 0x80000000 24 #define __LOAD_PARTITION__ 0x80000000
25 #define NUM_CORES 4 25 #define NUM_CORES 4
26#elif (DEVICE==6678) 26#elif (DEVICE==6678)
diff --git a/mad-loader/mal/malLib/build/Makefile b/mad-loader/mal/malLib/build/Makefile
index e70b866..390b254 100644
--- a/mad-loader/mal/malLib/build/Makefile
+++ b/mad-loader/mal/malLib/build/Makefile
@@ -35,17 +35,17 @@ LIB_EXT = a
35 35
36AS = cl6x 36AS = cl6x
37ifeq ($(DEVICE),C6472) 37ifeq ($(DEVICE),C6472)
38C_OPTS = -DDEVICE=6472 ## Tomahawk 38C_OPTS = -DDEVICE=6472
39C_OPTS += -mv6400+ 39C_OPTS += -mv6400+
40A_OPTS += -mv6400+ 40A_OPTS += -mv6400+
41else 41else
42ifeq ($(DEVICE),C6616) 42ifeq ($(DEVICE),C6670)
43C_OPTS = -DDEVICE=6616 ## Nyquist 43C_OPTS = -DDEVICE=6670
44C_OPTS += -mv6600 44C_OPTS += -mv6600
45A_OPTS += -mv6600 45A_OPTS += -mv6600
46else 46else
47ifeq ($(DEVICE),C6678) 47ifeq ($(DEVICE),C6678)
48C_OPTS = -DDEVICE=6678 ## Shannon 48C_OPTS = -DDEVICE=6678
49C_OPTS += -mv6600 49C_OPTS += -mv6600
50A_OPTS += -mv6600 50A_OPTS += -mv6600
51else 51else
diff --git a/mad-loader/mal/malLib/malApis/device_C6616.h b/mad-loader/mal/malLib/malApis/device_C6670.h
index ff8ef7a..5fca2e4 100644
--- a/mad-loader/mal/malLib/malApis/device_C6616.h
+++ b/mad-loader/mal/malLib/malApis/device_C6670.h
@@ -2,8 +2,8 @@
2 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ 2 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
3 */ 3 */
4 4
5#ifndef __DEVICE_C6616_H__ 5#ifndef __DEVICE_C6670_H__
6#define __DEVICE_C6616_H__ 6#define __DEVICE_C6670_H__
7 7
8/* Number of cores */ 8/* Number of cores */
9#define NUM_DEVICE_CORES 4 9#define NUM_DEVICE_CORES 4
@@ -32,8 +32,9 @@
32 32
33/* PSC module ID's */ 33/* PSC module ID's */
34#define MOD_GEM0 23 34#define MOD_GEM0 23
35
35/* Get the Module for core */ 36/* Get the Module for core */
36#define GET_PSC_MOD(x) (x + MOD_GEM0) 37#define GET_PSC_MOD(x) ((x<=1) ? (x + MOD_GEM0) : (((x*2)-1) + MOD_GEM0))
37 38
38#define MDCTL_NEXT_STATE_DIS 2 39#define MDCTL_NEXT_STATE_DIS 2
39#define MDCTL_NEXT_STATE_EN 3 40#define MDCTL_NEXT_STATE_EN 3
@@ -85,5 +86,5 @@
85#define L2_GLOBAL_INVALIDATE (*(volatile unsigned int*)(L1DINV_REG)=1) 86#define L2_GLOBAL_INVALIDATE (*(volatile unsigned int*)(L1DINV_REG)=1)
86#define L2_GLOBAL_WBINVALIDATE (*(volatile unsigned int*)(L1DWBINV_REG)=1) 87#define L2_GLOBAL_WBINVALIDATE (*(volatile unsigned int*)(L1DWBINV_REG)=1)
87 88
88#endif /* __DEVICE_C6616_H__ */ 89#endif /* __DEVICE_C6670_H__ */
89 90
diff --git a/mad-loader/mal/malLib/malApis/mal_lib_loader.c b/mad-loader/mal/malLib/malApis/mal_lib_loader.c
index 0d69699..3d91d50 100644
--- a/mad-loader/mal/malLib/malApis/mal_lib_loader.c
+++ b/mad-loader/mal/malLib/malApis/mal_lib_loader.c
@@ -19,8 +19,8 @@
19#if (DEVICE==6472) 19#if (DEVICE==6472)
20#include "device_C6472.h" 20#include "device_C6472.h"
21/* Nyquist */ 21/* Nyquist */
22#elif (DEVICE==6616) 22#elif (DEVICE==6670)
23#include "device_C6616.h" 23#include "device_C6670.h"
24/* Shannon */ 24/* Shannon */
25#elif (DEVICE==6678) 25#elif (DEVICE==6678)
26#include "device_C6678.h" 26#include "device_C6678.h"
@@ -101,7 +101,7 @@ void mal_wbinv_cache_block(void* base_addr, int size, int mode)
101 /* Writeback and Invalidate L1D cache */ 101 /* Writeback and Invalidate L1D cache */
102 *(unsigned int *)(l1d_bar_reg) = (unsigned int)base_addr; 102 *(unsigned int *)(l1d_bar_reg) = (unsigned int)base_addr;
103 *(unsigned int *)(l1d_wc_reg) = size; 103 *(unsigned int *)(l1d_wc_reg) = size;
104#if ((DEVICE==6616) || (DEVICE==6678)) 104#if ((DEVICE==6670) || (DEVICE==6678))
105 asm (" MFENCE"); 105 asm (" MFENCE");
106#elif (DEVICE==6472) 106#elif (DEVICE==6472)
107 while (*(unsigned int *)(l1d_wc_reg) != 0); 107 while (*(unsigned int *)(l1d_wc_reg) != 0);
@@ -110,7 +110,7 @@ void mal_wbinv_cache_block(void* base_addr, int size, int mode)
110 /* Writeback and Invalidate L2 cache */ 110 /* Writeback and Invalidate L2 cache */
111 *(unsigned int *)(l2_bar_reg) = (unsigned int)base_addr; 111 *(unsigned int *)(l2_bar_reg) = (unsigned int)base_addr;
112 *(unsigned int *)(l2_wc_reg) = size; 112 *(unsigned int *)(l2_wc_reg) = size;
113#if ((DEVICE==6616) || (DEVICE==6678)) 113#if ((DEVICE==6670) || (DEVICE==6678))
114 asm (" MFENCE"); 114 asm (" MFENCE");
115#elif (DEVICE==6472) 115#elif (DEVICE==6472)
116 while (*(unsigned int *)(l2_wc_reg) != 0); 116 while (*(unsigned int *)(l2_wc_reg) != 0);
@@ -320,7 +320,7 @@ static int reset_run_core(unsigned int coreId, unsigned int ba)
320 *reg = (*reg & ~ MDCTL_LRSTZ_MASK); 320 *reg = (*reg & ~ MDCTL_LRSTZ_MASK);
321 321
322 /* Enable power domain module */ 322 /* Enable power domain module */
323#if ((DEVICE==6678) || (DEVICE==6616)) 323#if ((DEVICE==6678) || (DEVICE==6670))
324 pd = GET_PD(coreId); 324 pd = GET_PD(coreId);
325#elif (DEVICE==6472) 325#elif (DEVICE==6472)
326 pd = (*(unsigned int *)MDCFG_ADDR(mod_id) & MDCFG_PD_MASK) >> 16; 326 pd = (*(unsigned int *)MDCFG_ADDR(mod_id) & MDCFG_PD_MASK) >> 16;
@@ -337,7 +337,7 @@ static int reset_run_core(unsigned int coreId, unsigned int ba)
337 if (ba & 0x3ff) 337 if (ba & 0x3ff)
338 return -1; 338 return -1;
339 339
340#if ((DEVICE==6678) || (DEVICE==6616)) 340#if ((DEVICE==6678) || (DEVICE==6670))
341 /* Unlock the DSCR boot config */ 341 /* Unlock the DSCR boot config */
342 reg = (unsigned int*)DSCR_KICK0; 342 reg = (unsigned int*)DSCR_KICK0;
343 *reg = DSCR_KICK0_KEY; 343 *reg = DSCR_KICK0_KEY;
@@ -347,7 +347,7 @@ static int reset_run_core(unsigned int coreId, unsigned int ba)
347 347
348 /* Set the Boot Address for Core */ 348 /* Set the Boot Address for Core */
349 reg = (unsigned int*)BOOT_ADDR(coreId); 349 reg = (unsigned int*)BOOT_ADDR(coreId);
350#if ((DEVICE==6678) || (DEVICE==6616)) 350#if ((DEVICE==6678) || (DEVICE==6670))
351 *reg = ba; 351 *reg = ba;
352#elif (DEVICE==6472) 352#elif (DEVICE==6472)
353 *reg = (ba >> 10); 353 *reg = (ba >> 10);
@@ -357,7 +357,7 @@ static int reset_run_core(unsigned int coreId, unsigned int ba)
357 reg = (unsigned int*)BOOT_COMPLETE_ADDR; 357 reg = (unsigned int*)BOOT_COMPLETE_ADDR;
358 *reg = (1 << coreId); 358 *reg = (1 << coreId);
359 359
360#if ((DEVICE==6678) || (DEVICE==6616)) 360#if ((DEVICE==6678) || (DEVICE==6670))
361 /* Lock the DSCR boot config */ 361 /* Lock the DSCR boot config */
362 reg = (unsigned int*)DSCR_KICK0; 362 reg = (unsigned int*)DSCR_KICK0;
363 *reg = 0; 363 *reg = 0;
@@ -397,7 +397,7 @@ static int reset_core(unsigned int coreId)
397 *reg = (*reg & ~ MDCTL_NEXT_STATE_MASK) | MDCTL_NEXT_STATE_EN; 397 *reg = (*reg & ~ MDCTL_NEXT_STATE_MASK) | MDCTL_NEXT_STATE_EN;
398 *reg = (*reg & ~ MDCTL_LRSTZ_MASK); 398 *reg = (*reg & ~ MDCTL_LRSTZ_MASK);
399 399
400#if ((DEVICE==6678) || (DEVICE==6616)) 400#if ((DEVICE==6678) || (DEVICE==6670))
401 pd = GET_PD(coreId); 401 pd = GET_PD(coreId);
402#elif (DEVICE==6472) 402#elif (DEVICE==6472)
403 pd = (*(unsigned int *)MDCFG_ADDR(mod_id) & MDCFG_PD_MASK) >> 16; 403 pd = (*(unsigned int *)MDCFG_ADDR(mod_id) & MDCFG_PD_MASK) >> 16;
diff --git a/mad-loader/nmlLoader/build/Makefile b/mad-loader/nmlLoader/build/Makefile
index 25788a0..afedd9a 100644
--- a/mad-loader/nmlLoader/build/Makefile
+++ b/mad-loader/nmlLoader/build/Makefile
@@ -10,17 +10,17 @@ HOST_EXT = 6x
10 10
11AS = cl6x 11AS = cl6x
12ifeq ($(DEVICE),C6472) 12ifeq ($(DEVICE),C6472)
13C_OPTS = -DDEVICE=6472 ## Tomahawk 13C_OPTS = -DDEVICE=6472
14C_OPTS += -mv6400+ 14C_OPTS += -mv6400+
15A_OPTS += -mv6400+ 15A_OPTS += -mv6400+
16else 16else
17ifeq ($(DEVICE),C6616) 17ifeq ($(DEVICE),C6670)
18C_OPTS = -DDEVICE=6616 ## Nyquist 18C_OPTS = -DDEVICE=6670
19C_OPTS += -mv6600 19C_OPTS += -mv6600
20A_OPTS += -mv6600 20A_OPTS += -mv6600
21else 21else
22ifeq ($(DEVICE),C6678) 22ifeq ($(DEVICE),C6678)
23C_OPTS = -DDEVICE=6678 ## Shannon 23C_OPTS = -DDEVICE=6678
24C_OPTS += -mv6600 24C_OPTS += -mv6600
25A_OPTS += -mv6600 25A_OPTS += -mv6600
26else 26else
diff --git a/mad-loader/nmlLoader/build/lnk_C6616.cmd b/mad-loader/nmlLoader/build/lnk_C6670.cmd
index 3c33131..cce1867 100644
--- a/mad-loader/nmlLoader/build/lnk_C6616.cmd
+++ b/mad-loader/nmlLoader/build/lnk_C6670.cmd
@@ -10,8 +10,8 @@
10MEMORY 10MEMORY
11{ 11{
12 PMEM: o = 0x80016400 l = 0x60 12 PMEM: o = 0x80016400 l = 0x60
13 PMEM1: o = 0x80016460 l = 0x798 13 PMEM1: o = 0x80016460 l = 0x7a0
14 DMEM: o = 0x8fffd800 l = 0x2800 14 DMEM: o = 0x9fffd800 l = 0x2800
15} 15}
16 16
17SECTIONS 17SECTIONS
diff --git a/mad-loader/nmlLoader/build/prelink_nml_C6616.cmd b/mad-loader/nmlLoader/build/prelink_nml_C6670.cmd
index 508ea70..508ea70 100644
--- a/mad-loader/nmlLoader/build/prelink_nml_C6616.cmd
+++ b/mad-loader/nmlLoader/build/prelink_nml_C6670.cmd
diff --git a/mad-loader/nmlLoader/src/device_C6472.h b/mad-loader/nmlLoader/src/device_C6472.h
index ff93f1b..2d747f1 100644
--- a/mad-loader/nmlLoader/src/device_C6472.h
+++ b/mad-loader/nmlLoader/src/device_C6472.h
@@ -11,6 +11,8 @@
11#ifndef __DEVICE_C6472_H__ 11#ifndef __DEVICE_C6472_H__
12#define __DEVICE_C6472_H__ 12#define __DEVICE_C6472_H__
13 13
14#define NUM_CORES 6
15
14#define L2MPPA0_BASE_ADDR 0x184A200 16#define L2MPPA0_BASE_ADDR 0x184A200
15#define L2MPPA_ADDR(x) (L2MPPA0_BASE_ADDR + (4*x)) 17#define L2MPPA_ADDR(x) (L2MPPA0_BASE_ADDR + (4*x))
16 18
diff --git a/mad-loader/nmlLoader/src/device_C6616.h b/mad-loader/nmlLoader/src/device_C6670.h
index 059dba9..bb89dfa 100644
--- a/mad-loader/nmlLoader/src/device_C6616.h
+++ b/mad-loader/nmlLoader/src/device_C6670.h
@@ -3,14 +3,16 @@
3 */ 3 */
4 4
5/** 5/**
6 * @file device_C6616.h 6 * @file device_C6670.h
7 * 7 *
8 * @brief 8 * @brief
9 * Device specific macros 9 * Device specific macros
10 */ 10 */
11 11
12#ifndef __DEVICE_C6616_H__ 12#ifndef __DEVICE_C6670_H__
13#define __DEVICE_C6616_H__ 13#define __DEVICE_C6670_H__
14
15#define NUM_CORES 4
14 16
15#define XMPAXL_BASE_ADDR 0x8000000 17#define XMPAXL_BASE_ADDR 0x8000000
16#define XMPAXH_BASE_ADDR 0x8000004 18#define XMPAXH_BASE_ADDR 0x8000004
@@ -90,5 +92,5 @@
90#define L2_GLOBAL_WBINVALIDATE (*(volatile unsigned int*)(L1DWBINV_REG)=1) 92#define L2_GLOBAL_WBINVALIDATE (*(volatile unsigned int*)(L1DWBINV_REG)=1)
91#define L2_GLOBAL_WB (*(volatile unsigned int*)(L1DWB_REG)=1) 93#define L2_GLOBAL_WB (*(volatile unsigned int*)(L1DWB_REG)=1)
92 94
93#endif /* __DEVICE_C6616_H__ */ 95#endif /* __DEVICE_C6670_H__ */
94 96
diff --git a/mad-loader/nmlLoader/src/device_C6678.h b/mad-loader/nmlLoader/src/device_C6678.h
index fee1c50..7330c9f 100644
--- a/mad-loader/nmlLoader/src/device_C6678.h
+++ b/mad-loader/nmlLoader/src/device_C6678.h
@@ -12,6 +12,8 @@
12#ifndef __DEVICE_C6678_H__ 12#ifndef __DEVICE_C6678_H__
13#define __DEVICE_C6678_H__ 13#define __DEVICE_C6678_H__
14 14
15#define NUM_CORES 8
16
15#define XMPAXL_BASE_ADDR 0x8000000 17#define XMPAXL_BASE_ADDR 0x8000000
16#define XMPAXH_BASE_ADDR 0x8000004 18#define XMPAXH_BASE_ADDR 0x8000004
17#define XMPAXL(x) (XMPAXL_BASE_ADDR + (8*x)) 19#define XMPAXL(x) (XMPAXL_BASE_ADDR + (8*x))
diff --git a/mad-loader/nmlLoader/src/nml_ar_utils.c b/mad-loader/nmlLoader/src/nml_ar_utils.c
index 50fb2f7..21d2506 100644
--- a/mad-loader/nmlLoader/src/nml_ar_utils.c
+++ b/mad-loader/nmlLoader/src/nml_ar_utils.c
@@ -17,8 +17,8 @@
17 17
18#if (DEVICE==6472) 18#if (DEVICE==6472)
19#include "device_C6472.h" 19#include "device_C6472.h"
20#elif (DEVICE==6616) 20#elif (DEVICE==6670)
21#include "device_C6616.h" 21#include "device_C6670.h"
22#elif (DEVICE==6678) 22#elif (DEVICE==6678)
23#include "device_C6678.h" 23#include "device_C6678.h"
24#else 24#else
@@ -41,7 +41,7 @@ void nml_wbinv_cache_block(void* base_addr, int size)
41 /* Writeback and Invalidate L1D cache */ 41 /* Writeback and Invalidate L1D cache */
42 *(unsigned int *)(L1DWIBAR_REG) = (unsigned int)base_addr; 42 *(unsigned int *)(L1DWIBAR_REG) = (unsigned int)base_addr;
43 *(unsigned int *)(L1DWIWC_REG) = size; 43 *(unsigned int *)(L1DWIWC_REG) = size;
44#if ((DEVICE==6616) || (DEVICE==6678)) 44#if ((DEVICE==6670) || (DEVICE==6678))
45 asm (" MFENCE"); 45 asm (" MFENCE");
46#elif (DEVICE==6472) 46#elif (DEVICE==6472)
47 while (*(unsigned int *)(L1DWIWC_REG) != 0); 47 while (*(unsigned int *)(L1DWIWC_REG) != 0);
@@ -50,7 +50,7 @@ void nml_wbinv_cache_block(void* base_addr, int size)
50 /* Writeback and Invalidate L2 cache */ 50 /* Writeback and Invalidate L2 cache */
51 *(unsigned int *)(L2WIBAR_REG) = (unsigned int)base_addr; 51 *(unsigned int *)(L2WIBAR_REG) = (unsigned int)base_addr;
52 *(unsigned int *)(L2WIWC_REG) = size; 52 *(unsigned int *)(L2WIWC_REG) = size;
53#if ((DEVICE==6616) || (DEVICE==6678)) 53#if ((DEVICE==6670) || (DEVICE==6678))
54 asm (" MFENCE"); 54 asm (" MFENCE");
55#elif (DEVICE==6472) 55#elif (DEVICE==6472)
56 while (*(unsigned int *)(L2WIWC_REG) != 0); 56 while (*(unsigned int *)(L2WIWC_REG) != 0);
@@ -101,7 +101,7 @@ int nml_mem_set (void *dest, unsigned int byte, unsigned int num_bytes)
101 return 0; 101 return 0;
102} 102}
103 103
104#if ((DEVICE==6616) || (DEVICE==6678)) 104#if ((DEVICE==6670) || (DEVICE==6678))
105static inline int __logbase2(num) 105static inline int __logbase2(num)
106{ 106{
107 unsigned r = 0; 107 unsigned r = 0;
@@ -111,25 +111,25 @@ static inline int __logbase2(num)
111 return r; 111 return r;
112} 112}
113#define LOG_BASE2_4K 12 113#define LOG_BASE2_4K 12
114#endif /* C6616 C6678 */ 114#endif /* C6670 C6678 */
115 115
116/** 116/**
117 * @brief 117 * @brief
118 * Setup MPAX for 6616 118 * Setup MPAX for 6670
119 * Setup memory protection attributes in MPPA 119 * Setup memory protection attributes in MPPA
120 */ 120 */
121/* paddr is 36 bits for 6616: Activation record will specify paddr without the 4 LSbits */ 121/* paddr is 36 bits for 6670: Activation record will specify paddr without the 4 LSbits */
122int nml_mem_map_set (unsigned int paddr, unsigned int vaddr, unsigned int size, 122int nml_mem_map_set (unsigned int paddr, unsigned int vaddr, unsigned int size,
123 unsigned int perm) 123 unsigned int perm)
124{ 124{
125 unsigned char permissions, p; 125 unsigned char permissions, p;
126 unsigned int num_mppa, start_mppa_idx, *start_mppa_addr, i, mppa_val; 126 unsigned int num_mppa, start_mppa_idx, *start_mppa_addr, i, mppa_val;
127#if ((DEVICE==6616) || (DEVICE==6678)) 127#if ((DEVICE==6670) || (DEVICE==6678))
128 unsigned char segsz; 128 unsigned char segsz;
129 unsigned int raddr, baddr; 129 unsigned int raddr, baddr;
130#endif 130#endif
131 131
132#if ((DEVICE==6616) || (DEVICE==6678)) 132#if ((DEVICE==6670) || (DEVICE==6678))
133 if (vaddr >= MPAX_MAPPABLE_RANGE_START) { 133 if (vaddr >= MPAX_MAPPABLE_RANGE_START) {
134 /* Configure MPAX registers */ 134 /* Configure MPAX registers */
135 p = (unsigned char)perm; 135 p = (unsigned char)perm;
@@ -156,7 +156,7 @@ int nml_mem_map_set (unsigned int paddr, unsigned int vaddr, unsigned int size,
156 nml_mpax_seg_idx[DNUM]++; 156 nml_mpax_seg_idx[DNUM]++;
157 return 0; 157 return 0;
158 } 158 }
159#endif /* C6616, C6678 */ 159#endif /* C6670, C6678 */
160 160
161 /* Configure MPPA registers */ 161 /* Configure MPPA registers */
162 p = (unsigned char)perm; 162 p = (unsigned char)perm;
@@ -242,7 +242,7 @@ int nml_mem_attr_set (unsigned int vaddr, unsigned int size, unsigned int attrs)
242 return 0; 242 return 0;
243 243
244 cache_en = (attrs & CACHE_EN)? CACHE_EN_MASK:0; 244 cache_en = (attrs & CACHE_EN)? CACHE_EN_MASK:0;
245#if ((DEVICE==6616) || (DEVICE==6678)) 245#if ((DEVICE==6670) || (DEVICE==6678))
246 prefetch_en = (attrs & PREFETCH_EN)? PREFETCH_EN_MASK:0; 246 prefetch_en = (attrs & PREFETCH_EN)? PREFETCH_EN_MASK:0;
247#else 247#else
248 prefetch_en = 0; 248 prefetch_en = 0;
diff --git a/mad-loader/nmlLoader/src/nml_loader.c b/mad-loader/nmlLoader/src/nml_loader.c
index ff11431..6d17525 100644
--- a/mad-loader/nmlLoader/src/nml_loader.c
+++ b/mad-loader/nmlLoader/src/nml_loader.c
@@ -10,22 +10,26 @@
10#include "mal_lib_activation_record.h" 10#include "mal_lib_activation_record.h"
11#include "nml_ar_utils.h" 11#include "nml_ar_utils.h"
12 12
13extern volatile unsigned int cregister DNUM; 13#if !(defined DEVICE)
14#error DEVICE not defined
15#endif
14 16
15#if (DEVICE==6472) 17#if (DEVICE==6472)
16#define NUM_CORES 6 18#include "device_C6472.h"
17#define NML_STACK_SZ 512 19#define NML_STACK_SZ 512
18 20
19#elif (DEVICE==6616) 21#elif (DEVICE==6670)
20#define NUM_CORES 4 22#include "device_C6670.h"
21#define NML_STACK_SZ 512 23#define NML_STACK_SZ 512
22 24
23#elif (DEVICE==6678) 25#elif (DEVICE==6678)
24#define NUM_CORES 8 26#include "device_C6678.h"
25#define NML_STACK_SZ 512 27#define NML_STACK_SZ 512
26#endif 28#endif
27 29
28 30
31extern volatile unsigned int cregister DNUM;
32
29typedef int (*fp)(unsigned int, unsigned int, unsigned int, unsigned int); 33typedef int (*fp)(unsigned int, unsigned int, unsigned int, unsigned int);
30 34
31/* Following data will go into an RW segment */ 35/* Following data will go into an RW segment */
@@ -36,7 +40,7 @@ mal_lib_activationRecord_t nml_ar_data[NUM_CORES*MAL_LIB_MAX_AR];
36/* Boot status for each core */ 40/* Boot status for each core */
37unsigned int nml_boot_status[NUM_CORES]; 41unsigned int nml_boot_status[NUM_CORES];
38/* Global variables */ 42/* Global variables */
39#if ((DEVICE==6616) || (DEVICE==6678)) 43#if ((DEVICE==6670) || (DEVICE==6678))
40/* Variable to maintain current segment idx of MPAX */ 44/* Variable to maintain current segment idx of MPAX */
41unsigned char nml_mpax_seg_idx[NUM_CORES]; 45unsigned char nml_mpax_seg_idx[NUM_CORES];
42#endif 46#endif
@@ -62,7 +66,7 @@ void nml_loader()
62 register mal_lib_activationRecord_t *arp; 66 register mal_lib_activationRecord_t *arp;
63 register fp fptr; 67 register fp fptr;
64 68
65#if ((DEVICE==6616) || (DEVICE==6678)) 69#if ((DEVICE==6670) || (DEVICE==6678))
66 /* Initialize the MPAX segment index number */ 70 /* Initialize the MPAX segment index number */
67 nml_mpax_seg_idx[DNUM] = 2; 71 nml_mpax_seg_idx[DNUM] = 2;
68#endif 72#endif
diff --git a/map-tool/config-files/deployment_template_C6616.json b/map-tool/config-files/deployment_template_C6670.json
index 1b21a42..2b36b76 100644
--- a/map-tool/config-files/deployment_template_C6616.json
+++ b/map-tool/config-files/deployment_template_C6670.json
@@ -1,5 +1,5 @@
1{ 1{
2 "deviceName" : "C6616", 2 "deviceName" : "C6670",
3 3
4 "partitions" : [ 4 "partitions" : [
5 { 5 {
@@ -19,8 +19,8 @@
19 { 19 {
20 "name" : "ddr-data", 20 "name" : "ddr-data",
21 "vaddr" : "0xD0000000", 21 "vaddr" : "0xD0000000",
22 "paddr" : [ "0x870000000", "0x890000000", "0x8B0000000", "0x8D0000000" ], 22 "paddr" : [ "0x806000000", "0x807000000", "0x808000000", "0x809000000" ],
23 "size" : "0x2000000", 23 "size" : "0x1000000",
24 "secNamePat" : ["stack", "^.far$", "args", "neardata", "fardata" ], 24 "secNamePat" : ["stack", "^.far$", "args", "neardata", "fardata" ],
25 "cores" : [0,1,2,3], 25 "cores" : [0,1,2,3],
26 "permissions" : ["SR", "SW"], 26 "permissions" : ["SR", "SW"],
diff --git a/map-tool/config-files/maptoolCfg_C6616.json b/map-tool/config-files/maptoolCfg_C6670.json
index a276cf9..0f159f5 100644
--- a/map-tool/config-files/maptoolCfg_C6616.json
+++ b/map-tool/config-files/maptoolCfg_C6670.json
@@ -1,6 +1,6 @@
1{ 1{
2 "deploymentCfgFile" : "./config-files/deployment_template_C6616.json", 2 "deploymentCfgFile" : "./config-files/deployment_template_C6670.json",
3 "LoadImageName" : "c6616-le.bin", 3 "LoadImageName" : "c6670-le.bin",
4 "prelinkExe" : "prelink6x", 4 "prelinkExe" : "prelink6x",
5 "ofdTool" : "ofd6x", 5 "ofdTool" : "ofd6x",
6 "stripExe" : "strip6x", 6 "stripExe" : "strip6x",
diff --git a/map-tool/maptool.py b/map-tool/maptool.py
index 7d28df4..42f6dc3 100755
--- a/map-tool/maptool.py
+++ b/map-tool/maptool.py
@@ -485,7 +485,7 @@ def createPadFile(__fname, __size):
485class device: 485class device:
486# stores [# cores, has MPAX] 486# stores [# cores, has MPAX]
487 __id = '' 487 __id = ''
488 __deviceToCore = { 'C6678' : [8, True], 'C6616' : [4, True], 'C6472' : [6, False] } 488 __deviceToCore = { 'C6678' : [8, True], 'C6670' : [4, True], 'C6472' : [6, False] }
489 489
490 def __init__(self,id): 490 def __init__(self,id):
491 if id.upper() in self.__deviceToCore: 491 if id.upper() in self.__deviceToCore:
@@ -1329,12 +1329,14 @@ class application:
1329 fileoffset = 0 # offset of the ELF file within ROMFS 1329 fileoffset = 0 # offset of the ELF file within ROMFS
1330 elfFile = None # Elf File object of the Application 1330 elfFile = None # Elf File object of the Application
1331 dependentLibs = None # List of all dependent DSO's 1331 dependentLibs = None # List of all dependent DSO's
1332 archiveDir = None # Directory where application image would be archived
1332 1333
1333 def __init__(self, name, file, libpath, archiveDir): 1334 def __init__(self, name, file, libpath, archiveDir):
1334 self.alias = name 1335 self.alias = name
1335 self.shlibPath = libpath 1336 self.shlibPath = libpath
1336 self.allowedCores = set() 1337 self.allowedCores = set()
1337 self.dependentLibs = [] 1338 self.dependentLibs = []
1339 self.archiveDir = archiveDir
1338 __fileCopy = os.path.join(archiveDir, name) 1340 __fileCopy = os.path.join(archiveDir, name)
1339 __strippedFile = __fileCopy + '.strip' 1341 __strippedFile = __fileCopy + '.strip'
1340 copyFile(file, __fileCopy) 1342 copyFile(file, __fileCopy)
@@ -1360,7 +1362,7 @@ class application:
1360 else: 1362 else:
1361 #create a new dso object 1363 #create a new dso object
1362 file = os.path.join(self.shlibPath,tail) 1364 file = os.path.join(self.shlibPath,tail)
1363 lib = dso(file,tail,globalLibList,archiveDir) 1365 lib = dso(file,tail,globalLibList,self.archiveDir)
1364 self.dependentLibs.append(lib) 1366 self.dependentLibs.append(lib)
1365 globalLibList[tail] = lib 1367 globalLibList[tail] = lib
1366 # Create the full dependency list 1368 # Create the full dependency list