Added the IBL files to remove the internal utils
[keystone-rtos/mcsdk-tools.git] / boot_loader / IBL_makestg1
1 #*******************************************************************************************
2 #* FILE PURPOSE: Top level make for the IBL
3 #*******************************************************************************************
4 #* FILE NAME: Makefile
5 #*
6 #* DESCRIPTION: Builds the Intermediate Boot Loader (IBL)
7 #*
8 #*  Usage:  make c6455 | c6472 | c6474 | c6457 | c661x [DEBUG=yes] [ETH=no] [NAND=no]  \
9 #*          [BIS=no] [COFF=no] [BLOB=no] [ELF=no] [ENDIAN= both | big | little] [I2C_BUS_ADDR= 0x50 | 0x51] \
10 #*                      [COMPACT_I2C=yes] [I2C_SIZE_BYTES=..]
11 #*******************************************************************************************
13 IBLS_C6X= c6455 c6472 c6474 c6474l c6457 c661x
16 # Excluding functions from the build reduces the I2C eeprom memory used and
17 # speeds the initial boot time. Note that boot table cannot be excluded
18 # because it is required for the two stage I2C load process
20 # The endian of the build. The default target builds a single ROM image with both endians present
21 ifeq ($(ENDIAN_MODE),big)
22  I2CROM=        big_endian
23  STAGE1_TARGET= be_target
24 else
25  ifeq ($(ENDIAN_MODE),little)
26   I2CROM=        little_endian
27   STAGE1_TARGET= le_target
28  else
29   I2CROM=        both
30   STAGE1_TARGET= be_target le_target compare
31  endif
32 endif
34 EXCLUDES= $(CEXCLUDES)
37 # The default i2c size. This is used only for the i2c writer utility
38 ifndef I2C_SIZE_BYTES
39  I2C_SIZE_BYTES=0x20000
40 endif
42 # exclusions based on device capability
43 ifeq ($(TARGET),c6455)
44  C64X_EXCLUDES=yes
45 endif
47 ifeq ($(TARGET),c6457)
48  C64X_EXCLUDES=yes
49 endif
50  
51 ifeq ($(TARGET),c6472)
52  C64X_EXCLUDES=yes
53 endif
55 ifeq ($(TARGET),c6474)
56  C64X_EXCLUDES=yes
57 endif
59 ifeq ($(C64X_EXCLUDES),yes)
61  ifeq (,$(findstring SPI, $(EXCLUDES)))
62   EXCLUDES+= SPI
63  endif
65  ifeq (,$(findstring NOR_SPI, $(EXCLUDES)))
66   EXCLUDES+= NOR_SPI
67  endif
69  ifeq (,$(findstring NOR_EMIF, $(EXCLUDES)))
70   EXCLUDES+= NOR_EMIF
71  endif
73  ifeq (,$(findstring NAND_SPI, $(EXCLUDES)))
74   EXCLUDES+= NAND_SPI
75  endif
77  ifeq (,$(findstring NAND_EMIF, $(EXCLUDES)))
78   EXCLUDES+= NAND_EMIF
79  endif
81 endif
83 ifeq ($(TARGET),c661x)
84  EXCLUDES+= NAND_GPIO
85 endif
88 # Prevent I2C/SPI rom creation based on defines
89 ROMS=
91 ifeq (,$(findstring I2C, $(EXCLUDES)))
92  ROMS+= i2crom
93 endif
95 ifeq (,$(findstring SPI, $(EXCLUDES)))
96  ROMS+= spiRom
97 endif
100 # Excludes identify which components are not part of the build
101 export EXCLUDES
103 .PHONY: all be_target le_target compare $(IBLS_C6X)
105 all:
106         @echo must specify a target [ $(IBLS_C6X) ]
110 be_target:
111         @echo EXCLUDES= $(EXCLUDES)
112         make -f makestg2 ARCH=c64x TARGET=$(TARGET) ENDIAN=big    I2C_SIZE_BYTES=$(I2C_SIZE_BYTES) I2C_BUS_ADDR=$(I2C_BUS_ADDR) INTERNAL_UTILS=$(INTERNAL_UTILS) SPI_DEFS='$(SPI_DEFS)' utils
113         make -f makestg2 ARCH=c64x TARGET=$(TARGET) ENDIAN=big    I2C_SIZE_BYTES=$(I2C_SIZE_BYTES) I2C_BUS_ADDR=$(I2C_BUS_ADDR) SPI_DEFS='$(SPI_DEFS)' $(TARGET)
115 le_target:
116         make -f makestg2 ARCH=c64x TARGET=$(TARGET) ENDIAN=little I2C_SIZE_BYTES=$(I2C_SIZE_BYTES) I2C_BUS_ADDR=$(I2C_BUS_ADDR) INTERNAL_UTILS=$(INTERNAL_UTILS) SPI_DEFS='$(SPI_DEFS)' utils
117         make -f makestg2 ARCH=c64x TARGET=$(TARGET) ENDIAN=little I2C_SIZE_BYTES=$(I2C_SIZE_BYTES) I2C_BUS_ADDR=$(I2C_BUS_ADDR) SPI_DEFS='$(SPI_DEFS)' $(TARGET)
119 compare:
120         make -f makestg2 ARCH=c64x TARGET=$(TARGET) compare
123 $(IBLS_C6X): $(STAGE1_TARGET)
124         make -f makestg2 ARCH=c64x TARGET=$@ I2CROM=$(I2CROM) I2C_BUS_ADDR=$(I2C_BUS_ADDR) I2C_MAP_ADDRESS=$(I2C_MAP_ADDRESS) COMPACT_I2C=$(COMPACT_I2C) SPI_DEFS='$(SPI_DEFS)' $(ROMS)