Makefile 91.6 KB
Newer Older
wdenk's avatar
wdenk committed
1
#
2
# (C) Copyright 2000-2008
wdenk's avatar
wdenk committed
3 4 5 6 7 8 9
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# See file CREDITS for list of people who contributed to this
# project.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
10
# published by the Free Software Foundatio; either version 2 of
wdenk's avatar
wdenk committed
11 12 13 14 15 16 17 18 19 20 21 22 23
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#

24
VERSION = 1
25
PATCHLEVEL = 3
26
SUBLEVEL = 2
27
EXTRAVERSION = -rc2
28
U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
29
VERSION_FILE = $(obj)include/version_autogenerated.h
30

wdenk's avatar
wdenk committed
31 32 33 34 35 36
HOSTARCH := $(shell uname -m | \
	sed -e s/i.86/i386/ \
	    -e s/sun4u/sparc64/ \
	    -e s/arm.*/arm/ \
	    -e s/sa110/arm/ \
	    -e s/powerpc/ppc/ \
Kumar Gala's avatar
Kumar Gala committed
37
	    -e s/ppc64/ppc/ \
wdenk's avatar
wdenk committed
38 39
	    -e s/macppc/ppc/)

40
HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
wdenk's avatar
wdenk committed
41 42
	    sed -e 's/\(cygwin\).*/cygwin/')

43
export	HOSTARCH HOSTOS
wdenk's avatar
wdenk committed
44 45 46 47

# Deal with colliding definitions from tcsh etc.
VENDOR=

48 49 50 51 52 53 54 55
#########################################################################
# Allow for silent builds
ifeq (,$(findstring s,$(MAKEFLAGS)))
XECHO = echo
else
XECHO = :
endif

wdenk's avatar
wdenk committed
56
#########################################################################
57 58 59
#
# U-boot build supports producing a object files to the separate external
# directory. Two use cases are supported:
60
#
61 62 63 64 65 66 67 68 69 70
# 1) Add O= to the make command line
# 'make O=/tmp/build all'
#
# 2) Set environement variable BUILD_DIR to point to the desired location
# 'export BUILD_DIR=/tmp/build'
# 'make'
#
# The second approach can also be used with a MAKEALL script
# 'export BUILD_DIR=/tmp/build'
# './MAKEALL'
71
#
72
# Command line 'O=' setting overrides BUILD_DIR environent variable.
73
#
74 75
# When none of the above methods is used the local build is performed and
# the object files are placed in the source directory.
76
#
77 78 79 80 81 82 83 84 85

ifdef O
ifeq ("$(origin O)", "command line")
BUILD_DIR := $(O)
endif
endif

ifneq ($(BUILD_DIR),)
saved-output := $(BUILD_DIR)
86 87 88 89

# Attempt to create a output directory.
$(shell [ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR})

Stefan Roese's avatar
Stefan Roese committed
90
# Verify if it was successful.
91 92 93 94 95 96 97 98 99 100 101 102
BUILD_DIR := $(shell cd $(BUILD_DIR) && /bin/pwd)
$(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
endif # ifneq ($(BUILD_DIR),)

OBJTREE		:= $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
SRCTREE		:= $(CURDIR)
TOPDIR		:= $(SRCTREE)
LNDIR		:= $(OBJTREE)
export	TOPDIR SRCTREE OBJTREE

MKCONFIG	:= $(SRCTREE)/mkconfig
export MKCONFIG
wdenk's avatar
wdenk committed
103

104
ifneq ($(OBJTREE),$(SRCTREE))
Wolfgang Denk's avatar
Wolfgang Denk committed
105
REMOTE_BUILD	:= 1
106 107 108 109 110 111 112 113 114 115 116 117
export REMOTE_BUILD
endif

# $(obj) and (src) are defined in config.mk but here in main Makefile
# we also need them before config.mk is included which is the case for
# some targets like unconfig, clean, clobber, distclean, etc.
ifneq ($(OBJTREE),$(SRCTREE))
obj := $(OBJTREE)/
src := $(SRCTREE)/
else
obj :=
src :=
118
endif
119 120
export obj src

wdenk's avatar
wdenk committed
121 122
#########################################################################

123
ifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))
wdenk's avatar
wdenk committed
124 125

# load ARCH, BOARD, and CPU configuration
126
include $(obj)include/config.mk
wdenk's avatar
wdenk committed
127
export	ARCH CPU BOARD VENDOR SOC
128

