Makefile 69.5 KB
Newer Older
wdenk's avatar
wdenk committed
1
#
2
# (C) Copyright 2000-2006
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 25
VERSION = 1
PATCHLEVEL = 1
Wolfgang Denk's avatar
Wolfgang Denk committed
26
SUBLEVEL = 6
27 28
EXTRAVERSION =
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 37 38
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/ \
	    -e s/macppc/ppc/)

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

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

# Deal with colliding definitions from tcsh etc.
VENDOR=

47 48 49 50
#########################################################################
#
# U-boot build supports producing a object files to the separate external
# directory. Two use cases are supported:
51
#
52 53 54 55 56 57 58 59 60 61
# 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'
62
#
63
# Command line 'O=' setting overrides BUILD_DIR environent variable.
64
#
65 66
# When none of the above methods is used the local build is performed and
# the object files are placed in the source directory.
67
#
68 69 70 71 72 73 74 75 76

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

ifneq ($(BUILD_DIR),)
saved-output := $(BUILD_DIR)
77 78 79 80

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

Stefan Roese's avatar
Stefan Roese committed
81
# Verify if it was successful.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
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

ifneq ($(OBJTREE),$(SRCTREE))
REMOTE_BUILD 	:= 1
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 :=
109
endif
110 111
export obj src

wdenk's avatar
wdenk committed
112 113
#########################################################################

114
ifeq ($(OBJTREE)/include/config.mk,$(wildcard $(OBJTREE)/include/config.mk))
wdenk's avatar
wdenk committed
115 116

# load ARCH, BOARD, and CPU configuration
117
include $(OBJTREE)/include/config.mk
wdenk's avatar
wdenk committed
118
export	ARCH CPU BOARD VENDOR SOC
119

wdenk's avatar
wdenk committed
120 121 122 123 124
ifndef CROSS_COMPILE
ifeq ($(HOSTARCH),ppc)
CROSS_COMPILE =
else
ifeq ($(ARCH),ppc)
Eran Liberty's avatar
Eran Liberty committed
125
CROSS_COMPILE = powerpc-linux-
wdenk's avatar
wdenk committed
126 127
endif
ifeq ($(ARCH),arm)
wdenk's avatar
wdenk committed
128
CROSS_COMPILE = arm-linux-
wdenk's avatar
wdenk committed
129
endif
130
ifeq ($(ARCH),i386)
wdenk's avatar
wdenk committed
131 132 133 134 135
ifeq ($(HOSTARCH),i386)
CROSS_COMPILE =
else
CROSS_COMPILE = i386-linux-
endif
136
endif
137 138 139
ifeq ($(ARCH),mips)
CROSS_COMPILE = mips_4KC-
endif
wdenk's avatar
wdenk committed
140 141 142
ifeq ($(ARCH),nios)
CROSS_COMPILE = nios-elf-
endif
wdenk's avatar
wdenk committed
143 144 145
ifeq ($(ARCH),nios2)
CROSS_COMPILE = nios2-elf-
endif
wdenk's avatar
wdenk committed
146 147 148
ifeq ($(ARCH),m68k)
CROSS_COMPILE = m68k-elf-
endif
wdenk's avatar
wdenk committed
149 150 151
ifeq ($(ARCH),microblaze)
CROSS_COMPILE = mb-
endif
Wolfgang Denk's avatar
Wolfgang Denk committed
152 153 154
ifeq ($(ARCH),blackfin)
CROSS_COMPILE = bfin-elf-
endif
Wolfgang Denk's avatar
Wolfgang Denk committed
155 156 157
ifeq ($(ARCH),avr32)
CROSS_COMPILE = avr32-
endif
wdenk's avatar
wdenk committed
158 159 160 161 162
endif
endif

export	CROSS_COMPILE

163 164 165
# load other configuration
include $(TOPDIR)/config.mk

wdenk's avatar
wdenk committed
166 167 168
#########################################################################
# U-Boot objects....order is important (i.e. start must be first)

