]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ivimm/ipumm.git/blob - Makefile
Integration with IPC 3.42.00.02, BIOS 6.45, XDC 3.32
[ivimm/ipumm.git] / Makefile
1 #/*
2 # * Copyright (c) 2011-2015, Texas Instruments Incorporated
3 # * All rights reserved.
4 # *
5 # * Redistribution and use in source and binary forms, with or without
6 # * modification, are permitted provided that the following conditions
7 # * are met:
8 # *
9 # * *  Redistributions of source code must retain the above copyright
10 # *    notice, this list of conditions and the following disclaimer.
11 # *
12 # * *  Redistributions in binary form must reproduce the above copyright
13 # *    notice, this list of conditions and the following disclaimer in the
14 # *    documentation and/or other materials provided with the distribution.
15 # *
16 # * *  Neither the name of Texas Instruments Incorporated nor the names of
17 # *    its contributors may be used to endorse or promote products derived
18 # *    from this software without specific prior written permission.
19 # *
20 # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 # * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 # * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 # * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 # * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 # * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 # * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 # * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 # * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 # * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 # * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 # */
33 # Repo
34 BIOSTOOLSROOT   ?= /opt/ti
35 REPO            := $(BIOSTOOLSROOT)
37 # Different tool versions can easily be programmed by defining below variables
38 # in your environment.
39 XDCVERSION      ?= xdctools_3_32_00_06_core
40 BIOSVERSION     ?= bios_6_45_01_29
41 IPCVERSION      ?= ipc_3_42_00_02
42 CEVERSION       ?= codec_engine_3_24_00_08
43 FCVERSION       ?= framework_components_3_40_01_04
44 XDAISVERSION    ?= xdais_7_24_00_04
46 # TI Compiler Settings
47 export TMS470CGTOOLPATH ?= $(BIOSTOOLSROOT)/ccsv6/tools/compiler/ti-cgt-arm_5.2.7
49 # Define where the sources are
50 DUCATIDCEMMSRC  = $(shell pwd)
51 TIVIDEOTOOLSROOT ?= $(BIOSTOOLSROOT)
53 # Generate the full package paths for tools
54 BIOSPROD        = $(REPO)/$(BIOSVERSION)
55 CEPROD          = $(TIVIDEOTOOLSROOT)/$(CEVERSION)
56 FCPROD          = $(TIVIDEOTOOLSROOT)/$(FCVERSION)
57 XDAISPROD       = $(REPO)/$(XDAISVERSION)
59 # XDC settings
60 export XDCBUILDCFG = $(DUCATIDCEMMSRC)/build/config.bld
62 XDCDIST_TREE    = $(REPO)/$(XDCVERSION)
63 export XDCROOT  = $(XDCDIST_TREE)
65 export XDCPATH  = $(BIOSPROD)/packages;$(IPCSRC)/packages;$(CEPROD)/packages;$(FCPROD)/packages;$(XDAISPROD)/packages;$(DUCATIDCEMMSRC)/extrel/ti/ivahd_codecs/packages;$(DUCATIDCEMMSRC)/src;
67 # Custom settings for build
68 JOBS            ?= 1
69 # Set profile, always set as release version. Alternate option is "debug"
70 PROFILE         ?= release
71 # Set debug/trace level from 0 to 4
72 TRACELEVEL      ?= 0
73 # Offloads core to sysm3 code
74 OFFLOAD         ?= 1
75 # Set to Non-SMP by default
76 FORSMP          ?= 0
77 # Set Instrumentation to be allowed (ENABLE to enable it)
78 SETINST         ?= ENABLE
79 # Set HW revision type- OMAP5:ES20, VAYU:ES10
80 HWVERSION   ?= ES10
81 # Set if Profiler needs to ON or OFF for the build
82 PROFILER    ?= DISABLE
84 all: ducatibin
86 # Include platform build configuration
87 config:
88 ifeq (bldcfg.mk,$(wildcard bldcfg.mk))
89 include bldcfg.mk
90 else
91         @echo "No config selected. Please configure the build first and then try to build."
92         @echo "For more info, use 'make help'"
93         @exit 1
94 endif
96 unconfig:
97         @echo "Removed existing configuration"
98         @rm -f bldcfg.mk
100 vayu_smp_config: unconfig
101         @echo "Creating new config\c"
102         @echo DUCATI_CONFIG = vayu_smp_config > bldcfg.mk
103         @echo ".\c"
104         @echo MYXDCARGS=\"profile=$(PROFILE) trace_level=$(TRACELEVEL) hw_type=VAYU hw_version=$(HWVERSION) BIOS_type=SMP prof_type=$(PROFILER)\" >> bldcfg.mk
105         @echo ".\c"
106         @echo CHIP = VAYU >> bldcfg.mk
107         @echo ".\c"
108         @echo FORSMP = 1 >> bldcfg.mk
109         @echo ".\c"
110         @echo DUCATIBINNAME = "dra7-ipu2-fw.xem4" >> bldcfg.mk
111         @echo INTBINNAME = "ipu.xem4" >> bldcfg.mk
112         @echo ".\c"
113         @echo QNXDUCATIBINNAME = "dra7xx-m4-ipu2.xem4" >> bldcfg.mk
114         @echo QNXINTBINNAME = "qnx_ipu.xem4" >> bldcfg.mk
115         @echo ".\c"
116         @echo "done"
118 omap5_smp_config: unconfig
119         @echo "Creating new config\c"
120         @echo DUCATI_CONFIG = omap5_smp_config > bldcfg.mk
121         @echo ".\c"
122         @echo MYXDCARGS=\"profile=$(PROFILE) trace_level=$(TRACELEVEL) hw_type=OMAP5 hw_version=$(HWVERSION) BIOS_type=SMP prof_type=$(PROFILER)\" >> bldcfg.mk
123         @echo ".\c"
124         @echo CHIP = OMAP5 >> bldcfg.mk
125         @echo ".\c"
126         @echo FORSMP = 1 >> bldcfg.mk
127         @echo ".\c"
128         @echo DUCATIBINNAME = "omap5-ipu-fw.xem4" >> bldcfg.mk
129         @echo INTBINNAME = "ipu.xem4" >> bldcfg.mk
130         @echo ".\c"
131         @echo QNXDUCATIBINNAME = "omap5-m4-ipu.xem4" >> bldcfg.mk
132         @echo QNXINTBINNAME = "qnx_ipu.xem4" >> bldcfg.mk
133         @echo ".\c"
134         @echo "done"
136 clean: config
137         export XDCARGS=$(MYXDCARGS); \
138          $(XDCROOT)/xdc --jobs=$(JOBS) clean -PD $(DUCATIDCEMMSRC)/platform/ti/dce/baseimage/.
140 build: config
141 ifeq ($(IPCSRC),)
142         @echo "ERROR: IPCSRC not set. Exiting..."
143         @echo "For more info, use 'make help'"
144         @exit 1
145 else ifeq ($(TMS470CGTOOLPATH),)
146         @echo "ERROR: TMS470CGTOOLPATH not set. Exiting..."
147         @echo "For more info, use 'make help'"
148         @exit 1
149 endif
150         export XDCARGS=$(MYXDCARGS); \
151         $(XDCROOT)/xdc --jobs=$(JOBS) -PD $(DUCATIDCEMMSRC)/platform/ti/dce/baseimage/.
153 ducatibin: build
154 ifeq ($(FORSMP),1)
155         $(TMS470CGTOOLPATH)/bin/armstrip -p $(DUCATIDCEMMSRC)/platform/ti/dce/baseimage/out/ipu/$(PROFILE)/$(INTBINNAME) -o=$(DUCATIBINNAME)
156         $(TMS470CGTOOLPATH)/bin/armstrip -p $(DUCATIDCEMMSRC)/platform/ti/dce/baseimage/out/ipu/$(PROFILE)/$(QNXINTBINNAME) -o=$(QNXDUCATIBINNAME)
157 else
158         @echo "***********Not yet implemented************"
159 endif
161 info: tools sources custom
162 tools:
163         @echo "REPO    := $(REPO)"
164         @echo "XDC     := $(XDCDIST_TREE)"
165         @echo "BIOS    := $(BIOSPROD)"
166         @echo "FC      := $(FCPROD)"
167         @echo "CE      := $(CEPROD)"
168         @echo "XDAIS   := $(XDAISPROD)"
169         @echo "TMS470CGTOOLPATH := $(TMS470CGTOOLPATH)"
170         @echo " "
172 sources:
173         @echo "IPC  := $(IPCSRC)"
174         @echo " "
176         @echo "DUCATIDCEMMSRC  := $(DUCATIDCEMMSRC)"
177         @echo "DUCATIDCEMMSRC info: $(shell git --git-dir=$(DUCATIDCEMMSRC)/.git --work-tree=$(DUCATIDCEMMSRC)/ log --pretty=format:'%ad %h %d' --oneline --date=short -1 )"
178         @echo "DUCATIMMSRC describe: $(shell git --git-dir=$(DUCATIDCEMMSRC)/.git --work-tree=$(DUCATIDCEMMSRC)/ describe --dirty)"
179         @echo " "
181 custom:
182         @echo "JOBS       := $(JOBS)"
183         @echo "PROFILE    := $(PROFILE)"
184         @echo "TRACELEVEL := $(TRACELEVEL)"
185         @echo "OFFLOAD    := $(OFFLOAD)"
186         @echo "FORSMP     := $(FORSMP)"
187         @echo "SETINST    := $(SETINST)"
188         @echo "HWVERSION  := $(HWVERSION)"
189         @echo "PROFILER   := $(PROFILER)"
190         @echo " "
191         @echo "Ducati configuration used:  $(DUCATI_CONFIG)"
192         @echo "Ducati binary name:         $(DUCATIBINNAME)"
193         @echo "QNX Ducati binary name:     $(QNXDUCATIBINNAME)"
194         @echo " "
196 help:
197         @echo " "
198         @echo "Please export the following variables: "
199         @echo " 1. BIOSTOOLSROOT - Directory where all the BIOS tools are installed."
200         @echo "                    If not mentioned, picks up the default, /opt/ti"
201         @echo " 2. TMS470CGTOOLPATH - TMS470 ARM Code Generation Tools installation path"
202         @echo "                       If not mentioned, tries the default install location, /opt/ti/TI_CGT_TI_ARM_5.0.1"
203         @echo " 3. IPCSRC - Absolute path of the $(IPCVERSION)"
204         @echo " 4. [Optional] - Any of the following variables can be defined to customize your build."
205         @echo "       JOBS       - To specify the number of parallel build jobs (default is 1)"
206         @echo "       PROFILE    - 'release' or 'debug' profile for the libraries and binaries (default is release)"
207         @echo "       TRACELEVEL - From 0 to 4. Higher the value, more the traces. 0 implies no traces (default is 0)"
208         @echo "       OFFLOAD    - Enable offloading support (default is 1, set to 0 to disable)"
209         @echo " 5. [Optional] - Any of the following variables can be defined to change the default tool versions."
210         @echo "       XDCVERSION       = $(XDCDIST_TREE)"
211         @echo "       BIOSVERSION      = $(BIOSPROD)"
212         @echo "       IPCVERSION       = $(IPCSRC)"
213         @echo "       CEVERSION        = $(CEPROD)"
214         @echo "       FCVERSION        = $(FCPROD)"
215         @echo "       XDAISVERSION     = $(XDAISPROD)"
216         @echo "       TMS470CGTOOLPATH = $(TMS470CGTOOLPATH)"
217         @echo " "
218         @echo "Use the appropriate make targets from the following: "
219         @echo "  Configure Platform: "
220         @echo "     OMAP5 (SMP)       - export HWVERSION=ES20 && make omap5_smp_config"
221         @echo "     VAYU/J6 (SMP)     - export HWVERSION=ES10 && make vayu_smp_config"
222         @echo "  Build:               - make"
223         @echo "  Clean:               - make clean"
224         @echo "  Generate Binary: "
225         @echo "     Firmware        - make ducatibin"
226         @echo "  Information: "
227         @echo "     Tools           - make tools"
228         @echo "     Sources         - make sources"
229         @echo "     Custom          - make custom"
230         @echo "     all 3           - make info"
231         @echo "  Others: "
232         @echo "     Check config    - make config"
233         @echo "     Clean config    - make unconfig"
234         @echo " "