5c6547d7a5143bc738c4d3bc1eb3a2773225edba
1 #*
2 #*
3 #* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
4 #*
5 #*
6 #* Redistribution and use in source and binary forms, with or without
7 #* modification, are permitted provided that the following conditions
8 #* are met:
9 #*
10 #* Redistributions of source code must retain the above copyright
11 #* notice, this list of conditions and the following disclaimer.
12 #*
13 #* Redistributions in binary form must reproduce the above copyright
14 #* notice, this list of conditions and the following disclaimer in the
15 #* documentation and/or other materials provided with the
16 #* distribution.
17 #*
18 #* Neither the name of Texas Instruments Incorporated nor the names of
19 #* its contributors may be used to endorse or promote products derived
20 #* from this software without specific prior written permission.
21 #*
22 #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 #* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 #* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 #* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 #* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 #* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 #* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 #* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 #* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 #* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 #* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #*
36 #*******************************************************************************************
37 #* FILE PURPOSE: Top level make for the IBL
38 #*******************************************************************************************
39 #* FILE NAME: Makefile
40 #*
41 #* DESCRIPTION: Builds the Intermediate Boot Loader (IBL)
42 #*
43 #* Usage: make c6455 | c6472 | c6474 | c6457 [DEBUG=yes] [ETH=no] [NAND=no] \
44 #* [BIS=no] [COFF=no] [BLOB=no] [ELF=no] [ENDIAN= both | big | little] [I2C_BUS_ADDR= 0x50 | 0x51] \
45 #* [COMPACT_I2C=yes]
46 #*
47 #* or to make a board specific configuraiton
48 #*
49 #* make evm_c6455 | evm_c6472 | evm_c6474 | evm_c6457
50 #*
51 #* or to test the builds by making all the devices and testing excludes
52 #*
53 #* make test_build
54 #*******************************************************************************************
56 IBLS_C6X= c6455 c6472 c6474 c6457
57 EVMS_C6X= evm_c6455 evm_c6472 evm_c6474
60 # Excluding functions from the build reduces the I2C eeprom memory used and
61 # speeds the initial boot time. Note that boot table cannot be excluded
62 # because it is required for the two stage I2C load process
64 EXCLUDES=
66 ifeq ($(ETH),no)
67 EXCLUDES+= ETH
68 endif
70 ifeq ($(NAND),no)
71 EXCLUDES+= NAND
72 endif
74 ifeq ($(BIS),no)
75 EXCLUDES+= BIS
76 endif
78 ifeq ($(COFF),no)
79 EXCLUDES+= COFF
80 endif
82 ifeq ($(BLOB),no)
83 EXCLUDES+= BLOB
84 endif
86 ifeq ($(ELF),no)
87 EXCLUDES+= ELF
88 endif
92 # The endian of the build. The default target builds a single ROM image with both endians present
93 ifeq ($(ENDIAN),big)
94 ENDIAN_MODE=big
95 else
96 ifeq ($(ENDIAN),little)
97 ENDIAN_MODE=little
98 else
99 ENDIAN_MODE=both
100 endif
101 endif
103 # The i2c ROM bus address. The code will advance accross I2C bus address boundaries (the code must
104 # be blocked so that a single block doesn't cross a boundary, however).
105 ifndef I2C_BUS_ADDR
106 I2C_BUS_ADDR=0x50
107 endif
111 all:
112 @echo must specify a target [ $(IBLS_C6X) $(EVMS_C6X) ]
115 # The debug flag changes compiler options
116 ifndef DEBUG
117 DEBUG=no
118 endif
119 export DEBUG
122 $(IBLS_C6X):
123 make -f makestg1 ARCH=c64x TARGET=$@ I2C_BUS_ADDR=$(I2C_BUS_ADDR) COMPACT_I2C=$(COMPACT_I2C) ENDIAN_MODE=$(ENDIAN_MODE) EXCLUDES='$(EXCLUDES)' $@
126 # Configurations for individual evms
127 # The c455 EVM has a 128k eeprom (64k at 0x50, 64k at 0x51), so both endians are built with full functionality
128 evm_c6455:
129 make -f makestg1 ARCH=c64x TARGET=c6455 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES= c6455
131 # The c6472 EVM has a 128k eeprom (64k at 0x50, 64k at 0x51), so both endians are built with full functionality
132 evm_c6472:
133 make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES= c6472
135 # The 6474 EVM has a 32k eeprom. A stripped down version is build with only one endian.
136 evm_c6474:
137 make -f makestg1 ARCH=c64x TARGET=c6474 I2C_BUS_ADDR=0x50 COMPACT_I2C=yes ENDIAN_MODE=little EXCLUDES='ELF NAND BIS' I2C_SIZE_BYTES=0x8000 c6474
138 cp ibl_c6474/i2crom.dat ibl_c6474/i2crom_0x50.dat
139 make -f makestg1 ARCH=c64x TARGET=c6474 I2C_BUS_ADDR=0x51 COMPACT_I2C=yes ENDIAN_MODE=big EXCLUDES='ELF NAND BIS' I2C_SIZE_BYTES=0x8000 c6474
140 cp ibl_c6474/i2crom.dat ibl_c6474/i2crom_0x51.dat
142 # The 6457 EVM
143 evm_c6457:
144 make -f makestg1 ARCH=c64x TARGET=c6457 I2C_BUS_ADDR=0x50 COMPACT_I2C=yes ENDIAN_MODE=little EXCLUDES='ELF NAND BIS' I2C_SIZE_BYTES=0x8000 c6457
145 cp ibl_c6457/i2crom.dat ibl_c6457/i2crom_0x50.dat
146 make -f makestg1 ARCH=c64x TARGET=c6457 I2C_BUS_ADDR=0x51 COMPACT_I2C=yes ENDIAN_MODE=big EXCLUDES='ELF NAND BIS' I2C_SIZE_BYTES=0x8000 c6457
147 cp ibl_c6457/i2crom.dat ibl_c6457/i2crom_0x51.dat
149 # Test - builds all the targets, with single component exclusion
150 test_build:
151 make -f makestg1 ARCH=c64x TARGET=c6455 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES= c6455
152 make -f makestg1 ARCH=c64x TARGET=c6455 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=ETH c6455
153 make -f makestg1 ARCH=c64x TARGET=c6455 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=NAND c6455
154 make -f makestg1 ARCH=c64x TARGET=c6455 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=BIS c6455
155 make -f makestg1 ARCH=c64x TARGET=c6455 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=COFF c6455
156 make -f makestg1 ARCH=c64x TARGET=c6455 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=ELF c6455
157 make -f makestg1 ARCH=c64x TARGET=c6455 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=BLOB c6455
159 make -f makestg1 ARCH=c64x TARGET=c6457 I2C_BUS_ADDR=0x50 COMPACT_I2C=yes ENDIAN_MODE=both EXCLUDES= c6457
160 make -f makestg1 ARCH=c64x TARGET=c6457 I2C_BUS_ADDR=0x50 COMPACT_I2C=yes ENDIAN_MODE=both EXCLUDES=ETH c6457
161 make -f makestg1 ARCH=c64x TARGET=c6457 I2C_BUS_ADDR=0x50 COMPACT_I2C=yes ENDIAN_MODE=both EXCLUDES=NAND c6457
162 make -f makestg1 ARCH=c64x TARGET=c6457 I2C_BUS_ADDR=0x50 COMPACT_I2C=yes ENDIAN_MODE=both EXCLUDES=BIS c6457
163 make -f makestg1 ARCH=c64x TARGET=c6457 I2C_BUS_ADDR=0x50 COMPACT_I2C=yes ENDIAN_MODE=both EXCLUDES=COFF c6457
164 make -f makestg1 ARCH=c64x TARGET=c6457 I2C_BUS_ADDR=0x50 COMPACT_I2C=yes ENDIAN_MODE=both EXCLUDES=ELF c6457
165 make -f makestg1 ARCH=c64x TARGET=c6457 I2C_BUS_ADDR=0x50 COMPACT_I2C=yes ENDIAN_MODE=both EXCLUDES=BLOB c6457
167 make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES= c6472
168 make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=ETH c6472
169 make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=NAND c6472
170 make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=BIS c6472
171 make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=COFF c6472
172 make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=ELF c6472
173 make -f makestg1 ARCH=c64x TARGET=c6472 I2C_BUS_ADDR=0x50 COMPACT_I2C=no ENDIAN_MODE=both EXCLUDES=BLOB c6472
175 make -f makestg1 ARCH=c64x TARGET=c6474 I2C_BUS_ADDR=0x50 COMPACT_I2C=yes ENDIAN_MODE=both EXCLUDES= c6474
176 make -f makestg1 ARCH=c64x TARGET=c6474 I2C_BUS_ADDR=0x50 COMPACT_I2C=yes ENDIAN_MODE=both EXCLUDES=ETH c6474
177 make -f makestg1 ARCH=c64x TARGET=c6474 I2C_BUS_ADDR=0x50 COMPACT_I2C=yes ENDIAN_MODE=both EXCLUDES=NAND c6474
178 make -f makestg1 ARCH=c64x TARGET=c6474 I2C_BUS_ADDR=0x50 COMPACT_I2C=yes ENDIAN_MODE=both EXCLUDES=BIS c6474
179 make -f makestg1 ARCH=c64x TARGET=c6474 I2C_BUS_ADDR=0x50 COMPACT_I2C=yes ENDIAN_MODE=both EXCLUDES=COFF c6474
180 make -f makestg1 ARCH=c64x TARGET=c6474 I2C_BUS_ADDR=0x50 COMPACT_I2C=yes ENDIAN_MODE=both EXCLUDES=ELF c6474
181 make -f makestg1 ARCH=c64x TARGET=c6474 I2C_BUS_ADDR=0x50 COMPACT_I2C=yes ENDIAN_MODE=both EXCLUDES=BLOB c6474
184 # will need to add a line for each additional ARCH type added
185 clean:
186 make -f makestg2 clean ARCH=c64x TARGET=c6472
187 make -f makestg2 cleant ARCH=c64x TARGET=c6472
188 make -f makestg2 cleant ARCH=c64x TARGET=c6474
189 make -f makestg2 cleant ARCH=c64x TARGET=c6455
190 make -f makestg2 cleant ARCH=c64x TARGET=c6457
191 make -C ../util/bconvert clean
192 make -C ../util/btoccs clean
193 make -C ../util/i2cConfig clean ARCH=c64x TARGET=c6455
194 make -C ../util/i2cConfig clean ARCH=c64x TARGET=c6472
195 make -C ../util/i2cConfig clean ARCH=c64x TARGET=c6474
196 make -C ../util/i2cConfig clean ARCH=c64x TARGET=c6457
197 make -C ../util/nandwriter clean ARCH=c64x TARGET=c6455
198 make -C ../util/nandwriter clean ARCH=c64x TARGET=c6472
199 make -C ../util/nandwriter clean ARCH=c64x TARGET=c6474
200 make -C ../util/nandwriter clean ARCH=c64x TARGET=c6457
201 make -C ../util/romparse clean
202 make -C ../test/test1 clean
203 make -C ../test/test2 clean