wdenk's avatar
wdenk committed
169
OBJS  = cpu/$(CPU)/start.o
170
ifeq ($(CPU),i386)
wdenk's avatar
wdenk committed
171 172
OBJS += cpu/$(CPU)/start16.o
OBJS += cpu/$(CPU)/reset.o
173
endif
wdenk's avatar
wdenk committed
174
ifeq ($(CPU),ppc4xx)
wdenk's avatar
wdenk committed
175
OBJS += cpu/$(CPU)/resetvec.o
wdenk's avatar
wdenk committed
176
endif
Eran Liberty's avatar
Eran Liberty committed
177 178 179
ifeq ($(CPU),mpc83xx)
OBJS += cpu/$(CPU)/resetvec.o
endif
180 181 182
ifeq ($(CPU),mpc85xx)
OBJS += cpu/$(CPU)/resetvec.o
endif
183 184 185
ifeq ($(CPU),mpc86xx)
OBJS += cpu/$(CPU)/resetvec.o
endif
Wolfgang Denk's avatar
Wolfgang Denk committed
186 187 188 189
ifeq ($(CPU),bf533)
OBJS += cpu/$(CPU)/start1.o	cpu/$(CPU)/interrupt.o	cpu/$(CPU)/cache.o
OBJS += cpu/$(CPU)/cplbhdlr.o	cpu/$(CPU)/cplbmgr.o	cpu/$(CPU)/flush.o
endif
wdenk's avatar
wdenk committed
190

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

wdenk's avatar
wdenk committed
193 194
LIBS  = lib_generic/libgeneric.a
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
wdenk's avatar
wdenk committed
199
LIBS += lib_$(ARCH)/lib$(ARCH).a
wdenk's avatar
wdenk committed
200
LIBS += fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a \
stroese's avatar
stroese committed
201
	fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a
wdenk's avatar
wdenk committed
202 203 204 205 206
LIBS += net/libnet.a
LIBS += disk/libdisk.a
LIBS += rtc/librtc.a
LIBS += dtt/libdtt.a
LIBS += drivers/libdrivers.a
207 208
LIBS += drivers/nand/libnand.a
LIBS += drivers/nand_legacy/libnand_legacy.a
wdenk's avatar
wdenk committed
209
LIBS += drivers/sk98lin/libsk98lin.a
wdenk's avatar
wdenk committed
210 211
LIBS += post/libpost.a post/cpu/libcpu.a
LIBS += common/libcommon.a
212
LIBS += $(BOARDLIBS)
213 214

LIBS := $(addprefix $(obj),$(LIBS))
wdenk's avatar
wdenk committed
215
.PHONY : $(LIBS)
wdenk's avatar
wdenk committed
216

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

wdenk's avatar
wdenk committed
220 221 222 223 224 225
# The "tools" are needed early, so put this first
# Don't include stuff already done in $(LIBS)
SUBDIRS	= tools \
	  examples \
	  post \
	  post/cpu
wdenk's avatar
wdenk committed
226
.PHONY : $(SUBDIRS)
wdenk's avatar
wdenk committed
227

228 229 230 231 232
ifeq ($(CONFIG_NAND_U_BOOT),y)
NAND_SPL = nand_spl
U_BOOT_NAND = $(obj)u-boot-nand.bin
endif

233 234 235
__OBJS := $(subst $(obj),,$(OBJS))
__LIBS := $(subst $(obj),,$(LIBS))

236
#########################################################################
wdenk's avatar
wdenk committed
237 238
#########################################################################

239
ALL = $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map $(U_BOOT_NAND)
wdenk's avatar
wdenk committed
240

241
all:		$(ALL)
wdenk's avatar
wdenk committed
242

243
$(obj)u-boot.hex:	$(obj)u-boot
wdenk's avatar
wdenk committed
244 245
		$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@

246
$(obj)u-boot.srec:	$(obj)u-boot
wdenk's avatar
wdenk committed
247 248
		$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@

249
$(obj)u-boot.bin:	$(obj)u-boot
wdenk's avatar
wdenk committed
250 251
		$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@

252
$(obj)u-boot.img:	$(obj)u-boot.bin
253 254
		./tools/mkimage -A $(ARCH) -T firmware -C none \
		-a $(TEXT_BASE) -e 0 \
255
		-n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
256 257 258
			sed -e 's/"[	 ]*$$/ for $(BOARD) board"/') \
		-d $< $@

259
$(obj)u-boot.dis:	$(obj)u-boot
wdenk's avatar
wdenk committed
260 261
		$(OBJDUMP) -d $< > $@

262
$(obj)u-boot:		depend version $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT)
wdenk's avatar
wdenk committed
263
		UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
264 265
		cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \
			--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
266
			-Map u-boot.map -o u-boot
wdenk's avatar
wdenk committed
267

268 269 270
$(OBJS):
		$(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@))

wdenk's avatar
wdenk committed
271
$(LIBS):
272
		$(MAKE) -C $(dir $(subst $(obj),,$@))
wdenk's avatar
wdenk committed
273 274

