diff options
author | John Dowdal | 2015-09-08 15:17:16 -0500 |
---|---|---|
committer | John Dowdal | 2015-09-08 15:17:16 -0500 |
commit | 36b8b34db4a84010d4afd07819064fdfba334346 (patch) | |
tree | ac6bbc0cea46022bb0dd9c541d31550ad3429fa2 /config.bld | |
parent | c4be8ba56b9d1afc9361678a7db6e7a93b64c133 (diff) | |
download | pcie-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.bld | 443 |
1 files changed, 236 insertions, 207 deletions
@@ -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. */ |
15 | var c66ToolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH"); | 15 | var c66ToolsBaseDir = java.lang.System.getenv("C6X_GEN_INSTALL_PATH"); |
16 | var m4ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_M4"); | 16 | var m4ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_M4"); |
17 | var a15ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A15"); | 17 | var a15ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A15"); |
18 | 18 | var a9ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A9"); | |
19 | /* Check if we need to create the Makefiles? */ | 19 | var a8ToolsBaseDir = java.lang.System.getenv("TOOLCHAIN_PATH_A8"); |
20 | var 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 */ |
23 | var extDbgFlags = java.lang.System.getenv("EXTDBGFLAGS"); | 23 | var 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 */ |
26 | var pcielldPath = new java.io.File(".//").getPath(); | 26 | var 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 */ |
29 | var pcielldPartNumber = java.lang.System.getenv("PARTNO"); | 29 | var extDbgFlags_a8 = java.lang.System.getenv("EXTDBGFLAGS_A8"); |
30 | 30 | ||
31 | if(pcielldPartNumber == null) | 31 | /* Get the extended debug flags for A9 */ |
32 | { | 32 | var extDbgFlags_a9 = java.lang.System.getenv("EXTDBGFLAGS_A9"); |
33 | pcielldPartNumber = "keystone2"; | 33 | |
34 | } | 34 | /* Get the extended debug flags for M4 */ |
35 | 35 | var extDbgFlags_m4 = java.lang.System.getenv("EXTDBGFLAGS_M4"); | |
36 | /* Include Path */ | 36 | |
37 | var pcielldIncPath = " -I" + pcielldPath; | 37 | /* Get the base directory for the PCIE LLD Package */ |
38 | 38 | var 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 */ |
41 | var pcielldReleaseVersion = (""+Pkg.version.replace(/\s/g, "")).split(','); | 41 | var 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 */ |
45 | var pcieCoverityAnalysis = java.lang.System.getenv("STATIC_ANALYZE"); | 45 | var 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. */ |
48 | var C66LE = xdc.useModule('ti.targets.elf.C66'); | 48 | var C66LE = xdc.useModule('ti.targets.elf.C66'); |
49 | C66LE.rootDir = c66ToolsBaseDir; | 49 | C66LE.rootDir = c66ToolsBaseDir; |
50 | C66LE.ccOpts.prefix = "-mo -o3 -q -k -eo.o"; | 50 | C66LE.ccOpts.prefix = "-mo -o3 -q -k -eo.o"; |
51 | if(extDbgFlags) | 51 | if(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. */ |
55 | var C66BE = xdc.useModule('ti.targets.elf.C66_big_endian'); | 55 | var C66BE = xdc.useModule('ti.targets.elf.C66_big_endian'); |
56 | C66BE.rootDir = c66ToolsBaseDir; | 56 | C66BE.rootDir = c66ToolsBaseDir; |
57 | C66BE.ccOpts.prefix = "-mo -o3 -q -k -eo.o -DBIGENDIAN"; | 57 | C66BE.ccOpts.prefix = "-mo -o3 -q -k -eo.o -DBIGENDIAN"; |
58 | if(extDbgFlags) | 58 | if(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 */ |
62 | var A15LE = xdc.useModule('gnu.targets.arm.A15F'); | 62 | var A15LE = xdc.useModule('gnu.targets.arm.A15F'); |
63 | A15LE.rootDir = a15ToolsBaseDir; | 63 | A15LE.rootDir = a15ToolsBaseDir; |
64 | A15LE.ccOpts.prefix = "-mno-unaligned-access -c -mtune=cortex-a15 -marm -DDRA7xx -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1"; | 64 | A15LE.ccOpts.prefix = "-mno-unaligned-access -c -mtune=cortex-a15 -marm -DDRA7xx -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1"; |
65 | 65 | if(extDbgFlags_a15) | |
66 | /* M4 ELF compiler configuration for Little Endian Mode. */ | 66 | A15LE.ccOpts.prefix = A15LE.ccOpts.prefix + " " + extDbgFlags_a15; |
67 | var M4LE = xdc.useModule('ti.targets.arm.elf.M4'); | 67 | |
68 | M4LE.rootDir = m4ToolsBaseDir; | 68 | /* ARMv7 A9 compiler configuration */ |
69 | M4LE.ccOpts.prefix = "-o4 -qq -pdsw255 -DMAKEFILE_BUILD"; | 69 | var A9LE = xdc.useModule('gnu.targets.arm.A9F'); |
70 | 70 | A9LE.rootDir = a9ToolsBaseDir; | |
71 | /* Check if we need to run the STATIC Analysis or not? */ | 71 | A9LE.ccOpts.prefix = "-mno-unaligned-access -c -mtune=cortex-a9 -marm -DDRA7xx -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1"; |
72 | var coverityAnalysis = java.lang.System.getenv("STATIC_ANALYZE"); | 72 | if(extDbgFlags_a9) |
73 | 73 | A9LE.ccOpts.prefix = A9LE.ccOpts.prefix + " " + extDbgFlags_a9; | |
74 | /* Setup the Coverity Filters to perform Static Analysis. */ | 74 | |
75 | if (coverityAnalysis == "ON") { | 75 | /* ARMv7 A8 compiler configuration */ |
76 | var coverityInstallPath = java.lang.System.getenv("STATIC_ANALYZE_PATH"); | 76 | var A8LE = xdc.useModule('gnu.targets.arm.A8F'); |
77 | var cfgBase = xdc.getPackageBase("tisb.coverity.filters") + "cfg"; | 77 | A8LE.rootDir = a8ToolsBaseDir; |
78 | 78 | A8LE.ccOpts.prefix = "-mno-unaligned-access -c -mtune=cortex-a8 -marm -DDRA7xx -gstrict-dwarf -Wall -D__ARMv7 -D_LITTLE_ENDIAN=1"; | |
79 | var coverityFilter = [ | 79 | if(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 | 83 | var M4LE = xdc.useModule('ti.targets.arm.elf.M4'); |
84 | rootDir: coverityInstallPath, | 84 | M4LE.rootDir = m4ToolsBaseDir; |
85 | outDir: xdc.csd() + "cov_out", | 85 | M4LE.ccOpts.prefix = "-o4 -qq -pdsw255 -DMAKEFILE_BUILD"; |
86 | analyzeLibs: true | 86 | if(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 | |||
95 | if (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. */ | ||
119 | Build.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 */ |
123 | var deviceConstruct = [ "soc/", "/src/pcie_soc.c" ]; | 92 | var deviceConstruct = [ "soc/", "/src/pcie_soc.c" ]; |
124 | 93 | ||
125 | var soc_all = | 94 | /* Create the SoC List */ |
126 | { | 95 | var 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 */ | |
137 | var 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 ] | |
149 | var 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 | }, | |
161 | var 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 : | |
173 | var 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 | { | |
185 | var 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 */ | |
197 | var 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 | ************************************************************************** |
210 | var socs = [soc_all]; | 179 | * DESCRIPTION : |
211 | 180 | * The function is used to merge two arrarys | |
212 | 181 | **************************************************************************/ | |
182 | function 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 */ | ||
198 | var buildArguments = []; | ||
199 | |||
200 | /* Construct the build arguments */ | ||
201 | for (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 */ | ||
212 | var build_targets = []; | ||
213 | |||
214 | for (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 */ | ||
239 | socs["all"].targets = build_targets; | ||
240 | Build.targets = build_targets; | ||
241 | |||