Makefile 91 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
# 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
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
wdenk's avatar
wdenk committed
16
17
18
19
20
21
22
23
# 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
Wolfgang Denk's avatar
Wolfgang Denk committed
27
EXTRAVERSION =
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

121
122
123
# Make sure CDPATH settings don't interfere
unexport CDPATH

wdenk's avatar
wdenk committed
124
125
#########################################################################

126
ifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))
wdenk's avatar
wdenk committed
127
128

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

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

export	CROSS_COMPILE

174
175
176
# load other configuration
include $(TOPDIR)/config.mk

wdenk's avatar
wdenk committed
177
178
179
#########################################################################
# U-Boot objects....order is important (i.e. start must be first)

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

192
193
OBJS := $(addprefix $(obj),$(OBJS))

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

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

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

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

wdenk's avatar
wdenk committed
261
.PHONY : $(SUBDIRS)
wdenk's avatar
wdenk committed
262

263
264
265
266
267
ifeq ($(CONFIG_NAND_U_BOOT),y)
NAND_SPL = nand_spl
U_BOOT_NAND = $(obj)u-boot-nand.bin
endif

268
269
270
271
272
ifeq ($(CONFIG_ONENAND_U_BOOT),y)
ONENAND_IPL = onenand_ipl
U_BOOT_ONENAND = $(obj)u-boot-onenand.bin
endif

273
274
275
__OBJS := $(subst $(obj),,$(OBJS))
__LIBS := $(subst $(obj),,$(LIBS))

276
#########################################################################
wdenk's avatar
wdenk committed
277
278
#########################################################################

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

284
all:		$(ALL)
wdenk's avatar
wdenk committed
285

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

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

292
$(obj)u-boot.bin:	$(obj)u-boot
wdenk's avatar
wdenk committed
293
294
		$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@

295
296
297
298
299
300
301
302
303
$(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

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

311
$(obj)u-boot.sha1:	$(obj)u-boot.bin
312
		$(obj)tools/ubsha1 $(obj)u-boot.bin
313

314
$(obj)u-boot.dis:	$(obj)u-boot
wdenk's avatar
wdenk committed
315
316
		$(OBJDUMP) -d $< > $@

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

323
$(OBJS):	depend $(obj)include/autoconf.mk
324
325
		$(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@))

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

329
$(SUBDIRS):	depend $(obj)include/autoconf.mk
wdenk's avatar
wdenk committed
330
		$(MAKE) -C $@ all
wdenk's avatar
wdenk committed
331

332
333
334
$(LDSCRIPT):	depend $(obj)include/autoconf.mk
		$(MAKE) -C $(dir $@) $(notdir $@)

335
$(NAND_SPL):	$(VERSION_FILE)	$(obj)include/autoconf.mk
336
		$(MAKE) -C nand_spl/board/$(BOARDDIR) all
337

338
$(U_BOOT_NAND):	$(NAND_SPL) $(obj)u-boot.bin $(obj)include/autoconf.mk
339
		cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
340

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

$(U_BOOT_ONENAND):	$(ONENAND_IPL) $(obj)u-boot.bin $(obj)include/autoconf.mk
345
		$(MAKE) -C $(obj)onenand_ipl/board/$(BOARDDIR) all
346
		cat $(obj)onenand_ipl/onenand-ipl-2k.bin $(obj)u-boot.bin > $(obj)u-boot-onenand.bin
347
		cat $(obj)onenand_ipl/onenand-ipl-4k.bin $(obj)u-boot.bin > $(obj)u-boot-flexonenand.bin
348

349
350
351
$(VERSION_FILE):
		@( echo -n "#define U_BOOT_VERSION \"U-Boot " ; \
		echo -n "$(U_BOOT_VERSION)" ; \
352
		echo -n $(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion \
353
			 $(TOPDIR)) ; \
354
355
		echo "\"" ) > $@.tmp
		@cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
356

357
gdbtools:
358
359
360
361
362
363
		$(MAKE) -C tools/gdb all || exit 1

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

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

366
depend dep:	$(VERSION_FILE)
367
		for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir _depend ; done