wdenk's avatar
wdenk committed
129
ifndef CROSS_COMPILE
Wolfgang Denk's avatar
Wolfgang Denk committed
130
ifeq ($(HOSTARCH),$(ARCH))
wdenk's avatar
wdenk committed
131 132 133
CROSS_COMPILE =
else
ifeq ($(ARCH),ppc)
Wolfgang Denk's avatar
Wolfgang Denk committed
134
CROSS_COMPILE = ppc_8xx-
wdenk's avatar
wdenk committed
135 136
endif
ifeq ($(ARCH),arm)
wdenk's avatar
wdenk committed
137
CROSS_COMPILE = arm-linux-
wdenk's avatar
wdenk committed
138
endif
139
ifeq ($(ARCH),i386)
wdenk's avatar
wdenk committed
140 141
CROSS_COMPILE = i386-linux-
endif
142 143 144
ifeq ($(ARCH),mips)
CROSS_COMPILE = mips_4KC-
endif
wdenk's avatar
wdenk committed
145 146 147
ifeq ($(ARCH),nios)
CROSS_COMPILE = nios-elf-
endif
wdenk's avatar
wdenk committed
148 149 150
ifeq ($(ARCH),nios2)
CROSS_COMPILE = nios2-elf-
endif
wdenk's avatar
wdenk committed
151 152 153
ifeq ($(ARCH),m68k)
CROSS_COMPILE = m68k-elf-
endif
wdenk's avatar
wdenk committed
154 155 156
ifeq ($(ARCH),microblaze)
CROSS_COMPILE = mb-
endif
Wolfgang Denk's avatar
Wolfgang Denk committed
157
ifeq ($(ARCH),blackfin)
158
CROSS_COMPILE = bfin-uclinux-
Wolfgang Denk's avatar
Wolfgang Denk committed
159
endif
Wolfgang Denk's avatar
Wolfgang Denk committed
160
ifeq ($(ARCH),avr32)
161
CROSS_COMPILE = avr32-linux-
Wolfgang Denk's avatar
Wolfgang Denk committed
162
endif
163 164
ifeq ($(ARCH),sh)
CROSS_COMPILE = sh4-linux-
165 166 167
endif	# sh
endif	# HOSTARCH,ARCH
endif	# CROSS_COMPILE
wdenk's avatar
wdenk committed
168 169 170

export	CROSS_COMPILE

171 172 173
# load other configuration
include $(TOPDIR)/config.mk

wdenk's avatar
wdenk committed
174 175 176
#########################################################################
# U-Boot objects....order is important (i.e. start must be first)

wdenk's avatar
wdenk committed
177
OBJS  = cpu/$(CPU)/start.o
178
ifeq ($(CPU),i386)
wdenk's avatar
wdenk committed
179 180
OBJS += cpu/$(CPU)/start16.o
OBJS += cpu/$(CPU)/reset.o
181
endif
wdenk's avatar
wdenk committed
182
ifeq ($(CPU),ppc4xx)
wdenk's avatar
wdenk committed
183
OBJS += cpu/$(CPU)/resetvec.o
wdenk's avatar
wdenk committed
184
endif
185 186 187
ifeq ($(CPU),mpc85xx)
OBJS += cpu/$(CPU)/resetvec.o
endif
wdenk's avatar
wdenk committed
188

189 190
OBJS := $(addprefix $(obj),$(OBJS))

wdenk's avatar
wdenk committed
191
LIBS  = lib_generic/libgeneric.a
192 193
LIBS += $(shell if [ -f board/$(VENDOR)/common/Makefile ]; then echo \
	"board/$(VENDOR)/common/lib$(VENDOR).a"; fi)
wdenk's avatar
wdenk committed
194
LIBS += board/$(BOARDDIR)/lib$(BOARD).a
wdenk's avatar
wdenk committed
195
LIBS += cpu/$(CPU)/lib$(CPU).a
wdenk's avatar
wdenk committed
196 197 198
ifdef SOC
LIBS += cpu/$(CPU)/$(SOC)/lib$(SOC).a
endif
199 200 201
ifeq ($(CPU),ixp)
LIBS += cpu/ixp/npe/libnpe.a
endif
wdenk's avatar
wdenk committed
202
LIBS += lib_$(ARCH)/lib$(ARCH).a
wdenk's avatar
wdenk committed
203
LIBS += fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a \
stroese's avatar
stroese committed
204
	fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a
wdenk's avatar
wdenk committed
205 206
LIBS += net/libnet.a
LIBS += disk/libdisk.a
207
LIBS += drivers/bios_emulator/libatibiosemu.a
208
LIBS += drivers/block/libblock.a
209
LIBS += drivers/dma/libdma.a
210
LIBS += drivers/hwmon/libhwmon.a
211
LIBS += drivers/i2c/libi2c.a
212
LIBS += drivers/input/libinput.a
213
LIBS += drivers/misc/libmisc.a
214 215 216 217
LIBS += drivers/mtd/libmtd.a
LIBS += drivers/mtd/nand/libnand.a
LIBS += drivers/mtd/nand_legacy/libnand_legacy.a
LIBS += drivers/mtd/onenand/libonenand.a
218
LIBS += drivers/net/libnet.a
219 220 221
LIBS += drivers/net/sk98lin/libsk98lin.a
LIBS += drivers/pci/libpci.a
LIBS += drivers/pcmcia/libpcmcia.a
222
LIBS += drivers/spi/libspi.a
Dave Liu's avatar
Dave Liu committed
223 224 225
ifeq ($(CPU),mpc83xx)
LIBS += drivers/qe/qe.a
endif
Andy Fleming's avatar
Andy Fleming committed
226 227 228
ifeq ($(CPU),mpc85xx)
LIBS += drivers/qe/qe.a
endif
229
LIBS += drivers/rtc/librtc.a
230
LIBS += drivers/serial/libserial.a
231 232
LIBS += drivers/usb/libusb.a
LIBS += drivers/video/libvideo.a
233 234 235
LIBS += post/libpost.a post/drivers/libpostdrivers.a
LIBS += $(shell if [ -d post/lib_$(ARCH) ]; then echo \
	"post/lib_$(ARCH)/libpost$(ARCH).a"; fi)
