xref: /openbmc/u-boot/Makefile (revision 7816f2cf)
17ebf7443Swdenk#
2b1af6f53SWolfgang Denk# (C) Copyright 2000-2011
37ebf7443Swdenk# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
47ebf7443Swdenk#
57ebf7443Swdenk# See file CREDITS for list of people who contributed to this
67ebf7443Swdenk# project.
77ebf7443Swdenk#
87ebf7443Swdenk# This program is free software; you can redistribute it and/or
97ebf7443Swdenk# modify it under the terms of the GNU General Public License as
1045a212c4SWolfgang Denk# published by the Free Software Foundatio; either version 2 of
117ebf7443Swdenk# the License, or (at your option) any later version.
127ebf7443Swdenk#
137ebf7443Swdenk# This program is distributed in the hope that it will be useful,
147ebf7443Swdenk# but WITHOUT ANY WARRANTY; without even the implied warranty of
157ebf7443Swdenk# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
167ebf7443Swdenk# GNU General Public License for more details.
177ebf7443Swdenk#
187ebf7443Swdenk# You should have received a copy of the GNU General Public License
197ebf7443Swdenk# along with this program; if not, write to the Free Software
207ebf7443Swdenk# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
217ebf7443Swdenk# MA 02111-1307 USA
227ebf7443Swdenk#
237ebf7443Swdenk
2442d44f63SWolfgang DenkVERSION = 2011
257a82c208SWolfgang DenkPATCHLEVEL = 06
268b9e4787SWolfgang DenkSUBLEVEL =
27b1af6f53SWolfgang DenkEXTRAVERSION =
288b9e4787SWolfgang Denkifneq "$(SUBLEVEL)" ""
29881a87ecSWolfgang DenkU_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
308b9e4787SWolfgang Denkelse
318b9e4787SWolfgang DenkU_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION)
328b9e4787SWolfgang Denkendif
33561858eeSPeter TyserTIMESTAMP_FILE = $(obj)include/timestamp_autogenerated.h
34f9328639SMarian BalakowiczVERSION_FILE = $(obj)include/version_autogenerated.h
35881a87ecSWolfgang Denk
367ebf7443SwdenkHOSTARCH := $(shell uname -m | \
37fea25720SGraeme Russ	sed -e s/i.86/x86/ \
387ebf7443Swdenk	    -e s/sun4u/sparc64/ \
397ebf7443Swdenk	    -e s/arm.*/arm/ \
407ebf7443Swdenk	    -e s/sa110/arm/ \
41d0179083SKumar Gala	    -e s/ppc64/powerpc/ \
42d0179083SKumar Gala	    -e s/ppc/powerpc/ \
438d1f6355SNobuhiro Iwamatsu	    -e s/macppc/powerpc/\
448d1f6355SNobuhiro Iwamatsu	    -e s/sh.*/sh/)
457ebf7443Swdenk
46f9d77ed3SWolfgang DenkHOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
477ebf7443Swdenk	    sed -e 's/\(cygwin\).*/cygwin/')
487ebf7443Swdenk
49cf7a7b99SPeter Tyser# Set shell to bash if possible, otherwise fall back to sh
50cf7a7b99SPeter TyserSHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
51cf7a7b99SPeter Tyser	else if [ -x /bin/bash ]; then echo /bin/bash; \
52cf7a7b99SPeter Tyser	else echo sh; fi; fi)
53cf7a7b99SPeter Tyser
54cf7a7b99SPeter Tyserexport	HOSTARCH HOSTOS SHELL
557ebf7443Swdenk
567ebf7443Swdenk# Deal with colliding definitions from tcsh etc.
577ebf7443SwdenkVENDOR=
587ebf7443Swdenk
597ebf7443Swdenk#########################################################################
60ae6d1056SWolfgang Denk# Allow for silent builds
61ae6d1056SWolfgang Denkifeq (,$(findstring s,$(MAKEFLAGS)))
62ae6d1056SWolfgang DenkXECHO = echo
63ae6d1056SWolfgang Denkelse
64ae6d1056SWolfgang DenkXECHO = :
65ae6d1056SWolfgang Denkendif
66ae6d1056SWolfgang Denk
67ae6d1056SWolfgang Denk#########################################################################
68f9328639SMarian Balakowicz#
69f9328639SMarian Balakowicz# U-boot build supports producing a object files to the separate external
70f9328639SMarian Balakowicz# directory. Two use cases are supported:
71f9328639SMarian Balakowicz#
72f9328639SMarian Balakowicz# 1) Add O= to the make command line
73f9328639SMarian Balakowicz# 'make O=/tmp/build all'
74f9328639SMarian Balakowicz#
75f9328639SMarian Balakowicz# 2) Set environement variable BUILD_DIR to point to the desired location
76f9328639SMarian Balakowicz# 'export BUILD_DIR=/tmp/build'
77f9328639SMarian Balakowicz# 'make'
78f9328639SMarian Balakowicz#
79f9328639SMarian Balakowicz# The second approach can also be used with a MAKEALL script
80f9328639SMarian Balakowicz# 'export BUILD_DIR=/tmp/build'
81f9328639SMarian Balakowicz# './MAKEALL'
82f9328639SMarian Balakowicz#
83f9328639SMarian Balakowicz# Command line 'O=' setting overrides BUILD_DIR environent variable.
84f9328639SMarian Balakowicz#
85f9328639SMarian Balakowicz# When none of the above methods is used the local build is performed and
86f9328639SMarian Balakowicz# the object files are placed in the source directory.
87f9328639SMarian Balakowicz#
887ebf7443Swdenk
89f9328639SMarian Balakowiczifdef O
90f9328639SMarian Balakowiczifeq ("$(origin O)", "command line")
91f9328639SMarian BalakowiczBUILD_DIR := $(O)
92f9328639SMarian Balakowiczendif
93f9328639SMarian Balakowiczendif
947ebf7443Swdenk
95f9328639SMarian Balakowiczifneq ($(BUILD_DIR),)
96f9328639SMarian Balakowiczsaved-output := $(BUILD_DIR)
974f0645ebSMarian Balakowicz
984f0645ebSMarian Balakowicz# Attempt to create a output directory.
994f0645ebSMarian Balakowicz$(shell [ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR})
1004f0645ebSMarian Balakowicz
1014f0645ebSMarian Balakowicz# Verify if it was successful.
102f9328639SMarian BalakowiczBUILD_DIR := $(shell cd $(BUILD_DIR) && /bin/pwd)
103f9328639SMarian Balakowicz$(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
104f9328639SMarian Balakowiczendif # ifneq ($(BUILD_DIR),)
105f9328639SMarian Balakowicz
106f9328639SMarian BalakowiczOBJTREE		:= $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
107c8f9c302SDaniel SchwierzeckSPLTREE		:= $(OBJTREE)/spl
108f9328639SMarian BalakowiczSRCTREE		:= $(CURDIR)
109f9328639SMarian BalakowiczTOPDIR		:= $(SRCTREE)
110f9328639SMarian BalakowiczLNDIR		:= $(OBJTREE)
111c8f9c302SDaniel Schwierzeckexport	TOPDIR SRCTREE OBJTREE SPLTREE
112f9328639SMarian Balakowicz
113f9328639SMarian BalakowiczMKCONFIG	:= $(SRCTREE)/mkconfig
114f9328639SMarian Balakowiczexport MKCONFIG
115f9328639SMarian Balakowicz
116f9328639SMarian Balakowiczifneq ($(OBJTREE),$(SRCTREE))
117f9328639SMarian BalakowiczREMOTE_BUILD	:= 1
118f9328639SMarian Balakowiczexport REMOTE_BUILD
119f9328639SMarian Balakowiczendif
120f9328639SMarian Balakowicz
121f9328639SMarian Balakowicz# $(obj) and (src) are defined in config.mk but here in main Makefile
122f9328639SMarian Balakowicz# we also need them before config.mk is included which is the case for
123f9328639SMarian Balakowicz# some targets like unconfig, clean, clobber, distclean, etc.
124f9328639SMarian Balakowiczifneq ($(OBJTREE),$(SRCTREE))
125f9328639SMarian Balakowiczobj := $(OBJTREE)/
126f9328639SMarian Balakowiczsrc := $(SRCTREE)/
127f9328639SMarian Balakowiczelse
128f9328639SMarian Balakowiczobj :=
129f9328639SMarian Balakowiczsrc :=
130f9328639SMarian Balakowiczendif
131f9328639SMarian Balakowiczexport obj src
132f9328639SMarian Balakowicz
1335013c09fSWolfgang Denk# Make sure CDPATH settings don't interfere
1345013c09fSWolfgang Denkunexport CDPATH
1355013c09fSWolfgang Denk
136f9328639SMarian Balakowicz#########################################################################
137f9328639SMarian Balakowicz
1386d1ce387SMike Frysinger# The "tools" are needed early, so put this first
1396d1ce387SMike Frysinger# Don't include stuff already done in $(LIBS)
1406d1ce387SMike FrysingerSUBDIRS	= tools \
1411bc15386SPeter Tyser	  examples/standalone \
142d4abc757SPeter Tyser	  examples/api
1436d1ce387SMike Frysinger
14428abd48fSIlya Yanok.PHONY : $(SUBDIRS) $(VERSION_FILE)
1456d1ce387SMike Frysinger
146ae6d1056SWolfgang Denkifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))
147f9328639SMarian Balakowicz
1482632c008SMike Frysinger# Include autoconf.mk before config.mk so that the config options are available
1492632c008SMike Frysinger# to all top level build files.  We need the dummy all: target to prevent the
1502632c008SMike Frysinger# dependency target in autoconf.mk.dep from being the default.
1512632c008SMike Frysingerall:
1522632c008SMike Frysingersinclude $(obj)include/autoconf.mk.dep
1532632c008SMike Frysingersinclude $(obj)include/autoconf.mk
1542632c008SMike Frysinger
1557ebf7443Swdenk# load ARCH, BOARD, and CPU configuration
156ae6d1056SWolfgang Denkinclude $(obj)include/config.mk
1571d9f4105Swdenkexport	ARCH CPU BOARD VENDOR SOC
158f9328639SMarian Balakowicz
1591ea6bcd8SMike Frysinger# set default to nothing for native builds
160a5284efdSWolfgang Denkifeq ($(HOSTARCH),$(ARCH))
1611ea6bcd8SMike FrysingerCROSS_COMPILE ?=
1627ebf7443Swdenkendif
1637ebf7443Swdenk
16492b197f0SWolfgang Denk# load other configuration
16592b197f0SWolfgang Denkinclude $(TOPDIR)/config.mk
16692b197f0SWolfgang Denk
167d51dfff7SIlya Yanok# If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
168d51dfff7SIlya Yanok# that (or fail if absent).  Otherwise, search for a linker script in a
169d51dfff7SIlya Yanok# standard location.
170d51dfff7SIlya Yanok
171d51dfff7SIlya Yanokifndef LDSCRIPT
172d51dfff7SIlya Yanok	#LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
173d51dfff7SIlya Yanok	ifdef CONFIG_SYS_LDSCRIPT
174d51dfff7SIlya Yanok		# need to strip off double quotes
175d51dfff7SIlya Yanok		LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
176d51dfff7SIlya Yanok	endif
177d51dfff7SIlya Yanokendif
178d51dfff7SIlya Yanok
179d51dfff7SIlya Yanokifndef LDSCRIPT
180d51dfff7SIlya Yanok	ifeq ($(CONFIG_NAND_U_BOOT),y)
181d51dfff7SIlya Yanok		LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
182d51dfff7SIlya Yanok		ifeq ($(wildcard $(LDSCRIPT)),)
183d51dfff7SIlya Yanok			LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
184d51dfff7SIlya Yanok		endif
185d51dfff7SIlya Yanok	endif
186d51dfff7SIlya Yanok	ifeq ($(wildcard $(LDSCRIPT)),)
187d51dfff7SIlya Yanok		LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
188d51dfff7SIlya Yanok	endif
189d51dfff7SIlya Yanok	ifeq ($(wildcard $(LDSCRIPT)),)
190d51dfff7SIlya Yanok		LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot.lds
191d51dfff7SIlya Yanok	endif
192d51dfff7SIlya Yanok	ifeq ($(wildcard $(LDSCRIPT)),)
193d51dfff7SIlya Yanok$(error could not find linker script)
194d51dfff7SIlya Yanok	endif
195d51dfff7SIlya Yanokendif
196d51dfff7SIlya Yanok
1977ebf7443Swdenk#########################################################################
1987ebf7443Swdenk# U-Boot objects....order is important (i.e. start must be first)
1997ebf7443Swdenk
20003b7004dSPeter TyserOBJS  = $(CPUDIR)/start.o
201fea25720SGraeme Russifeq ($(CPU),x86)
20203b7004dSPeter TyserOBJS += $(CPUDIR)/start16.o
20303b7004dSPeter TyserOBJS += $(CPUDIR)/resetvec.o
2042262cfeeSwdenkendif
2057ebf7443Swdenkifeq ($(CPU),ppc4xx)
20603b7004dSPeter TyserOBJS += $(CPUDIR)/resetvec.o
2077ebf7443Swdenkendif
20842d1f039Swdenkifeq ($(CPU),mpc85xx)
20903b7004dSPeter TyserOBJS += $(CPUDIR)/resetvec.o
21042d1f039Swdenkendif
2117ebf7443Swdenk
212f9328639SMarian BalakowiczOBJS := $(addprefix $(obj),$(OBJS))
213f9328639SMarian Balakowicz
2146d8962e8SSebastien CarlierLIBS  = lib/libgeneric.o
2156d8962e8SSebastien CarlierLIBS += lib/lzma/liblzma.o
2166d8962e8SSebastien CarlierLIBS += lib/lzo/liblzo.o
217e89516f0SMike FrysingerLIBS += lib/zlib/libz.o
2187608d75fSKim PhillipsLIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
2196d8962e8SSebastien Carlier	"board/$(VENDOR)/common/lib$(VENDOR).o"; fi)
2206d8962e8SSebastien CarlierLIBS += $(CPUDIR)/lib$(CPU).o
2211d9f4105Swdenkifdef SOC
2226d8962e8SSebastien CarlierLIBS += $(CPUDIR)/$(SOC)/lib$(SOC).o
2231d9f4105Swdenkendif
224323bfa8fSStefan Roeseifeq ($(CPU),ixp)
2256d8962e8SSebastien CarlierLIBS += arch/arm/cpu/ixp/npe/libnpe.o
226323bfa8fSStefan Roeseendif
2276d8962e8SSebastien CarlierLIBS += arch/$(ARCH)/lib/lib$(ARCH).o
2286d8962e8SSebastien CarlierLIBS += fs/cramfs/libcramfs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o \
2296d8962e8SSebastien Carlier	fs/reiserfs/libreiserfs.o fs/ext2/libext2fs.o fs/yaffs2/libyaffs2.o \
2306d8962e8SSebastien Carlier	fs/ubifs/libubifs.o
2316d8962e8SSebastien CarlierLIBS += net/libnet.o
2326d8962e8SSebastien CarlierLIBS += disk/libdisk.o
2336d8962e8SSebastien CarlierLIBS += drivers/bios_emulator/libatibiosemu.o
2346d8962e8SSebastien CarlierLIBS += drivers/block/libblock.o
2356d8962e8SSebastien CarlierLIBS += drivers/dma/libdma.o
2366d8962e8SSebastien CarlierLIBS += drivers/fpga/libfpga.o
2376d8962e8SSebastien CarlierLIBS += drivers/gpio/libgpio.o
2386d8962e8SSebastien CarlierLIBS += drivers/hwmon/libhwmon.o
2396d8962e8SSebastien CarlierLIBS += drivers/i2c/libi2c.o
2406d8962e8SSebastien CarlierLIBS += drivers/input/libinput.o
2416d8962e8SSebastien CarlierLIBS += drivers/misc/libmisc.o
2426d8962e8SSebastien CarlierLIBS += drivers/mmc/libmmc.o
2436d8962e8SSebastien CarlierLIBS += drivers/mtd/libmtd.o
2446d8962e8SSebastien CarlierLIBS += drivers/mtd/nand/libnand.o
2456d8962e8SSebastien CarlierLIBS += drivers/mtd/onenand/libonenand.o
2466d8962e8SSebastien CarlierLIBS += drivers/mtd/ubi/libubi.o
2476d8962e8SSebastien CarlierLIBS += drivers/mtd/spi/libspi_flash.o
2486d8962e8SSebastien CarlierLIBS += drivers/net/libnet.o
2496d8962e8SSebastien CarlierLIBS += drivers/net/phy/libphy.o
2506d8962e8SSebastien CarlierLIBS += drivers/pci/libpci.o
2516d8962e8SSebastien CarlierLIBS += drivers/pcmcia/libpcmcia.o
2526d8962e8SSebastien CarlierLIBS += drivers/power/libpower.o
2536d8962e8SSebastien CarlierLIBS += drivers/spi/libspi.o
2547737d5c6SDave Liuifeq ($(CPU),mpc83xx)
2556d8962e8SSebastien CarlierLIBS += drivers/qe/libqe.o
2566d8962e8SSebastien CarlierLIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
2577737d5c6SDave Liuendif
258da9d4610SAndy Flemingifeq ($(CPU),mpc85xx)
2596d8962e8SSebastien CarlierLIBS += drivers/qe/libqe.o
2606d8962e8SSebastien CarlierLIBS += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
2616d8962e8SSebastien CarlierLIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
26258e5e9afSKumar Galaendif
26358e5e9afSKumar Galaifeq ($(CPU),mpc86xx)
2646d8962e8SSebastien CarlierLIBS += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
2656d8962e8SSebastien CarlierLIBS += arch/powerpc/cpu/mpc8xxx/lib8xxx.o
266da9d4610SAndy Flemingendif
2676d8962e8SSebastien CarlierLIBS += drivers/rtc/librtc.o
2686d8962e8SSebastien CarlierLIBS += drivers/serial/libserial.o
2696d8962e8SSebastien CarlierLIBS += drivers/twserial/libtws.o
270181f565cSMike FrysingerLIBS += drivers/usb/eth/libusb_eth.o
2716d8962e8SSebastien CarlierLIBS += drivers/usb/gadget/libusb_gadget.o
2726d8962e8SSebastien CarlierLIBS += drivers/usb/host/libusb_host.o
2736d8962e8SSebastien CarlierLIBS += drivers/usb/musb/libusb_musb.o
2746d8962e8SSebastien CarlierLIBS += drivers/usb/phy/libusb_phy.o
2756d8962e8SSebastien CarlierLIBS += drivers/video/libvideo.o
2766d8962e8SSebastien CarlierLIBS += drivers/watchdog/libwatchdog.o
2776d8962e8SSebastien CarlierLIBS += common/libcommon.o
2786d8962e8SSebastien CarlierLIBS += lib/libfdt/libfdt.o
2796d8962e8SSebastien CarlierLIBS += api/libapi.o
2806d8962e8SSebastien CarlierLIBS += post/libpost.o
281f9328639SMarian Balakowicz
282d34efc76SSteve Sakomanifeq ($(SOC),omap3)
2836d8962e8SSebastien CarlierLIBS += $(CPUDIR)/omap-common/libomap-common.o
284d34efc76SSteve Sakomanendif
285d34efc76SSteve Sakomanifeq ($(SOC),omap4)
2866d8962e8SSebastien CarlierLIBS += $(CPUDIR)/omap-common/libomap-common.o
287d34efc76SSteve Sakomanendif
288d34efc76SSteve Sakoman
289852bd07cSMinkyu Kangifeq ($(SOC),s5pc1xx)
2906d8962e8SSebastien CarlierLIBS += $(CPUDIR)/s5p-common/libs5p-common.o
291852bd07cSMinkyu Kangendif
292852bd07cSMinkyu Kangifeq ($(SOC),s5pc2xx)
2936d8962e8SSebastien CarlierLIBS += $(CPUDIR)/s5p-common/libs5p-common.o
294852bd07cSMinkyu Kangendif
295852bd07cSMinkyu Kang
296566d49a3SWolfgang DenkLIBS := $(addprefix $(obj),$(sort $(LIBS)))
29728abd48fSIlya Yanok.PHONY : $(LIBS) $(TIMESTAMP_FILE)
298a8c7c708Swdenk
2996d8962e8SSebastien CarlierLIBBOARD = board/$(BOARDDIR)/lib$(BOARD).o
300de109d90SWolfgang DenkLIBBOARD := $(addprefix $(obj),$(LIBBOARD))
301de109d90SWolfgang Denk
3024f7cb08eSwdenk# Add GCC lib
30352b1bf2cSWolfgang Denkifdef USE_PRIVATE_LIBGCC
30452b1bf2cSWolfgang Denkifeq ("$(USE_PRIVATE_LIBGCC)", "yes")
305635d1b3eSMatthias WeisserPLATFORM_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/libgcc.o
30652b1bf2cSWolfgang Denkelse
30752b1bf2cSWolfgang DenkPLATFORM_LIBGCC = -L $(USE_PRIVATE_LIBGCC) -lgcc
30852b1bf2cSWolfgang Denkendif
30952b1bf2cSWolfgang Denkelse
31052b1bf2cSWolfgang DenkPLATFORM_LIBGCC = -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
31152b1bf2cSWolfgang Denkendif
31252b1bf2cSWolfgang DenkPLATFORM_LIBS += $(PLATFORM_LIBGCC)
31352b1bf2cSWolfgang Denkexport PLATFORM_LIBS
3143d3befa7Swdenk
3156ac9f479SMike Frysinger# Special flags for CPP when processing the linker script.
3166ac9f479SMike Frysinger# Pass the version down so we can handle backwards compatibility
3176ac9f479SMike Frysinger# on the fly.
3186ac9f479SMike FrysingerLDPPFLAGS += \
3196ac9f479SMike Frysinger	-include $(TOPDIR)/include/u-boot/u-boot.lds.h \
3206ac9f479SMike Frysinger	$(shell $(LD) --version | \
3216ac9f479SMike Frysinger	  sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
3226ac9f479SMike Frysinger
323f9328639SMarian Balakowicz__OBJS := $(subst $(obj),,$(OBJS))
324de109d90SWolfgang Denk__LIBS := $(subst $(obj),,$(LIBS)) $(subst $(obj),,$(LIBBOARD))
325f9328639SMarian Balakowicz
3267ebf7443Swdenk#########################################################################
327bdccc4feSwdenk#########################################################################
3287ebf7443Swdenk
329f3a14d37SMike Frysingerifneq ($(CONFIG_BOARD_SIZE_LIMIT),)
330f3a14d37SMike FrysingerBOARD_SIZE_CHECK = \
331f3a14d37SMike Frysinger	@actual=`wc -c $@ | awk '{print $$1}'`; \
332f3a14d37SMike Frysinger	limit=$(CONFIG_BOARD_SIZE_LIMIT); \
333f3a14d37SMike Frysinger	if test $$actual -gt $$limit; then \
334f3a14d37SMike Frysinger		echo "$@ exceeds file size limit:"; \
335f3a14d37SMike Frysinger		echo "  limit:  $$limit bytes"; \
336f3a14d37SMike Frysinger		echo "  actual: $$actual bytes"; \
337f3a14d37SMike Frysinger		echo "  excess: $$((actual - limit)) bytes"; \
338f3a14d37SMike Frysinger		exit 1; \
339f3a14d37SMike Frysinger	fi
340f3a14d37SMike Frysingerelse
341f3a14d37SMike FrysingerBOARD_SIZE_CHECK =
342f3a14d37SMike Frysingerendif
343f3a14d37SMike Frysinger
3443e88337bSMike Frysinger# Always append ALL so that arch config.mk's can add custom ones
3454e0fbb98SDaniel SchwierzeckALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
346e935a374SHaiying Wang
3474e0fbb98SDaniel SchwierzeckALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
3484e0fbb98SDaniel SchwierzeckALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
349e935a374SHaiying WangONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
3504e0fbb98SDaniel SchwierzeckALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
3515df2ee27SDaniel SchwierzeckALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
3527ebf7443Swdenk
3534e0fbb98SDaniel Schwierzeckall:		$(ALL-y)
3547ebf7443Swdenk
355f9328639SMarian Balakowicz$(obj)u-boot.hex:	$(obj)u-boot
3566310eb9dSwdenk		$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
3576310eb9dSwdenk
358f9328639SMarian Balakowicz$(obj)u-boot.srec:	$(obj)u-boot
3590817d688SRicardo Ribalda Delgado		$(OBJCOPY) -O srec $< $@
3607ebf7443Swdenk
361f9328639SMarian Balakowicz$(obj)u-boot.bin:	$(obj)u-boot
3627ebf7443Swdenk		$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
363f3a14d37SMike Frysinger		$(BOARD_SIZE_CHECK)
3647ebf7443Swdenk
36594a91e24SMike Frysinger$(obj)u-boot.ldr:	$(obj)u-boot
36676d82187SMike Frysinger		$(CREATE_LDR_ENV)
36768e56324SMike Frysinger		$(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS)
368f3a14d37SMike Frysinger		$(BOARD_SIZE_CHECK)
36994a91e24SMike Frysinger
37094a91e24SMike Frysinger$(obj)u-boot.ldr.hex:	$(obj)u-boot.ldr
37194a91e24SMike Frysinger		$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ -I binary
37294a91e24SMike Frysinger
37394a91e24SMike Frysinger$(obj)u-boot.ldr.srec:	$(obj)u-boot.ldr
37494a91e24SMike Frysinger		$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ -I binary
37594a91e24SMike Frysinger
376f9328639SMarian Balakowicz$(obj)u-boot.img:	$(obj)u-boot.bin
377a2a0a717SWolfgang Denk		$(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
37814d0a02aSWolfgang Denk		-a $(CONFIG_SYS_TEXT_BASE) -e 0 \
379881a87ecSWolfgang Denk		-n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
380bdccc4feSwdenk			sed -e 's/"[	 ]*$$/ for $(BOARD) board"/') \
381bdccc4feSwdenk		-d $< $@
382bdccc4feSwdenk
3838edcde5eSStefano Babic$(obj)u-boot.imx:       $(obj)u-boot.bin
38445d7d72bSStefano Babic		$(obj)tools/mkimage -n  $(CONFIG_IMX_CONFIG) -T imximage \
38514d0a02aSWolfgang Denk		-e $(CONFIG_SYS_TEXT_BASE) -d $< $@
3868edcde5eSStefano Babic
387aa0c7a86SPrafulla Wadaskar$(obj)u-boot.kwb:       $(obj)u-boot.bin
38831d80c77SPrafulla Wadaskar		$(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
3892ea88b06SEric Cooper		-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
390aa0c7a86SPrafulla Wadaskar
391566a494fSHeiko Schocher$(obj)u-boot.sha1:	$(obj)u-boot.bin
39201159530SHeiko Schocher		$(obj)tools/ubsha1 $(obj)u-boot.bin
393566a494fSHeiko Schocher
394f9328639SMarian Balakowicz$(obj)u-boot.dis:	$(obj)u-boot
3957ebf7443Swdenk		$(OBJDUMP) -d $< > $@
3967ebf7443Swdenk
397*7816f2cfSHeiko Schocher$(obj)u-boot.ubl:       $(obj)u-boot-nand.bin
398*7816f2cfSHeiko Schocher		$(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \
399*7816f2cfSHeiko Schocher		-e $(CONFIG_SYS_TEXT_BASE) -d $< $@
400*7816f2cfSHeiko Schocher
401ecb1dc89SMike FrysingerGEN_UBOOT = \
402de109d90SWolfgang Denk		UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \
403de109d90SWolfgang Denk		sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
4048aba9dceSNobuhiro Iwamatsu		cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__OBJS) \
405f9328639SMarian Balakowicz			--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
406b2184c31Swdenk			-Map u-boot.map -o u-boot
40716a354f9SWolfgang Denk$(obj)u-boot:	depend \
40816a354f9SWolfgang Denk		$(SUBDIRS) $(OBJS) $(LIBBOARD) $(LIBS) $(LDSCRIPT) $(obj)u-boot.lds
409ecb1dc89SMike Frysinger		$(GEN_UBOOT)
410ecb1dc89SMike Frysingerifeq ($(CONFIG_KALLSYMS),y)
4111aada9cdSWolfgang Denk		smap=`$(call SYSTEM_MAP,u-boot) | \
4121aada9cdSWolfgang Denk			awk '$$2 ~ /[tTwW]/ {printf $$1 $$3 "\\\\000"}'` ; \
4131aada9cdSWolfgang Denk		$(CC) $(CFLAGS) -DSYSTEM_MAP="\"$${smap}\"" \
4141aada9cdSWolfgang Denk			-c common/system_map.c -o $(obj)common/system_map.o
415ecb1dc89SMike Frysinger		$(GEN_UBOOT) $(obj)common/system_map.o
416ecb1dc89SMike Frysingerendif
4177ebf7443Swdenk
418d0d6144eSPeter Tyser$(OBJS):	depend
41903b7004dSPeter Tyser		$(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir $@))
420f9328639SMarian Balakowicz
421d0d6144eSPeter Tyser$(LIBS):	depend $(SUBDIRS)
422f9328639SMarian Balakowicz		$(MAKE) -C $(dir $(subst $(obj),,$@))
423a8c7c708Swdenk
424d0d6144eSPeter Tyser$(LIBBOARD):	depend $(LIBS)
425de109d90SWolfgang Denk		$(MAKE) -C $(dir $(subst $(obj),,$@))
426de109d90SWolfgang Denk
427d0d6144eSPeter Tyser$(SUBDIRS):	depend
428b028f715Swdenk		$(MAKE) -C $@ all
4297ebf7443Swdenk
430d0d6144eSPeter Tyser$(LDSCRIPT):	depend
431f65c9812SMike Frysinger		$(MAKE) -C $(dir $@) $(notdir $@)
432f65c9812SMike Frysinger
4331aada9cdSWolfgang Denk$(obj)u-boot.lds: $(LDSCRIPT)
4341aada9cdSWolfgang Denk		$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
4351aada9cdSWolfgang Denk
436e935a374SHaiying Wangnand_spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
4378318fbf8SMarian Balakowicz		$(MAKE) -C nand_spl/board/$(BOARDDIR) all
438887e2ec9SStefan Roese
439e935a374SHaiying Wang$(obj)u-boot-nand.bin:	nand_spl $(obj)u-boot.bin
4408318fbf8SMarian Balakowicz		cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
441887e2ec9SStefan Roese
442e935a374SHaiying Wangonenand_ipl:	$(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
443f2302d44SStefan Roese		$(MAKE) -C onenand_ipl/board/$(BOARDDIR) all
444751b9b51SKyungmin Park
445e935a374SHaiying Wang$(obj)u-boot-onenand.bin:	onenand_ipl $(obj)u-boot.bin
446ca6189dbSKyungmin Park		cat $(ONENAND_BIN) $(obj)u-boot.bin > $(obj)u-boot-onenand.bin
447751b9b51SKyungmin Park
4480d3c62e4SChander Kashyapmmc_spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
4490d3c62e4SChander Kashyap		$(MAKE) -C mmc_spl/board/$(BOARDDIR) all
4500d3c62e4SChander Kashyap
4510d3c62e4SChander Kashyap$(obj)mmc_spl/u-boot-mmc-spl.bin:	mmc_spl
4520d3c62e4SChander Kashyap
4535df2ee27SDaniel Schwierzeck$(obj)spl/u-boot-spl.bin:		depend
4545df2ee27SDaniel Schwierzeck		$(MAKE) -C spl all
4555df2ee27SDaniel Schwierzeck
456561858eeSPeter Tyser$(TIMESTAMP_FILE):
457d6b93714SIlya Yanok		@LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
458d6b93714SIlya Yanok		@LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@
459561858eeSPeter Tyser
460f9328639SMarian Balakowiczupdater:
4610358df42SMike Frysinger		$(MAKE) -C tools/updater all
4628f713fdfSdzu
4632a998793SDaniel Hobi# Explicitly make _depend in subdirs containing multiple targets to prevent
4642a998793SDaniel Hobi# parallel sub-makes creating .depend files simultaneously.
46516a354f9SWolfgang Denkdepend dep:	$(TIMESTAMP_FILE) $(VERSION_FILE) \
46616a354f9SWolfgang Denk		$(obj)include/autoconf.mk \
46716a354f9SWolfgang Denk		$(obj)include/generated/generic-asm-offsets.h
46803b7004dSPeter Tyser		for dir in $(SUBDIRS) $(CPUDIR) $(dir $(LDSCRIPT)) ; do \
4692a998793SDaniel Hobi			$(MAKE) -C $$dir _depend ; done
4707ebf7443Swdenk
471e5e4e705SLi YangTAG_SUBDIRS = $(SUBDIRS)
472e5e4e705SLi YangTAG_SUBDIRS += $(dir $(__LIBS))
473a340c325SJean-Christophe PLAGNIOL-VILLARDTAG_SUBDIRS += include
474a340c325SJean-Christophe PLAGNIOL-VILLARD
475857d9ea6SHorst KronstorferFIND := find
476857d9ea6SHorst KronstorferFINDFLAGS := -L
477857d9ea6SHorst Kronstorfer
478f9328639SMarian Balakowicztags ctags:
479857d9ea6SHorst Kronstorfer		ctags -w -o $(obj)ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
480e5e4e705SLi Yang						-name '*.[chS]' -print`
4817ebf7443Swdenk
4827ebf7443Swdenketags:
483857d9ea6SHorst Kronstorfer		etags -a -o $(obj)etags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
484e5e4e705SLi Yang						-name '*.[chS]' -print`
485ffda586fSLi Yangcscope:
486857d9ea6SHorst Kronstorfer		$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) -name '*.[chS]' -print > \
487857d9ea6SHorst Kronstorfer						cscope.files
488ffda586fSLi Yang		cscope -b -q -k
4897ebf7443Swdenk
490ecb1dc89SMike FrysingerSYSTEM_MAP = \
491ecb1dc89SMike Frysinger		$(NM) $1 | \
4927ebf7443Swdenk		grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
493ecb1dc89SMike Frysinger		LC_ALL=C sort
494ecb1dc89SMike Frysinger$(obj)System.map:	$(obj)u-boot
495ecb1dc89SMike Frysinger		@$(call SYSTEM_MAP,$<) > $(obj)System.map
4967ebf7443Swdenk
4972f155f6cSGrant Likely#
4982f155f6cSGrant Likely# Auto-generate the autoconf.mk file (which is included by all makefiles)
4992f155f6cSGrant Likely#
5002f155f6cSGrant Likely# This target actually generates 2 files; autoconf.mk and autoconf.mk.dep.
5012f155f6cSGrant Likely# the dep file is only include in this top level makefile to determine when
5022f155f6cSGrant Likely# to regenerate the autoconf.mk file.
5031510b82dSWolfgang Denk$(obj)include/autoconf.mk.dep: $(obj)include/config.h include/common.h
5041510b82dSWolfgang Denk	@$(XECHO) Generating $@ ; \
50516fe7775SMike Frysinger	set -e ; \
506ae6d1056SWolfgang Denk	: Generate the dependancies ; \
5079aef7388SMike Frysinger	$(CC) -x c -DDO_DEPS_ONLY -M $(HOSTCFLAGS) $(CPPFLAGS) \
5081510b82dSWolfgang Denk		-MQ $(obj)include/autoconf.mk include/common.h > $@
5091510b82dSWolfgang Denk
5101510b82dSWolfgang Denk$(obj)include/autoconf.mk: $(obj)include/config.h
5111510b82dSWolfgang Denk	@$(XECHO) Generating $@ ; \
5121510b82dSWolfgang Denk	set -e ; \
513ae6d1056SWolfgang Denk	: Extract the config macros ; \
5141510b82dSWolfgang Denk	$(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h | \
5154a0f7538SWolfgang Denk		sed -n -f tools/scripts/define2mk.sed > $@.tmp && \
5164a0f7538SWolfgang Denk	mv $@.tmp $@
5172f155f6cSGrant Likely
51816a354f9SWolfgang Denk$(obj)include/generated/generic-asm-offsets.h:	$(obj)include/autoconf.mk.dep \
51916a354f9SWolfgang Denk	$(obj)lib/asm-offsets.s
52016a354f9SWolfgang Denk	@$(XECHO) Generating $@
52116a354f9SWolfgang Denk	tools/scripts/make-asm-offsets $(obj)lib/asm-offsets.s $@
52216a354f9SWolfgang Denk
52316a354f9SWolfgang Denk$(obj)lib/asm-offsets.s:	$(obj)include/autoconf.mk.dep \
52416a354f9SWolfgang Denk	$(src)lib/asm-offsets.c
52516a354f9SWolfgang Denk	@mkdir -p $(obj)lib
52616a354f9SWolfgang Denk	$(CC) -DDO_DEPS_ONLY \
52716a354f9SWolfgang Denk		$(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR)) \
52816a354f9SWolfgang Denk		-o $@ $(src)lib/asm-offsets.c -c -S
52916a354f9SWolfgang Denk
5307ebf7443Swdenk#########################################################################
531ae6d1056SWolfgang Denkelse	# !config.mk
532f9328639SMarian Balakowiczall $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
533f9328639SMarian Balakowicz$(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \
53428abd48fSIlya Yanok$(filter-out tools,$(SUBDIRS)) $(TIMESTAMP_FILE) \
5350358df42SMike Frysingerupdater depend dep tags ctags etags cscope $(obj)System.map:
5367ebf7443Swdenk	@echo "System not configured - see README" >&2
5377ebf7443Swdenk	@ exit 1
538c7c0d542SMike Frysinger
53928abd48fSIlya Yanoktools: $(VERSION_FILE)
5400358df42SMike Frysinger	$(MAKE) -C $@ all
541ae6d1056SWolfgang Denkendif	# config.mk
5427ebf7443Swdenk
54328abd48fSIlya Yanok$(VERSION_FILE):
54414ce91b1SMike Frysinger		@mkdir -p $(dir $(VERSION_FILE))
54528abd48fSIlya Yanok		@( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \
54628abd48fSIlya Yanok		   printf '#define PLAIN_VERSION "%s%s"\n' \
54728abd48fSIlya Yanok			"$(U_BOOT_VERSION)" "$${localvers}" ; \
54828abd48fSIlya Yanok		   printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \
54928abd48fSIlya Yanok			"$(U_BOOT_VERSION)" "$${localvers}" ; \
55028abd48fSIlya Yanok		) > $@.tmp
55128abd48fSIlya Yanok		@( printf '#define CC_VERSION_STRING "%s"\n' \
55228abd48fSIlya Yanok		 '$(shell $(CC) --version | head -n 1)' )>>  $@.tmp
55328abd48fSIlya Yanok		@( printf '#define LD_VERSION_STRING "%s"\n' \
55428abd48fSIlya Yanok		 '$(shell $(LD) -v | head -n 1)' )>>  $@.tmp
55528abd48fSIlya Yanok		@cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
55628abd48fSIlya Yanok
5570358df42SMike Frysingereasylogo env gdb:
5580358df42SMike Frysinger	$(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION}
5590358df42SMike Frysingergdbtools: gdb
5600358df42SMike Frysinger
56128abd48fSIlya Yanoktools-all: easylogo env gdb $(VERSION_FILE)
5620358df42SMike Frysinger	$(MAKE) -C tools HOST_TOOLS_ALL=y
5630358df42SMike Frysinger
5644e53a258SWolfgang Denk.PHONY : CHANGELOG
5654e53a258SWolfgang DenkCHANGELOG:
566b985b5d6SBen Warren	git log --no-merges U-Boot-1_1_5.. | \
567b985b5d6SBen Warren	unexpand -a | sed -e 's/\s\s*$$//' > $@
5684e53a258SWolfgang Denk
5690a823aa2SHarald Welteinclude/license.h: tools/bin2header COPYING
5700a823aa2SHarald Welte	cat COPYING | gzip -9 -c | ./tools/bin2header license_gzip > include/license.h
5717ebf7443Swdenk#########################################################################
5727ebf7443Swdenk
5737ebf7443Swdenkunconfig:
574887e2ec9SStefan Roese	@rm -f $(obj)include/config.h $(obj)include/config.mk \
5752f155f6cSGrant Likely		$(obj)board/*/config.tmp $(obj)board/*/*/config.tmp \
5762f155f6cSGrant Likely		$(obj)include/autoconf.mk $(obj)include/autoconf.mk.dep
5777ebf7443Swdenk
578a6862bc1SWolfgang Denk%_config::	unconfig
579a6862bc1SWolfgang Denk	@$(MKCONFIG) -A $(@:_config=)
580a6862bc1SWolfgang Denk
581d6a5e6d5SLoïc Miniersinclude $(obj).boards.depend
582d6a5e6d5SLoïc Minier$(obj).boards.depend:	boards.cfg
583727ebd9fSMike Frysinger	awk '(NF && $$1 !~ /^#/) { print $$1 ": " $$1 "_config; $$(MAKE)" }' $< > $@
5849f4a4206SMike Frysinger
5858c994630SWolfgang Denk#
5868c994630SWolfgang Denk# Functions to generate common board directory names
5878c994630SWolfgang Denk#
5888c994630SWolfgang Denklcname	= $(shell echo $(1) | sed -e 's/\(.*\)_config/\L\1/')
5898c994630SWolfgang Denkucname	= $(shell echo $(1) | sed -e 's/\(.*\)_config/\U\1/')
5908c994630SWolfgang Denk
5914e5ca3ebSwdenk#########################################################################
5924e5ca3ebSwdenk## Coldfire
5934e5ca3ebSwdenk#########################################################################
5944e5ca3ebSwdenk
5959d79e575SWolfgang Wegnerastro_mcf5373l_config \
5969d79e575SWolfgang Wegnerastro_mcf5373l_RAM_config :	unconfig
597ed7a196cSWolfgang Denk	@$(MKCONFIG) -n $@ -t $@ astro_mcf5373l m68k mcf532x mcf5373l astro
5989d79e575SWolfgang Wegner
599a21d0c2cSTsiChung LiewM52277EVB_config \
600a21d0c2cSTsiChung LiewM52277EVB_spansion_config \
601a21d0c2cSTsiChung LiewM52277EVB_stmicro_config :	unconfig
602a21d0c2cSTsiChung Liew	@case "$@" in \
603a21d0c2cSTsiChung Liew	M52277EVB_config)		FLASH=SPANSION;; \
604a21d0c2cSTsiChung Liew	M52277EVB_spansion_config)	FLASH=SPANSION;; \
605a21d0c2cSTsiChung Liew	M52277EVB_stmicro_config)	FLASH=STMICRO;; \
606a21d0c2cSTsiChung Liew	esac; \
607a21d0c2cSTsiChung Liew	if [ "$${FLASH}" = "SPANSION" ] ; then \
608a21d0c2cSTsiChung Liew		echo "#define CONFIG_SYS_SPANSION_BOOT"	>> $(obj)include/config.h ; \
60914d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0x00000000" > $(obj)board/freescale/m52277evb/config.tmp ; \
610a21d0c2cSTsiChung Liew		cp $(obj)board/freescale/m52277evb/u-boot.spa $(obj)board/freescale/m52277evb/u-boot.lds ; \
611a21d0c2cSTsiChung Liew	fi; \
612a21d0c2cSTsiChung Liew	if [ "$${FLASH}" = "STMICRO" ] ; then \
613a21d0c2cSTsiChung Liew		echo "#define CONFIG_CF_SBF"	>> $(obj)include/config.h ; \
614a21d0c2cSTsiChung Liew		echo "#define CONFIG_SYS_STMICRO_BOOT"	>> $(obj)include/config.h ; \
61514d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0x43E00000" > $(obj)board/freescale/m52277evb/config.tmp ; \
616a21d0c2cSTsiChung Liew		cp $(obj)board/freescale/m52277evb/u-boot.stm $(obj)board/freescale/m52277evb/u-boot.lds ; \
617a21d0c2cSTsiChung Liew	fi
6180e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a M52277EVB m68k mcf5227x m52277evb freescale
6191552af70STsiChungLiew
6204a442d31STsiChungLiewM5235EVB_config \
6214a442d31STsiChungLiewM5235EVB_Flash16_config \
6224a442d31STsiChungLiewM5235EVB_Flash32_config:	unconfig
6234a442d31STsiChungLiew	@case "$@" in \
6244a442d31STsiChungLiew	M5235EVB_config)		FLASH=16;; \
6254a442d31STsiChungLiew	M5235EVB_Flash16_config)	FLASH=16;; \
6264a442d31STsiChungLiew	M5235EVB_Flash32_config)	FLASH=32;; \
6274a442d31STsiChungLiew	esac; \
6284a442d31STsiChungLiew	if [ "$${FLASH}" != "16" ] ; then \
629ae6d1056SWolfgang Denk		echo "#define NORFLASH_PS32BIT	1" >> $(obj)include/config.h ; \
63014d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0xFFC00000" > $(obj)board/freescale/m5235evb/config.tmp ; \
6314a442d31STsiChungLiew		cp $(obj)board/freescale/m5235evb/u-boot.32 $(obj)board/freescale/m5235evb/u-boot.lds ; \
6324a442d31STsiChungLiew	else \
63314d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0xFFE00000" > $(obj)board/freescale/m5235evb/config.tmp ; \
6344a442d31STsiChungLiew		cp $(obj)board/freescale/m5235evb/u-boot.16 $(obj)board/freescale/m5235evb/u-boot.lds ; \
6354a442d31STsiChungLiew	fi
6360e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a M5235EVB m68k mcf523x m5235evb freescale
6374a442d31STsiChungLiew
6387481266eSWolfgang Denkcobra5272_config :		unconfig
639ed7a196cSWolfgang Denk	@$(MKCONFIG) $@ m68k mcf52x2 cobra5272
6407481266eSWolfgang Denk
6414176c799SWolfgang DenkEB+MCF-EV123_config :		unconfig
642f9328639SMarian Balakowicz	@mkdir -p $(obj)include
643f9328639SMarian Balakowicz	@mkdir -p $(obj)board/BuS/EB+MCF-EV123
64414d0a02aSWolfgang Denk	@echo "CONFIG_SYS_TEXT_BASE = 0xFFE00000"|tee $(obj)board/BuS/EB+MCF-EV123/textbase.mk
6450e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ EB+MCF-EV123 m68k mcf52x2 EB+MCF-EV123 BuS
6464176c799SWolfgang Denk
6474176c799SWolfgang DenkEB+MCF-EV123_internal_config :	unconfig
648f9328639SMarian Balakowicz	@mkdir -p $(obj)include
649f9328639SMarian Balakowicz	@mkdir -p $(obj)board/BuS/EB+MCF-EV123
65014d0a02aSWolfgang Denk	@echo "CONFIG_SYS_TEXT_BASE = 0xF0000000"|tee $(obj)board/BuS/EB+MCF-EV123/textbase.mk
6510e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ EB+MCF-EV123 m68k mcf52x2 EB+MCF-EV123 BuS
6524176c799SWolfgang Denk
6538e585f02STsiChung LiewM5329AFEE_config \
6548e585f02STsiChung LiewM5329BFEE_config :	unconfig
6558e585f02STsiChung Liew	@case "$@" in \
6568e585f02STsiChung Liew	M5329AFEE_config)	NAND=0;; \
6578e585f02STsiChung Liew	M5329BFEE_config)	NAND=16;; \
6588e585f02STsiChung Liew	esac; \
6598e585f02STsiChung Liew	if [ "$${NAND}" != "0" ] ; then \
660ab77bc54STsiChungLiew		echo "#define NANDFLASH_SIZE	$${NAND}" > $(obj)include/config.h ; \
6618e585f02STsiChung Liew	fi
6620e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a M5329EVB m68k mcf532x m5329evb freescale
6638e585f02STsiChung Liew
664aa5f1f9dSTsiChungLiewM5373EVB_config :	unconfig
665aa5f1f9dSTsiChungLiew	@case "$@" in \
666aa5f1f9dSTsiChungLiew	M5373EVB_config)	NAND=16;; \
667aa5f1f9dSTsiChungLiew	esac; \
668aa5f1f9dSTsiChungLiew	if [ "$${NAND}" != "0" ] ; then \
669aa5f1f9dSTsiChungLiew		echo "#define NANDFLASH_SIZE	$${NAND}" > $(obj)include/config.h ; \
670aa5f1f9dSTsiChungLiew	fi
671aa5f1f9dSTsiChungLiew	@$(MKCONFIG) -a M5373EVB m68k mcf532x m5373evb freescale
672aa5f1f9dSTsiChungLiew
67305316f8eSTsiChung LiewM54451EVB_config \
67405316f8eSTsiChung LiewM54451EVB_stmicro_config :	unconfig
67505316f8eSTsiChung Liew	@case "$@" in \
676709b384bSTsiChung Liew	M54451EVB_config)		FLASH=NOR;; \
67705316f8eSTsiChung Liew	M54451EVB_stmicro_config)	FLASH=STMICRO;; \
67805316f8eSTsiChung Liew	esac; \
679709b384bSTsiChung Liew	if [ "$${FLASH}" = "NOR" ] ; then \
68014d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0x00000000" > $(obj)board/freescale/m54451evb/config.tmp ; \
68105316f8eSTsiChung Liew		cp $(obj)board/freescale/m54451evb/u-boot.spa $(obj)board/freescale/m54451evb/u-boot.lds ; \
68205316f8eSTsiChung Liew	fi; \
68305316f8eSTsiChung Liew	if [ "$${FLASH}" = "STMICRO" ] ; then \
68405316f8eSTsiChung Liew		echo "#define CONFIG_CF_SBF"	>> $(obj)include/config.h ; \
6856d0f6bcfSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_STMICRO_BOOT"	>> $(obj)include/config.h ; \
68614d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0x47E00000" > $(obj)board/freescale/m54451evb/config.tmp ; \
68705316f8eSTsiChung Liew		cp $(obj)board/freescale/m54451evb/u-boot.stm $(obj)board/freescale/m54451evb/u-boot.lds ; \
68805316f8eSTsiChung Liew	fi; \
6896d0f6bcfSJean-Christophe PLAGNIOL-VILLARD	echo "#define CONFIG_SYS_INPUT_CLKSRC 24000000" >> $(obj)include/config.h ;
6900e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a M54451EVB m68k mcf5445x m54451evb freescale
69105316f8eSTsiChung Liew
6928ae158cdSTsiChungLiewM54455EVB_config \
6938ae158cdSTsiChungLiewM54455EVB_atmel_config \
6948ae158cdSTsiChungLiewM54455EVB_intel_config \
6958ae158cdSTsiChungLiewM54455EVB_a33_config \
6968ae158cdSTsiChungLiewM54455EVB_a66_config \
6978ae158cdSTsiChungLiewM54455EVB_i33_config \
6989f751551STsiChung LiewM54455EVB_i66_config \
6999f751551STsiChung LiewM54455EVB_stm33_config :	unconfig
7008ae158cdSTsiChungLiew	@case "$@" in \
7018ae158cdSTsiChungLiew	M54455EVB_config)		FLASH=ATMEL; FREQ=33333333;; \
7028ae158cdSTsiChungLiew	M54455EVB_atmel_config)		FLASH=ATMEL; FREQ=33333333;; \
7038ae158cdSTsiChungLiew	M54455EVB_intel_config)		FLASH=INTEL; FREQ=33333333;; \
7048ae158cdSTsiChungLiew	M54455EVB_a33_config)		FLASH=ATMEL; FREQ=33333333;; \
7058ae158cdSTsiChungLiew	M54455EVB_a66_config)		FLASH=ATMEL; FREQ=66666666;; \
7068ae158cdSTsiChungLiew	M54455EVB_i33_config)		FLASH=INTEL; FREQ=33333333;; \
7078ae158cdSTsiChungLiew	M54455EVB_i66_config)		FLASH=INTEL; FREQ=66666666;; \
7089f751551STsiChung Liew	M54455EVB_stm33_config)		FLASH=STMICRO; FREQ=33333333;; \
7098ae158cdSTsiChungLiew	esac; \
7101aaab9bfSWolfgang Denk	if [ "$${FLASH}" = "INTEL" ] ; then \
7116d0f6bcfSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_INTEL_BOOT" >> $(obj)include/config.h ; \
71214d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0x00000000" > $(obj)board/freescale/m54455evb/config.tmp ; \
713e8ee8f3aSTsiChungLiew		cp $(obj)board/freescale/m54455evb/u-boot.int $(obj)board/freescale/m54455evb/u-boot.lds ; \
7149f751551STsiChung Liew	fi; \
7159f751551STsiChung Liew	if [ "$${FLASH}" = "ATMEL" ] ; then \
7166d0f6bcfSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_ATMEL_BOOT"	>> $(obj)include/config.h ; \
71714d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0x04000000" > $(obj)board/freescale/m54455evb/config.tmp ; \
718e8ee8f3aSTsiChungLiew		cp $(obj)board/freescale/m54455evb/u-boot.atm $(obj)board/freescale/m54455evb/u-boot.lds ; \
7198ae158cdSTsiChungLiew	fi; \
7209f751551STsiChung Liew	if [ "$${FLASH}" = "STMICRO" ] ; then \
7219f751551STsiChung Liew		echo "#define CONFIG_CF_SBF"	>> $(obj)include/config.h ; \
7226d0f6bcfSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_STMICRO_BOOT"	>> $(obj)include/config.h ; \
72314d0a02aSWolfgang Denk		echo "CONFIG_SYS_TEXT_BASE = 0x4FE00000" > $(obj)board/freescale/m54455evb/config.tmp ; \
7249f751551STsiChung Liew		cp $(obj)board/freescale/m54455evb/u-boot.stm $(obj)board/freescale/m54455evb/u-boot.lds ; \
7259f751551STsiChung Liew	fi; \
7266d0f6bcfSJean-Christophe PLAGNIOL-VILLARD	echo "#define CONFIG_SYS_INPUT_CLKSRC $${FREQ}" >> $(obj)include/config.h ; \
7270e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a M54455EVB m68k mcf5445x m54455evb freescale
7288ae158cdSTsiChungLiew
72957a12720STsiChungLiewM5475AFE_config \
73057a12720STsiChungLiewM5475BFE_config \
73157a12720STsiChungLiewM5475CFE_config \
73257a12720STsiChungLiewM5475DFE_config \
73357a12720STsiChungLiewM5475EFE_config \
73457a12720STsiChungLiewM5475FFE_config \
73557a12720STsiChungLiewM5475GFE_config :	unconfig
73657a12720STsiChungLiew	@case "$@" in \
73757a12720STsiChungLiew	M5475AFE_config)	BOOT=2;CODE=0;VID=0;USB=0;RAM=64;RAM1=0;; \
73857a12720STsiChungLiew	M5475BFE_config)	BOOT=2;CODE=16;VID=0;USB=0;RAM=64;RAM1=0;; \
73957a12720STsiChungLiew	M5475CFE_config)	BOOT=2;CODE=16;VID=1;USB=1;RAM=64;RAM1=0;; \
74057a12720STsiChungLiew	M5475DFE_config)	BOOT=2;CODE=0;VID=0;USB=1;RAM=64;RAM1=0;; \
74157a12720STsiChungLiew	M5475EFE_config)	BOOT=2;CODE=0;VID=1;USB=1;RAM=64;RAM1=0;; \
74257a12720STsiChungLiew	M5475FFE_config)	BOOT=2;CODE=32;VID=1;USB=1;RAM=64;RAM1=64;; \
74357a12720STsiChungLiew	M5475GFE_config)	BOOT=4;CODE=0;VID=0;USB=0;RAM=64;RAM1=0;; \
74457a12720STsiChungLiew	esac; \
7456d0f6bcfSJean-Christophe PLAGNIOL-VILLARD	echo "#define CONFIG_SYS_BUSCLK	133333333" > $(obj)include/config.h ; \
7466d0f6bcfSJean-Christophe PLAGNIOL-VILLARD	echo "#define CONFIG_SYS_BOOTSZ	$${BOOT}" >> $(obj)include/config.h ; \
7476d0f6bcfSJean-Christophe PLAGNIOL-VILLARD	echo "#define CONFIG_SYS_DRAMSZ	$${RAM}" >> $(obj)include/config.h ; \
74857a12720STsiChungLiew	if [ "$${RAM1}" != "0" ] ; then \
7496d0f6bcfSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_DRAMSZ1	$${RAM1}" >> $(obj)include/config.h ; \
75057a12720STsiChungLiew	fi; \
75157a12720STsiChungLiew	if [ "$${CODE}" != "0" ] ; then \
7526d0f6bcfSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_NOR1SZ	$${CODE}" >> $(obj)include/config.h ; \
75357a12720STsiChungLiew	fi; \
75457a12720STsiChungLiew	if [ "$${VID}" == "1" ] ; then \
7556d0f6bcfSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_VIDEO" >> $(obj)include/config.h ; \
75657a12720STsiChungLiew	fi; \
75757a12720STsiChungLiew	if [ "$${USB}" == "1" ] ; then \
7586d0f6bcfSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_USBCTRL" >> $(obj)include/config.h ; \
75957a12720STsiChungLiew	fi
7600e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a M5475EVB m68k mcf547x_8x m547xevb freescale
76157a12720STsiChungLiew
76257a12720STsiChungLiewM5485AFE_config \
76357a12720STsiChungLiewM5485BFE_config \
76457a12720STsiChungLiewM5485CFE_config \
76557a12720STsiChungLiewM5485DFE_config \
76657a12720STsiChungLiewM5485EFE_config \
76757a12720STsiChungLiewM5485FFE_config \
76857a12720STsiChungLiewM5485GFE_config \
76957a12720STsiChungLiewM5485HFE_config :	unconfig
77057a12720STsiChungLiew	@case "$@" in \
77157a12720STsiChungLiew	M5485AFE_config)	BOOT=2;CODE=0;VID=0;USB=0;RAM=64;RAM1=0;; \
77257a12720STsiChungLiew	M5485BFE_config)	BOOT=2;CODE=16;VID=0;USB=0;RAM=64;RAM1=0;; \
77357a12720STsiChungLiew	M5485CFE_config)	BOOT=2;CODE=16;VID=1;USB=1;RAM=64;RAM1=0;; \
77457a12720STsiChungLiew	M5485DFE_config)	BOOT=2;CODE=0;VID=0;USB=1;RAM=64;RAM1=0;; \
77557a12720STsiChungLiew	M5485EFE_config)	BOOT=2;CODE=0;VID=1;USB=1;RAM=64;RAM1=0;; \
77657a12720STsiChungLiew	M5485FFE_config)	BOOT=2;CODE=32;VID=1;USB=1;RAM=64;RAM1=64;; \
77757a12720STsiChungLiew	M5485GFE_config)	BOOT=4;CODE=0;VID=0;USB=0;RAM=64;RAM1=0;; \
7784d264effSTsiChungLiew	M5485HFE_config)	BOOT=2;CODE=16;VID=1;USB=0;RAM=64;RAM1=0;; \
77957a12720STsiChungLiew	esac; \
7806d0f6bcfSJean-Christophe PLAGNIOL-VILLARD	echo "#define CONFIG_SYS_BUSCLK	100000000" > $(obj)include/config.h ; \
7816d0f6bcfSJean-Christophe PLAGNIOL-VILLARD	echo "#define CONFIG_SYS_BOOTSZ	$${BOOT}" >> $(obj)include/config.h ; \
7826d0f6bcfSJean-Christophe PLAGNIOL-VILLARD	echo "#define CONFIG_SYS_DRAMSZ	$${RAM}" >> $(obj)include/config.h ; \
78357a12720STsiChungLiew	if [ "$${RAM1}" != "0" ] ; then \
7846d0f6bcfSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_DRAMSZ1	$${RAM1}" >> $(obj)include/config.h ; \
78557a12720STsiChungLiew	fi; \
78657a12720STsiChungLiew	if [ "$${CODE}" != "0" ] ; then \
7876d0f6bcfSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_NOR1SZ	$${CODE}" >> $(obj)include/config.h ; \
78857a12720STsiChungLiew	fi; \
78957a12720STsiChungLiew	if [ "$${VID}" == "1" ] ; then \
7906d0f6bcfSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_VIDEO" >> $(obj)include/config.h ; \
79157a12720STsiChungLiew	fi; \
79257a12720STsiChungLiew	if [ "$${USB}" == "1" ] ; then \
7936d0f6bcfSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_USBCTRL" >> $(obj)include/config.h ; \
79457a12720STsiChungLiew	fi
7950e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a M5485EVB m68k mcf547x_8x m548xevb freescale
79657a12720STsiChungLiew
7977ebf7443Swdenk#========================================================================
7987ebf7443Swdenk# ARM
7997ebf7443Swdenk#========================================================================
80043a5f0dfSPo-Yu Chuang
801a4b46ed6SUlf Samuelsson#########################################################################
80234be1065SMatthias Weisser## ARM926EJ-S Systems
803a4b46ed6SUlf Samuelsson#########################################################################
804a4b46ed6SUlf Samuelsson
80589a7a87fSNicolas Ferreat91sam9261ek_nandflash_config \
80689a7a87fSNicolas Ferreat91sam9261ek_dataflash_cs0_config \
80789a7a87fSNicolas Ferreat91sam9261ek_dataflash_cs3_config \
8085ccc2d99SSedji Gaouaouat91sam9261ek_config \
8095ccc2d99SSedji Gaouaouat91sam9g10ek_nandflash_config \
8105ccc2d99SSedji Gaouaouat91sam9g10ek_dataflash_cs0_config \
8115ccc2d99SSedji Gaouaouat91sam9g10ek_dataflash_cs3_config \
8125ccc2d99SSedji Gaouaouat91sam9g10ek_config	:	unconfig
813e12d9a8fSJean-Christophe PLAGNIOL-VILLARD	@mkdir -p $(obj)include
8145ccc2d99SSedji Gaouaou	@if [ "$(findstring 9g10,$@)" ] ; then \
8155ccc2d99SSedji Gaouaou		echo "#define CONFIG_AT91SAM9G10EK 1"	>>$(obj)include/config.h ; \
8165ccc2d99SSedji Gaouaou	else \
8175ccc2d99SSedji Gaouaou		echo "#define CONFIG_AT91SAM9261EK 1"	>>$(obj)include/config.h ; \
8185ccc2d99SSedji Gaouaou	fi;
81989a7a87fSNicolas Ferre	@if [ "$(findstring _nandflash,$@)" ] ; then \
82089a7a87fSNicolas Ferre		echo "#define CONFIG_SYS_USE_NANDFLASH 1"	>>$(obj)include/config.h ; \
8215ccc2d99SSedji Gaouaou	elif [ "$(findstring dataflash_cs0,$@)" ] ; then \
82289a7a87fSNicolas Ferre		echo "#define CONFIG_SYS_USE_DATAFLASH_CS3 1"	>>$(obj)include/config.h ; \
82389a7a87fSNicolas Ferre	else \
82489a7a87fSNicolas Ferre		echo "#define CONFIG_SYS_USE_DATAFLASH_CS0 1"	>>$(obj)include/config.h ; \
82589a7a87fSNicolas Ferre	fi;
8260e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a at91sam9261ek arm arm926ejs at91sam9261ek atmel at91
82728962f5aSJean-Christophe PLAGNIOL-VILLARD
8281b3b7c64SJean-Christophe PLAGNIOL-VILLARDat91sam9263ek_norflash_config \
8291b3b7c64SJean-Christophe PLAGNIOL-VILLARDat91sam9263ek_norflash_boot_config \
83089a7a87fSNicolas Ferreat91sam9263ek_nandflash_config \
83189a7a87fSNicolas Ferreat91sam9263ek_dataflash_config \
83289a7a87fSNicolas Ferreat91sam9263ek_dataflash_cs0_config \
83328962f5aSJean-Christophe PLAGNIOL-VILLARDat91sam9263ek_config	:	unconfig
834e12d9a8fSJean-Christophe PLAGNIOL-VILLARD	@mkdir -p $(obj)include
83589a7a87fSNicolas Ferre	@if [ "$(findstring _nandflash,$@)" ] ; then \
83689a7a87fSNicolas Ferre		echo "#define CONFIG_SYS_USE_NANDFLASH 1"	>>$(obj)include/config.h ; \
8371b3b7c64SJean-Christophe PLAGNIOL-VILLARD	elif [ "$(findstring norflash,$@)" ] ; then \
8381b3b7c64SJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_USE_NORFLASH 1"	>>$(obj)include/config.h ; \
83989a7a87fSNicolas Ferre	else \
84089a7a87fSNicolas Ferre		echo "#define CONFIG_SYS_USE_DATAFLASH 1"	>>$(obj)include/config.h ; \
84189a7a87fSNicolas Ferre	fi;
8421b3b7c64SJean-Christophe PLAGNIOL-VILLARD	@if [ "$(findstring norflash_boot,$@)" ] ; then \
8431b3b7c64SJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_SYS_USE_BOOT_NORFLASH 1"	>>$(obj)include/config.h ; \
8441b3b7c64SJean-Christophe PLAGNIOL-VILLARD	fi;
8450e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a at91sam9263ek arm arm926ejs at91sam9263ek atmel at91
84628962f5aSJean-Christophe PLAGNIOL-VILLARD
84789a7a87fSNicolas Ferreat91sam9rlek_nandflash_config \
84889a7a87fSNicolas Ferreat91sam9rlek_dataflash_config \
84989a7a87fSNicolas Ferreat91sam9rlek_dataflash_cs0_config \
85028962f5aSJean-Christophe PLAGNIOL-VILLARDat91sam9rlek_config	:	unconfig
851e12d9a8fSJean-Christophe PLAGNIOL-VILLARD	@mkdir -p $(obj)include
85289a7a87fSNicolas Ferre	@if [ "$(findstring _nandflash,$@)" ] ; then \
85389a7a87fSNicolas Ferre		echo "#define CONFIG_SYS_USE_NANDFLASH 1"	>>$(obj)include/config.h ; \
85489a7a87fSNicolas Ferre	else \
85589a7a87fSNicolas Ferre		echo "#define CONFIG_SYS_USE_DATAFLASH 1"	>>$(obj)include/config.h ; \
85689a7a87fSNicolas Ferre	fi;
8570e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a at91sam9rlek arm arm926ejs at91sam9rlek atmel at91
85828962f5aSJean-Christophe PLAGNIOL-VILLARD
85922ee6473SSedji Gaouaouat91sam9m10g45ek_nandflash_config \
86022ee6473SSedji Gaouaouat91sam9m10g45ek_dataflash_config \
86122ee6473SSedji Gaouaouat91sam9m10g45ek_dataflash_cs0_config \
86222ee6473SSedji Gaouaouat91sam9m10g45ek_config \
86322ee6473SSedji Gaouaouat91sam9g45ekes_nandflash_config \
86422ee6473SSedji Gaouaouat91sam9g45ekes_dataflash_config \
86522ee6473SSedji Gaouaouat91sam9g45ekes_dataflash_cs0_config \
86622ee6473SSedji Gaouaouat91sam9g45ekes_config	:	unconfig
86722ee6473SSedji Gaouaou	@mkdir -p $(obj)include
86822ee6473SSedji Gaouaou		@if [ "$(findstring 9m10,$@)" ] ; then \
86922ee6473SSedji Gaouaou		echo "#define CONFIG_AT91SAM9M10G45EK 1"	>>$(obj)include/config.h ; \
87022ee6473SSedji Gaouaou	else \
87122ee6473SSedji Gaouaou		echo "#define CONFIG_AT91SAM9G45EKES 1"	>>$(obj)include/config.h ; \
87222ee6473SSedji Gaouaou	fi;
87322ee6473SSedji Gaouaou	@if [ "$(findstring _nandflash,$@)" ] ; then \
87422ee6473SSedji Gaouaou		echo "#define CONFIG_SYS_USE_NANDFLASH 1"	>>$(obj)include/config.h ; \
87522ee6473SSedji Gaouaou	else \
87622ee6473SSedji Gaouaou		echo "#define CONFIG_ATMEL_SPI 1"	>>$(obj)include/config.h ; \
87722ee6473SSedji Gaouaou	fi;
8780e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a at91sam9m10g45ek arm arm926ejs at91sam9m10g45ek atmel at91
87922ee6473SSedji Gaouaou
880b5d289fcSAsen Dimovpm9g45_config	:	unconfig
881b5d289fcSAsen Dimov	@mkdir -p $(obj)include
882b5d289fcSAsen Dimov	@$(MKCONFIG) -a pm9g45 arm arm926ejs pm9g45 ronetix at91
883b5d289fcSAsen Dimov
8849453967eSAlbin TonnerreSBC35_A9G20_NANDFLASH_config \
8859453967eSAlbin TonnerreSBC35_A9G20_EEPROM_config \
8869453967eSAlbin TonnerreSBC35_A9G20_config	:	unconfig
8879453967eSAlbin Tonnerre	@mkdir -p $(obj)include
8889453967eSAlbin Tonnerre	@echo "#define CONFIG_$(@:_config=) 1" >$(obj)include/config.h
8890e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a sbc35_a9g20 arm arm926ejs sbc35_a9g20 calao at91
8909453967eSAlbin Tonnerre
8912dc851e3SAlbin TonnerreTNY_A9G20_NANDFLASH_config \
8922dc851e3SAlbin TonnerreTNY_A9G20_EEPROM_config \
8932dc851e3SAlbin TonnerreTNY_A9G20_config \
8942dc851e3SAlbin TonnerreTNY_A9260_NANDFLASH_config \
8952dc851e3SAlbin TonnerreTNY_A9260_EEPROM_config \
8962dc851e3SAlbin TonnerreTNY_A9260_config	:	unconfig
8972dc851e3SAlbin Tonnerre	@mkdir -p $(obj)include
8982dc851e3SAlbin Tonnerre	@echo "#define CONFIG_$(@:_config=) 1" >$(obj)include/config.h
8990e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a tny_a9260 arm arm926ejs tny_a9260 calao at91
9002dc851e3SAlbin Tonnerre
90174f4304eSWolfgang Denk########################################################################
90287cb6862SWolfgang Denk## ARM Integrator boards - see doc/README-integrator for more info.
90387cb6862SWolfgang Denkintegratorap_config	\
90487cb6862SWolfgang Denkap_config		\
90587cb6862SWolfgang Denkap966_config		\
90687cb6862SWolfgang Denkap922_config		\
90787cb6862SWolfgang Denkap922_XA10_config	\
90887cb6862SWolfgang Denkap7_config		\
90987cb6862SWolfgang Denkap720t_config		\
91087cb6862SWolfgang Denkap920t_config		\
91187cb6862SWolfgang Denkap926ejs_config		\
91287cb6862SWolfgang Denkap946es_config: unconfig
913576afd4fSJean-Christophe PLAGNIOL-VILLARD	@board/armltd/integrator/split_by_variant.sh ap $@
9143d3befa7Swdenk
91587cb6862SWolfgang Denkintegratorcp_config	\
91687cb6862SWolfgang Denkcp_config		\
91787cb6862SWolfgang Denkcp920t_config		\
91887cb6862SWolfgang Denkcp926ejs_config		\
91987cb6862SWolfgang Denkcp946es_config		\
92087cb6862SWolfgang Denkcp1136_config		\
92187cb6862SWolfgang Denkcp966_config		\
92287cb6862SWolfgang Denkcp922_config		\
92387cb6862SWolfgang Denkcp922_XA10_config	\
92487cb6862SWolfgang Denkcp1026_config: unconfig
925576afd4fSJean-Christophe PLAGNIOL-VILLARD	@board/armltd/integrator/split_by_variant.sh cp $@
92625d6712aSwdenk
927a4b46ed6SUlf Samuelssonxtract_omap1610xxx = $(subst _cs0boot,,$(subst _cs3boot,,$(subst _cs_autoboot,,$(subst _config,,$1))))
928a4b46ed6SUlf Samuelsson
92963e73c9aSwdenkomap1610inn_config \
93063e73c9aSwdenkomap1610inn_cs0boot_config \
93163e73c9aSwdenkomap1610inn_cs3boot_config \
9323ff02c27Swdenkomap1610inn_cs_autoboot_config \
93363e73c9aSwdenkomap1610h2_config \
93463e73c9aSwdenkomap1610h2_cs0boot_config \
9353ff02c27Swdenkomap1610h2_cs3boot_config \
9363ff02c27Swdenkomap1610h2_cs_autoboot_config:	unconfig
937f9328639SMarian Balakowicz	@mkdir -p $(obj)include
93863e73c9aSwdenk	@if [ "$(findstring _cs0boot_, $@)" ] ; then \
939cdd917a4SWolfgang Denk		echo "#define CONFIG_CS0_BOOT" >> .$(obj)include/config.h ; \
9403ff02c27Swdenk	elif [ "$(findstring _cs_autoboot_, $@)" ] ; then \
941cdd917a4SWolfgang Denk		echo "#define CONFIG_CS_AUTOBOOT" >> $(obj)include/config.h ; \
94263e73c9aSwdenk	else \
943cdd917a4SWolfgang Denk		echo "#define CONFIG_CS3_BOOT" >> $(obj)include/config.h ; \
94463e73c9aSwdenk	fi;
9450e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a $(call xtract_omap1610xxx,$@) arm arm926ejs omap1610inn ti omap
9466f21347dSwdenk
947a56bd922Swdenkomap730p2_config \
948a56bd922Swdenkomap730p2_cs0boot_config \
949a56bd922Swdenkomap730p2_cs3boot_config :	unconfig
950f9328639SMarian Balakowicz	@mkdir -p $(obj)include
951a56bd922Swdenk	@if [ "$(findstring _cs0boot_, $@)" ] ; then \
952f9328639SMarian Balakowicz		echo "#define CONFIG_CS0_BOOT" >> $(obj)include/config.h ; \
953a56bd922Swdenk	else \
954f9328639SMarian Balakowicz		echo "#define CONFIG_CS3_BOOT" >> $(obj)include/config.h ; \
955a56bd922Swdenk	fi;
956ed7a196cSWolfgang Denk	@$(MKCONFIG) -n $@ -a omap730p2 arm arm926ejs omap730p2 ti omap
957a56bd922Swdenk
958080cfee7SVipin KUMARspear300_config \
9597da69236SVipin KUMARspear310_config \
9607da69236SVipin KUMARspear320_config :	unconfig
961ed7a196cSWolfgang Denk	@$(MKCONFIG) -n $@ -t $@ spear3xx arm arm926ejs $(@:_config=) spear spear
9627e074158SVipin KUMAR
963566c9c16SVipin KUMARspear600_config :	unconfig
964ed7a196cSWolfgang Denk	@$(MKCONFIG) -n $@ -t $@ spear6xx arm arm926ejs $(@:_config=) spear spear
965566c9c16SVipin KUMAR
96647fd3bffSJean-Christophe PLAGNIOL-VILLARDSX1_stdout_serial_config \
9672d24a3a7SwdenkSX1_config:		unconfig
96847fd3bffSJean-Christophe PLAGNIOL-VILLARD	@mkdir -p $(obj)include
96947fd3bffSJean-Christophe PLAGNIOL-VILLARD	@if [ "$(findstring _stdout_serial_, $@)" ] ; then \
97047fd3bffSJean-Christophe PLAGNIOL-VILLARD		echo "#undef CONFIG_STDOUT_USBTTY" >> $(obj)include/config.h ; \
97147fd3bffSJean-Christophe PLAGNIOL-VILLARD	else \
97247fd3bffSJean-Christophe PLAGNIOL-VILLARD		echo "#define CONFIG_STDOUT_USBTTY" >> $(obj)include/config.h ; \
97347fd3bffSJean-Christophe PLAGNIOL-VILLARD	fi;
9740e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ SX1 arm arm925t sx1
9752d24a3a7Swdenk
9766895d451SJohn Rigbytx25_config	: unconfig
9776895d451SJohn Rigby	@echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
978ed7a196cSWolfgang Denk	@$(MKCONFIG) $@ arm arm926ejs tx25 karo mx25
9796895d451SJohn Rigby
980a6862bc1SWolfgang Denkedb9301_config \
981a6862bc1SWolfgang Denkedb9302_config \
982a6862bc1SWolfgang Denkedb9302a_config \
983a6862bc1SWolfgang Denkedb9307_config \
984a6862bc1SWolfgang Denkedb9307a_config \
985a6862bc1SWolfgang Denkedb9312_config \
986a6862bc1SWolfgang Denkedb9315_config \
987a6862bc1SWolfgang Denkedb9315a_config: unconfig
988a6862bc1SWolfgang Denk	@$(MKCONFIG) -n $@ -t $(@:_config=) edb93xx arm arm920t edb93xx - ep93xx
989a6862bc1SWolfgang Denk
990699f0512SWolfgang Denk#########################################################################
99187cb6862SWolfgang Denk# ARM supplied Versatile development boards
992699f0512SWolfgang Denk#########################################################################
993699f0512SWolfgang Denk
99487cb6862SWolfgang Denkversatile_config	\
99587cb6862SWolfgang Denkversatileab_config	\
99687cb6862SWolfgang Denkversatilepb_config :	unconfig
997e4943ec5SJean-Christophe PLAGNIOL-VILLARD	@board/armltd/versatile/split_by_variant.sh $@
998074cff0dSwdenk
999074cff0dSwdenk#########################################################################
100043d9616cSwdenk## XScale Systems
10017ebf7443Swdenk#########################################################################
10027ebf7443Swdenk
10039d8d5a5bSStefan Roesepdnb3_config \
10049d8d5a5bSStefan Roesescpu_config:	unconfig
1005cdd917a4SWolfgang Denk	@mkdir -p $(obj)include
10069d8d5a5bSStefan Roese	@if [ "$(findstring scpu_,$@)" ] ; then \
1007cdd917a4SWolfgang Denk		echo "#define CONFIG_SCPU"	>>$(obj)include/config.h ; \
10089d8d5a5bSStefan Roese	fi
10090e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a pdnb3 arm ixp pdnb3 prodrive
1010ba94a1bbSWolfgang Denk
10118ed96046Swdenk#########################################################################
10128ed96046Swdenk## ARM1136 Systems
10138ed96046Swdenk#########################################################################
10145ca9881aSPeter Pearse
10155ca9881aSPeter Pearseapollon_config		: unconfig
10168cbf4e4fSWolfgang Denk	@mkdir -p $(obj)include
1017751b9b51SKyungmin Park	@echo "#define CONFIG_ONENAND_U_BOOT" > $(obj)include/config.h
1018751b9b51SKyungmin Park	@echo "CONFIG_ONENAND_U_BOOT = y" >> $(obj)include/config.mk
1019a6862bc1SWolfgang Denk	@$(MKCONFIG) $@ arm arm1136 apollon - omap24xx
10208ed96046Swdenk
1021a2bb7105SGuennadi Liakhovetskiimx31_phycore_eet_config \
10225ad86216SSascha Hauerimx31_phycore_config	: unconfig
102369c5bf29SGuennadi Liakhovetski	@mkdir -p $(obj)include
1024a2bb7105SGuennadi Liakhovetski	@if [ -n "$(findstring _eet_,$@)" ]; then			\
1025a2bb7105SGuennadi Liakhovetski		echo "#define CONFIG_IMX31_PHYCORE_EET" >> $(obj)include/config.h;	\
1026a2bb7105SGuennadi Liakhovetski	fi
1027a6862bc1SWolfgang Denk	@$(MKCONFIG) -n $@ -a imx31_phycore arm arm1136 imx31_phycore - mx31
10285ad86216SSascha Hauer
1029d08e5ca3SMagnus Liljamx31pdk_config \
1030d08e5ca3SMagnus Liljamx31pdk_nand_config	: unconfig
1031d08e5ca3SMagnus Lilja	@mkdir -p $(obj)include
1032d08e5ca3SMagnus Lilja	@if [ -n "$(findstring _nand_,$@)" ]; then					\
1033d08e5ca3SMagnus Lilja		echo "#define CONFIG_NAND_U_BOOT" >> $(obj)include/config.h;		\
1034d08e5ca3SMagnus Lilja	else										\
1035d08e5ca3SMagnus Lilja		echo "#define CONFIG_SKIP_LOWLEVEL_INIT" >> $(obj)include/config.h;	\
1036d08e5ca3SMagnus Lilja	fi
10370e42ada3SWolfgang Denk	@$(MKCONFIG) -n $@ -a mx31pdk arm arm1136 mx31pdk freescale mx31
10388449f287SMagnus Lilja
103911edcfe2SGuennadi Liakhovetski#########################################################################
104011edcfe2SGuennadi Liakhovetski## ARM1176 Systems
104111edcfe2SGuennadi Liakhovetski#########################################################################
104211edcfe2SGuennadi Liakhovetskismdk6400_noUSB_config	\
104311edcfe2SGuennadi Liakhovetskismdk6400_config	:	unconfig
104411edcfe2SGuennadi Liakhovetski	@mkdir -p $(obj)include $(obj)board/samsung/smdk6400
104511edcfe2SGuennadi Liakhovetski	@mkdir -p $(obj)nand_spl/board/samsung/smdk6400
104611edcfe2SGuennadi Liakhovetski	@echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
10470e42ada3SWolfgang Denk	@echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
104811edcfe2SGuennadi Liakhovetski	@if [ -z "$(findstring smdk6400_noUSB_config,$@)" ]; then			\
104911edcfe2SGuennadi Liakhovetski		echo "RAM_TEXT = 0x57e00000" >> $(obj)board/samsung/smdk6400/config.tmp;\
105011edcfe2SGuennadi Liakhovetski	else										\
105111edcfe2SGuennadi Liakhovetski		echo "RAM_TEXT = 0xc7e00000" >> $(obj)board/samsung/smdk6400/config.tmp;\
105211edcfe2SGuennadi Liakhovetski	fi
105354e19a7dSWolfgang Denk	@$(MKCONFIG) smdk6400 arm arm1176 smdk6400 samsung s3c64xx
105411edcfe2SGuennadi Liakhovetski	@echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
105511edcfe2SGuennadi Liakhovetski
10560afe519aSWolfgang Denk#########################################################################
10573e38691eSwdenk#########################################################################
10587ebf7443Swdenk
10597ebf7443Swdenkclean:
10601bc15386SPeter Tyser	@rm -f $(obj)examples/standalone/82559_eeprom			  \
1061d640ac58SWolfgang Denk	       $(obj)examples/standalone/atmel_df_pow2			  \
10621bc15386SPeter Tyser	       $(obj)examples/standalone/eepro100_eeprom		  \
10631bc15386SPeter Tyser	       $(obj)examples/standalone/hello_world			  \
10641bc15386SPeter Tyser	       $(obj)examples/standalone/interrupt			  \
10651bc15386SPeter Tyser	       $(obj)examples/standalone/mem_to_mem_idma2intr		  \
10661bc15386SPeter Tyser	       $(obj)examples/standalone/sched				  \
1067201a017cSMike Frysinger	       $(obj)examples/standalone/smc911{11,x}_eeprom		  \
10681bc15386SPeter Tyser	       $(obj)examples/standalone/test_burst			  \
10691bc15386SPeter Tyser	       $(obj)examples/standalone/timer
1070d4abc757SPeter Tyser	@rm -f $(obj)examples/api/demo{,.bin}
1071f9301e1cSWolfgang Denk	@rm -f $(obj)tools/bmp_logo	   $(obj)tools/easylogo/easylogo  \
1072f9301e1cSWolfgang Denk	       $(obj)tools/env/{fw_printenv,fw_setenv}			  \
1073f9301e1cSWolfgang Denk	       $(obj)tools/envcrc					  \
1074f9301e1cSWolfgang Denk	       $(obj)tools/gdb/{astest,gdbcont,gdbsend}			  \
1075f9301e1cSWolfgang Denk	       $(obj)tools/gen_eth_addr    $(obj)tools/img2srec		  \
1076f9301e1cSWolfgang Denk	       $(obj)tools/mkimage	   $(obj)tools/mpc86x_clk	  \
1077f9301e1cSWolfgang Denk	       $(obj)tools/ncb		   $(obj)tools/ubsha1
1078f9301e1cSWolfgang Denk	@rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image}	  \
107974c7a95fSWolfgang Denk	       $(obj)board/matrix_vision/*/bootscript.img		  \
1080f9301e1cSWolfgang Denk	       $(obj)board/netstar/{eeprom,crcek,crcit,*.srec,*.bin}	  \
1081566e5cf4SWolfgang Denk	       $(obj)board/voiceblue/eeprom 				  \
10821dcb50afSWolfgang Denk	       $(obj)board/armltd/{integratorap,integratorcp}/u-boot.lds  \
10831aada9cdSWolfgang Denk	       $(obj)u-boot.lds						  \
1084c6fb83d2SPeter Tyser	       $(obj)arch/blackfin/cpu/bootrom-asm-offsets.[chs]
1085dc7746d8SWolfgang Denk	@rm -f $(obj)include/bmp_logo.h
108616a354f9SWolfgang Denk	@rm -f $(obj)lib/asm-offsets.s
1087ff6b47adSKumar Gala	@rm -f $(obj)nand_spl/{u-boot.lds,u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map,System.map}
1088ca6189dbSKyungmin Park	@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
10890d3c62e4SChander Kashyap	@rm -f $(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
1090ca6189dbSKyungmin Park	@rm -f $(ONENAND_BIN)
10911aada9cdSWolfgang Denk	@rm -f $(obj)onenand_ipl/u-boot.lds
10925df2ee27SDaniel Schwierzeck	@rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.lds,u-boot-spl.map}
1093d4abc757SPeter Tyser	@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
1094ae6d1056SWolfgang Denk	@find $(OBJTREE) -type f \
10957ebf7443Swdenk		\( -name 'core' -o -name '*.bak' -o -name '*~' \
10962b48f7d5SPeter Tyser		-o -name '*.o'	-o -name '*.a' -o -name '*.exe'	\) -print \
10977ebf7443Swdenk		| xargs rm -f
10987ebf7443Swdenk
10997ebf7443Swdenkclobber:	clean
1100727ebd9fSMike Frysinger	@find $(OBJTREE) -type f \( -name '*.depend' \
11014c0d4c3bSwdenk		-o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
11024c0d4c3bSwdenk		-print0 \
11034c0d4c3bSwdenk		| xargs -0 rm -f
1104ffda586fSLi Yang	@rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
11055013c09fSWolfgang Denk		$(obj)cscope.* $(obj)*.*~
11064e0fbb98SDaniel Schwierzeck	@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL-y)
1107aa0c7a86SPrafulla Wadaskar	@rm -f $(obj)u-boot.kwb
1108c5fb70c9SStefano Babic	@rm -f $(obj)u-boot.imx
1109*7816f2cfSHeiko Schocher	@rm -f $(obj)u-boot.ubl
1110fb8b33c1SPeter Tyser	@rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes}
1111a47a12beSStefan Roese	@rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
1112a9d8bc98SLoïc Minier	@rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
111316a354f9SWolfgang Denk	@rm -fr $(obj)include/generated
1114a958b663SJean-Christophe PLAGNIOL-VILLARD	@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f
1115a958b663SJean-Christophe PLAGNIOL-VILLARD	@[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name "*" -type l -print | xargs rm -f
11160d3c62e4SChander Kashyap	@[ ! -d $(obj)mmc_spl ] || find $(obj)mmc_spl -name "*" -type l -print | xargs rm -f
11177ebf7443Swdenk
11187ebf7443Swdenkmrproper \
11197ebf7443Swdenkdistclean:	clobber unconfig
1120afd077bdSMike Frysingerifneq ($(OBJTREE),$(SRCTREE))
1121ae6d1056SWolfgang Denk	rm -rf $(obj)*
1122f9328639SMarian Balakowiczendif
11237ebf7443Swdenk
11247ebf7443Swdenkbackup:
11257ebf7443Swdenk	F=`basename $(TOPDIR)` ; cd .. ; \
1126d6b93714SIlya Yanok	gtar --force-local -zcvf `LC_ALL=C date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
11277ebf7443Swdenk
11287ebf7443Swdenk#########################################################################
1129