$(SUBDIRS):
wdenk's avatar
wdenk committed
275
		$(MAKE) -C $@ all
wdenk's avatar
wdenk committed
276

277
$(NAND_SPL):	version
278
		$(MAKE) -C nand_spl/board/$(BOARDDIR) all
279 280

$(U_BOOT_NAND):	$(NAND_SPL) $(obj)u-boot.bin
281
		cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
282

283 284 285 286 287 288 289
version:
		@echo -n "#define U_BOOT_VERSION \"U-Boot " > $(VERSION_FILE); \
		echo -n "$(U_BOOT_VERSION)" >> $(VERSION_FILE); \
		echo -n $(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion \
			 $(TOPDIR)) >> $(VERSION_FILE); \
		echo "\"" >> $(VERSION_FILE)

290
gdbtools:
291 292 293 294 295 296 297
		$(MAKE) -C tools/gdb all || exit 1

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

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

wdenk's avatar
wdenk committed
299
depend dep:
300
		for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir _depend ; done
wdenk's avatar
wdenk committed
301

302 303
tags ctags:
		ctags -w -o $(OBJTREE)/ctags `find $(SUBDIRS) include \
304 305 306
				lib_generic board/$(BOARDDIR) cpu/$(CPU) lib_$(ARCH) \
				fs/cramfs fs/fat fs/fdos fs/jffs2 \
				net disk rtc dtt drivers drivers/sk98lin common \
wdenk's avatar
wdenk committed
307 308 309
			\( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`

etags:
310
		etags -a -o $(OBJTREE)/etags `find $(SUBDIRS) include \
wdenk's avatar
wdenk committed
311 312 313
				lib_generic board/$(BOARDDIR) cpu/$(CPU) lib_$(ARCH) \
				fs/cramfs fs/fat fs/fdos fs/jffs2 \
				net disk rtc dtt drivers drivers/sk98lin common \
wdenk's avatar
wdenk committed
314 315
			\( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`

316
$(obj)System.map:	$(obj)u-boot
wdenk's avatar
wdenk committed
317 318
		@$(NM) $< | \
		grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
319
		sort > $(obj)System.map
wdenk's avatar
wdenk committed
320 321 322