236 237
LIBS += $(shell if [ -d post/lib_$(ARCH)/fpu ]; then echo \
	"post/lib_$(ARCH)/fpu/libpost$(ARCH)fpu.a"; fi)
238 239 240 241
LIBS += $(shell if [ -d post/cpu/$(CPU) ]; then echo \
	"post/cpu/$(CPU)/libpost$(CPU).a"; fi)
LIBS += $(shell if [ -d post/board/$(BOARDDIR) ]; then echo \
	"post/board/$(BOARDDIR)/libpost$(BOARD).a"; fi)
wdenk's avatar
wdenk committed
242
LIBS += common/libcommon.a
243
LIBS += libfdt/libfdt.a
244
LIBS += api/libapi.a
245 246

LIBS := $(addprefix $(obj),$(LIBS))
Stefano Babic's avatar
Stefano Babic committed
247
.PHONY : $(LIBS) $(VERSION_FILE)
wdenk's avatar
wdenk committed
248

wdenk's avatar
wdenk committed
249
# Add GCC lib
250
PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
251

wdenk's avatar
wdenk committed
252 253 254
# The "tools" are needed early, so put this first
# Don't include stuff already done in $(LIBS)
SUBDIRS	= tools \
255 256
	  examples \
	  api_examples
257

wdenk's avatar
wdenk committed
258
.PHONY : $(SUBDIRS)
wdenk's avatar
wdenk committed
259

260 261 262 263 264
ifeq ($(CONFIG_NAND_U_BOOT),y)
NAND_SPL = nand_spl
U_BOOT_NAND = $(obj)u-boot-nand.bin
endif

265 266 267 268 269
ifeq ($(CONFIG_ONENAND_U_BOOT),y)
ONENAND_IPL = onenand_ipl
U_BOOT_ONENAND = $(obj)u-boot-onenand.bin
endif

270 271 272
__OBJS := $(subst $(obj),,$(OBJS))
__LIBS := $(subst $(obj),,$(LIBS))

273
#########################################################################
wdenk's avatar
wdenk committed
274 275
#########################################################################

276
ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map $(U_BOOT_NAND) $(U_BOOT_ONENAND)
277 278 279
ifeq ($(ARCH),blackfin)
ALL += $(obj)u-boot.ldr
endif
wdenk's avatar
wdenk committed
280

281
all:		$(ALL)
wdenk's avatar
wdenk committed
282

283
$(obj)u-boot.hex:	$(obj)u-boot
wdenk's avatar
wdenk committed
284 285
		$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@

286
$(obj)u-boot.srec:	$(obj)u-boot
wdenk's avatar
wdenk committed
287 288
		$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@

289
$(obj)u-boot.bin:	$(obj)u-boot
wdenk's avatar
wdenk committed
290 291
		$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@

292 293 294 295 296 297 298 299 300
$(obj)u-boot.ldr:	$(obj)u-boot
		$(LDR) -T $(CONFIG_BFIN_CPU) -f -c $@ $< $(LDR_FLAGS)

$(obj)u-boot.ldr.hex:	$(obj)u-boot.ldr
		$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@ -I binary

$(obj)u-boot.ldr.srec:	$(obj)u-boot.ldr
		$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@ -I binary

301
$(obj)u-boot.img:	$(obj)u-boot.bin
302 303
		./tools/mkimage -A $(ARCH) -T firmware -C none \
		-a $(TEXT_BASE) -e 0 \
304
		-n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
305 306 307
			sed -e 's/"[	 ]*$$/ for $(BOARD) board"/') \
		-d $< $@

308
$(obj)u-boot.sha1:	$(obj)u-boot.bin
309
		$(obj)tools/ubsha1 $(obj)u-boot.bin
310

311
$(obj)u-boot.dis:	$(obj)u-boot
wdenk's avatar
wdenk committed
312 313
		$(OBJDUMP) -d $< > $@

314
$(obj)u-boot:		depend $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT)
315
		UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
316 317
		cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \
			--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
318
			-Map u-boot.map -o u-boot
wdenk's avatar
wdenk committed
319

320
$(OBJS):	depend $(obj)include/autoconf.mk
321 322
		$(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@))

