summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Dowdal2015-09-08 15:17:16 -0500
committerJohn Dowdal2015-09-08 15:17:16 -0500
commit36b8b34db4a84010d4afd07819064fdfba334346 (patch)
treeac6bbc0cea46022bb0dd9c541d31550ad3429fa2 /config.bld
parentc4be8ba56b9d1afc9361678a7db6e7a93b64c133 (diff)
downloadpcie-lld-36b8b34db4a84010d4afd07819064fdfba334346.tar.gz
pcie-lld-36b8b34db4a84010d4afd07819064fdfba334346.tar.xz
pcie-lld-36b8b34db4a84010d4afd07819064fdfba334346.zip
sync with latest device library implementation from uart
Diffstat (limited to 'config.bld')
-rw-r--r--config.bld443
1 files changed, 236 insertions, 207 deletions
diff --git a/config.bld b/config.bld
index 8372ae3..4ff1013 100644
--- a/config.bld
+++ b/config.bld
@@ -1,212 +1,241 @@
1/****************************************************************************** 1/******************************************************************************
2 * FILE PURPOSE: Build configuration Script for the PCIE LLD 2 * FILE PURPOSE: Build configuration Script for the PCIE LLD
3 ****************************************************************************** 3 ******************************************************************************
4 * FILE NAME: config.bld 4 * FILE NAME: config.bld
5 * 5 *
6 * DESCRIPTION: 6 * DESCRIPTION:
7 * This file contains the build configuration script for the PCIE LLD 7 * This file contains the build configuration script for the PCIE LLD
8 * and is responsible for configuration of the paths for the various 8 * and is responsible for configuration of the paths for the various
9 * tools required to build the driver. 9 * tools required to build the driver.
10 * 10 *
11 * Copyright (C) 2012-2015, Texas Instruments, Inc. 11 * Copyright (C) 2012-2015, Texas Instruments, Inc.
12 *****************************************************************************/ 12 *****************************************************************************/
13 13
14/* Get the Tools Base directory from the Environment Variable. */ 14/* Get the Tools Base directory from the Environment Variable. */
15var c66ToolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH"); 15var c66ToolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH");
16var m4ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_M4"); 16var m4ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_M4");
17var a15ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A15"); 17var a15ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A15");
18 18var a9ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A9");
19/* Check if we need to create the Makefiles? */ 19var a8ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A8");
20var miniBuild = java.lang.System.getenv("MINI_PACKAGE"); 20
21 21/* Get the extended debug flags for C66x,
22/* Get the extended debug flags */ 22 * did not change the name for backwards compatibilty */
23var extDbgFlags = java.lang.System.getenv("EXTDBGFLAGS"); 23var extDbgFlags = java.lang.System.getenv("EXTDBGFLAGS");
24 24
25/* Get the base directory for the PCIE LLD Package */ 25/* Get the extended debug flags for A15 */
26var pcielldPath = new java.io.File(".//").getPath(); 26var extDbgFlags_a15 = java.lang.System.getenv("EXTDBGFLAGS_A15");
27 27
28/* This is the part Number for which the PCIE LLD is being created */ 28/* Get the extended debug flags for A8 */
29var pcielldPartNumber = java.lang.System.getenv("PARTNO"); 29var extDbgFlags_a8 = java.lang.System.getenv("EXTDBGFLAGS_A8");
30 30
31if(pcielldPartNumber == null) 31/* Get the extended debug flags for A9 */
32{ 32var extDbgFlags_a9 = java.lang.System.getenv("EXTDBGFLAGS_A9");
33 pcielldPartNumber = "keystone2"; 33
34} 34/* Get the extended debug flags for M4 */
35 35var extDbgFlags_m4 = java.lang.System.getenv("EXTDBGFLAGS_M4");
36/* Include Path */ 36
37var pcielldIncPath = " -I" + pcielldPath; 37/* Get the base directory for the PCIE LLD Package */
38 38var driverPath = new java.io.File(".//").getPath();
39/* Configure the PCIE LLD Version Information */ 39
40/* 3 steps: remove SPACE and TAB, convert to string and split to make array */ 40/* Include Path */
41var pcielldReleaseVersion = (""+Pkg.version.replace(/\s/g, "")).split(','); 41var lldIncludePath = " -I" + driverPath;
42 42
43/* PCIE LLD Coverity Analysis: Check the environment variable to determine if Static 43/* Configure the PCIE LLD Version Information */
44 * Analysis has to be done on the driver Code base or not? */ 44/* 3 steps: remove SPACE and TAB, convert to string and split to make array */
45var pcieCoverityAnalysis = java.lang.System.getenv("STATIC_ANALYZE"); 45var driverReleaseVersion = (""+Pkg.version.replace(/\s/g, "")).split(',');
46 46
47/* C66 ELF compiler configuration for Little Endian Mode. */ 47/* C66 ELF compiler configuration for Little Endian Mode. */
48var C66LE = xdc.useModule('ti.targets.elf.C66'); 48var C66LE = xdc.useModule('ti.targets.elf.C66');
49C66LE.rootDir = c66ToolsBaseDir; 49C66LE.rootDir = c66ToolsBaseDir;
50C66LE.ccOpts.prefix = "-mo -o3 -q -k -eo.o"; 50C66LE.ccOpts.prefix = "-mo -o3 -q -k -eo.o";
51if(extDbgFlags) 51if(extDbgFlags)
52 C66LE.ccOpts.prefix = C66LE.ccOpts.prefix + " " + extDbgFlags; 52 C66LE.ccOpts.prefix = C66LE.ccOpts.prefix + " " + extDbgFlags;
53 53
54/* C66 ELF compiler configuration for Big Endian Mode. */ 54/* C66 ELF compiler configuration for Big Endian Mode. */
55var C66BE = xdc.useModule('ti.targets.elf.C66_big_endian'); 55var C66BE = xdc.useModule('ti.targets.elf.C66_big_endian');
56C66BE.rootDir = c66ToolsBaseDir; 56C66BE.rootDir = c66ToolsBaseDir;
57C66BE.ccOpts.prefix = "-mo -o3 -q -k -eo.o -DBIGENDIAN"; 57C66BE.ccOpts.prefix = "-mo -o3 -q -k -eo.o -DBIGENDIAN";
58if(extDbgFlags) 58if(extDbgFlags)
59 C66BE.ccOpts.prefix = C66BE.ccOpts.prefix + " " + extDbgFlags; 59 C66BE.ccOpts.prefix = C66BE.ccOpts.prefix + " " + extDbgFlags;
60 60
61/* ARMv7 A15 compiler configuration */ 61/* ARMv7 A15 compiler configuration */
62var A15LE = xdc.useModule('gnu.targets.arm.A15F'); 62var A15LE = xdc.useModule('gnu.targets.arm.A15F');
63A15LE.rootDir = a15ToolsBaseDir; 63A15LE.rootDir = a15ToolsBaseDir;
64A15LE.ccOpts.prefix = "-mno-unaligned-access -c -mtune=cortex-a15 -marm -DDRA7xx -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1"; 64A15LE.ccOpts.prefix = "-mno-unaligned-access -c -mtune=cortex-a15 -marm -DDRA7xx -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1";
65 65if(extDbgFlags_a15)
66/* M4 ELF compiler configuration for Little Endian Mode. */ 66 A15LE.ccOpts.prefix = A15LE.ccOpts.prefix + " " + extDbgFlags_a15;
67var M4LE = xdc.useModule('ti.targets.arm.elf.M4'); 67
68M4LE.rootDir = m4ToolsBaseDir; 68/* ARMv7 A9 compiler configuration */
69M4LE.ccOpts.prefix = "-o4 -qq -pdsw255 -DMAKEFILE_BUILD"; 69var A9LE = xdc.useModule('gnu.targets.arm.A9F');
70 70A9LE.rootDir = a9ToolsBaseDir;
71/* Check if we need to run the STATIC Analysis or not? */ 71A9LE.ccOpts.prefix = "-mno-unaligned-access -c -mtune=cortex-a9 -marm -DDRA7xx -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1";
72var coverityAnalysis = java.lang.System.getenv("STATIC_ANALYZE"); 72if(extDbgFlags_a9)
73 73 A9LE.ccOpts.prefix = A9LE.ccOpts.prefix + " " + extDbgFlags_a9;
74/* Setup the Coverity Filters to perform Static Analysis. */ 74
75if (coverityAnalysis == "ON") { 75/* ARMv7 A8 compiler configuration */
76 var coverityInstallPath = java.lang.System.getenv("STATIC_ANALYZE_PATH"); 76var A8LE = xdc.useModule('gnu.targets.arm.A8F');
77 var cfgBase = xdc.getPackageBase("tisb.coverity.filters") + "cfg"; 77A8LE.rootDir = a8ToolsBaseDir;
78 78A8LE.ccOpts.prefix = "-mno-unaligned-access -c -mtune=cortex-a8 -marm -DDRA7xx -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1";
79 var coverityFilter = [ 79if(extDbgFlags_a8)
80 { 80 A8LE.ccOpts.prefix = A8LE.ccOpts.prefix + " " + extDbgFlags_a8;
81 moduleName: "tisb.coverity.filters.Coverity", 81
82 params: { 82/* M4 ELF compiler configuration for Little Endian Mode. */
83 cfgDir: cfgBase, // The Coverity configuration file directory 83var M4LE = xdc.useModule('ti.targets.arm.elf.M4');
84 rootDir: coverityInstallPath, 84M4LE.rootDir = m4ToolsBaseDir;
85 outDir: xdc.csd() + "cov_out", 85M4LE.ccOpts.prefix = "-o4 -qq -pdsw255 -DMAKEFILE_BUILD";
86 analyzeLibs: true 86if(extDbgFlags_m4)
87 } 87 M4LE.ccOpts.prefix = M4LE.ccOpts.prefix + " " + extDbgFlags_m4;
88 }, 88
89 ]; 89
90 90/* soc name (am?) is inserted between first an second element of this
91 /* Run the coverity filters on the LE Build only. */
92 C66LE.profiles["release"].filters = coverityFilter;
93}
94
95if (miniBuild == "ON")
96{
97
98 var makeC66LEFilter = {
99 moduleName: "build.filter.Make",
100 params: {
101 makefileName: "simpleC66LE.mak",
102 }
103 };
104
105 C66LE.profiles["release"].filters[C66LE.profiles["release"].filters.length++] = makeC66LEFilter;
106
107
108 var makeC66BEFilter = {
109 moduleName: "build.filter.Make",
110 params: {
111 makefileName: "simpleC66BE.mak",
112 }
113 };
114
115 C66BE.profiles["release"].filters[C66BE.profiles["release"].filters.length++] = makeC66BEFilter;
116}
117
118/* List all the build targets here. */
119Build.targets = [ C66LE, C66BE, M4LE, A15LE];
120
121/* device name (k2?) is inserted between first an second element of this
122 list to construct device file name for each device */ 91 list to construct device file name for each device */
123var deviceConstruct = [ "soc/", "/src/pcie_soc.c" ]; 92var deviceConstruct = [ "soc/", "/src/pcie_soc.c" ];
124 93
125var soc_all = 94/* Create the SoC List */
126{ 95var socs = {
127 /* soc name */ 96 /* device independent libraries */
128 name: "", 97 all :
129 98 {
130 /* Library options */ 99 /* Build this library */
131 copts: "", 100 build: "true",
132 101 /* SoC lib enabled */
133 /* target list */ 102 socDevLib: "false",
134 targets: [ C66LE, C66BE, M4LE, A15LE] 103 /* Library options */
135}; 104 copts: "",
136 105 /* target lists, kept blank now, would be updated based on argument lists */
137var soc_k2k = 106 targets: []
138{ 107 },
139 /* soc name */ 108 k2k :
140 name: "k2k", 109 {
141 110 /* this variable would be reinitialized to true, if XDCARGS contains am572x */
142 /* Library options */ 111 build: "false",
143 copts: " -DDEVICE_K2K", 112 /* SoC lib enabled */
144 113 socDevLib: "true",
145 /* target list */ 114 /* Library options */
146 targets: [ C66LE, C66BE ] 115 copts: " -DDEVICE_K2K",
147}; 116 /* target list */
148 117 targets: [ C66LE, C66BE ]
149var soc_k2h = 118 },
150{ 119 k2h :
151 /* soc name */ 120 {
152 name: "k2h", 121 /* this variable would be reinitialized to true, if XDCARGS contains am572x */
153 122 build: "false",
154 /* Library options */ 123 /* SoC lib enabled */
155 copts: " -DDEVICE_K2H", 124 socDevLib: "true",
156 125 /* Library options */
157 /* target list */ 126 copts: " -DDEVICE_K2H",
158 targets: [ C66LE, C66BE ] 127 /* target list */
159}; 128 targets: [ C66LE, C66BE ]
160 129 },
161var soc_k2l = 130 k2e :
162{ 131 {
163 /* soc name */ 132 /* this variable would be reinitialized to true, if XDCARGS contains am572x */
164 name: "k2l", 133 build: "false",
165 134 /* SoC lib enabled */
166 /* Library options */ 135 socDevLib: "true",
167 copts: " -DDEVICE_K2L", 136 /* Library options */
168 137 copts: " -DDEVICE_K2E",
169 /* target list */ 138 /* target list */
170 targets: [ C66LE, C66BE ] 139 targets: [ C66LE, C66BE ]
171}; 140 },
172 141 k2l :
173var soc_k2e = 142 {
174{ 143 /* this variable would be reinitialized to true, if XDCARGS contains am572x */
175 /* soc name */ 144 build: "false",
176 name: "k2e", 145 /* SoC lib enabled */
177 146 socDevLib: "true",
178 /* Library options */ 147 /* Library options */
179 copts: " -DDEVICE_K2E", 148 copts: " -DDEVICE_K2L",
180 149 /* target list */
181 /* target list */ 150 targets: [ C66LE, C66BE ]
182 targets: [ C66LE, C66BE ] 151 },
183}; 152 am572x :
184 153 {
185var soc_am572x = 154 /* this variable would be reinitialized to true, if XDCARGS contains am572x */
186{ 155 build: "false",
187 /* soc name */ 156 /* SoC lib enabled */
188 name: "am572x", 157 socDevLib: "true",
189 158 /* Library options */
190 /* Library options */ 159 copts: " -DSOC_AM572x",
191 copts: " -DSOC_AM572x", 160 /* target list */
192 161 targets: [ C66LE, M4LE, A15LE]
193 /* target list */ 162 },
194 targets: [ C66LE, C66BE, M4LE, A15LE] 163 am571x :
195}; 164 {
196 165 /* this variable would be reinitialized to true, if XDCARGS contains am571x */
197var soc_am571x = 166 build: "false",
198{ 167 /* SoC lib enabled */
199 /* soc name */ 168 socDevLib: "true",
200 name: "am571x", 169 /* Library options */
201 170 copts: " -DSOC_AM571x",
202 /* Library options */ 171 /* target list */
203 copts: " -DSOC_AM571x", 172 targets: [ C66LE, M4LE, A15LE]
204 173 }
205 /* target list */ 174};
206 targets: [ C66LE, C66BE, M4LE, A15LE] 175
207}; 176/**************************************************************************
208 177 * FUNCTION NAME : merge
209/* Build soc-independent library only for now */ 178 **************************************************************************
210var socs = [soc_all]; 179 * DESCRIPTION :
211 180 * The function is used to merge two arrarys
212 181 **************************************************************************/
182function merge() {
183 var args = arguments;
184 var hash = {};
185 var arr = [];
186 for (var i = 0; i < args.length; i++) {
187 for (var j = 0; j < args[i].length; j++) {
188 if (hash[args[i][j]] !== true) {
189 arr[arr.length] = args[i][j];
190 hash[args[i][j]] = true;
191 }
192 }
193 }
194 return arr;
195}
196
197/* Grab input from XDCARGS */
198var buildArguments = [];
199
200/* Construct the build arguments */
201for (var tmp=0; arguments[tmp] != undefined; tmp++)
202{
203
204 /* If no arguments are provided, override for building all */
205 if ( ( arguments.length == 1) && (arguments[tmp].equals("./config.bld")) )
206 buildArguments[buildArguments.length++] = "all";
207 else
208 buildArguments[buildArguments.length++] = arguments[tmp];
209}
210
211/* Build targets on this build */
212var build_targets = [];
213
214for (var i=0; i < buildArguments.length; i++ ) {
215 /* Build it for all targets */
216 var soc_names = Object.keys(socs);
217 if (buildArguments[i] == "all") {
218 for (var j = 0; j < soc_names.length; j++) {
219 build_targets = merge (build_targets.slice(0), socs[soc_names[j]].targets.slice(0));
220 /* Set build to "true" for that SoC */
221 socs[soc_names[j]].build = "true";
222 }
223 }
224 else {
225 /* Skip the first argument, which is ./config.bld to get to next SoCs */
226 if (i == 0) continue;
227 /* Set that build to true if it is found in supported build socs */
228 for (j = 0; j < soc_names.length; j++) {
229 if (buildArguments[i] == soc_names[j]) {
230 socs[buildArguments[i]].build = "true";
231 build_targets = merge (build_targets.slice(0), socs[buildArguments[i]].targets.slice(0));
232 break;
233 }
234 }
235 }
236}
237
238/* Update the Build target generated list */
239socs["all"].targets = build_targets;
240Build.targets = build_targets;
241