502ce2d2e273e7aeca997f178e628d1e0e59318d
1 #
2 # =====================================================================
3 # Copyright (C) 2012 Texas Instruments Incorporated
4 #
5 # All rights reserved. Property of Texas Instruments Incorporated.
6 # Restricted rights to use, duplicate or disclose this code are
7 # granted through contract.
8 #
9 # The program may not be used without the written permission
10 # of Texas Instruments Incorporated or against the terms and conditions
11 # stipulated in the agreement under which this program has been
12 # supplied.
13 # =====================================================================
14 #
16 # Repo
17 BIOSTOOLSROOT ?= /opt/ti
18 REPO := $(BIOSTOOLSROOT)
20 # Different tool versions can easily be programmed by defining below variables
21 # in your environment.
22 XDCVERSION ?= xdctools_3_25_05_94
23 BIOSVERSION ?= bios_6_37_02_27
24 IPCVERSION ?= ipc_3_21_00_07
25 CEVERSION ?= codec_engine_3_24_00_08
26 FCVERSION ?= framework_components_3_24_02_15
27 XDAISVERSION ?= xdais_7_24_00_04
28 OSALVERSION ?= osal_1_24_00_09
30 # TI Compiler Settings
31 export C66XCGTOOLSPATH ?= /opt/ti/C6000CGT7.4.2
33 # Define where the sources are
34 DSPDCEMMSRC = $(shell pwd)
35 TIVIDEOTOOLSROOT ?= $(BIOSTOOLSROOT)
37 # Generate the full package paths for tools
38 BIOSPROD = $(REPO)/$(BIOSVERSION)
39 CEPROD = $(TIVIDEOTOOLSROOT)/$(CEVERSION)
40 FCPROD = $(TIVIDEOTOOLSROOT)/$(FCVERSION)
41 XDAISPROD = $(REPO)/$(XDAISVERSION)
42 OSALPROD = $(REPO)/$(OSALVERSION)
44 # XDC settings
45 export XDCBUILDCFG = $(DSPDCEMMSRC)/build/config.bld
47 XDCDIST_TREE = $(REPO)/$(XDCVERSION)
48 export XDCROOT = $(XDCDIST_TREE)
50 export XDCPATH = $(BIOSPROD)/packages;$(IPCSRC)/packages;$(CEPROD)/packages;$(FCPROD)/packages;$(XDAISPROD)/packages;$(OSALPROD)/packages;$(DSPDCEMMSRC)/extrel/ti/dsp_codecs/packages;$(DSPDCEMMSRC)/src;
52 # Custom settings for build
53 JOBS ?= 1
54 # Set profile, always set as release version. Alternate option is "debug"
55 PROFILE ?= release
56 # Set debug/trace level from 0 to 4
57 TRACELEVEL ?= 0
58 # Offloads core to sysm3 code
59 OFFLOAD ?= 1
60 # Set to Non-SMP by default
61 FORSMP ?= 0
62 # Set Instrumentation to be allowed (ENABLE to enable it)
63 SETINST ?= ENABLE
64 # Set HW revision type- OMAP5:ES20, VAYU:ES10
65 HWVERSION ?= ES10
67 all: dspbin
69 # Include platform build configuration
70 config:
71 ifeq (bldcfg.mk,$(wildcard bldcfg.mk))
72 include bldcfg.mk
73 else
74 @echo "No config selected. Please configure the build first and then try to build."
75 @echo "For more info, use 'make help'"
76 @exit 1
77 endif
79 unconfig:
80 @echo "Removed existing configuration"
81 @rm -f bldcfg.mk
83 vayu_config: unconfig
84 @echo "Creating new config\c"
85 @echo DSP_CONFIG = vayu_config > bldcfg.mk
86 @echo ".\c"
87 @echo MYXDCARGS=\"profile=$(PROFILE) trace_level=$(TRACELEVEL) hw_type=VAYU hw_version=$(HWVERSION) BIOS_type=non-SMP\" >> bldcfg.mk
88 @echo ".\c"
89 @echo CHIP = VAYU >> bldcfg.mk
90 @echo ".\c"
91 @echo FORSMP = 0 >> bldcfg.mk
92 @echo ".\c"
93 @echo DSPBINNAME = "dra7xx-c66x-dsp.xe66" >> bldcfg.mk
94 @echo INTBINNAME = "dsp.xe66" >> bldcfg.mk
95 @echo ".\c"
96 @echo "done"
98 clean: config
99 export XDCARGS=$(MYXDCARGS); \
100 $(XDCROOT)/xdc --jobs=$(JOBS) clean -PD $(DSPDCEMMSRC)/platform/ti/dce/baseimage/.
102 build: config
103 ifeq ($(IPCSRC),)
104 @echo "ERROR: IPCSRC not set. Exiting..."
105 @echo "For more info, use 'make help'"
106 @exit 1
107 else ifeq ($(C66XCGTOOLSPATH),)
108 @echo "ERROR: C66XCGTOOLSPATH not set. Exiting..."
109 @echo "For more info, use 'make help'"
110 @exit 1
111 endif
112 export XDCARGS=$(MYXDCARGS); \
113 $(XDCROOT)/xdc --jobs=$(JOBS) -PD $(DSPDCEMMSRC)/platform/ti/dce/baseimage/.
115 dspbin: build
116 ifeq ($(FORSMP),0)
117 $(C66XCGTOOLSPATH)/bin/strip6x $(DSPDCEMMSRC)/platform/ti/dce/baseimage/out/dsp/$(PROFILE)/$(INTBINNAME) -o=$(DSPBINNAME)
118 else
119 @echo "***********Not yet implemented************"
120 endif
122 info: tools sources custom
123 tools:
124 @echo "REPO := $(REPO)"
125 @echo "XDC := $(XDCDIST_TREE)"
126 @echo "BIOS := $(BIOSPROD)"
127 @echo "OSAL := $(OSALPROD)"
128 @echo "FC := $(FCPROD)"
129 @echo "CE := $(CEPROD)"
130 @echo "XDAIS := $(XDAISPROD)"
131 @echo "C66XCGTOOLSPATH := $(C66XCGTOOLSPATH)"
132 @echo " "
134 sources:
135 @echo "IPC := $(IPCSRC)"
136 @echo " "
138 @echo "DSPDCEMMSRC := $(DSPDCEMMSRC)"
139 @echo "DSPDCEMMSRC info: $(shell git --git-dir=$(DSPDCEMMSRC)/.git --work-tree=$(DSPDCEMMSRC)/ log --pretty=format:'%ad %h %d' --oneline --date=short -1 )"
140 @echo "DUCATIMMSRC describe: $(shell git --git-dir=$(DSPDCEMMSRC)/.git --work-tree=$(DSPDCEMMSRC)/ describe --dirty)"
141 @echo " "
143 custom:
144 @echo "JOBS := $(JOBS)"
145 @echo "PROFILE := $(PROFILE)"
146 @echo "TRACELEVEL := $(TRACELEVEL)"
147 @echo "OFFLOAD := $(OFFLOAD)"
148 @echo "FORSMP := $(FORSMP)"
149 @echo "SETINST := $(SETINST)"
150 @echo "HWVERSION := $(HWVERSION)"
151 @echo " "
152 @echo "Ducati configuration used: $(DSP_CONFIG)"
153 @echo "Ducati binary name: $(DSPBINNAME)"
154 @echo " "
156 help:
157 @echo " "
158 @echo "Please export the following variables: "
159 @echo " 1. BIOSTOOLSROOT - Directory where all the BIOS tools are installed."
160 @echo " If not mentioned, picks up the default, /opt/ti"
161 @echo " 2. C66XCGTOOLSPATH - DSP Code Generation Tools installation path"
162 @echo " If not mentioned, tries the default install location, /opt/ti/TI_CGT_TI_ARM_5.0.1"
163 @echo " 3. IPCSRC - Absolute path of the $(IPCVERSION)"
164 @echo " 4. [Optional] - Any of the following variables can be defined to customize your build."
165 @echo " JOBS - To specify the number of parallel build jobs (default is 1)"
166 @echo " PROFILE - 'release' or 'debug' profile for the libraries and binaries (default is release)"
167 @echo " TRACELEVEL - From 0 to 4. Higher the value, more the traces. 0 implies no traces (default is 0)"
168 @echo " OFFLOAD - Enable offloading support (default is 1, set to 0 to disable)"
169 @echo " 5. [Optional] - Any of the following variables can be defined to change the default tool versions."
170 @echo " XDCVERSION = $(XDCDIST_TREE)"
171 @echo " BIOSVERSION = $(BIOSPROD)"
172 @echo " IPCVERSION = $(IPCSRC)"
173 @echo " CEVERSION = $(CEPROD)"
174 @echo " FCVERSION = $(FCPROD)"
175 @echo " XDAISVERSION = $(XDAISPROD)"
176 @echo " OSALVERSION = $(OSALPROD)"
177 @echo " C66XCGTOOLSPATH = $(C66XCGTOOLSPATH)"
178 @echo " "
179 @echo "Use the appropriate make targets from the following: "
180 @echo " Configure Platform: "
181 @echo " OMAP5 (SMP) - export HWVERSION=ES20 && make omap5_smp_config"
182 @echo " VAYU/J6 (SMP) - export HWVERSION=ES10 && make vayu_smp_config"
183 @echo " Build: - make"
184 @echo " Clean: - make clean"
185 @echo " Generate Binary: "
186 @echo " Firmware - make dspbin"
187 @echo " Information: "
188 @echo " Tools - make tools"
189 @echo " Sources - make sources"
190 @echo " Custom - make custom"
191 @echo " all 3 - make info"
192 @echo " Others: "
193 @echo " Check config - make config"
194 @echo " Clean config - make unconfig"
195 @echo " "