323
$(LIBS):	depend $(obj)include/autoconf.mk
324
		$(MAKE) -C $(dir $(subst $(obj),,$@))
wdenk's avatar
wdenk committed
325

326
$(SUBDIRS):	depend $(obj)include/autoconf.mk
wdenk's avatar
wdenk committed
327
		$(MAKE) -C $@ all
wdenk's avatar
wdenk committed
328

329 330 331
$(LDSCRIPT):	depend $(obj)include/autoconf.mk
		$(MAKE) -C $(dir $@) $(notdir $@)

332
$(NAND_SPL):	$(VERSION_FILE)	$(obj)include/autoconf.mk
333
		$(MAKE) -C nand_spl/board/$(BOARDDIR) all
334

335
$(U_BOOT_NAND):	$(NAND_SPL) $(obj)u-boot.bin $(obj)include/autoconf.mk
336
		cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
337

338 339 340 341 342 343
$(ONENAND_IPL):	$(VERSION_FILE)	$(obj)include/autoconf.mk
		$(MAKE) -C onenand_ipl/board/$(BOARDDIR) all

$(U_BOOT_ONENAND):	$(ONENAND_IPL) $(obj)u-boot.bin $(obj)include/autoconf.mk
		cat $(obj)onenand_ipl/onenand-ipl-2k.bin $(obj)u-boot.bin > $(obj)u-boot-onenand.bin

344 345 346
$(VERSION_FILE):
		@( echo -n "#define U_BOOT_VERSION \"U-Boot " ; \
		echo -n "$(U_BOOT_VERSION)" ; \
347
		echo -n $(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion \
348
			 $(TOPDIR)) ; \
349 350
		echo "\"" ) > $@.tmp
		@cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
351

352
gdbtools:
353 354 355 356 357 358
		$(MAKE) -C tools/gdb all || exit 1

updater:
		$(MAKE) -C tools/updater all || exit 1

env:
359
		$(MAKE) -C tools/env all MTD_VERSION=${MTD_VERSION} || exit 1
360

361
depend dep:	$(VERSION_FILE)
362
		for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir _depend ; done
wdenk's avatar
wdenk committed
363

364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391
TAG_SUBDIRS += include
TAG_SUBDIRS += lib_generic board/$(BOARDDIR)
TAG_SUBDIRS += cpu/$(CPU)
TAG_SUBDIRS += lib_$(ARCH)
TAG_SUBDIRS += fs/cramfs
TAG_SUBDIRS += fs/fat
TAG_SUBDIRS += fs/fdos
TAG_SUBDIRS += fs/jffs2
TAG_SUBDIRS += net
TAG_SUBDIRS += disk
TAG_SUBDIRS += common
TAG_SUBDIRS += drivers/bios_emulator
TAG_SUBDIRS += drivers/block
TAG_SUBDIRS += drivers/hwmon
TAG_SUBDIRS += drivers/i2c
TAG_SUBDIRS += drivers/input
TAG_SUBDIRS += drivers/misc
TAG_SUBDIRS += drivers/mtd
TAG_SUBDIRS += drivers/mtd/nand
TAG_SUBDIRS += drivers/mtd/nand_legacy
TAG_SUBDIRS += drivers/mtd/onenand
TAG_SUBDIRS += drivers/net
TAG_SUBDIRS += drivers/net/sk98lin
TAG_SUBDIRS += drivers/pci
TAG_SUBDIRS += drivers/pcmcia
TAG_SUBDIRS += drivers/qe
TAG_SUBDIRS += drivers/rtc
TAG_SUBDIRS += drivers/serial
392
TAG_SUBDIRS += drivers/spi
393 394 395
TAG_SUBDIRS += drivers/usb
TAG_SUBDIRS += drivers/video

396
tags ctags:
397
		ctags -w -o $(obj)ctags `find $(SUBDIRS) $(TAG_SUBDIRS) \
Wolfgang Denk's avatar
Wolfgang Denk committed
398
						-name '*.[ch]' -print`
wdenk's avatar
wdenk committed
399 400

etags:
401
		etags -a -o $(obj)etags `find $(SUBDIRS) $(TAG_SUBDIRS) \
Wolfgang Denk's avatar
Wolfgang Denk committed
402
						-name '*.[ch]' -print`
Li Yang's avatar
Li Yang committed
403 404 405 406
cscope:
		find $(SUBDIRS) $(TAG_SUBDIRS) -name '*.[ch]' -print \
						> cscope.files
		cscope -b -q -k
wdenk's avatar
wdenk committed
407

408
$(obj)System.map:	$(obj)u-boot
wdenk's avatar
wdenk committed
409 410
		@$(NM) $< | \
		grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
411
		sort > $(obj)System.map
wdenk's avatar
wdenk committed
412

413 414 415 416 417 418
#
# Auto-generate the autoconf.mk file (which is included by all makefiles)
#
# This target actually generates 2 files; autoconf.mk and autoconf.mk.dep.
# the dep file is only include in this top level makefile to determine when
# to regenerate the autoconf.mk file.
419 420
$(obj)include/autoconf.mk: $(obj)include/config.h $(VERSION_FILE)
	@$(XECHO) Generating include/autoconf.mk ; \
