diff options
-rw-r--r-- | scripts/pdk_create_projSpec.sh | 521 |
1 files changed, 521 insertions, 0 deletions
diff --git a/scripts/pdk_create_projSpec.sh b/scripts/pdk_create_projSpec.sh new file mode 100644 index 0000000..d2baa87 --- /dev/null +++ b/scripts/pdk_create_projSpec.sh | |||
@@ -0,0 +1,521 @@ | |||
1 | #!/bin/bash | ||
2 | # ****************************************************************************** | ||
3 | # * FILE PURPOSE: PDK Unit Test and Example ProjectSpec Creator | ||
4 | # ****************************************************************************** | ||
5 | # * FILE NAME: pdk_create_projspec.sh | ||
6 | # * | ||
7 | # * DESCRIPTION: | ||
8 | # * The script file is used to create the test and example projects of all | ||
9 | # * components under PDK. These projects are available in the specified | ||
10 | # * workspace. It expects to be run in the folder pdk/packages. | ||
11 | # * | ||
12 | # * USAGE: | ||
13 | # * pdk_create_projspec.sh [soc] | ||
14 | # * | ||
15 | # * Description: (first option is default) | ||
16 | # * soc - AM335x / AM437x / AM571x / AM572x / AM574x / K2E / K2G / K2K / K2H / K2L / | ||
17 | # * C6678 / C6657 / DRA72x / DRA75x / DRA78x / OMAPL137 / OMAPL138 / am65xx | ||
18 | # * | ||
19 | # * Example: | ||
20 | # * pdk_create_projspec.sh AM572x | ||
21 | # * | ||
22 | # * Copyright (C) 2012-2020, Texas Instruments, Inc. | ||
23 | # ***************************************************************************** | ||
24 | |||
25 | # Lists of valid input parameters - MUST be updated as new input parameters are added | ||
26 | # ***************************************************************************** | ||
27 | soc_list=("AM335x" "AM437x" "AM571x" "AM572x" "AM574x" "K2E" "K2K" "K2H" "K2L" "K2G" "C6678" "C6657" "DRA72x" "DRA75x" "DRA78x" "OMAPL137" "OMAPL138" "am65xx") | ||
28 | |||
29 | # Parameter Validation: Check if the argument was passed to the batch file. | ||
30 | # ***************************************************************************** | ||
31 | # Argument [soc] is used to set SOC variable. | ||
32 | if [ -n "$1" ]; then | ||
33 | export SOC="$1" | ||
34 | fi | ||
35 | |||
36 | error_exit () { | ||
37 | echo "Exiting..." | ||
38 | echo "=========================================================================" | ||
39 | exit 1 | ||
40 | } | ||
41 | |||
42 | contains () { | ||
43 | local name=$1[@] | ||
44 | local list=("${!name}") | ||
45 | local in_list=0 | ||
46 | |||
47 | for item in "${list[@]}" | ||
48 | do | ||
49 | if [ "$2" = "$item" ]; then | ||
50 | in_list=1 | ||
51 | break | ||
52 | fi | ||
53 | done | ||
54 | |||
55 | if [ $in_list -eq 0 ]; then | ||
56 | echo "ERROR: $3 ($2) is invalid" | ||
57 | error_exit | ||
58 | fi | ||
59 | } | ||
60 | |||
61 | contains soc_list "$SOC" "SOC" | ||
62 | |||
63 | # ***************************************************************************** | ||
64 | # Component Versions | ||
65 | # ***************************************************************************** | ||
66 | |||
67 | # This is the format of the executable being created - valid values are 'ELF' and 'COFF' | ||
68 | export OUTPUT_FORMAT=ELF | ||
69 | |||
70 | # Version of CG-Tools | ||
71 | export CGT_VERSION=8.3.2 | ||
72 | |||
73 | # Version of CG-ARM-Tools for M4 | ||
74 | export CGT_M4_VERSION=18.12.1.LTS | ||
75 | |||
76 | # Version of XDC | ||
77 | export XDC_VERSION=3.55.02.22 | ||
78 | |||
79 | # Version of BIOS | ||
80 | export BIOS_VERSION=6.76.02.02 | ||
81 | |||
82 | # Version of CG-Tools for ARM | ||
83 | export CGT_VERSION_ARM=GNU_7.2.1:Linaro | ||
84 | |||
85 | # Version of CG-Tools for A53 | ||
86 | export CGT_VERSION_ARM_A53="GNU_7.2.1:Linaro aarch64" | ||
87 | |||
88 | # Version of the IPC | ||
89 | export IPC_VERSION=3_50_04_07 | ||
90 | |||
91 | # EDMA3 Version | ||
92 | export EDMA_VERSION=2.12.05.30E | ||
93 | |||
94 | # Version of the PDK | ||
95 | export PDK_VERSION=1.0.10 | ||
96 | |||
97 | # Version of the NDK | ||
98 | export NDK_VERSION=3.61.01.01 | ||
99 | |||
100 | # Version of UIA | ||
101 | export UIA_VERSION=2.30.01.02 | ||
102 | |||
103 | # Version of CG-Tools for ARM | ||
104 | export CGT_VERSION_ARM9=18.1.5.LTS | ||
105 | |||
106 | export ENDIAN="little" | ||
107 | |||
108 | export PDK_SHORT_NAME=$PWD | ||
109 | |||
110 | |||
111 | if [[ "$SOC" != "am65xx" ]]; then | ||
112 | export RTSC_EDMA=";com.ti.sdo.edma3:$EDMA_VERSION" | ||
113 | fi | ||
114 | |||
115 | export RTSC_NDK=";com.ti.rtsc.NDK:${NDK_VERSION}-eng" | ||
116 | export RTSC_UIA=";com.ti.uia:$UIA_VERSION" | ||
117 | |||
118 | if [[ "$SOC" != "AM335x" && "$SOC" != "AM437x" && "$SOC" != "OMAPL137" ]]; then | ||
119 | export RTSC_IPC=";com.ti.rtsc.IPC:$IPC_VERSION" | ||
120 | fi | ||
121 | |||
122 | echo "*****************************************************************************" | ||
123 | echo "Detecting all projects in PDK and importing them in the examples folder" | ||
124 | |||
125 | ccs_create_pspec() { | ||
126 | |||
127 | textfile=${1#*/} | ||
128 | |||
129 | ccs_proj_name=${textfile%.*} | ||
130 | |||
131 | echo Creating Project "$ccs_proj_name" | ||
132 | |||
133 | # Extract the module from the proj name and make it lowercase | ||
134 | drv="$(echo $ccs_proj_name | cut -d'_' -f 1 | awk '{print tolower($0)}')" | ||
135 | |||
136 | # Create folder for example project if it does not exist | ||
137 | mkdir -p -- ${PDK_SHORT_NAME}/../examples/${drv} | ||
138 | |||
139 | # Set projectspec file name and location | ||
140 | pspec=${PDK_SHORT_NAME}/../examples/${drv}/${ccs_proj_name}.projectspec | ||
141 | |||
142 | # Create projectspec file | ||
143 | > "$pspec" | ||
144 | |||
145 | # Get any compiler options from project.txt file, remove first part of string, and remove double quotes | ||
146 | compiler_options=$(grep ccs.setCompilerOptions $textfile | cut -b 24- | sed -e 's/"//g')" -DUSE_BIOS" | ||
147 | |||
148 | # Remove "-rtsc.enableRtsc" from compiler options (causes error when importing project and is not required) | ||
149 | compiler_options=${compiler_options//"-rtsc.enableRtsc"/} | ||
150 | |||
151 | # Remove USE_BIOS flag if nonOS project | ||
152 | if [[ "$textfile" =~ "nonOS" ]]; then | ||
153 | compiler_options=${compiler_options//"-DUSE_BIOS"/} | ||
154 | fi | ||
155 | |||
156 | # Get any linker options from project.txt file, remove first part of string, and remove double quotes | ||
157 | linker_options=$(grep ccs.setLinkerOptions "$textfile" | cut -b 22- | sed -e 's/"//g') | ||
158 | |||
159 | # Get any XDCtools options from project.txt file, remove first part of string, replace backslashes with single quotes (CCS doesn't allow \" with pspecs currently), and remove all double quotes | ||
160 | xdc_options=$(grep rtsc.setConfiguroOptions "$textfile" | cut -b 28- | sed 's/\\/'"'"'/g' | sed "s/\"//g") | ||
161 | echo $COMPILER | ||
162 | # Write projectspec file | ||
163 | echo "<projectSpec>" >> $pspec | ||
164 | echo " <project" >> $pspec | ||
165 | echo " name=\"${ccs_proj_name}\"" >> $pspec | ||
166 | echo " device=\"${CCS_DEVICE}\"" >> $pspec | ||
167 | echo " endianness=\"${ENDIAN}\"" >> $pspec | ||
168 | echo " outputFormat=\"${OUTPUT_FORMAT}\"" >> $pspec | ||
169 | echo " outputType=\"executable\"" >> $pspec | ||
170 | echo " cgtVersion=\"${COMPILER}\"" >> $pspec | ||
171 | echo " runtimeSupportLibrary=\"libc.a\"" >> $pspec | ||
172 | echo " launchWizard=\"False\"" >> $pspec | ||
173 | echo " linkerCommandFile=\"\"" >> $pspec | ||
174 | echo " ignoreDefaultDeviceSettings=\"False\"" >> $pspec | ||
175 | echo " compilerBuildOptions=\"${compiler_options} ${COMPILER_OPT}\"" >> $pspec | ||
176 | echo " linkerBuildOptions=\"${linker_options} ${LINKER_OPT}\"" >> $pspec | ||
177 | echo " >" >> $pspec | ||
178 | |||
179 | #new line | ||
180 | echo >> $pspec | ||
181 | |||
182 | # Write XDC settings to projectspec file | ||
183 | echo " <!--Project Properties-->" >> $pspec | ||
184 | echo " <property name=\"type\" value=\"rtsc\"/>" >> $pspec | ||
185 | echo " <property name=\"xdcToolsVersion\" value=\"${XDC_VERSION}\"/>" >> $pspec | ||
186 | echo " <property name=\"buildProfile\" value=\"debug\"/>" >> $pspec | ||
187 | echo " <property name=\"products\" value=\"${RTSC_PRODUCTS}\"/>" >> $pspec | ||
188 | echo " <property name=\"platform\" value=\"${RTSC_PLATFORM_NAME}\"/>" >> $pspec | ||
189 | echo " <property name=\"target\" value=\"${RTSC_TARGET}\"/>" >> $pspec | ||
190 | echo " <property name=\"configuroOptions\" value=\"${xdc_options}\"/>" >> $pspec | ||
191 | |||
192 | #new line | ||
193 | echo >> $pspec | ||
194 | |||
195 | # Get project files from project .txt file and print to projectspec file | ||
196 | echo " <!--Project Files-->" >> $pspec | ||
197 | while read -r line ; do | ||
198 | echo " <file action=\"link\" path=$line targetDirectory=\".\" />" >> $pspec | ||
199 | done < <(grep ccs.linkFile $textfile | cut -b 15-) | ||
200 | |||
201 | #new line | ||
202 | echo >> $pspec | ||
203 | |||
204 | # Write macros.ini variables to projectspec | ||
205 | echo " <!--Path Variables-->" >> $pspec | ||
206 | echo " <pathVariable name=\"PDK_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
207 | echo " <pathVariable name=\"CSL_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
208 | echo " <pathVariable name=\"BOARD_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
209 | echo " <pathVariable name=\"SBL_BOOT_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
210 | echo " <pathVariable name=\"FATFS_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
211 | echo " <pathVariable name=\"OSAL_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
212 | echo " <pathVariable name=\"NIMU_INSTAL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
213 | echo " <pathVariable name=\"NIMU_ICSS_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
214 | echo " <pathVariable name=\"GPIO_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
215 | echo " <pathVariable name=\"I2C_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
216 | echo " <pathVariable name=\"ICSS_EMAC_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
217 | echo " <pathVariable name=\"MMCSD_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
218 | echo " <pathVariable name=\"PCIE_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
219 | echo " <pathVariable name=\"PRUSS_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
220 | echo " <pathVariable name=\"SPI_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
221 | echo " <pathVariable name=\"UART_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
222 | echo " <pathVariable name=\"USB_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
223 | echo " <pathVariable name=\"SRIO_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
224 | echo " <pathVariable name=\"CPPI_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
225 | echo " <pathVariable name=\"QMSS_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
226 | echo " <pathVariable name=\"FFTC_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
227 | echo " <pathVariable name=\"TCP3D_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
228 | echo " <pathVariable name=\"PASS_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
229 | echo " <pathVariable name=\"BCP_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
230 | echo " <pathVariable name=\"AIF2_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
231 | echo " <pathVariable name=\"PKTLIB_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
232 | echo " <pathVariable name=\"NWAL_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
233 | echo " <pathVariable name=\"SA_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
234 | echo " <pathVariable name=\"DFE_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
235 | echo " <pathVariable name=\"IQN_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
236 | echo " <pathVariable name=\"IQN2_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
237 | echo " <pathVariable name=\"PKTLIB_INSTALL_PATH\" path=\"\${COM_TI_PDK_INSTALL_DIR}/packages\" scope=\"project\"> </pathVariable>" >> $pspec | ||
238 | |||
239 | #new line | ||
240 | echo >> $pspec | ||
241 | |||
242 | echo " </project>" >> $pspec | ||
243 | echo "</projectSpec>" >> $pspec | ||
244 | |||
245 | echo "Project creation complete" | ||
246 | |||
247 | } | ||
248 | |||
249 | export -f ccs_create_pspec | ||
250 | |||
251 | # define platform.mk file for retrieving core and board list (starting with 6.3 platform.mk will contain core and board list for SOCs) | ||
252 | platform_file=${PDK_SHORT_NAME}/ti/build/makerules/platform.mk | ||
253 | |||
254 | # get core list for given SOC from platform.mk file | ||
255 | core_list=$(grep -i CORE_LIST_${SOC} $platform_file) | ||
256 | core_list=${core_list#*=} | ||
257 | |||
258 | if [[ -z "$core_list" ]]; then | ||
259 | echo "No cores detected in platform.mk file for SOC $SOC: $platform_file" | ||
260 | error_exit | ||
261 | fi | ||
262 | |||
263 | # get board list for given SOC from platform.mk file | ||
264 | board_list=$(grep -i BOARD_LIST_${SOC} $platform_file) | ||
265 | board_list=${board_list#*=} | ||
266 | |||
267 | if [[ -z "$board_list" ]]; then | ||
268 | echo "No boards detected in platform.mk file for SOC $SOC: $platform_file" | ||
269 | error_exit | ||
270 | fi | ||
271 | |||
272 | # Loop through and create projectSpec for every board of every core of given SOC | ||
273 | for core in $core_list; do | ||
274 | echo $core | ||
275 | if [[ "$core" == "c"* ]]; then | ||
276 | core="dsp" | ||
277 | fi | ||
278 | |||
279 | if [[ "$core" == "a"* ]]; then | ||
280 | core="arm" | ||
281 | fi | ||
282 | |||
283 | if [[ "$core" == "mpu"* ]]; then | ||
284 | core="mpu" | ||
285 | fi | ||
286 | |||
287 | if [[ "$core" == "ipu"* ]]; then | ||
288 | core="m4" | ||
289 | fi | ||
290 | |||
291 | if [[ "$core" == "mcu"* ]]; then | ||
292 | core="mcu" | ||
293 | fi | ||
294 | |||
295 | # set default dsp to c66, will be changed further down for specific SOCs | ||
296 | if [[ "$core" == "dsp" ]]; then | ||
297 | export RTSC_TARGET=ti.targets.elf.C66 | ||
298 | export CCS_DEVICE="com.ti.ccstudio.deviceModel.C6000.GenericC64xPlusDevice" | ||
299 | export DSP_TYPE=c66 | ||
300 | fi | ||
301 | |||
302 | # set default arm options, will be changed further down for specific SOCs | ||
303 | if [[ "$core" == "arm" ]]; then | ||
304 | export LINKER_OPT=\"-L\${BIOS_CG_ROOT}/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/hard\ --specs=nano.specs\" | ||
305 | export COMPILER_OPT=\"-I\${CG_TOOL_ROOT}/arm-none-eabi/include/newlib-nano\" | ||
306 | export COMPILER=$CGT_VERSION_ARM | ||
307 | else | ||
308 | export LINKER_OPT="" | ||
309 | export COMPILER_OPT="" | ||
310 | export COMPILER=$CGT_VERSION | ||
311 | fi | ||
312 | |||
313 | # PDK Part Number & Platform name | ||
314 | if [ "$SOC" = "K2K" ]; then | ||
315 | export PDK_ECLIPSE_ID=com.ti.pdk.k2hk | ||
316 | export RTSC_PLATFORM_NAME=ti.platforms.evmTCI6638K2K | ||
317 | if [ "$core" == "arm" ]; then | ||
318 | export RTSC_TARGET=gnu.targets.arm.A15F | ||
319 | export CCS_DEVICE="Cortex A.TCI6638K2K" | ||
320 | fi | ||
321 | |||
322 | elif [ "$SOC" = "K2H" ]; then | ||
323 | export PDK_ECLIPSE_ID=com.ti.pdk.k2hk | ||
324 | export RTSC_PLATFORM_NAME=ti.platforms.evmTCI6636K2H | ||
325 | if [ "$core" == "arm" ]; then | ||
326 | export RTSC_TARGET=gnu.targets.arm.A15F | ||
327 | export CCS_DEVICE="Cortex A.66AK2H12" | ||
328 | fi | ||
329 | |||
330 | elif [ "$SOC" = "K2L" ]; then | ||
331 | export PDK_ECLIPSE_ID=com.ti.pdk.k2l | ||
332 | export RTSC_PLATFORM_NAME=ti.platforms.evmTCI6630K2L | ||
333 | if [ "$core" == "arm" ]; then | ||
334 | export RTSC_TARGET=gnu.targets.arm.A15F | ||
335 | export CCS_DEVICE="Cortex A.TCI6630K2L" | ||
336 | fi | ||
337 | |||
338 | elif [ "$SOC" = "K2E" ]; then | ||
339 | export PDK_ECLIPSE_ID=com.ti.pdk.k2e | ||
340 | export RTSC_PLATFORM_NAME=ti.platforms.evmC66AK2E | ||
341 | if [ "$core" == "arm" ]; then | ||
342 | export RTSC_TARGET=gnu.targets.arm.A15F | ||
343 | export CCS_DEVICE="Cortex A.66AK2E05" | ||
344 | fi | ||
345 | |||
346 | elif [ "$SOC" = "OMAPL137" ]; then | ||
347 | export PDK_ECLIPSE_ID=com.ti.pdk.omapl137 | ||
348 | export RTSC_PLATFORM_NAME=ti.platforms.evmOMAPL137 | ||
349 | if [ "$core" == "arm" ]; then | ||
350 | export RTSC_TARGET=ti.targets.arm.elf.Arm9 | ||
351 | export CCS_DEVICE="ARM9.OMAPL137" | ||
352 | export LINKER_OPT="" | ||
353 | export COMPILER_OPT="" | ||
354 | export COMPILER=$CGT_VERSION_ARM9 | ||
355 | else | ||
356 | export RTSC_TARGET=ti.targets.elf.C674 | ||
357 | export CCS_DEVICE="com.ti.ccstudio.deviceModel.C6000.GenericC674xDevice" | ||
358 | export DSP_TYPE=c674x | ||
359 | fi | ||
360 | |||
361 | elif [ "$SOC" = "OMAPL138" ]; then | ||
362 | export PDK_ECLIPSE_ID=com.ti.pdk.omapl138 | ||
363 | export RTSC_PLATFORM_NAME=ti.platforms.evmOMAPL138 | ||
364 | if [ "$core" == "arm" ]; then | ||
365 | export RTSC_TARGET=ti.targets.arm.elf.Arm9 | ||
366 | export CCS_DEVICE="ARM9.OMAPL138" | ||
367 | export LINKER_OPT="" | ||
368 | export COMPILER_OPT="" | ||
369 | export COMPILER=$CGT_VERSION_ARM9 | ||
370 | else | ||
371 | export RTSC_TARGET=ti.targets.elf.C674 | ||
372 | export CCS_DEVICE="com.ti.ccstudio.deviceModel.C6000.GenericC674xDevice" | ||
373 | export DSP_TYPE=c674x | ||
374 | fi | ||
375 | |||
376 | elif [ "$SOC" = "K2G" ]; then | ||
377 | export PDK_ECLIPSE_ID=com.ti.pdk.k2g | ||
378 | export RTSC_PLATFORM_NAME=ti.platforms.evmTCI66AK2G02 | ||
379 | if [ "$core" == "arm" ]; then | ||
380 | export RTSC_TARGET=gnu.targets.arm.A15F | ||
381 | export CCS_DEVICE="Cortex A.66AK2G02" | ||
382 | fi | ||
383 | |||
384 | elif [ "$SOC" = "AM571x" ]; then | ||
385 | export PDK_ECLIPSE_ID=com.ti.pdk.am57xx | ||
386 | export RTSC_PLATFORM_NAME=ti.platforms.idkAM571X | ||
387 | if [ "$core" = "arm" ]; then | ||
388 | export RTSC_TARGET=gnu.targets.arm.A15F | ||
389 | export CCS_DEVICE="Cortex A.AM5728_RevA" | ||
390 | elif [ "$core" == "m4" ]; then | ||
391 | export RTSC_TARGET=ti.targets.arm.elf.M4 | ||
392 | export CCS_DEVICE="Cortex M.AM5728_RevA" | ||
393 | fi | ||
394 | |||
395 | elif [ "$SOC" == "AM572x" ]; then | ||
396 | export PDK_ECLIPSE_ID=com.ti.pdk.am57xx | ||
397 | if [ "$core" == "arm" ]; then | ||
398 | export RTSC_TARGET=gnu.targets.arm.A15F | ||
399 | export CCS_DEVICE="Cortex A.AM5728_RevA" | ||
400 | elif [ "$core" == "m4" ]; then | ||
401 | export RTSC_TARGET=ti.targets.arm.elf.M4 | ||
402 | export CCS_DEVICE="Cortex M.AM5728_RevA" | ||
403 | fi | ||
404 | |||
405 | elif [ "$SOC" = "AM574x" ]; then | ||
406 | export PDK_ECLIPSE_ID=com.ti.pdk.am57xx | ||
407 | export RTSC_PLATFORM_NAME=ti.platforms.idkAM572X | ||
408 | if [ "$core" = "arm" ]; then | ||
409 | export RTSC_TARGET=gnu.targets.arm.A15F | ||
410 | export CCS_DEVICE="Cortex A.AM5728_RevA" | ||
411 | elif [ "$core" == "m4" ]; then | ||
412 | export RTSC_TARGET=ti.targets.arm.elf.M4 | ||
413 | export CCS_DEVICE="Cortex M.AM5728_RevA" | ||
414 | fi | ||
415 | |||
416 | elif [ "$SOC" == "DRA72x" ]; then | ||
417 | export PDK_ECLIPSE_ID=com.ti.pdk.dra7xx | ||
418 | export RTSC_PLATFORM_NAME=ti.platforms.evmDRA7XX | ||
419 | if [ "$core" == "arm" ]; then | ||
420 | export RTSC_TARGET=gnu.targets.arm.A15F | ||
421 | export CCS_DEVICE="Cortex A.DRA72x" | ||
422 | elif [ "$core" == "m4" ]; then | ||
423 | export RTSC_TARGET=ti.targets.arm.elf.M4 | ||
424 | export CCS_DEVICE="Cortex M.DRA72x" | ||
425 | fi | ||
426 | |||
427 | elif [ "$SOC" == "DRA75x" ]; then | ||
428 | export PDK_ECLIPSE_ID=com.ti.pdk.dra7xx | ||
429 | export RTSC_PLATFORM_NAME=ti.platforms.evmDRA7XX | ||
430 | if [ "$core" == "arm" ]; then | ||
431 | export RTSC_TARGET=gnu.targets.arm.A15F | ||
432 | export CCS_DEVICE="Cortex A.DRA75x_DRA74x" | ||
433 | elif [ "$core" == "m4" ]; then | ||
434 | export RTSC_TARGET=ti.targets.arm.elf.M4 | ||
435 | export CCS_DEVICE="Cortex M.DRA75x_DRA74x" | ||
436 | fi | ||
437 | |||
438 | elif [ "$SOC" == "DRA78x" ]; then | ||
439 | export PDK_ECLIPSE_ID=com.ti.pdk.dra7xx | ||
440 | export RTSC_PLATFORM_NAME=ti.platforms.evmTDA3XX | ||
441 | if [ "$core" == "m4" ]; then | ||
442 | export RTSC_TARGET=ti.targets.arm.elf.M4 | ||
443 | export CCS_DEVICE="Cortex M.TDA3x" | ||
444 | fi | ||
445 | |||
446 | elif [ "$SOC" == "AM335x" ]; then | ||
447 | export PDK_ECLIPSE_ID=com.ti.pdk.am335x | ||
448 | export RTSC_PLATFORM_NAME=ti.platforms.evmAM3359 | ||
449 | export RTSC_TARGET=gnu.targets.arm.A8F | ||
450 | export CCS_DEVICE="Cortex A.AM3359.ICE_AM3359" | ||
451 | |||
452 | elif [ "$SOC" = "AM437x" ]; then | ||
453 | export PDK_ECLIPSE_ID=com.ti.pdk.am437x | ||
454 | export RTSC_PLATFORM_NAME=ti.platforms.evmAM437X | ||
455 | export RTSC_TARGET=gnu.targets.arm.A9F | ||
456 | export CCS_DEVICE="Cortex A.AM4379.IDK_AM437X" | ||
457 | |||
458 | elif [ "$SOC" = "C6678" ]; then | ||
459 | export PDK_ECLIPSE_ID=com.ti.pdk.c667x | ||
460 | export RTSC_PLATFORM_NAME=ti.platforms.evm6678 | ||
461 | |||
462 | elif [ "$SOC" = "C6657" ]; then | ||
463 | export PDK_ECLIPSE_ID=com.ti.pdk.c665x | ||
464 | export RTSC_PLATFORM_NAME=ti.platforms.evm6657 | ||
465 | |||
466 | elif [ "$SOC" = "am65xx" ]; then | ||
467 | export PDK_ECLIPSE_ID=com.ti.pdk.am65xx | ||
468 | if [ "$core" = "mpu" ]; then | ||
469 | export RTSC_PLATFORM_NAME=ti.platforms.cortexA:AM65X | ||
470 | export RTSC_TARGET=gnu.targets.arm.A53F | ||
471 | export CCS_DEVICE="Cortex A.AM6548" | ||
472 | export LINKER_OPT="" | ||
473 | export COMPILER_OPT="" | ||
474 | export COMPILER="$CGT_VERSION_ARM_A53" | ||
475 | elif [ "$core" == "mcu" ]; then | ||
476 | export RTSC_PLATFORM_NAME=ti.platforms.cortexR:AM65X | ||
477 | export RTSC_TARGET=ti.targets.arm.elf.R5F | ||
478 | export CCS_DEVICE="Cortex R.AM6548" | ||
479 | fi | ||
480 | fi | ||
481 | export RTSC_PRODUCTS="com.ti.rtsc.SYSBIOS:$BIOS_VERSION;$PDK_ECLIPSE_ID:$PDK_VERSION" | ||
482 | export RTSC_PRODUCTS="${RTSC_PRODUCTS}${RTSC_EDMA}${RTSC_IPC}${RTSC_NDK}${RTSC_UIA}" | ||
483 | |||
484 | # Remove outer double quotes from extra compiler and linker options | ||
485 | COMPILER_OPT=$(sed -e 's/^"//' -e 's/"$//' <<<"$COMPILER_OPT") | ||
486 | LINKER_OPT=$(sed -e 's/^"//' -e 's/"$//' <<<"$LINKER_OPT") | ||
487 | |||
488 | # create projectspecs for all boards of a given core | ||
489 | for board in $board_list; do | ||
490 | |||
491 | # am572x has rtsc platform for each board | ||
492 | if [ "$board" == "idkAM572x" ]; then | ||
493 | export RTSC_PLATFORM_NAME=ti.platforms.idkAM572X | ||
494 | elif [ "$board" == "evmAM572x" ]; then | ||
495 | export RTSC_PLATFORM_NAME=ti.platforms.evmAM572X | ||
496 | fi | ||
497 | |||
498 | if [[ "$core" == "dsp" ]]; then | ||
499 | find -iname "*$board*$DSP_TYPE***roject.txt" -execdir bash -c 'ccs_create_pspec {}' \; | ||
500 | if [ $(find -iname "*$board*$DSP_TYPE*roject.txt" | wc -l) -eq 0 ]; then | ||
501 | echo "No projects detected" | ||
502 | fi | ||
503 | fi | ||
504 | if [[ "$core" == "arm" ]] || [[ "$core" == "mpu" ]]; then | ||
505 | find -iname "*$board*$core*roject.txt" -execdir bash -c 'ccs_create_pspec {}' \; | ||
506 | if [ $(find -iname "*$board*$core*roject.txt" | wc -l) -eq 0 ]; then | ||
507 | echo "No projects detected" | ||
508 | fi | ||
509 | fi | ||
510 | if [[ "$core" == "m4" ]]|| [[ "$core" == "mcu" ]]; then | ||
511 | find -iname "*$board*$core*roject.txt" -execdir bash -c 'ccs_create_pspec {}' \; | ||
512 | if [ $(find -iname "*$board*$core*roject.txt" | wc -l) -eq 0 ]; then | ||
513 | echo "No projects detected" | ||
514 | fi | ||
515 | fi | ||
516 | done | ||
517 | |||
518 | done | ||
519 | |||
520 | echo "Project generation complete" | ||
521 | echo "*****************************************************************************" \ No newline at end of file | ||