wdenk's avatar
wdenk committed
368

369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
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
397
TAG_SUBDIRS += drivers/spi
398
399
400
TAG_SUBDIRS += drivers/usb
TAG_SUBDIRS += drivers/video

401
tags ctags:
402
		ctags -w -o $(obj)ctags `find $(SUBDIRS) $(TAG_SUBDIRS) \
Wolfgang Denk's avatar
Wolfgang Denk committed
403
						-name '*.[ch]' -print`
wdenk's avatar
wdenk committed
404
405

etags:
406
		etags -a -o $(obj)etags `find $(SUBDIRS) $(TAG_SUBDIRS) \
Wolfgang Denk's avatar
Wolfgang Denk committed
407
						-name '*.[ch]' -print`
Li Yang's avatar
Li Yang committed
408
409
410
411
cscope:
		find $(SUBDIRS) $(TAG_SUBDIRS) -name '*.[ch]' -print \
						> cscope.files
		cscope -b -q -k
wdenk's avatar
wdenk committed
412

413
$(obj)System.map:	$(obj)u-boot
wdenk's avatar
wdenk committed
414
415
		@$(NM) $< | \
		grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
416
		sort > $(obj)System.map
wdenk's avatar
wdenk committed
417

418
419
420
421
422
423
#
# 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.
424
425
$(obj)include/autoconf.mk: $(obj)include/config.h $(VERSION_FILE)
	@$(XECHO) Generating include/autoconf.mk ; \
426
	set -e ; \
427
428
429
430
	: 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 > $@
431

432
sinclude $(obj)include/autoconf.mk.dep
433

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

444
445
.PHONY : CHANGELOG
CHANGELOG:
446
447
	git log --no-merges U-Boot-1_1_5.. | \
	unexpand -a | sed -e 's/\s\s*$$//' > $@
448

wdenk's avatar
wdenk committed
449
450
451
#########################################################################

unconfig:
452
	@rm -f $(obj)include/config.h $(obj)include/config.mk \
453
454
		$(obj)board/*/config.tmp $(obj)board/*/*/config.tmp \
		$(obj)include/autoconf.mk $(obj)include/autoconf.mk.dep
wdenk's avatar
wdenk committed
455
456
457
458

#========================================================================
# PowerPC
#========================================================================
459
460
461
462
463

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

wdenk's avatar
wdenk committed
464
canmb_config:	unconfig
465
	@$(MKCONFIG) -a canmb ppc mpc5xxx canmb
wdenk's avatar
wdenk committed
466

467
cmi_mpc5xx_config:	unconfig
468
	@$(MKCONFIG) $(@:_config=) ppc mpc5xx cmi
469

470
PATI_config:		unconfig
471
	@$(MKCONFIG) $(@:_config=) ppc mpc5xx pati mpl
wdenk's avatar
wdenk committed
472

473
474
475
#########################################################################
## MPC5xxx Systems
#########################################################################
wdenk's avatar
wdenk committed
476

477
aev_config: unconfig
478
	@$(MKCONFIG) -a aev ppc mpc5xxx tqm5200
479

dzu@denx.de's avatar
dzu@denx.de committed
480
BC3450_config:	unconfig
481
	@$(MKCONFIG) -a BC3450 ppc mpc5xxx bc3450
dzu@denx.de's avatar
dzu@denx.de committed
482

483
cpci5200_config:  unconfig
484
	@$(MKCONFIG) -a cpci5200  ppc mpc5xxx cpci5200 esd
485

486
hmi1001_config:	unconfig
487
	@$(MKCONFIG) hmi1001 ppc mpc5xxx hmi1001
wdenk's avatar
wdenk committed
488

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

527
jupiter_config:	unconfig
528
529
	@$(MKCONFIG) jupiter ppc mpc5xxx jupiter

530
v38b_config: unconfig
531
	@$(MKCONFIG) -a v38b ppc mpc5xxx v38b
532

533
inka4x0_config:	unconfig
534
	@$(MKCONFIG) inka4x0 ppc mpc5xxx inka4x0
wdenk's avatar
wdenk committed
535

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

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