421
	set -e ; \
422 423 424 425
	: Generate the dependancies ; \
	$(CC) -M $(HOST_CFLAGS) $(CPPFLAGS) -MQ $@ include/common.h > $@.dep ; \
	: Extract the config macros ; \
	$(CPP) $(CFLAGS) -dM include/common.h | sed -n -f tools/scripts/define2mk.sed > $@
426

427
sinclude $(obj)include/autoconf.mk.dep
428

wdenk's avatar
wdenk committed
429
#########################################################################
430
else	# !config.mk
431 432
all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
$(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \
433
$(SUBDIRS) $(VERSION_FILE) gdbtools updater env depend \
Li Yang's avatar
Li Yang committed
434
dep tags ctags etags cscope $(obj)System.map:
wdenk's avatar
wdenk committed
435 436
	@echo "System not configured - see README" >&2
	@ exit 1
437
endif	# config.mk
wdenk's avatar
wdenk committed
438

439 440
.PHONY : CHANGELOG
CHANGELOG:
441 442
	git log --no-merges U-Boot-1_1_5.. | \
	unexpand -a | sed -e 's/\s\s*$$//' > $@
443

wdenk's avatar
wdenk committed
444 445 446
#########################################################################

unconfig:
447
	@rm -f $(obj)include/config.h $(obj)include/config.mk \
448 449
		$(obj)board/*/config.tmp $(obj)board/*/*/config.tmp \
		$(obj)include/autoconf.mk $(obj)include/autoconf.mk.dep
wdenk's avatar
wdenk committed
450 451 452 453

#========================================================================
# PowerPC
#========================================================================
454 455 456 457 458

#########################################################################
## MPC5xx Systems
#########################################################################

wdenk's avatar
wdenk committed
459
canmb_config:	unconfig
460
	@$(MKCONFIG) -a canmb ppc mpc5xxx canmb
wdenk's avatar
wdenk committed
461

462
cmi_mpc5xx_config:	unconfig
463
	@$(MKCONFIG) $(@:_config=) ppc mpc5xx cmi
464

465
PATI_config:		unconfig
466
	@$(MKCONFIG) $(@:_config=) ppc mpc5xx pati mpl
wdenk's avatar
wdenk committed
467

468 469 470
#########################################################################
## MPC5xxx Systems
#########################################################################
wdenk's avatar
wdenk committed
471

472
aev_config: unconfig
473
	@$(MKCONFIG) -a aev ppc mpc5xxx tqm5200
474

dzu@denx.de's avatar
dzu@denx.de committed
475
BC3450_config:	unconfig
476
	@$(MKCONFIG) -a BC3450 ppc mpc5xxx bc3450
dzu@denx.de's avatar
dzu@denx.de committed
477

478
cpci5200_config:  unconfig
479
	@$(MKCONFIG) -a cpci5200  ppc mpc5xxx cpci5200 esd
480

481
hmi1001_config:	unconfig
482
	@$(MKCONFIG) hmi1001 ppc mpc5xxx hmi1001
wdenk's avatar
wdenk committed
483

484 485 486 487 488 489
Lite5200_config				\
Lite5200_LOWBOOT_config			\
Lite5200_LOWBOOT08_config		\
icecube_5200_config			\
icecube_5200_LOWBOOT_config		\
icecube_5200_LOWBOOT08_config		\
Wolfgang Denk's avatar
Wolfgang Denk committed
490 491
icecube_5200_DDR_config			\
icecube_5200_DDR_LOWBOOT_config		\
492 493
icecube_5200_DDR_LOWBOOT08_config	\
icecube_5100_config:			unconfig
494 495 496
	@mkdir -p $(obj)include
	@mkdir -p $(obj)board/icecube
	@ >$(obj)include/config.h
wdenk's avatar
wdenk committed
497 498
	@[ -z "$(findstring LOWBOOT_,$@)" ] || \
		{ if [ "$(findstring DDR,$@)" ] ; \
499 500
			then echo "TEXT_BASE = 0xFF800000" >$(obj)board/icecube/config.tmp ; \
			else echo "TEXT_BASE = 0xFF000000" >$(obj)board/icecube/config.tmp ; \
wdenk's avatar
wdenk committed
501
		  fi ; \
502
		  $(XECHO) "... with LOWBOOT configuration" ; \
wdenk's avatar
wdenk committed
503 504
		}
	@[ -z "$(findstring LOWBOOT08,$@)" ] || \
505
		{ echo "TEXT_BASE = 0xFF800000" >$(obj)board/icecube/config.tmp ; \
wdenk's avatar
wdenk committed
506
		  echo "... with 8 MB flash only" ; \
507
		  $(XECHO) "... with LOWBOOT configuration" ; \
wdenk's avatar
wdenk committed
508
		}
509
	@[ -z "$(findstring DDR,$@)" ] || \
510
		{ echo "#define CONFIG_MPC5200_DDR"	>>$(obj)include/config.h ; \
511
		  $(XECHO) "... DDR memory revision" ; \
512
		}
wdenk's avatar
wdenk committed
513
	@[ -z "$(findstring 5200,$@)" ] || \
514
		{ echo "#define CONFIG_MPC5200"		>>$(obj)include/config.h ; \
515
		  $(XECHO) "... with MPC5200 processor" ; \
wdenk's avatar
wdenk committed
516
		}
wdenk's avatar
wdenk committed
517
	@[ -z "$(findstring 5100,$@)" ] || \
518
		{ echo "#define CONFIG_MGT5100"		>>$(obj)include/config.h ; \
519
		  $(XECHO) "... with MGT5100 processor" ; \
520
		}
521
	@$(MKCONFIG) -a IceCube ppc mpc5xxx icecube
522

523
jupiter_config:	unconfig
524 525
	@$(MKCONFIG) jupiter ppc mpc5xxx jupiter

526
v38b_config: unconfig
527
	@$(MKCONFIG) -a v38b ppc mpc5xxx v38b
528

529
inka4x0_config:	unconfig
530
	@$(MKCONFIG) inka4x0 ppc mpc5xxx inka4x0
wdenk's avatar
wdenk committed
531

532
lite5200b_config	\
533
lite5200b_PM_config	\
534
lite5200b_LOWBOOT_config:	unconfig
535 536 537 538
	@mkdir -p $(obj)include
	@mkdir -p $(obj)board/icecube
	@ >$(obj)include/config.h
	@ echo "#define CONFIG_MPC5200_DDR"	>>$(obj)include/config.h
539
	@ $(XECHO) "... DDR memory revision"
540 541
	@ echo "#define CONFIG_MPC5200"		>>$(obj)include/config.h
	@ echo "#define CONFIG_LITE5200B"	>>$(obj)include/config.h
542 543
	@[ -z "$(findstring _PM_,$@)" ] || \
		{ echo "#define CONFIG_LITE5200B_PM"	>>$(obj)include/config.h ; \
544
		  $(XECHO) "... with power management (low-power mode) support" ; \
545
		}
546
	@[ -z "$(findstring LOWBOOT_,$@)" ] || \
547
		{ echo "TEXT_BASE = 0xFF000000" >$(obj)board/icecube/config.tmp ; \
548
		  $(XECHO) "... with LOWBOOT configuration" ; \
549
		}
550
	@ $(XECHO) "... with MPC5200B processor"
551
	@$(MKCONFIG) -a IceCube  ppc mpc5xxx icecube
552

553
mcc200_config	\
554 555 556 557
mcc200_SDRAM_config	\
mcc200_highboot_config	\
mcc200_COM12_config	\
mcc200_COM12_SDRAM_config	\
558 559
mcc200_COM12_highboot_config	\
mcc200_COM12_highboot_SDRAM_config	\
560 561 562 563 564
mcc200_highboot_SDRAM_config	\
prs200_config	\
prs200_DDR_config	\
prs200_highboot_config	\
prs200_highboot_DDR_config:	unconfig
565 566 567
	@mkdir -p $(obj)include
	@mkdir -p $(obj)board/mcc200
	@ >$(obj)include/config.h
568
	@[ -n "$(findstring highboot,$@)" ] || \
569
		{ $(XECHO) "... with lowboot configuration" ; \
570
		}
571
	@[ -z "$(findstring highboot,$@)" ] || \
572
		{ echo "TEXT_BASE = 0xFFF00000" >$(obj)board/mcc200/config.tmp ; \
573
		  $(XECHO) "... with highboot configuration" ; \
574 575
		}
	@[ -n "$(findstring _SDRAM,$@)" ] || \
576 577
		{ if [ -n "$(findstring mcc200,$@)" ]; \
		  then \
578
			$(XECHO) "... with DDR" ; \
579 580 581
		  else \
			if [ -n "$(findstring _DDR,$@)" ];\
			then \
582
				$(XECHO) "... with DDR" ; \
583
			else \
584
				echo "#define CONFIG_MCC200_SDRAM" >>$(obj)include/config.h ;\
585
				$(XECHO) "... with SDRAM" ; \
586 587
			fi; \
		  fi; \
588 589
		}
	@[ -z "$(findstring _SDRAM,$@)" ] || \
590
		{ echo "#define CONFIG_MCC200_SDRAM"	>>$(obj)include/config.h ; \
591
		  $(XECHO) "... with SDRAM" ; \
592
		}
593
	@[ -z "$(findstring COM12,$@)" ] || \
594
		{ echo "#define CONFIG_CONSOLE_COM12"	>>$(obj)include/config.h ; \
595
		  $(XECHO) "... with console on COM12" ; \
596
		}
597
	@[ -z "$(findstring prs200,$@)" ] || \
598
		{ echo "#define CONFIG_PRS200"  >>$(obj)include/config.h ;\
599
		}
600
	@$(MKCONFIG) -n $@ -a mcc200 ppc mpc5xxx mcc200
601

602
mecp5200_config:  unconfig
603
	@$(MKCONFIG) mecp5200  ppc mpc5xxx mecp5200 esd
604

605
munices_config:	unconfig
606
	@$(MKCONFIG) munices ppc mpc5xxx munices
607

608
o2dnt_config:
609
	@$(MKCONFIG) o2dnt ppc mpc5xxx o2dnt
610

611
pf5200_config:  unconfig
612
	@$(MKCONFIG) pf5200  ppc mpc5xxx pf5200 esd
613

wdenk's avatar
wdenk committed
614 615 616 617
PM520_config \
PM520_DDR_config \
PM520_ROMBOOT_config \
PM520_ROMBOOT_DDR_config:	unconfig
618 619
	@mkdir -p $(obj)include
	@ >$(obj)include/config.h
wdenk's avatar
wdenk committed
620
	@[ -z "$(findstring DDR,$@)" ] || \
621
		{ echo "#define CONFIG_MPC5200_DDR"	>>$(obj)include/config.h ; \
622
		  $(XECHO) "... DDR memory revision" ; \
wdenk's avatar
wdenk committed
623 624
		}
	@[ -z "$(findstring ROMBOOT,$@)" ] || \
625
		{ echo "#define CONFIG_BOOT_ROM" >>$(obj)include/config.h ; \
626
		  $(XECHO) "... booting from 8-bit flash" ; \
wdenk's avatar
wdenk committed
627
		}
628
	@$(MKCONFIG) -a PM520 ppc mpc5xxx pm520
wdenk's avatar
wdenk committed
629

630
smmaco4_config: unconfig
631
	@$(MKCONFIG) -a smmaco4 ppc mpc5xxx tqm5200
632

633 634
cm5200_config:	unconfig
	@./mkconfig -a cm5200 ppc mpc5xxx cm5200
635

636
spieval_config:	unconfig
637
	@$(MKCONFIG) -a spieval ppc mpc5xxx tqm5200
638

639
TB5200_B_config \
Wolfgang Denk's avatar
Wolfgang Denk committed
640
TB5200_config:	unconfig
641
	@mkdir -p $(obj)include
642
	@[ -z "$(findstring _B,$@)" ] || \
643
		{ echo "#define CONFIG_TQM5200_B"	>>$(obj)include/config.h ; \
644
		  $(XECHO) "... with MPC5200B processor" ; \
645
		}
646
	@$(MKCONFIG) -n $@ -a TB5200 ppc mpc5xxx tqm5200
Wolfgang Denk's avatar
Wolfgang Denk committed
647

wdenk's avatar
wdenk committed
648 649 650
MINI5200_config	\
EVAL5200_config	\
TOP5200_config:	unconfig
651 652 653
	@mkdir -p $(obj)include
	@ echo "#define CONFIG_$(@:_config=) 1"	>$(obj)include/config.h
	@$(MKCONFIG) -n $@ -a TOP5200 ppc mpc5xxx top5200 emk
wdenk's avatar
wdenk committed
654

wdenk's avatar
wdenk committed
655 656 657 658 659
Total5100_config		\
Total5200_config		\
Total5200_lowboot_config	\
Total5200_Rev2_config		\
Total5200_Rev2_lowboot_config:	unconfig
660 661 662
	@mkdir -p $(obj)include
	@mkdir -p $(obj)board/total5200
	@ >$(obj)include/config.h
wdenk's avatar
wdenk committed
663
	@[ -z "$(findstring 5100,$@)" ] || \
664
		{ echo "#define CONFIG_MGT5100"		>>$(obj)include/config.h ; \
665
		  $(XECHO) "... with MGT5100 processor" ; \
wdenk's avatar
wdenk committed
666 667
		}
	@[ -z "$(findstring 5200,$@)" ] || \
668
		{ echo "#define CONFIG_MPC5200"		>>$(obj)include/config.h ; \
669
		  $(XECHO) "... with MPC5200 processor" ; \
wdenk's avatar
wdenk committed
670 671
		}
	@[ -n "$(findstring Rev,$@)" ] || \
672
		{ echo "#define CONFIG_TOTAL5200_REV 1"	>>$(obj)include/config.h ; \
673
		  $(XECHO) "... revision 1 board" ; \
wdenk's avatar
wdenk committed
674 675
		}
	@[ -z "$(findstring Rev2_,$@)" ] || \
676
		{ echo "#define CONFIG_TOTAL5200_REV 2"	>>$(obj)include/config.h ; \
677
		  $(XECHO) "... revision 2 board" ; \
wdenk's avatar
wdenk committed
678 679
		}
	@[ -z "$(findstring lowboot_,$@)" ] || \
680
		{ echo "TEXT_BASE = 0xFE000000" >$(obj)board/total5200/config.tmp ; \
681
		  $(XECHO) "... with lowboot configuration" ; \
wdenk's avatar
wdenk committed
682
		}
683
	@$(MKCONFIG) -a Total5200 ppc mpc5xxx total5200
wdenk's avatar
wdenk committed
684

685
cam5200_config \
686
cam5200_niosflash_config \
Wolfgang Denk's avatar
Wolfgang Denk committed
687
fo300_config \
688
MiniFAP_config \
689 690
TQM5200S_config \
TQM5200S_HIGHBOOT_config \
Wolfgang Denk's avatar
Wolfgang Denk committed
691 692 693 694
TQM5200_B_config \
TQM5200_B_HIGHBOOT_config \
TQM5200_config	\
TQM5200_STK100_config:	unconfig
695 696 697
	@mkdir -p $(obj)include
	@mkdir -p $(obj)board/tqm5200
	@ >$(obj)include/config.h
698
	@[ -z "$(findstring cam5200,$@)" ] || \
699 700 701
		{ echo "#define CONFIG_CAM5200"	>>$(obj)include/config.h ; \
		  echo "#define CONFIG_TQM5200S"	>>$(obj)include/config.h ; \
		  echo "#define CONFIG_TQM5200_B"	>>$(obj)include/config.h ; \
702
		  $(XECHO) "... TQM5200S on Cam5200" ; \
703
		}
704 705
	@[ -z "$(findstring niosflash,$@)" ] || \
		{ echo "#define CONFIG_CAM5200_NIOSFLASH"	>>$(obj)include/config.h ; \
706
		  $(XECHO) "... with NIOS flash driver" ; \
707
		}
708
	@[ -z "$(findstring fo300,$@)" ] || \
709
		{ echo "#define CONFIG_FO300"	>>$(obj)include/config.h ; \
710
		  $(XECHO) "... TQM5200 on FO300" ; \
711
		}
wdenk's avatar
wdenk committed
712
	@[ -z "$(findstring MiniFAP,$@)" ] || \
713
		{ echo "#define CONFIG_MINIFAP"	>>$(obj)include/config.h ; \
714
		  $(XECHO) "... TQM5200_AC on MiniFAP" ; \
wdenk's avatar
wdenk committed
715
		}
Wolfgang Denk's avatar
Wolfgang Denk committed
716
	@[ -z "$(findstring STK100,$@)" ] || \
717
		{ echo "#define CONFIG_STK52XX_REV100"	>>$(obj)include/config.h ; \
718
		  $(XECHO) "... on a STK52XX.100 base board" ; \
wdenk's avatar
wdenk committed
719
		}
720
	@[ -z "$(findstring TQM5200_B,$@)" ] || \
721
		{ echo "#define CONFIG_TQM5200_B"	>>$(obj)include/config.h ; \
722 723
		}
	@[ -z "$(findstring TQM5200S,$@)" ] || \
724 725
		{ echo "#define CONFIG_TQM5200S"	>>$(obj)include/config.h ; \
		  echo "#define CONFIG_TQM5200_B"	>>$(obj)include/config.h ; \
726
		}
727
	@[ -z "$(findstring HIGHBOOT,$@)" ] || \
728
		{ echo "TEXT_BASE = 0xFFF00000" >$(obj)board/tqm5200/config.tmp ; \
729
		}
730
	@$(MKCONFIG) -n $@ -a TQM5200 ppc mpc5xxx tqm5200
731
uc101_config:		unconfig
732
	@$(MKCONFIG) uc101 ppc mpc5xxx uc101
733
motionpro_config:	unconfig
734 735
	@$(MKCONFIG) motionpro ppc mpc5xxx motionpro

wdenk's avatar
wdenk committed
736

737 738 739
#########################################################################
## MPC512x Systems
#########################################################################
John Rigby's avatar
John Rigby committed
740 741 742 743 744 745 746 747 748
ads5121_config \
ads5121_PCI_config \
	:		 unconfig
	@echo "" >$(obj)include/config.h
	@if [ "$(findstring _PCI_,$@)" ] ; then \
		echo "#define CONFIG_PCI"  >>$(obj)include/config.h ; \
		$(XECHO) "... with PCI enabled" ; \
	fi
	@$(MKCONFIG) -a ads5121 ppc mpc512x ads5121
749 750


wdenk's avatar
wdenk committed
751 752 753 754
#########################################################################
## MPC8xx Systems
#########################################################################

wdenk's avatar
wdenk committed
755 756
Adder_config    \
Adder87x_config \
wdenk's avatar
wdenk committed
757
AdderII_config  \
wdenk's avatar
wdenk committed
758
	:		unconfig
759
	@mkdir -p $(obj)include
wdenk's avatar
wdenk committed
760
	$(if $(findstring AdderII,$@), \
761 762
	@echo "#define CONFIG_MPC852T" > $(obj)include/config.h)
	@$(MKCONFIG) -a Adder ppc mpc8xx adder
wdenk's avatar
wdenk committed
763