#########################################################################
else
323 324 325 326
all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
$(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \
$(SUBDIRS) version gdbtools updater env depend \
dep tags ctags etags $(obj)System.map:
wdenk's avatar
wdenk committed
327 328 329 330
	@echo "System not configured - see README" >&2
	@ exit 1
endif

331 332
.PHONY : CHANGELOG
CHANGELOG:
333 334
	git log --no-merges U-Boot-1_1_5.. | \
	unexpand -a | sed -e 's/\s\s*$$//' > $@
335

wdenk's avatar
wdenk committed
336 337 338
#########################################################################

unconfig:
339 340
	@rm -f $(obj)include/config.h $(obj)include/config.mk \
		$(obj)board/*/config.tmp $(obj)board/*/*/config.tmp
wdenk's avatar
wdenk committed
341 342 343 344

#========================================================================
# PowerPC
#========================================================================
345 346 347 348 349

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

wdenk's avatar
wdenk committed
350
canmb_config:	unconfig
351
	@$(MKCONFIG) -a canmb ppc mpc5xxx canmb
wdenk's avatar
wdenk committed
352

353
cmi_mpc5xx_config:	unconfig
354
	@$(MKCONFIG) $(@:_config=) ppc mpc5xx cmi
355

356
PATI_config:		unconfig
357
	@$(MKCONFIG) $(@:_config=) ppc mpc5xx pati mpl
wdenk's avatar
wdenk committed
358

359 360 361
#########################################################################
## MPC5xxx Systems
#########################################################################
wdenk's avatar
wdenk committed
362

363
aev_config: unconfig
364
	@$(MKCONFIG) -a aev ppc mpc5xxx tqm5200
365

dzu@denx.de's avatar
dzu@denx.de committed
366
BC3450_config:	unconfig
367
	@$(MKCONFIG) -a BC3450 ppc mpc5xxx bc3450
dzu@denx.de's avatar
dzu@denx.de committed
368

369
cpci5200_config:  unconfig
370
	@$(MKCONFIG) -a cpci5200  ppc mpc5xxx cpci5200 esd
371

wdenk's avatar
wdenk committed
372
hmi1001_config:         unconfig
373
	@$(MKCONFIG) hmi1001 ppc mpc5xxx hmi1001
wdenk's avatar
wdenk committed
374

375 376 377 378 379 380 381 382 383 384
Lite5200_config				\
Lite5200_LOWBOOT_config			\
Lite5200_LOWBOOT08_config		\
icecube_5200_config			\
icecube_5200_LOWBOOT_config		\
icecube_5200_LOWBOOT08_config		\
icecube_5200_DDR_config 		\
icecube_5200_DDR_LOWBOOT_config 	\
icecube_5200_DDR_LOWBOOT08_config	\
icecube_5100_config:			unconfig
385 386 387
	@mkdir -p $(obj)include
	@mkdir -p $(obj)board/icecube
	@ >$(obj)include/config.h
wdenk's avatar
wdenk committed
388 389
	@[ -z "$(findstring LOWBOOT_,$@)" ] || \
		{ if [ "$(findstring DDR,$@)" ] ; \
390 391
			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
392
		  fi ; \
wdenk's avatar
wdenk committed
393 394 395
		  echo "... with LOWBOOT configuration" ; \
		}
	@[ -z "$(findstring LOWBOOT08,$@)" ] || \
396
		{ echo "TEXT_BASE = 0xFF800000" >$(obj)board/icecube/config.tmp ; \
wdenk's avatar
wdenk committed
397
		  echo "... with 8 MB flash only" ; \
wdenk's avatar
wdenk committed
398
		  echo "... with LOWBOOT configuration" ; \
wdenk's avatar
wdenk committed
399
		}
400
	@[ -z "$(findstring DDR,$@)" ] || \
401
		{ echo "#define CONFIG_MPC5200_DDR"	>>$(obj)include/config.h ; \
402 403
		  echo "... DDR memory revision" ; \
		}
wdenk's avatar
wdenk committed
404
	@[ -z "$(findstring 5200,$@)" ] || \
405
		{ echo "#define CONFIG_MPC5200"		>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
406 407
		  echo "... with MPC5200 processor" ; \
		}
wdenk's avatar
wdenk committed
408
	@[ -z "$(findstring 5100,$@)" ] || \
409
		{ echo "#define CONFIG_MGT5100"		>>$(obj)include/config.h ; \
410 411
		  echo "... with MGT5100 processor" ; \
		}
412
	@$(MKCONFIG) -a IceCube ppc mpc5xxx icecube
413

414 415 416
v38b_config: unconfig
	@./mkconfig -a V38B ppc mpc5xxx v38b

417
inka4x0_config:	unconfig
418
	@$(MKCONFIG) inka4x0 ppc mpc5xxx inka4x0
wdenk's avatar
wdenk committed
419

420 421
lite5200b_config	\
lite5200b_LOWBOOT_config:	unconfig
422 423 424 425
	@mkdir -p $(obj)include
	@mkdir -p $(obj)board/icecube
	@ >$(obj)include/config.h
	@ echo "#define CONFIG_MPC5200_DDR"	>>$(obj)include/config.h
426
	@ echo "... DDR memory revision"
427 428
	@ echo "#define CONFIG_MPC5200"		>>$(obj)include/config.h
	@ echo "#define CONFIG_LITE5200B"	>>$(obj)include/config.h
429
	@[ -z "$(findstring LOWBOOT_,$@)" ] || \
430
		{ echo "TEXT_BASE = 0xFF000000" >$(obj)board/icecube/config.tmp ; \
431 432 433
		  echo "... with LOWBOOT configuration" ; \
		}
	@ echo "... with MPC5200B processor"
434
	@$(MKCONFIG) -a IceCube  ppc mpc5xxx icecube
435

436
mcc200_config	\
437 438 439 440
mcc200_SDRAM_config	\
mcc200_highboot_config	\
mcc200_COM12_config	\
mcc200_COM12_SDRAM_config	\
441 442
mcc200_COM12_highboot_config	\
mcc200_COM12_highboot_SDRAM_config	\
443 444 445 446 447
mcc200_highboot_SDRAM_config	\
prs200_config	\
prs200_DDR_config	\
prs200_highboot_config	\
prs200_highboot_DDR_config:	unconfig
448 449 450
	@mkdir -p $(obj)include
	@mkdir -p $(obj)board/mcc200
	@ >$(obj)include/config.h
451 452
	@[ -n "$(findstring highboot,$@)" ] || \
		{ echo "... with lowboot configuration" ; \
453
		}
454
	@[ -z "$(findstring highboot,$@)" ] || \
455
		{ echo "TEXT_BASE = 0xFFF00000" >$(obj)board/mcc200/config.tmp ; \
456 457 458
		  echo "... with highboot configuration" ; \
		}
	@[ -n "$(findstring _SDRAM,$@)" ] || \
459 460 461 462 463 464 465 466
		{ if [ -n "$(findstring mcc200,$@)" ]; \
		  then \
		  	echo "... with DDR" ; \
		  else \
			if [ -n "$(findstring _DDR,$@)" ];\
			then \
				echo "... with DDR" ; \
			else \
467
				echo "#define CONFIG_MCC200_SDRAM" >>$(obj)include/config.h ;\
468 469 470
				echo "... with SDRAM" ; \
			fi; \
		  fi; \
471 472
		}
	@[ -z "$(findstring _SDRAM,$@)" ] || \
473
		{ echo "#define CONFIG_MCC200_SDRAM"	>>$(obj)include/config.h ; \
474 475
		  echo "... with SDRAM" ; \
		}
476
	@[ -z "$(findstring COM12,$@)" ] || \
477
		{ echo "#define CONFIG_CONSOLE_COM12"	>>$(obj)include/config.h ; \
478 479
		  echo "... with console on COM12" ; \
		}
480
	@[ -z "$(findstring prs200,$@)" ] || \
481
		{ echo "#define CONFIG_PRS200"  >>$(obj)include/config.h ;\
482
		}
483
	@$(MKCONFIG) -n $@ -a mcc200 ppc mpc5xxx mcc200
484

485
o2dnt_config:
486
	@$(MKCONFIG) o2dnt ppc mpc5xxx o2dnt
487

488
pf5200_config:  unconfig
489
	@$(MKCONFIG) pf5200  ppc mpc5xxx pf5200 esd
490

wdenk's avatar
wdenk committed
491 492 493 494
PM520_config \
PM520_DDR_config \
PM520_ROMBOOT_config \
PM520_ROMBOOT_DDR_config:	unconfig
495 496
	@mkdir -p $(obj)include
	@ >$(obj)include/config.h
wdenk's avatar
wdenk committed
497
	@[ -z "$(findstring DDR,$@)" ] || \
498
		{ echo "#define CONFIG_MPC5200_DDR"	>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
499 500 501
		  echo "... DDR memory revision" ; \
		}
	@[ -z "$(findstring ROMBOOT,$@)" ] || \
502
		{ echo "#define CONFIG_BOOT_ROM" >>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
503 504
		  echo "... booting from 8-bit flash" ; \
		}
505
	@$(MKCONFIG) -a PM520 ppc mpc5xxx pm520
wdenk's avatar
wdenk committed
506

507
smmaco4_config: unconfig
508
	@$(MKCONFIG) -a smmaco4 ppc mpc5xxx tqm5200
509 510

spieval_config:	unconfig
511
	@$(MKCONFIG) -a spieval ppc mpc5xxx tqm5200
512

513
TB5200_B_config \
Wolfgang Denk's avatar
Wolfgang Denk committed
514
TB5200_config:	unconfig
515
	@mkdir -p $(obj)include
516
	@[ -z "$(findstring _B,$@)" ] || \
517
		{ echo "#define CONFIG_TQM5200_B"	>>$(obj)include/config.h ; \
518 519
		  echo "... with MPC5200B processor" ; \
		}
520
	@$(MKCONFIG) -n $@ -a TB5200 ppc mpc5xxx tqm5200
Wolfgang Denk's avatar
Wolfgang Denk committed
521

wdenk's avatar
wdenk committed
522 523 524
MINI5200_config	\
EVAL5200_config	\
TOP5200_config:	unconfig
525 526 527
	@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
528

wdenk's avatar
wdenk committed
529 530 531 532 533
Total5100_config		\
Total5200_config		\
Total5200_lowboot_config	\
Total5200_Rev2_config		\
Total5200_Rev2_lowboot_config:	unconfig
534 535 536
	@mkdir -p $(obj)include
	@mkdir -p $(obj)board/total5200
	@ >$(obj)include/config.h
wdenk's avatar
wdenk committed
537
	@[ -z "$(findstring 5100,$@)" ] || \
538
		{ echo "#define CONFIG_MGT5100"		>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
539 540 541
		  echo "... with MGT5100 processor" ; \
		}
	@[ -z "$(findstring 5200,$@)" ] || \
542
		{ echo "#define CONFIG_MPC5200"		>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
543 544 545
		  echo "... with MPC5200 processor" ; \
		}
	@[ -n "$(findstring Rev,$@)" ] || \
546
		{ echo "#define CONFIG_TOTAL5200_REV 1"	>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
547 548 549
		  echo "... revision 1 board" ; \
		}
	@[ -z "$(findstring Rev2_,$@)" ] || \
550
		{ echo "#define CONFIG_TOTAL5200_REV 2"	>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
551 552 553
		  echo "... revision 2 board" ; \
		}
	@[ -z "$(findstring lowboot_,$@)" ] || \
554
		{ echo "TEXT_BASE = 0xFE000000" >$(obj)board/total5200/config.tmp ; \
wdenk's avatar
wdenk committed
555 556
		  echo "... with lowboot configuration" ; \
		}
557
	@$(MKCONFIG) -a Total5200 ppc mpc5xxx total5200
wdenk's avatar
wdenk committed
558

559
cam5200_config \
Wolfgang Denk's avatar
Wolfgang Denk committed
560
fo300_config \
561
MiniFAP_config \
Wolfgang Denk's avatar
Wolfgang Denk committed
562 563 564 565 566 567
TQM5200S_config \
TQM5200S_HIGHBOOT_config \
TQM5200_B_config \
TQM5200_B_HIGHBOOT_config \
TQM5200_config	\
TQM5200_STK100_config:	unconfig
568 569 570
	@mkdir -p $(obj)include
	@mkdir -p $(obj)board/tqm5200
	@ >$(obj)include/config.h
Wolfgang Denk's avatar
Wolfgang Denk committed
571
	@[ -z "$(findstring cam5200,$@)" ] || \
572 573 574
		{ 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 ; \
Wolfgang Denk's avatar
Wolfgang Denk committed
575 576
		  echo "... TQM5200S on Cam5200" ; \
		}
577
	@[ -z "$(findstring fo300,$@)" ] || \
578
		{ echo "#define CONFIG_FO300"	>>$(obj)include/config.h ; \
579 580
		  echo "... TQM5200 on FO300" ; \
		}
wdenk's avatar
wdenk committed
581
	@[ -z "$(findstring MiniFAP,$@)" ] || \
582
		{ echo "#define CONFIG_MINIFAP"	>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
583
		  echo "... TQM5200_AC on MiniFAP" ; \
wdenk's avatar
wdenk committed
584
		}
Wolfgang Denk's avatar
Wolfgang Denk committed
585
	@[ -z "$(findstring STK100,$@)" ] || \
586
		{ echo "#define CONFIG_STK52XX_REV100"	>>$(obj)include/config.h ; \
Wolfgang Denk's avatar
Wolfgang Denk committed
587
		  echo "... on a STK52XX.100 base board" ; \
wdenk's avatar
wdenk committed
588
		}
589
	@[ -z "$(findstring TQM5200_B,$@)" ] || \
590
		{ echo "#define CONFIG_TQM5200_B"	>>$(obj)include/config.h ; \
591 592
		}
	@[ -z "$(findstring TQM5200S,$@)" ] || \
593 594
		{ echo "#define CONFIG_TQM5200S"	>>$(obj)include/config.h ; \
		  echo "#define CONFIG_TQM5200_B"	>>$(obj)include/config.h ; \
595
		}
596
	@[ -z "$(findstring HIGHBOOT,$@)" ] || \
597
		{ echo "TEXT_BASE = 0xFFF00000" >$(obj)board/tqm5200/config.tmp ; \
598
		}
599
	@$(MKCONFIG) -n $@ -a TQM5200 ppc mpc5xxx tqm5200
wdenk's avatar
wdenk committed
600

wdenk's avatar
wdenk committed
601 602 603 604
#########################################################################
## MPC8xx Systems
#########################################################################

wdenk's avatar
wdenk committed
605 606
Adder_config    \
Adder87x_config \
wdenk's avatar
wdenk committed
607
AdderII_config  \
wdenk's avatar
wdenk committed
608
	:		unconfig
609
	@mkdir -p $(obj)include
wdenk's avatar
wdenk committed
610
	$(if $(findstring AdderII,$@), \
611 612
	@echo "#define CONFIG_MPC852T" > $(obj)include/config.h)
	@$(MKCONFIG) -a Adder ppc mpc8xx adder
wdenk's avatar
wdenk committed
613

614 615 616 617
ADS860_config     \
FADS823_config    \
FADS850SAR_config \
MPC86xADS_config  \
wdenk's avatar
wdenk committed
618
MPC885ADS_config  \
619
FADS860T_config:	unconfig
620
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx fads
wdenk's avatar
wdenk committed
621 622

AMX860_config	:	unconfig
623
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx amx860 westel
wdenk's avatar
wdenk committed
624 625

c2mon_config:		unconfig
626
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx c2mon
wdenk's avatar
wdenk committed
627 628

CCM_config:		unconfig
629
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx CCM siemens
wdenk's avatar
wdenk committed
630 631

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

wdenk's avatar
wdenk committed
634
ELPT860_config:		unconfig
635
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx elpt860 LEOX
wdenk's avatar
wdenk committed
636

637
EP88x_config:		unconfig
638
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx ep88x
639

wdenk's avatar
wdenk committed
640
ESTEEM192E_config:	unconfig
641
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx esteem192e
wdenk's avatar
wdenk committed
642 643

ETX094_config	:	unconfig
644
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx etx094
wdenk's avatar
wdenk committed
645 646

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

wdenk's avatar
wdenk committed
649 650 651
xtract_GEN860T = $(subst _SC,,$(subst _config,,$1))

GEN860T_SC_config	\
wdenk's avatar
wdenk committed
652
GEN860T_config: unconfig
653 654
	@mkdir -p $(obj)include
	@ >$(obj)include/config.h
wdenk's avatar
wdenk committed
655
	@[ -z "$(findstring _SC,$@)" ] || \
656
		{ echo "#define CONFIG_SC" >>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
657 658
		  echo "With reduced H/W feature set (SC)..." ; \
		}
659
	@$(MKCONFIG) -a $(call xtract_GEN860T,$@) ppc mpc8xx gen860t
wdenk's avatar
wdenk committed
660 661

GENIETV_config:	unconfig
662
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx genietv
wdenk's avatar
wdenk committed
663 664

GTH_config:	unconfig
665
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx gth
wdenk's avatar
wdenk committed
666 667

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

670
HMI10_config	:	unconfig
671
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx tqm8xx
672

wdenk's avatar
wdenk committed
673
IAD210_config: unconfig
674
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx IAD210 siemens
wdenk's avatar
wdenk committed
675 676 677 678 679

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

ICU862_100MHz_config	\
ICU862_config: unconfig
680 681
	@mkdir -p $(obj)include
	@ >$(obj)include/config.h
wdenk's avatar
wdenk committed
682
	@[ -z "$(findstring _100MHz,$@)" ] || \
683
		{ echo "#define CONFIG_100MHz"	>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
684 685
		  echo "... with 100MHz system clock" ; \
		}
686
	@$(MKCONFIG) -a $(call xtract_ICU862,$@) ppc mpc8xx icu862
wdenk's avatar
wdenk committed
687 688

IP860_config	:	unconfig
689
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx ip860
wdenk's avatar
wdenk committed
690 691 692 693

IVML24_256_config \
IVML24_128_config \
IVML24_config:	unconfig
694 695
	@mkdir -p $(obj)include
	@ >$(obj)include/config.h
wdenk's avatar
wdenk committed
696
	@[ -z "$(findstring IVML24_config,$@)" ] || \
697
		 { echo "#define CONFIG_IVML24_16M"	>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
698 699
		 }
	@[ -z "$(findstring IVML24_128_config,$@)" ] || \
700
		 { echo "#define CONFIG_IVML24_32M"	>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
701 702
		 }
	@[ -z "$(findstring IVML24_256_config,$@)" ] || \
703
		 { echo "#define CONFIG_IVML24_64M"	>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
704
		 }
705
	@$(MKCONFIG) -a IVML24 ppc mpc8xx ivm
wdenk's avatar
wdenk committed
706 707 708 709

IVMS8_256_config \
IVMS8_128_config \
IVMS8_config:	unconfig
710 711
	@mkdir -p $(obj)include
	@ >$(obj)include/config.h
wdenk's avatar
wdenk committed
712
	@[ -z "$(findstring IVMS8_config,$@)" ] || \
713
		 { echo "#define CONFIG_IVMS8_16M"	>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
714 715
		 }
	@[ -z "$(findstring IVMS8_128_config,$@)" ] || \
716
		 { echo "#define CONFIG_IVMS8_32M"	>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
717 718
		 }
	@[ -z "$(findstring IVMS8_256_config,$@)" ] || \
719
		 { echo "#define CONFIG_IVMS8_64M"	>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
720
		 }
721
	@$(MKCONFIG) -a IVMS8 ppc mpc8xx ivm
wdenk's avatar
wdenk committed
722

723
KUP4K_config	:	unconfig
724
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx kup4k kup
wdenk's avatar
wdenk committed
725 726

KUP4X_config    :       unconfig
727
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx kup4x kup
728

wdenk's avatar
wdenk committed
729
LANTEC_config	:	unconfig
730
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx lantec
wdenk's avatar
wdenk committed
731 732

lwmon_config:		unconfig
733
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx lwmon
wdenk's avatar
wdenk committed
734 735 736

MBX_config	\
MBX860T_config:	unconfig
737
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx mbx8xx
wdenk's avatar
wdenk committed
738 739

MHPC_config:		unconfig
740
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx mhpc eltec
wdenk's avatar
wdenk committed
741 742

MVS1_config :		unconfig
743
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx mvs1
wdenk's avatar
wdenk committed
744

745 746 747
xtract_NETVIA = $(subst _V2,,$(subst _config,,$1))

NETVIA_V2_config \
wdenk's avatar
wdenk committed
748
NETVIA_config:		unconfig
749 750
	@mkdir -p $(obj)include
	@ >$(obj)include/config.h
751
	@[ -z "$(findstring NETVIA_config,$@)" ] || \
752
		 { echo "#define CONFIG_NETVIA_VERSION 1" >>$(obj)include/config.h ; \
753 754 755
		  echo "... Version 1" ; \
		 }
	@[ -z "$(findstring NETVIA_V2_config,$@)" ] || \
756
		 { echo "#define CONFIG_NETVIA_VERSION 2" >>$(obj)include/config.h ; \
757 758
		  echo "... Version 2" ; \
		 }
759
	@$(MKCONFIG) -a $(call xtract_NETVIA,$@) ppc mpc8xx netvia
wdenk's avatar
wdenk committed
760

761 762 763
xtract_NETPHONE = $(subst _V2,,$(subst _config,,$1))

NETPHONE_V2_config \
764
NETPHONE_config:	unconfig
765 766
	@mkdir -p $(obj)include
	@ >$(obj)include/config.h
767
	@[ -z "$(findstring NETPHONE_config,$@)" ] || \
768
		 { echo "#define CONFIG_NETPHONE_VERSION 1" >>$(obj)include/config.h ; \
769 770
		 }
	@[ -z "$(findstring NETPHONE_V2_config,$@)" ] || \
771
		 { echo "#define CONFIG_NETPHONE_VERSION 2" >>$(obj)include/config.h ; \
772
		 }
773
	@$(MKCONFIG) -a $(call xtract_NETPHONE,$@) ppc mpc8xx netphone
774

775
xtract_NETTA = $(subst _SWAPHOOK,,$(subst _6412,,$(subst _ISDN,,$(subst _config,,$1))))
776

777 778 779 780 781
NETTA_ISDN_6412_SWAPHOOK_config \
NETTA_ISDN_SWAPHOOK_config \
NETTA_6412_SWAPHOOK_config \
NETTA_SWAPHOOK_config \
NETTA_ISDN_6412_config \
782
NETTA_ISDN_config \
783
NETTA_6412_config \
784
NETTA_config:		unconfig
785 786
	@mkdir -p $(obj)include
	@ >$(obj)include/config.h
787
	@[ -z "$(findstring ISDN_,$@)" ] || \
788
		 { echo "#define CONFIG_NETTA_ISDN 1" >>$(obj)include/config.h ; \
789 790
		 }
	@[ -n "$(findstring ISDN_,$@)" ] || \
791
		 { echo "#undef CONFIG_NETTA_ISDN" >>$(obj)include/config.h ; \
792
		 }
793
	@[ -z "$(findstring 6412_,$@)" ] || \
794
		 { echo "#define CONFIG_NETTA_6412 1" >>$(obj)include/config.h ; \
795 796
		 }
	@[ -n "$(findstring 6412_,$@)" ] || \
797
		 { echo "#undef CONFIG_NETTA_6412" >>$(obj)include/config.h ; \
798 799
		 }
	@[ -z "$(findstring SWAPHOOK_,$@)" ] || \
800
		 { echo "#define CONFIG_NETTA_SWAPHOOK 1" >>$(obj)include/config.h ; \
801 802
		 }
	@[ -n "$(findstring SWAPHOOK_,$@)" ] || \
803
		 { echo "#undef CONFIG_NETTA_SWAPHOOK" >>$(obj)include/config.h ; \
804
		 }
805
	@$(MKCONFIG) -a $(call xtract_NETTA,$@) ppc mpc8xx netta
806

807 808 809 810
xtract_NETTA2 = $(subst _V2,,$(subst _config,,$1))

NETTA2_V2_config \
NETTA2_config:		unconfig
Marian Balakowicz's avatar