604
mecp5200_config:  unconfig
605
	@$(MKCONFIG) mecp5200  ppc mpc5xxx mecp5200 esd
606

607
munices_config:	unconfig
608
	@$(MKCONFIG) munices ppc mpc5xxx munices
609

610
o2dnt_config:	unconfig
611
	@$(MKCONFIG) o2dnt ppc mpc5xxx o2dnt
612

613
pf5200_config:	unconfig
614
	@$(MKCONFIG) pf5200  ppc mpc5xxx pf5200 esd
615

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

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

634
cm5200_config:	unconfig
635
	@$(MKCONFIG) -a cm5200 ppc mpc5xxx cm5200
636

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

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

wdenk's avatar
wdenk committed
649
650
651
MINI5200_config	\
EVAL5200_config	\
TOP5200_config:	unconfig
652
653
654
	@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
655

wdenk's avatar
wdenk committed
656
657
658
659
660
Total5100_config		\
Total5200_config		\
Total5200_lowboot_config	\
Total5200_Rev2_config		\
Total5200_Rev2_lowboot_config:	unconfig
661
662
	@mkdir -p $(obj)include
	@mkdir -p $(obj)board/total5200
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
	@mkdir -p $(obj)include
	@mkdir -p $(obj)board/tqm5200
697
	@[ -z "$(findstring cam5200,$@)" ] || \
698
699
700
		{ 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 ; \
701
		  $(XECHO) "... TQM5200S on Cam5200" ; \
702
		}
703
704
	@[ -z "$(findstring niosflash,$@)" ] || \
		{ echo "#define CONFIG_CAM5200_NIOSFLASH"	>>$(obj)include/config.h ; \
705
		  $(XECHO) "... with NIOS flash driver" ; \
706
		}
707
	@[ -z "$(findstring fo300,$@)" ] || \
708
		{ echo "#define CONFIG_FO300"	>>$(obj)include/config.h ; \
709
		  $(XECHO) "... TQM5200 on FO300" ; \
710
		}
wdenk's avatar
wdenk committed
711
	@[ -z "$(findstring MiniFAP,$@)" ] || \
712
		{ echo "#define CONFIG_MINIFAP"	>>$(obj)include/config.h ; \
713
		  $(XECHO) "... TQM5200_AC on MiniFAP" ; \
wdenk's avatar
wdenk committed
714
		}
Wolfgang Denk's avatar
Wolfgang Denk committed
715
	@[ -z "$(findstring STK100,$@)" ] || \
716
		{ echo "#define CONFIG_STK52XX_REV100"	>>$(obj)include/config.h ; \
717
		  $(XECHO) "... on a STK52XX.100 base board" ; \
wdenk's avatar
wdenk committed
718
		}
719
	@[ -z "$(findstring TQM5200_B,$@)" ] || \
720
		{ echo "#define CONFIG_TQM5200_B"	>>$(obj)include/config.h ; \
721
722
		}
	@[ -z "$(findstring TQM5200S,$@)" ] || \
723
724
		{ echo "#define CONFIG_TQM5200S"	>>$(obj)include/config.h ; \
		  echo "#define CONFIG_TQM5200_B"	>>$(obj)include/config.h ; \
725
		}
726
	@[ -z "$(findstring HIGHBOOT,$@)" ] || \
727
		{ echo "TEXT_BASE = 0xFFF00000" >$(obj)board/tqm5200/config.tmp ; \
728
		}
729
	@$(MKCONFIG) -n $@ -a TQM5200 ppc mpc5xxx tqm5200
730
uc101_config:		unconfig
731
	@$(MKCONFIG) uc101 ppc mpc5xxx uc101
732
motionpro_config:	unconfig
733
734
	@$(MKCONFIG) motionpro ppc mpc5xxx motionpro

wdenk's avatar
wdenk committed
735

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


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

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

Wolfgang Denk's avatar
Wolfgang Denk committed
763
AdderUSB_config:	unconfig
764
	@$(MKCONFIG) -a AdderUSB ppc mpc8xx adder
Wolfgang Denk's avatar
Wolfgang Denk committed
765

