2 # (C) Copyright 2000, 2001, 2002
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 # See file CREDITS for list of people who contributed to this
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 HOSTARCH := $(shell uname -m | \
32 HOSTOS := $(shell uname -s | tr A-Z a-z | \
33 sed -e 's/\(cygwin\).*/cygwin/')
37 # Deal with colliding definitions from tcsh etc.
40 #########################################################################
42 TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
45 ifeq (include/config.mk,$(wildcard include/config.mk))
46 # load ARCH, BOARD, and CPU configuration
47 include include/config.mk
48 export ARCH CPU BOARD VENDOR
49 # load other configuration
50 include $(TOPDIR)/config.mk
53 ifeq ($(HOSTARCH),ppc)
56 ## #ifeq ($(CPU),mpc8xx)
57 ## CROSS_COMPILE = ppc_8xx-
59 ## #ifeq ($(CPU),ppc4xx)
60 ## #CROSS_COMPILE = ppc_4xx-
62 ## #ifeq ($(CPU),mpc824x)
63 ## #CROSS_COMPILE = ppc_82xx-
65 ## #ifeq ($(CPU),mpc8260)
66 ## #CROSS_COMPILE = ppc_82xx-
68 ## #ifeq ($(CPU),74xx_7xx)
69 ## #CROSS_COMPILE = ppc_74xx-)
72 CROSS_COMPILE = ppc_8xx-
75 CROSS_COMPILE = arm_920TDI-
78 #CROSS_COMPILE = i386-elf-
85 # The "tools" are needed early, so put this first
102 #########################################################################
103 # U-Boot objects....order is important (i.e. start must be first)
105 OBJS = cpu/$(CPU)/start.o
107 OBJS += cpu/$(CPU)/start16.o
108 OBJS += cpu/$(CPU)/reset.o
111 OBJS += cpu/$(CPU)/resetvec.o
114 LIBS = board/$(BOARDDIR)/lib$(BOARD).a
115 LIBS += cpu/$(CPU)/lib$(CPU).a
116 LIBS += lib_$(ARCH)/lib$(ARCH).a
117 LIBS += fs/jffs2/libjffs2.a fs/fdos/libfdos.a
119 LIBS += disk/libdisk.a
122 LIBS += drivers/libdrivers.a
123 LIBS += post/libpost.a post/cpu/libcpu.a
124 LIBS += common/libcommon.a
125 LIBS += lib_generic/libgeneric.a
127 #########################################################################
129 all: u-boot.srec u-boot.bin System.map
132 cp u-boot.bin /tftpboot/u-boot.bin
133 cp u-boot.bin /net/sam/tftpboot/u-boot.bin
136 $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
139 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
142 $(OBJDUMP) -d $< > $@
144 u-boot: depend subdirs $(OBJS) $(LIBS) $(LDSCRIPT)
145 $(LD) $(LDFLAGS) $(OBJS) \
146 --start-group $(LIBS) --end-group \
147 -Map u-boot.map -o u-boot
150 @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir || exit 1 ; done
153 @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir .depend ; done
156 ctags -w `find $(SUBDIRS) include \
157 \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
160 etags -a `find $(SUBDIRS) include \
161 \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
165 grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
168 #########################################################################
170 all install u-boot u-boot.srec depend dep:
171 @echo "System not configured - see README" >&2
175 #########################################################################
178 rm -f include/config.h include/config.mk
180 #========================================================================
182 #========================================================================
183 #########################################################################
185 #########################################################################
187 ADS860_config: unconfig
188 @./mkconfig $(@:_config=) ppc mpc8xx fads
190 AMX860_config : unconfig
191 @./mkconfig $(@:_config=) ppc mpc8xx amx860 westel
193 c2mon_config: unconfig
194 @./mkconfig $(@:_config=) ppc mpc8xx c2mon
197 @./mkconfig $(@:_config=) ppc mpc8xx CCM siemens
199 cogent_mpc8xx_config: unconfig
200 @./mkconfig $(@:_config=) ppc mpc8xx cogent
202 ESTEEM192E_config: unconfig
203 @./mkconfig $(@:_config=) ppc mpc8xx esteem192e
205 ETX094_config : unconfig
206 @./mkconfig $(@:_config=) ppc mpc8xx etx094
210 FADS860T_config: unconfig
211 @./mkconfig $(@:_config=) ppc mpc8xx fads
213 FLAGADM_config: unconfig
214 @./mkconfig $(@:_config=) ppc mpc8xx flagadm
216 GEN860T_config: unconfig
217 @./mkconfig $(@:_config=) ppc mpc8xx gen860t
219 GENIETV_config: unconfig
220 @./mkconfig $(@:_config=) ppc mpc8xx genietv
223 @./mkconfig $(@:_config=) ppc mpc8xx gth
225 hermes_config : unconfig
226 @./mkconfig $(@:_config=) ppc mpc8xx hermes
228 IAD210_config: unconfig
229 @./mkconfig $(@:_config=) ppc mpc8xx IAD210 siemens
231 xtract_ICU862 = $(subst _100MHz,,$(subst _config,,$1))
233 ICU862_100MHz_config \
234 ICU862_config: unconfig
236 @[ -z "$(findstring _100MHz,$@)" ] || \
237 { echo "#define CONFIG_100MHz" >>include/config.h ; \
238 echo "... with 100MHz system clock" ; \
240 @./mkconfig -a $(call xtract_ICU862,$@) ppc mpc8xx icu862
242 IP860_config : unconfig
243 @./mkconfig $(@:_config=) ppc mpc8xx ip860
247 IVML24_config: unconfig
249 @[ -z "$(findstring IVML24_config,$@)" ] || \
250 { echo "#define CONFIG_IVML24_16M" >>include/config.h ; \
252 @[ -z "$(findstring IVML24_128_config,$@)" ] || \
253 { echo "#define CONFIG_IVML24_32M" >>include/config.h ; \
255 @[ -z "$(findstring IVML24_256_config,$@)" ] || \
256 { echo "#define CONFIG_IVML24_64M" >>include/config.h ; \
258 @./mkconfig -a IVML24 ppc mpc8xx ivm
262 IVMS8_config: unconfig
264 @[ -z "$(findstring IVMS8_config,$@)" ] || \
265 { echo "#define CONFIG_IVMS8_16M" >>include/config.h ; \
267 @[ -z "$(findstring IVMS8_128_config,$@)" ] || \
268 { echo "#define CONFIG_IVMS8_32M" >>include/config.h ; \
270 @[ -z "$(findstring IVMS8_256_config,$@)" ] || \
271 { echo "#define CONFIG_IVMS8_64M" >>include/config.h ; \
273 @./mkconfig -a IVMS8 ppc mpc8xx ivm
275 KUP4K_config : unconfig
276 @./mkconfig $(@:_config=) ppc mpc8xx kup4k
278 LANTEC_config : unconfig
279 @./mkconfig $(@:_config=) ppc mpc8xx lantec
281 lwmon_config: unconfig
282 @./mkconfig $(@:_config=) ppc mpc8xx lwmon
285 MBX860T_config: unconfig
286 @./mkconfig $(@:_config=) ppc mpc8xx mbx8xx
288 MHPC_config: unconfig
289 @./mkconfig $(@:_config=) ppc mpc8xx mhpc eltec
291 MVS1_config : unconfig
292 @./mkconfig $(@:_config=) ppc mpc8xx mvs1
294 NETVIA_config: unconfig
295 @./mkconfig $(@:_config=) ppc mpc8xx netvia
297 NX823_config: unconfig
298 @./mkconfig $(@:_config=) ppc mpc8xx nx823
300 pcu_e_config: unconfig
301 @./mkconfig $(@:_config=) ppc mpc8xx pcu_e siemens
303 R360MPI_config: unconfig
304 @./mkconfig $(@:_config=) ppc mpc8xx r360mpi
306 RPXClassic_config: unconfig
307 @./mkconfig $(@:_config=) ppc mpc8xx RPXClassic
309 RPXlite_config: unconfig
310 @./mkconfig $(@:_config=) ppc mpc8xx RPXlite
312 RRvision_config: unconfig
313 @./mkconfig $(@:_config=) ppc mpc8xx RRvision
315 RRvision_LCD_config: unconfig
316 @echo "#define CONFIG_LCD" >include/config.h
317 @echo "#define CONFIG_SHARP_LQ104V7DS01" >>include/config.h
318 @./mkconfig -a RRvision ppc mpc8xx RRvision
320 SM850_config : unconfig
321 @./mkconfig $(@:_config=) ppc mpc8xx tqm8xx
323 SPD823TS_config: unconfig
324 @./mkconfig $(@:_config=) ppc mpc8xx spd8xx
326 SXNI855T_config: unconfig
327 @./mkconfig $(@:_config=) ppc mpc8xx sixnet
329 # Play some tricks for configuration selection
330 # All boards can come with 50 MHz (default), 66MHz or 80MHz clock,
331 # but only 855 and 860 boards may come with FEC
332 # and 823 boards may have LCD support
333 xtract_8xx = $(subst _66MHz,,$(subst _80MHz,,$(subst _LCD,,$(subst _FEC,,$(subst _config,,$1)))))
338 TQM823L_66MHz_config \
339 TQM823L_80MHz_config \
341 TQM823L_LCD_66MHz_config \
342 TQM823L_LCD_80MHz_config \
344 TQM850L_66MHz_config \
345 TQM850L_80MHz_config \
347 TQM855L_66MHz_config \
348 TQM855L_80MHz_config \
350 TQM855L_FEC_66MHz_config \
351 TQM855L_FEC_80MHz_config \
353 TQM860L_66MHz_config \
354 TQM860L_80MHz_config \
356 TQM860L_FEC_66MHz_config \
357 TQM860L_FEC_80MHz_config: unconfig
359 @[ -z "$(findstring _FEC,$@)" ] || \
360 { echo "#define CONFIG_FEC_ENET" >>include/config.h ; \
361 echo "... with FEC support" ; \
363 @[ -z "$(findstring _66MHz,$@)" ] || \
364 { echo "#define CONFIG_66MHz" >>include/config.h ; \
365 echo "... with 66MHz system clock" ; \
367 @[ -z "$(findstring _80MHz,$@)" ] || \
368 { echo "#define CONFIG_80MHz" >>include/config.h ; \
369 echo "... with 80MHz system clock" ; \
371 @[ -z "$(findstring _LCD,$@)" ] || \
372 { echo "#define CONFIG_LCD" >>include/config.h ; \
373 echo "#define CONFIG_NEC_NL6648BC20" >>include/config.h ; \
374 echo "... with LCD display" ; \
376 @./mkconfig -a $(call xtract_8xx,$@) ppc mpc8xx tqm8xx
378 TTTech_config: unconfig
379 @echo "#define CONFIG_LCD" >include/config.h
380 @echo "#define CONFIG_SHARP_LQ104V7DS01" >>include/config.h
381 @./mkconfig -a TQM823L ppc mpc8xx tqm8xx
384 @echo "#define CONFIG_LCD" >include/config.h
385 @echo "#define CONFIG_SHARP_LQ084V1DG21" >>include/config.h
386 @./mkconfig $(@:_config=) ppc mpc8xx v37
388 #########################################################################
390 #########################################################################
392 ADCIOP_config: unconfig
393 @./mkconfig $(@:_config=) ppc ppc4xx adciop esd
395 AR405_config: unconfig
396 @./mkconfig $(@:_config=) ppc ppc4xx ar405 esd
398 CANBT_config: unconfig
399 @./mkconfig $(@:_config=) ppc ppc4xx canbt esd
402 CPCI4052_config: unconfig
403 @./mkconfig $(@:_config=) ppc ppc4xx cpci405 esd
404 @echo "BOARD_REVISION = $(@:_config=)" >>include/config.mk
406 CPCI440_config: unconfig
407 @./mkconfig $(@:_config=) ppc ppc4xx cpci440 esd
409 CPCIISER4_config: unconfig
410 @./mkconfig $(@:_config=) ppc ppc4xx cpciiser4 esd
412 CRAYL1_config:unconfig
413 @./mkconfig $(@:_config=) ppc ppc4xx L1 cray
415 DASA_SIM_config: unconfig
416 @./mkconfig $(@:_config=) ppc ppc4xx dasa_sim esd
418 DU405_config: unconfig
419 @./mkconfig $(@:_config=) ppc ppc4xx du405 esd
421 EBONY_config:unconfig
422 @./mkconfig $(@:_config=) ppc ppc4xx ebony
425 @./mkconfig $(@:_config=) ppc ppc4xx eric
427 MIP405_config:unconfig
428 @./mkconfig $(@:_config=) ppc ppc4xx mip405 mpl
431 @./mkconfig $(@:_config=) ppc ppc4xx ml2
434 ORSG_config: unconfig
435 @./mkconfig $(@:_config=) ppc ppc4xx ocrtc esd
437 PCI405_config: unconfig
438 @./mkconfig $(@:_config=) ppc ppc4xx pci405 esd
440 PIP405_config:unconfig
441 @./mkconfig $(@:_config=) ppc ppc4xx pip405 mpl
444 W7OLMG_config: unconfig
445 @./mkconfig $(@:_config=) ppc ppc4xx w7o
447 WALNUT405_config:unconfig
448 @./mkconfig $(@:_config=) ppc ppc4xx walnut405
450 #########################################################################
452 #########################################################################
454 @./mkconfig $(@:_config=) ppc mpc824x bmw
456 CU824_config: unconfig
457 @./mkconfig $(@:_config=) ppc mpc824x cu824
459 MOUSSE_config: unconfig
460 @./mkconfig $(@:_config=) ppc mpc824x mousse
462 MUSENKI_config: unconfig
463 @./mkconfig $(@:_config=) ppc mpc824x musenki
466 @./mkconfig $(@:_config=) ppc mpc824x oxc
468 PN62_config: unconfig
469 @./mkconfig $(@:_config=) ppc mpc824x pn62
471 Sandpoint8240_config: unconfig
472 @./mkconfig $(@:_config=) ppc mpc824x sandpoint
474 Sandpoint8245_config: unconfig
475 @./mkconfig $(@:_config=) ppc mpc824x sandpoint
477 utx8245_config: unconfig
478 @./mkconfig $(@:_config=) ppc mpc824x utx8245
480 #########################################################################
482 #########################################################################
483 xtract_82xx = $(subst _ROMBOOT,,$(subst _L2,,$(subst _266MHz,,$(subst _300MHz,,$(subst _config,,$1)))))
485 cogent_mpc8260_config: unconfig
486 @./mkconfig $(@:_config=) ppc mpc8260 cogent
489 CPU86_ROMBOOT_config: unconfig
490 @./mkconfig $(call xtract_82xx,$@) ppc mpc8260 cpu86
492 if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
493 echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
494 echo "... booting from 8-bit flash" ; \
496 echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
497 echo "... booting from 64-bit flash" ; \
499 echo "export CONFIG_BOOT_ROM" >> config.mk;
501 ep8260_config: unconfig
502 @./mkconfig $(@:_config=) ppc mpc8260 ep8260
504 gw8260_config: unconfig
505 @./mkconfig $(@:_config=) ppc mpc8260 gw8260
507 hymod_config: unconfig
508 @./mkconfig $(@:_config=) ppc mpc8260 hymod
510 IPHASE4539_config: unconfig
511 @./mkconfig $(@:_config=) ppc mpc8260 iphase4539
513 MPC8260ADS_config: unconfig
514 @./mkconfig $(@:_config=) ppc mpc8260 mpc8260ads
517 PM826_ROMBOOT_config: unconfig
518 @./mkconfig $(call xtract_82xx,$@) ppc mpc8260 pm826
520 if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
521 echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
522 echo "... booting from 8-bit flash" ; \
524 echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
525 echo "... booting from 64-bit flash" ; \
527 echo "export CONFIG_BOOT_ROM" >> config.mk; \
529 ppmc8260_config: unconfig
530 @./mkconfig $(@:_config=) ppc mpc8260 ppmc8260
532 RPXsuper_config: unconfig
533 @./mkconfig $(@:_config=) ppc mpc8260 rpxsuper
535 rsdproto_config: unconfig
536 @./mkconfig $(@:_config=) ppc mpc8260 rsdproto
538 sacsng_config: unconfig
539 @./mkconfig $(@:_config=) ppc mpc8260 sacsng
541 sbc8260_config: unconfig
542 @./mkconfig $(@:_config=) ppc mpc8260 sbc8260
545 @./mkconfig $(@:_config=) ppc mpc8260 SCM siemens
549 TQM8260_266MHz_config \
550 TQM8260_L2_266MHz_config \
551 TQM8260_300MHz_config: unconfig
553 @if [ "$(findstring _L2_,$@)" ] ; then \
554 echo "#define CONFIG_L2_CACHE" >>include/config.h ; \
555 echo "... with L2 Cache support (60x Bus Mode)" ; \
557 echo "#undef CONFIG_L2_CACHE" >>include/config.h ; \
558 echo "... without L2 Cache support" ; \
560 @[ -z "$(findstring _266MHz,$@)" ] || \
561 { echo "#define CONFIG_266MHz" >>include/config.h ; \
562 echo "... with 266MHz system clock" ; \
564 @[ -z "$(findstring _300MHz,$@)" ] || \
565 { echo "#define CONFIG_300MHz" >>include/config.h ; \
566 echo "... with 300MHz system clock" ; \
568 @./mkconfig -a $(call xtract_82xx,$@) ppc mpc8260 tqm8260
570 #########################################################################
572 #########################################################################
574 AmigaOneG3SE_config: unconfig
575 @./mkconfig $(@:_config=) ppc 74xx_7xx AmigaOneG3SE MAI
578 EVB64260_750CX_config: unconfig
579 @./mkconfig EVB64260 ppc 74xx_7xx evb64260
581 ZUMA_config: unconfig
582 @./mkconfig $(@:_config=) ppc 74xx_7xx evb64260
585 PCIPPC6_config: unconfig
586 @./mkconfig $(@:_config=) ppc 74xx_7xx pcippc2
588 BAB7xx_config: unconfig
589 @./mkconfig $(@:_config=) ppc 74xx_7xx bab7xx eltec
591 ELPPC_config: unconfig
592 @./mkconfig $(@:_config=) ppc 74xx_7xx elppc eltec
594 #========================================================================
596 #========================================================================
597 #########################################################################
599 #########################################################################
601 lart_config : unconfig
602 @./mkconfig $(@:_config=) arm sa1100 lart
604 dnp1110_config : unconfig
605 @./mkconfig $(@:_config=) arm sa1100 dnp1110
607 shannon_config : unconfig
608 @./mkconfig $(@:_config=) arm sa1100 shannon
610 #########################################################################
612 #########################################################################
614 smdk2400_config : unconfig
615 @./mkconfig $(@:_config=) arm arm920t smdk2400
617 smdk2410_config : unconfig
618 @./mkconfig $(@:_config=) arm arm920t smdk2410
620 trab_config : unconfig
621 @./mkconfig $(@:_config=) arm arm920t trab
623 #########################################################################
625 #########################################################################
627 impa7_config : unconfig
628 @./mkconfig $(@:_config=) arm arm720t impa7
630 ep7312_config : unconfig
631 @./mkconfig $(@:_config=) arm arm720t ep7312
633 #########################################################################
635 #########################################################################
637 lubbock_config : unconfig
638 @./mkconfig $(@:_config=) arm xscale lubbock
640 cradle_config : unconfig
641 @./mkconfig $(@:_config=) arm xscale cradle
643 csb226_config : unconfig
644 @./mkconfig $(@:_config=) arm xscale csb226
646 #========================================================================
648 #========================================================================
649 #########################################################################
651 #########################################################################
652 sc520_cdp_config : unconfig
653 @./mkconfig $(@:_config=) i386 i386 sc520_cdp
655 #########################################################################
659 \( -name 'core' -o -name '*.bak' -o -name '*~' \
660 -o -name '*.o' -o -name '*.a' \) -print \
662 rm -f examples/hello_world examples/timer examples/eepro100_eeprom
663 rm -f tools/img2srec tools/mkimage tools/envcrc tools/gen_eth_addr
664 rm -f tools/easylogo/easylogo tools/bmp_logo
665 rm -f tools/gdb/astest tools/gdb/gdbcont tools/gdb/gdbsend
666 rm -f tools/env/fw_printenv tools/env/fw_setenv
670 \( -name .depend -o -name '*.srec' -o -name '*.bin' \) \
673 rm -f $(OBJS) *.bak tags TAGS
675 rm -f u-boot u-boot.bin u-boot.elf u-boot.srec u-boot.map System.map
676 rm -f tools/crc32.c tools/environment.c tools/env/crc32.c
677 rm -f include/asm/arch include/asm
680 distclean: clobber unconfig
683 F=`basename $(TOPDIR)` ; cd .. ; \
684 gtar --force-local -zcvf `date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
686 #########################################################################