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)
57 CROSS_COMPILE = ppc_8xx-
60 CROSS_COMPILE = arm-linux-
63 #CROSS_COMPILE = i386-elf-
66 CROSS_COMPILE = mips_4KC-
73 # The "tools" are needed early, so put this first
90 #########################################################################
91 # U-Boot objects....order is important (i.e. start must be first)
93 OBJS = cpu/$(CPU)/start.o
95 OBJS += cpu/$(CPU)/start16.o
96 OBJS += cpu/$(CPU)/reset.o
99 OBJS += cpu/$(CPU)/resetvec.o
102 LIBS = board/$(BOARDDIR)/lib$(BOARD).a
103 LIBS += cpu/$(CPU)/lib$(CPU).a
104 LIBS += lib_$(ARCH)/lib$(ARCH).a
105 LIBS += fs/jffs2/libjffs2.a fs/fdos/libfdos.a
107 LIBS += disk/libdisk.a
110 LIBS += drivers/libdrivers.a
111 LIBS += post/libpost.a post/cpu/libcpu.a
112 LIBS += common/libcommon.a
113 LIBS += lib_generic/libgeneric.a
115 #########################################################################
117 all: u-boot.srec u-boot.bin System.map
120 -cp u-boot.bin /tftpboot/u-boot.bin
121 -cp u-boot.bin /net/denx/tftpboot/u-boot.bin
124 $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
127 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
130 $(OBJDUMP) -d $< > $@
132 u-boot: depend subdirs $(OBJS) $(LIBS) $(LDSCRIPT)
133 $(LD) $(LDFLAGS) $(OBJS) \
134 --start-group $(LIBS) --end-group \
135 -Map u-boot.map -o u-boot
138 @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir || exit 1 ; done
141 @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir .depend ; done
144 ctags -w `find $(SUBDIRS) include \
145 \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
148 etags -a `find $(SUBDIRS) include \
149 \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
153 grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
156 #########################################################################
158 all install u-boot u-boot.srec depend dep:
159 @echo "System not configured - see README" >&2
163 #########################################################################
166 rm -f include/config.h include/config.mk
168 #========================================================================
170 #========================================================================
171 #########################################################################
173 #########################################################################
175 ADS860_config: unconfig
176 @./mkconfig $(@:_config=) ppc mpc8xx fads
178 AMX860_config : unconfig
179 @./mkconfig $(@:_config=) ppc mpc8xx amx860 westel
181 c2mon_config: unconfig
182 @./mkconfig $(@:_config=) ppc mpc8xx c2mon
185 @./mkconfig $(@:_config=) ppc mpc8xx CCM siemens
187 cogent_mpc8xx_config: unconfig
188 @./mkconfig $(@:_config=) ppc mpc8xx cogent
190 ELPT860_config: unconfig
191 @./mkconfig $(@:_config=) ppc mpc8xx elpt860 LEOX
193 ESTEEM192E_config: unconfig
194 @./mkconfig $(@:_config=) ppc mpc8xx esteem192e
196 ETX094_config : unconfig
197 @./mkconfig $(@:_config=) ppc mpc8xx etx094
201 FADS860T_config: unconfig
202 @./mkconfig $(@:_config=) ppc mpc8xx fads
204 FLAGADM_config: unconfig
205 @./mkconfig $(@:_config=) ppc mpc8xx flagadm
207 GEN860T_config: unconfig
208 @./mkconfig $(@:_config=) ppc mpc8xx gen860t
210 GENIETV_config: unconfig
211 @./mkconfig $(@:_config=) ppc mpc8xx genietv
214 @./mkconfig $(@:_config=) ppc mpc8xx gth
216 hermes_config : unconfig
217 @./mkconfig $(@:_config=) ppc mpc8xx hermes
219 IAD210_config: unconfig
220 @./mkconfig $(@:_config=) ppc mpc8xx IAD210 siemens
222 xtract_ICU862 = $(subst _100MHz,,$(subst _config,,$1))
224 ICU862_100MHz_config \
225 ICU862_config: unconfig
227 @[ -z "$(findstring _100MHz,$@)" ] || \
228 { echo "#define CONFIG_100MHz" >>include/config.h ; \
229 echo "... with 100MHz system clock" ; \
231 @./mkconfig -a $(call xtract_ICU862,$@) ppc mpc8xx icu862
233 IP860_config : unconfig
234 @./mkconfig $(@:_config=) ppc mpc8xx ip860
238 IVML24_config: unconfig
240 @[ -z "$(findstring IVML24_config,$@)" ] || \
241 { echo "#define CONFIG_IVML24_16M" >>include/config.h ; \
243 @[ -z "$(findstring IVML24_128_config,$@)" ] || \
244 { echo "#define CONFIG_IVML24_32M" >>include/config.h ; \
246 @[ -z "$(findstring IVML24_256_config,$@)" ] || \
247 { echo "#define CONFIG_IVML24_64M" >>include/config.h ; \
249 @./mkconfig -a IVML24 ppc mpc8xx ivm
253 IVMS8_config: unconfig
255 @[ -z "$(findstring IVMS8_config,$@)" ] || \
256 { echo "#define CONFIG_IVMS8_16M" >>include/config.h ; \
258 @[ -z "$(findstring IVMS8_128_config,$@)" ] || \
259 { echo "#define CONFIG_IVMS8_32M" >>include/config.h ; \
261 @[ -z "$(findstring IVMS8_256_config,$@)" ] || \
262 { echo "#define CONFIG_IVMS8_64M" >>include/config.h ; \
264 @./mkconfig -a IVMS8 ppc mpc8xx ivm
266 KUP4K_config : unconfig
267 @./mkconfig $(@:_config=) ppc mpc8xx kup4k
269 LANTEC_config : unconfig
270 @./mkconfig $(@:_config=) ppc mpc8xx lantec
272 lwmon_config: unconfig
273 @./mkconfig $(@:_config=) ppc mpc8xx lwmon
276 MBX860T_config: unconfig
277 @./mkconfig $(@:_config=) ppc mpc8xx mbx8xx
279 MHPC_config: unconfig
280 @./mkconfig $(@:_config=) ppc mpc8xx mhpc eltec
282 MVS1_config : unconfig
283 @./mkconfig $(@:_config=) ppc mpc8xx mvs1
285 NETVIA_config: unconfig
286 @./mkconfig $(@:_config=) ppc mpc8xx netvia
288 NX823_config: unconfig
289 @./mkconfig $(@:_config=) ppc mpc8xx nx823
291 pcu_e_config: unconfig
292 @./mkconfig $(@:_config=) ppc mpc8xx pcu_e siemens
294 R360MPI_config: unconfig
295 @./mkconfig $(@:_config=) ppc mpc8xx r360mpi
297 RPXClassic_config: unconfig
298 @./mkconfig $(@:_config=) ppc mpc8xx RPXClassic
300 RPXlite_config: unconfig
301 @./mkconfig $(@:_config=) ppc mpc8xx RPXlite
303 RRvision_config: unconfig
304 @./mkconfig $(@:_config=) ppc mpc8xx RRvision
306 RRvision_LCD_config: unconfig
307 @echo "#define CONFIG_LCD" >include/config.h
308 @echo "#define CONFIG_SHARP_LQ104V7DS01" >>include/config.h
309 @./mkconfig -a RRvision ppc mpc8xx RRvision
311 SM850_config : unconfig
312 @./mkconfig $(@:_config=) ppc mpc8xx tqm8xx
314 SPD823TS_config: unconfig
315 @./mkconfig $(@:_config=) ppc mpc8xx spd8xx
317 svm_sc8xx_config: unconfig
319 @./mkconfig $(@:_config=) ppc mpc8xx svm_sc8xx
321 SXNI855T_config: unconfig
322 @./mkconfig $(@:_config=) ppc mpc8xx sixnet
324 # EMK MPC8xx based modules
325 TOP860_config: unconfig
326 @./mkconfig $(@:_config=) ppc mpc8xx top860 emk
328 # Play some tricks for configuration selection
329 # All boards can come with 50 MHz (default), 66MHz or 80MHz clock,
330 # but only 855 and 860 boards may come with FEC
331 # and 823 boards may have LCD support
332 xtract_8xx = $(subst _66MHz,,$(subst _80MHz,,$(subst _LCD,,$(subst _FEC,,$(subst _config,,$1)))))
337 TQM823L_66MHz_config \
338 TQM823L_80MHz_config \
340 TQM823L_LCD_66MHz_config \
341 TQM823L_LCD_80MHz_config \
343 TQM850L_66MHz_config \
344 TQM850L_80MHz_config \
346 TQM855L_66MHz_config \
347 TQM855L_80MHz_config \
349 TQM855L_FEC_66MHz_config \
350 TQM855L_FEC_80MHz_config \
352 TQM860L_66MHz_config \
353 TQM860L_80MHz_config \
355 TQM860L_FEC_66MHz_config \
356 TQM860L_FEC_80MHz_config: unconfig
358 @[ -z "$(findstring _FEC,$@)" ] || \
359 { echo "#define CONFIG_FEC_ENET" >>include/config.h ; \
360 echo "... with FEC support" ; \
362 @[ -z "$(findstring _66MHz,$@)" ] || \
363 { echo "#define CONFIG_66MHz" >>include/config.h ; \
364 echo "... with 66MHz system clock" ; \
366 @[ -z "$(findstring _80MHz,$@)" ] || \
367 { echo "#define CONFIG_80MHz" >>include/config.h ; \
368 echo "... with 80MHz system clock" ; \
370 @[ -z "$(findstring _LCD,$@)" ] || \
371 { echo "#define CONFIG_LCD" >>include/config.h ; \
372 echo "#define CONFIG_NEC_NL6648BC20" >>include/config.h ; \
373 echo "... with LCD display" ; \
375 @./mkconfig -a $(call xtract_8xx,$@) ppc mpc8xx tqm8xx
377 TTTech_config: unconfig
378 @echo "#define CONFIG_LCD" >include/config.h
379 @echo "#define CONFIG_SHARP_LQ104V7DS01" >>include/config.h
380 @./mkconfig -a TQM823L ppc mpc8xx tqm8xx
383 @echo "#define CONFIG_LCD" >include/config.h
384 @echo "#define CONFIG_SHARP_LQ084V1DG21" >>include/config.h
385 @./mkconfig $(@:_config=) ppc mpc8xx v37
387 #########################################################################
389 #########################################################################
391 ADCIOP_config: unconfig
392 @./mkconfig $(@:_config=) ppc ppc4xx adciop esd
394 AR405_config: unconfig
395 @./mkconfig $(@:_config=) ppc ppc4xx ar405 esd
397 CANBT_config: unconfig
398 @./mkconfig $(@:_config=) ppc ppc4xx canbt esd
401 CPCI4052_config: unconfig
402 @./mkconfig $(@:_config=) ppc ppc4xx cpci405 esd
403 @echo "BOARD_REVISION = $(@:_config=)" >>include/config.mk
405 CPCI440_config: unconfig
406 @./mkconfig $(@:_config=) ppc ppc4xx cpci440 esd
408 CPCIISER4_config: unconfig
409 @./mkconfig $(@:_config=) ppc ppc4xx cpciiser4 esd
411 CRAYL1_config:unconfig
412 @./mkconfig $(@:_config=) ppc ppc4xx L1 cray
414 DASA_SIM_config: unconfig
415 @./mkconfig $(@:_config=) ppc ppc4xx dasa_sim esd
417 DU405_config: unconfig
418 @./mkconfig $(@:_config=) ppc ppc4xx du405 esd
420 EBONY_config:unconfig
421 @./mkconfig $(@:_config=) ppc ppc4xx ebony
424 @./mkconfig $(@:_config=) ppc ppc4xx eric
426 MIP405_config:unconfig
427 @./mkconfig $(@:_config=) ppc ppc4xx mip405 mpl
430 @./mkconfig $(@:_config=) ppc ppc4xx ml2
433 ORSG_config: unconfig
434 @./mkconfig $(@:_config=) ppc ppc4xx ocrtc esd
436 PCI405_config: unconfig
437 @./mkconfig $(@:_config=) ppc ppc4xx pci405 esd
439 PIP405_config:unconfig
440 @./mkconfig $(@:_config=) ppc ppc4xx pip405 mpl
443 W7OLMG_config: unconfig
444 @./mkconfig $(@:_config=) ppc ppc4xx w7o
446 WALNUT405_config:unconfig
447 @./mkconfig $(@:_config=) ppc ppc4xx walnut405
449 #########################################################################
451 #########################################################################
452 xtract_82xx = $(subst _ROMBOOT,,$(subst _L2,,$(subst _266MHz,,$(subst _300MHz,,$(subst _config,,$1)))))
455 @./mkconfig $(@:_config=) ppc mpc824x bmw
458 CPC45_ROMBOOT_config: unconfig
459 @./mkconfig $(call xtract_82xx,$@) ppc mpc824x cpc45
461 if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
462 echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
463 echo "... booting from 8-bit flash" ; \
465 echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
466 echo "... booting from 64-bit flash" ; \
468 echo "export CONFIG_BOOT_ROM" >> config.mk;
470 CU824_config: unconfig
471 @./mkconfig $(@:_config=) ppc mpc824x cu824
473 MOUSSE_config: unconfig
474 @./mkconfig $(@:_config=) ppc mpc824x mousse
476 MUSENKI_config: unconfig
477 @./mkconfig $(@:_config=) ppc mpc824x musenki
480 @./mkconfig $(@:_config=) ppc mpc824x oxc
482 PN62_config: unconfig
483 @./mkconfig $(@:_config=) ppc mpc824x pn62
485 Sandpoint8240_config: unconfig
486 @./mkconfig $(@:_config=) ppc mpc824x sandpoint
488 Sandpoint8245_config: unconfig
489 @./mkconfig $(@:_config=) ppc mpc824x sandpoint
491 utx8245_config: unconfig
492 @./mkconfig $(@:_config=) ppc mpc824x utx8245
494 #########################################################################
496 #########################################################################
498 cogent_mpc8260_config: unconfig
499 @./mkconfig $(@:_config=) ppc mpc8260 cogent
502 CPU86_ROMBOOT_config: unconfig
503 @./mkconfig $(call xtract_82xx,$@) ppc mpc8260 cpu86
505 if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
506 echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
507 echo "... booting from 8-bit flash" ; \
509 echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
510 echo "... booting from 64-bit flash" ; \
512 echo "export CONFIG_BOOT_ROM" >> config.mk;
514 ep8260_config: unconfig
515 @./mkconfig $(@:_config=) ppc mpc8260 ep8260
517 gw8260_config: unconfig
518 @./mkconfig $(@:_config=) ppc mpc8260 gw8260
520 hymod_config: unconfig
521 @./mkconfig $(@:_config=) ppc mpc8260 hymod
523 IPHASE4539_config: unconfig
524 @./mkconfig $(@:_config=) ppc mpc8260 iphase4539
526 MPC8260ADS_config: unconfig
527 @./mkconfig $(@:_config=) ppc mpc8260 mpc8260ads
529 MPC8266ADS_config: unconfig
530 @./mkconfig $(@:_config=) ppc mpc8260 mpc8266ads
533 PM825_ROMBOOT_config: unconfig
534 @echo "#define CONFIG_PCI" >include/config.h
535 @./mkconfig -a PM826 ppc mpc8260 pm826
537 if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
538 echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
539 echo "... booting from 8-bit flash" ; \
541 echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
542 echo "... booting from 64-bit flash" ; \
544 echo "export CONFIG_BOOT_ROM" >> config.mk; \
547 PM826_ROMBOOT_config: unconfig
548 @./mkconfig $(call xtract_82xx,$@) ppc mpc8260 pm826
550 if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
551 echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
552 echo "... booting from 8-bit flash" ; \
554 echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
555 echo "... booting from 64-bit flash" ; \
557 echo "export CONFIG_BOOT_ROM" >> config.mk; \
559 ppmc8260_config: unconfig
560 @./mkconfig $(@:_config=) ppc mpc8260 ppmc8260
562 RPXsuper_config: unconfig
563 @./mkconfig $(@:_config=) ppc mpc8260 rpxsuper
565 rsdproto_config: unconfig
566 @./mkconfig $(@:_config=) ppc mpc8260 rsdproto
568 sacsng_config: unconfig
569 @./mkconfig $(@:_config=) ppc mpc8260 sacsng
571 sbc8260_config: unconfig
572 @./mkconfig $(@:_config=) ppc mpc8260 sbc8260
575 @./mkconfig $(@:_config=) ppc mpc8260 SCM siemens
579 TQM8260_266MHz_config \
580 TQM8260_L2_266MHz_config \
581 TQM8260_300MHz_config: unconfig
583 @if [ "$(findstring _L2_,$@)" ] ; then \
584 echo "#define CONFIG_L2_CACHE" >>include/config.h ; \
585 echo "... with L2 Cache support (60x Bus Mode)" ; \
587 echo "#undef CONFIG_L2_CACHE" >>include/config.h ; \
588 echo "... without L2 Cache support" ; \
590 @[ -z "$(findstring _266MHz,$@)" ] || \
591 { echo "#define CONFIG_266MHz" >>include/config.h ; \
592 echo "... with 266MHz system clock" ; \
594 @[ -z "$(findstring _300MHz,$@)" ] || \
595 { echo "#define CONFIG_300MHz" >>include/config.h ; \
596 echo "... with 300MHz system clock" ; \
598 @./mkconfig -a $(call xtract_82xx,$@) ppc mpc8260 tqm8260
600 #########################################################################
602 #########################################################################
604 AmigaOneG3SE_config: unconfig
605 @./mkconfig $(@:_config=) ppc 74xx_7xx AmigaOneG3SE MAI
608 EVB64260_750CX_config: unconfig
609 @./mkconfig EVB64260 ppc 74xx_7xx evb64260
611 ZUMA_config: unconfig
612 @./mkconfig $(@:_config=) ppc 74xx_7xx evb64260
615 PCIPPC6_config: unconfig
616 @./mkconfig $(@:_config=) ppc 74xx_7xx pcippc2
618 BAB7xx_config: unconfig
619 @./mkconfig $(@:_config=) ppc 74xx_7xx bab7xx eltec
621 ELPPC_config: unconfig
622 @./mkconfig $(@:_config=) ppc 74xx_7xx elppc eltec
624 #========================================================================
626 #========================================================================
627 #########################################################################
629 #########################################################################
631 at91rm9200dk_config : unconfig
632 @./mkconfig $(@:_config=) arm at91rm9200 at91rm9200dk
634 lart_config : unconfig
635 @./mkconfig $(@:_config=) arm sa1100 lart
637 dnp1110_config : unconfig
638 @./mkconfig $(@:_config=) arm sa1100 dnp1110
640 shannon_config : unconfig
641 @./mkconfig $(@:_config=) arm sa1100 shannon
643 #########################################################################
645 #########################################################################
647 xtract_trab = $(subst _big_flash,,$(subst _config,,$1))
649 smdk2400_config : unconfig
650 @./mkconfig $(@:_config=) arm arm920t smdk2400
652 smdk2410_config : unconfig
653 @./mkconfig $(@:_config=) arm arm920t smdk2410
656 trab_big_flash_config: unconfig
658 @[ -z "$(findstring _big_flash,$@)" ] || \
659 { echo "#define CONFIG_BIG_FLASH" >>include/config.h ; \
660 echo "... with big flash support" ; \
662 @./mkconfig -a $(call xtract_trab,$@) arm arm920t trab
664 VCMA9_config : unconfig
665 @./mkconfig $(@:_config=) arm arm920t vcma9 mpl
667 #########################################################################
669 #########################################################################
671 impa7_config : unconfig
672 @./mkconfig $(@:_config=) arm arm720t impa7
674 ep7312_config : unconfig
675 @./mkconfig $(@:_config=) arm arm720t ep7312
677 #########################################################################
679 #########################################################################
681 cradle_config : unconfig
682 @./mkconfig $(@:_config=) arm xscale cradle
684 csb226_config : unconfig
685 @./mkconfig $(@:_config=) arm xscale csb226
687 innokom_config : unconfig
688 @./mkconfig $(@:_config=) arm xscale innokom
690 lubbock_config : unconfig
691 @./mkconfig $(@:_config=) arm xscale lubbock
693 #========================================================================
695 #========================================================================
696 #########################################################################
698 #########################################################################
699 sc520_cdp_config : unconfig
700 @./mkconfig $(@:_config=) i386 i386 sc520_cdp
702 #========================================================================
704 #========================================================================
705 #########################################################################
707 #########################################################################
709 incaip_config : unconfig
710 @./mkconfig $(@:_config=) mips mips incaip
716 \( -name 'core' -o -name '*.bak' -o -name '*~' \
717 -o -name '*.o' -o -name '*.a' \) -print \
719 rm -f examples/hello_world examples/timer examples/eepro100_eeprom
720 rm -f tools/img2srec tools/mkimage tools/envcrc tools/gen_eth_addr
721 rm -f tools/easylogo/easylogo tools/bmp_logo
722 rm -f tools/gdb/astest tools/gdb/gdbcont tools/gdb/gdbsend
723 rm -f tools/env/fw_printenv tools/env/fw_setenv
727 \( -name .depend -o -name '*.srec' -o -name '*.bin' \) \
730 rm -f $(OBJS) *.bak tags TAGS
732 rm -f u-boot u-boot.bin u-boot.elf u-boot.srec u-boot.map System.map
733 rm -f tools/crc32.c tools/environment.c tools/env/crc32.c
734 rm -f cpu/mpc824x/bedbug_603e.c
735 rm -f include/asm/arch include/asm
738 distclean: clobber unconfig
741 F=`basename $(TOPDIR)` ; cd .. ; \
742 gtar --force-local -zcvf `date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
744 #########################################################################