766
767
ADS860_config	  \
FADS823_config	  \
768
769
FADS850SAR_config \
MPC86xADS_config  \
wdenk's avatar
wdenk committed
770
MPC885ADS_config  \
771
FADS860T_config:	unconfig
772
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx fads
wdenk's avatar
wdenk committed
773
774

AMX860_config	:	unconfig
775
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx amx860 westel
wdenk's avatar
wdenk committed
776
777

c2mon_config:		unconfig
778
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx c2mon
wdenk's avatar
wdenk committed
779
780

CCM_config:		unconfig
781
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx CCM siemens
wdenk's avatar
wdenk committed
782
783

cogent_mpc8xx_config:	unconfig
784
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx cogent
wdenk's avatar
wdenk committed
785

wdenk's avatar
wdenk committed
786
ELPT860_config:		unconfig
787
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx elpt860 LEOX
wdenk's avatar
wdenk committed
788

789
EP88x_config:		unconfig
790
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx ep88x
791

wdenk's avatar
wdenk committed
792
ESTEEM192E_config:	unconfig
793
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx esteem192e
wdenk's avatar
wdenk committed
794
795

ETX094_config	:	unconfig
796
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx etx094
wdenk's avatar
wdenk committed
797
798

FLAGADM_config:	unconfig
799
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx flagadm
wdenk's avatar
wdenk committed
800

wdenk's avatar
wdenk committed
801
802
803
xtract_GEN860T = $(subst _SC,,$(subst _config,,$1))

GEN860T_SC_config	\
wdenk's avatar
wdenk committed
804
GEN860T_config: unconfig
805
	@mkdir -p $(obj)include
wdenk's avatar
wdenk committed
806
	@[ -z "$(findstring _SC,$@)" ] || \
807
		{ echo "#define CONFIG_SC" >>$(obj)include/config.h ; \
808
		  $(XECHO) "With reduced H/W feature set (SC)..." ; \
wdenk's avatar
wdenk committed
809
		}
810
	@$(MKCONFIG) -a $(call xtract_GEN860T,$@) ppc mpc8xx gen860t
wdenk's avatar
wdenk committed
811
812

GENIETV_config:	unconfig
813
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx genietv
wdenk's avatar
wdenk committed
814
815

GTH_config:	unconfig
816
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx gth
wdenk's avatar
wdenk committed
817
818

hermes_config	:	unconfig
819
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx hermes
wdenk's avatar
wdenk committed
820

821
HMI10_config	:	unconfig
822
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx tqm8xx
823

wdenk's avatar
wdenk committed
824
IAD210_config: unconfig
825
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx IAD210 siemens
wdenk's avatar
wdenk committed
826
827
828
829
830

xtract_ICU862 = $(subst _100MHz,,$(subst _config,,$1))

ICU862_100MHz_config	\
ICU862_config: unconfig
831
	@mkdir -p $(obj)include
wdenk's avatar
wdenk committed
832
	@[ -z "$(findstring _100MHz,$@)" ] || \
833
		{ echo "#define CONFIG_100MHz"	>>$(obj)include/config.h ; \
834
		  $(XECHO) "... with 100MHz system clock" ; \
wdenk's avatar
wdenk committed
835
		}
836
	@$(MKCONFIG) -a $(call xtract_ICU862,$@) ppc mpc8xx icu862
wdenk's avatar
wdenk committed
837
838

IP860_config	:	unconfig
839
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx ip860
wdenk's avatar
wdenk committed
840
841
842
843

IVML24_256_config \
IVML24_128_config \
IVML24_config:	unconfig
844
	@mkdir -p $(obj)include
wdenk's avatar
wdenk committed
845
	@[ -z "$(findstring IVML24_config,$@)" ] || \
846
		 { echo "#define CONFIG_IVML24_16M"	>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
847
848
		 }
	@[ -z "$(findstring IVML24_128_config,$@)" ] || \
849
		 { echo "#define CONFIG_IVML24_32M"	>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
850
851
		 }
	@[ -z "$(findstring IVML24_256_config,$@)" ] || \
852
		 { echo "#define CONFIG_IVML24_64M"	>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed