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
26
SUBLEVEL = 5
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})

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)
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
140 141 142
ifeq ($(ARCH),nios)
CROSS_COMPILE = nios-elf-
endif
143 144 145
ifeq ($(ARCH),nios2)
CROSS_COMPILE = nios2-elf-
endif
146 147 148
ifeq ($(ARCH),m68k)
CROSS_COMPILE = m68k-elf-
endif
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
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)

169
OBJS  = cpu/$(CPU)/start.o
170
ifeq ($(CPU),i386)
171 172
OBJS += cpu/$(CPU)/start16.o
OBJS += cpu/$(CPU)/reset.o
173
endif
wdenk's avatar
wdenk committed
174
ifeq ($(CPU),ppc4xx)
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))

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
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))
215
.PHONY : $(LIBS)
216

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

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
226
.PHONY : $(SUBDIRS)
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
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 $@))

271
$(LIBS):
272
		$(MAKE) -C $(dir $(subst $(obj),,$@))
273 274

$(SUBDIRS):
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 \
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:
Wolfgang Denk's avatar
Wolfgang Denk committed
333
	git log --no-merges U-Boot-1_1_5.. | unexpand -a > $@
334

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

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

#========================================================================
# PowerPC
#========================================================================
344 345 346 347 348

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

633
ELPT860_config:		unconfig
634
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx elpt860 LEOX
635

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

722
KUP4K_config	:	unconfig
723
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx kup4k kup
724 725

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

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

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

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

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

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

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

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

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

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

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

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

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

NETTA2_V2_config \
NETTA2_config:		unconfig
810 811
	@mkdir -p $(obj)include
	@ >$(obj)include/config.h
812
	@[ -z "$(findstring NETTA2_config,$@)" ] || \
813
		 { echo "#define CONFIG_NETTA2_VERSION 1" >>$(obj)include/config.h ; \
814 815
		 }
	@[ -z "$(findstring NETTA2_V2_config,$@)" ] || \
816
		 { echo "#define CONFIG_NETTA2_VERSION 2" >>$(obj)include/config.h ; \
817
		 }
818
	@$(MKCONFIG) -a $(call xtract_NETTA2,$@) ppc mpc8xx netta2
819

820 821 822
NC650_Rev1_config \
NC650_Rev2_config \
CP850_config:	unconfig
823 824
	@mkdir -p $(obj)include
	@ >$(obj)include/config.h
825
	@[ -z "$(findstring CP850,$@)" ] || \
826 827
		 { echo "#define CONFIG_CP850 1" >>$(obj)include/config.h ; \
		   echo "#define CONFIG_IDS852_REV2 1" >>$(obj)include/config.h ; \
828 829
		 }
	@[ -z "$(findstring Rev1,$@)" ] || \
830
		 { echo "#define CONFIG_IDS852_REV1 1" >>$(obj)include/config.h ; \
831 832
		 }
	@[ -z "$(findstring Rev2,$@)" ] || \
833
		 { echo "#define CONFIG_IDS852_REV2 1" >>$(obj)include/config.h ; \
834
		 }
835
	@$(MKCONFIG) -a NC650 ppc mpc8xx nc650
wdenk's avatar
wdenk committed
836

wdenk's avatar
wdenk committed
837
NX823_config:		unconfig
838
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx nx823
wdenk's avatar
wdenk committed
839 840

pcu_e_config:		unconfig
841
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx pcu_e siemens
wdenk's avatar
wdenk committed
842

843
QS850_config:	unconfig
844
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx qs850 snmc
845 846

QS823_config:	unconfig
847
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx qs850 snmc
848 849

QS860T_config:	unconfig
850
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx qs860t snmc
851

wdenk's avatar
wdenk committed
852
quantum_config:	unconfig
853
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx quantum
wdenk's avatar
wdenk committed
854

wdenk's avatar
wdenk committed
855
R360MPI_config:	unconfig
856
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx r360mpi
wdenk's avatar
wdenk committed
857

858
RBC823_config:	unconfig
859
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx rbc823
860

wdenk's avatar
wdenk committed
861
RPXClassic_config:	unconfig
862
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx RPXClassic
wdenk's avatar
wdenk committed
863 864

RPXlite_config:		unconfig
865
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx RPXlite
wdenk's avatar
wdenk committed
866

wdenk's avatar
wdenk committed
867 868 869 870 871 872 873 874
RPXlite_DW_64_config  		\
RPXlite_DW_LCD_config 		\
RPXlite_DW_64_LCD_config 	\
RPXlite_DW_NVRAM_config		\
RPXlite_DW_NVRAM_64_config      \
RPXlite_DW_NVRAM_LCD_config	\
RPXlite_DW_NVRAM_64_LCD_config  \
RPXlite_DW_config:         unconfig
875 876
	@mkdir -p $(obj)include
	@ >$(obj)include/config.h
wdenk's avatar
wdenk committed
877
	@[ -z "$(findstring _64,$@)" ] || \
878
		{ echo "#define RPXlite_64MHz"		>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
879 880 881
		  echo "... with 64MHz system clock ..."; \
		}
	@[ -z "$(findstring _LCD,$@)" ] || \
882 883
		{ echo "#define CONFIG_LCD"          	>>$(obj)include/config.h ; \
		  echo "#define CONFIG_NEC_NL6448BC20"	>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
884 885 886
		  echo "... with LCD display ..."; \
		}
	@[ -z "$(findstring _NVRAM,$@)" ] || \
887
		{ echo "#define  CFG_ENV_IS_IN_NVRAM" 	>>$(obj)include/config.h ; \
wdenk's avatar
wdenk committed
888 889
		  echo "... with ENV in NVRAM ..."; \
		}
890
	@$(MKCONFIG) -a RPXlite_DW ppc mpc8xx RPXlite_dw
wdenk's avatar
wdenk committed
891

wdenk's avatar
wdenk committed
892
rmu_config:	unconfig
893
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx rmu
wdenk's avatar
wdenk committed
894

wdenk's avatar
wdenk committed
895
RRvision_config:	unconfig
896
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx RRvision
wdenk's avatar
wdenk committed
897 898

RRvision_LCD_config:	unconfig
899 900 901 902
	@mkdir -p $(obj)include
	@echo "#define CONFIG_LCD" >$(obj)include/config.h
	@echo "#define CONFIG_SHARP_LQ104V7DS01" >>$(obj)include/config.h
	@$(MKCONFIG) -a RRvision ppc mpc8xx RRvision
wdenk's avatar
wdenk committed
903 904

SM850_config	:	unconfig
905
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx tqm8xx
wdenk's avatar
wdenk committed
906

907
spc1920_config:
908
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx spc1920
909

wdenk's avatar
wdenk committed
910
SPD823TS_config:	unconfig
911
	@$(MKCONFIG) $(@:_config=) ppc mpc8xx spd8xx
wdenk's avatar
wdenk committed
912

913
stxxtc_config:	unconfig