xref: /openbmc/u-boot/Makefile (revision b0fce99b)
1#
2# (C) Copyright 2000, 2001, 2002
3# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
5# See file CREDITS for list of people who contributed to this
6# project.
7#
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.
12#
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.
17#
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,
21# MA 02111-1307 USA
22#
23
24HOSTARCH := $(shell uname -m | \
25	sed -e s/i.86/i386/ \
26	    -e s/sun4u/sparc64/ \
27	    -e s/arm.*/arm/ \
28	    -e s/sa110/arm/ \
29	    -e s/powerpc/ppc/ \
30	    -e s/macppc/ppc/)
31
32HOSTOS := $(shell uname -s | tr A-Z a-z | \
33	    sed -e 's/\(cygwin\).*/cygwin/')
34
35export	HOSTARCH
36
37# Deal with colliding definitions from tcsh etc.
38VENDOR=
39
40#########################################################################
41
42TOPDIR	:= $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
43export	TOPDIR
44
45ifeq (include/config.mk,$(wildcard include/config.mk))
46# load ARCH, BOARD, and CPU configuration
47include include/config.mk
48export	ARCH CPU BOARD VENDOR
49# load other configuration
50include $(TOPDIR)/config.mk
51
52ifndef CROSS_COMPILE
53ifeq ($(HOSTARCH),ppc)
54CROSS_COMPILE =
55else
56ifeq ($(ARCH),ppc)
57CROSS_COMPILE = ppc_8xx-
58endif
59ifeq ($(ARCH),arm)
60CROSS_COMPILE = arm-linux-
61endif
62ifeq ($(ARCH),i386)
63ifeq ($(HOSTARCH),i386)
64CROSS_COMPILE =
65else
66CROSS_COMPILE = i386-linux-
67endif
68endif
69ifeq ($(ARCH),mips)
70CROSS_COMPILE = mips_4KC-
71endif
72endif
73endif
74
75export	CROSS_COMPILE
76
77# The "tools" are needed early, so put this first
78SUBDIRS	= tools \
79	  lib_generic \
80	  lib_$(ARCH) \
81	  cpu/$(CPU) \
82	  board/$(BOARDDIR) \
83	  common \
84	  disk \
85	  fs \
86	  net \
87	  rtc \
88	  dtt \
89	  drivers \
90	  post \
91	  post/cpu \
92	  examples
93
94#########################################################################
95# U-Boot objects....order is important (i.e. start must be first)
96
97OBJS  =	cpu/$(CPU)/start.o
98ifeq ($(CPU),i386)
99OBJS +=	cpu/$(CPU)/start16.o
100OBJS +=	cpu/$(CPU)/reset.o
101endif
102ifeq ($(CPU),ppc4xx)
103OBJS +=	cpu/$(CPU)/resetvec.o
104endif
105
106LIBS  =	board/$(BOARDDIR)/lib$(BOARD).a
107LIBS += cpu/$(CPU)/lib$(CPU).a
108LIBS += lib_$(ARCH)/lib$(ARCH).a
109LIBS += fs/jffs2/libjffs2.a fs/fdos/libfdos.a fs/fat/libfat.a
110LIBS += net/libnet.a
111LIBS += disk/libdisk.a
112LIBS += rtc/librtc.a
113LIBS += dtt/libdtt.a
114LIBS += drivers/libdrivers.a
115LIBS += post/libpost.a post/cpu/libcpu.a
116LIBS += common/libcommon.a
117LIBS += lib_generic/libgeneric.a
118
119#########################################################################
120
121all:		u-boot.srec u-boot.bin System.map
122
123install:	all
124		-cp u-boot.bin /tftpboot/u-boot.bin
125		-cp u-boot.bin /net/denx/tftpboot/u-boot.bin
126
127u-boot.srec:	u-boot
128		$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
129
130u-boot.bin:	u-boot
131		$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
132
133u-boot.dis:	u-boot
134		$(OBJDUMP) -d $< > $@
135
136u-boot:		depend subdirs $(OBJS) $(LIBS) $(LDSCRIPT)
137		UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
138		$(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
139			--start-group $(LIBS) --end-group \
140			-Map u-boot.map -o u-boot
141
142subdirs:
143		@for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir || exit 1 ; done
144
145depend dep:
146		@for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir .depend ; done
147
148tags:
149		ctags -w `find $(SUBDIRS) include \
150			\( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
151
152etags:
153		etags -a `find $(SUBDIRS) include \
154			\( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
155
156System.map:	u-boot
157		@$(NM) $< | \
158		grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
159		sort > System.map
160
161#########################################################################
162else
163all install u-boot u-boot.srec depend dep:
164	@echo "System not configured - see README" >&2
165	@ exit 1
166endif
167
168#########################################################################
169
170unconfig:
171	rm -f include/config.h include/config.mk
172
173#========================================================================
174# PowerPC
175#========================================================================
176
177#########################################################################
178## MPC5xx Systems
179#########################################################################
180
181cmi_mpc5xx_config:	unconfig
182	@./mkconfig $(@:_config=) ppc mpc5xx cmi
183
184#########################################################################
185## MPC8xx Systems
186#########################################################################
187
188ADS860_config:	unconfig
189	@./mkconfig $(@:_config=) ppc mpc8xx fads
190
191AMX860_config	:	unconfig
192	@./mkconfig $(@:_config=) ppc mpc8xx amx860 westel
193
194c2mon_config:		unconfig
195	@./mkconfig $(@:_config=) ppc mpc8xx c2mon
196
197CCM_config:		unconfig
198	@./mkconfig $(@:_config=) ppc mpc8xx CCM siemens
199
200cogent_mpc8xx_config:	unconfig
201	@./mkconfig $(@:_config=) ppc mpc8xx cogent
202
203ELPT860_config:		unconfig
204	@./mkconfig $(@:_config=) ppc mpc8xx elpt860 LEOX
205
206ESTEEM192E_config:	unconfig
207	@./mkconfig $(@:_config=) ppc mpc8xx esteem192e
208
209ETX094_config	:	unconfig
210	@./mkconfig $(@:_config=) ppc mpc8xx etx094
211
212FADS823_config	\
213FADS850SAR_config \
214FADS860T_config:	unconfig
215	@./mkconfig $(@:_config=) ppc mpc8xx fads
216
217FLAGADM_config:	unconfig
218	@./mkconfig $(@:_config=) ppc mpc8xx flagadm
219
220xtract_GEN860T = $(subst _SC,,$(subst _config,,$1))
221
222GEN860T_SC_config	\
223GEN860T_config: unconfig
224	@ >include/config.h
225	@[ -z "$(findstring _SC,$@)" ] || \
226		{ echo "#define CONFIG_SC" >>include/config.h ; \
227		  echo "With reduced H/W feature set (SC)..." ; \
228		}
229	@./mkconfig -a $(call xtract_GEN860T,$@) ppc mpc8xx gen860t
230
231GENIETV_config:	unconfig
232	@./mkconfig $(@:_config=) ppc mpc8xx genietv
233
234GTH_config:	unconfig
235	@./mkconfig $(@:_config=) ppc mpc8xx gth
236
237hermes_config	:	unconfig
238	@./mkconfig $(@:_config=) ppc mpc8xx hermes
239
240IAD210_config: unconfig
241	@./mkconfig $(@:_config=) ppc mpc8xx IAD210 siemens
242
243xtract_ICU862 = $(subst _100MHz,,$(subst _config,,$1))
244
245ICU862_100MHz_config	\
246ICU862_config: unconfig
247	@ >include/config.h
248	@[ -z "$(findstring _100MHz,$@)" ] || \
249		{ echo "#define CONFIG_100MHz"	>>include/config.h ; \
250		  echo "... with 100MHz system clock" ; \
251		}
252	@./mkconfig -a $(call xtract_ICU862,$@) ppc mpc8xx icu862
253
254IP860_config	:	unconfig
255	@./mkconfig $(@:_config=) ppc mpc8xx ip860
256
257IVML24_256_config \
258IVML24_128_config \
259IVML24_config:	unconfig
260	@ >include/config.h
261	@[ -z "$(findstring IVML24_config,$@)" ] || \
262		 { echo "#define CONFIG_IVML24_16M"	>>include/config.h ; \
263		 }
264	@[ -z "$(findstring IVML24_128_config,$@)" ] || \
265		 { echo "#define CONFIG_IVML24_32M"	>>include/config.h ; \
266		 }
267	@[ -z "$(findstring IVML24_256_config,$@)" ] || \
268		 { echo "#define CONFIG_IVML24_64M"	>>include/config.h ; \
269		 }
270	@./mkconfig -a IVML24 ppc mpc8xx ivm
271
272IVMS8_256_config \
273IVMS8_128_config \
274IVMS8_config:	unconfig
275	@ >include/config.h
276	@[ -z "$(findstring IVMS8_config,$@)" ] || \
277		 { echo "#define CONFIG_IVMS8_16M"	>>include/config.h ; \
278		 }
279	@[ -z "$(findstring IVMS8_128_config,$@)" ] || \
280		 { echo "#define CONFIG_IVMS8_32M"	>>include/config.h ; \
281		 }
282	@[ -z "$(findstring IVMS8_256_config,$@)" ] || \
283		 { echo "#define CONFIG_IVMS8_64M"	>>include/config.h ; \
284		 }
285	@./mkconfig -a IVMS8 ppc mpc8xx ivm
286
287KUP4K_config	:	unconfig
288	@./mkconfig $(@:_config=) ppc mpc8xx kup4k
289
290LANTEC_config	:	unconfig
291	@./mkconfig $(@:_config=) ppc mpc8xx lantec
292
293lwmon_config:		unconfig
294	@./mkconfig $(@:_config=) ppc mpc8xx lwmon
295
296MBX_config	\
297MBX860T_config:	unconfig
298	@./mkconfig $(@:_config=) ppc mpc8xx mbx8xx
299
300MHPC_config:		unconfig
301	@./mkconfig $(@:_config=) ppc mpc8xx mhpc eltec
302
303MVS1_config :		unconfig
304	@./mkconfig $(@:_config=) ppc mpc8xx mvs1
305
306xtract_NETVIA = $(subst _V2,,$(subst _config,,$1))
307
308NETVIA_V2_config \
309NETVIA_config:		unconfig
310	@ >include/config.h
311	@[ -z "$(findstring NETVIA_config,$@)" ] || \
312		 { echo "#define CONFIG_NETVIA_VERSION 1" >>include/config.h ; \
313		  echo "... Version 1" ; \
314		 }
315	@[ -z "$(findstring NETVIA_V2_config,$@)" ] || \
316		 { echo "#define CONFIG_NETVIA_VERSION 2" >>include/config.h ; \
317		  echo "... Version 2" ; \
318		 }
319	@./mkconfig -a $(call xtract_NETVIA,$@) ppc mpc8xx netvia
320
321NX823_config:		unconfig
322	@./mkconfig $(@:_config=) ppc mpc8xx nx823
323
324pcu_e_config:		unconfig
325	@./mkconfig $(@:_config=) ppc mpc8xx pcu_e siemens
326
327R360MPI_config:	unconfig
328	@./mkconfig $(@:_config=) ppc mpc8xx r360mpi
329
330RBC823_config:	unconfig
331	@./mkconfig $(@:_config=) ppc mpc8xx rbc823
332
333RPXClassic_config:	unconfig
334	@./mkconfig $(@:_config=) ppc mpc8xx RPXClassic
335
336RPXlite_config:		unconfig
337	@./mkconfig $(@:_config=) ppc mpc8xx RPXlite
338
339rmu_config:	unconfig
340	@./mkconfig $(@:_config=) ppc mpc8xx rmu
341
342RRvision_config:	unconfig
343	@./mkconfig $(@:_config=) ppc mpc8xx RRvision
344
345RRvision_LCD_config:	unconfig
346	@echo "#define CONFIG_LCD" >include/config.h
347	@echo "#define CONFIG_SHARP_LQ104V7DS01" >>include/config.h
348	@./mkconfig -a RRvision ppc mpc8xx RRvision
349
350SM850_config	:	unconfig
351	@./mkconfig $(@:_config=) ppc mpc8xx tqm8xx
352
353SPD823TS_config:	unconfig
354	@./mkconfig $(@:_config=) ppc mpc8xx spd8xx
355
356svm_sc8xx_config:	unconfig
357	@ >include/config.h
358	@./mkconfig $(@:_config=) ppc mpc8xx svm_sc8xx
359
360SXNI855T_config:	unconfig
361	@./mkconfig $(@:_config=) ppc mpc8xx sixnet
362
363# EMK MPC8xx based modules
364TOP860_config:		unconfig
365	@./mkconfig $(@:_config=) ppc mpc8xx top860 emk
366
367# Play some tricks for configuration selection
368# All boards can come with 50 MHz (default), 66MHz, 80MHz or 100 MHz clock,
369# but only 855 and 860 boards may come with FEC
370# and 823 boards may have LCD support
371xtract_8xx = $(subst _66MHz,,$(subst _80MHz,,$(subst _100MHz,,$(subst _LCD,,$(subst _config,,$1)))))
372
373FPS850L_config		\
374FPS860L_config		\
375TQM823L_config		\
376TQM823L_66MHz_config	\
377TQM823L_80MHz_config	\
378TQM823L_LCD_config	\
379TQM823L_LCD_66MHz_config \
380TQM823L_LCD_80MHz_config \
381TQM850L_config		\
382TQM850L_66MHz_config	\
383TQM850L_80MHz_config	\
384TQM855L_config		\
385TQM855L_66MHz_config	\
386TQM855L_80MHz_config	\
387TQM860L_config		\
388TQM860L_66MHz_config	\
389TQM860L_80MHz_config	\
390TQM862L_config		\
391TQM862L_66MHz_config	\
392TQM862L_80MHz_config	\
393TQM862M_100MHz_config:	unconfig
394	@ >include/config.h
395	@[ -z "$(findstring _66MHz,$@)" ] || \
396		{ echo "#define CONFIG_66MHz"		>>include/config.h ; \
397		  echo "... with 66MHz system clock" ; \
398		}
399	@[ -z "$(findstring _80MHz,$@)" ] || \
400		{ echo "#define CONFIG_80MHz"		>>include/config.h ; \
401		  echo "... with 80MHz system clock" ; \
402		}
403	@[ -z "$(findstring _100MHz,$@)" ] || \
404		{ echo "#define CONFIG_100MHz"		>>include/config.h ; \
405		  echo "... with 100MHz system clock" ; \
406		}
407	@[ -z "$(findstring _LCD,$@)" ] || \
408		{ echo "#define CONFIG_LCD"		>>include/config.h ; \
409		  echo "#define CONFIG_NEC_NL6648BC20"	>>include/config.h ; \
410		  echo "... with LCD display" ; \
411		}
412	@./mkconfig -a $(call xtract_8xx,$@) ppc mpc8xx tqm8xx
413
414TTTech_config:	unconfig
415	@echo "#define CONFIG_LCD" >include/config.h
416	@echo "#define CONFIG_SHARP_LQ104V7DS01" >>include/config.h
417	@./mkconfig -a TQM823L ppc mpc8xx tqm8xx
418
419v37_config:	unconfig
420	@echo "#define CONFIG_LCD" >include/config.h
421	@echo "#define CONFIG_SHARP_LQ084V1DG21" >>include/config.h
422	@./mkconfig $(@:_config=) ppc mpc8xx v37
423
424#########################################################################
425## PPC4xx Systems
426#########################################################################
427
428ADCIOP_config:	unconfig
429	@./mkconfig $(@:_config=) ppc ppc4xx adciop esd
430
431AR405_config:	unconfig
432	@./mkconfig $(@:_config=) ppc ppc4xx ar405 esd
433
434ASH405_config:	unconfig
435	@./mkconfig $(@:_config=) ppc ppc4xx ash405 esd
436
437BUBINGA405EP_config:unconfig
438	@./mkconfig $(@:_config=) ppc ppc4xx bubinga405ep
439
440CANBT_config:	unconfig
441	@./mkconfig $(@:_config=) ppc ppc4xx canbt esd
442
443CPCI405_config	\
444CPCI4052_config	\
445CPCI405AB_config:	unconfig
446	@./mkconfig $(@:_config=) ppc ppc4xx cpci405 esd
447	@echo "BOARD_REVISION = $(@:_config=)"	>>include/config.mk
448
449CPCI440_config:	unconfig
450	@./mkconfig $(@:_config=) ppc ppc4xx cpci440 esd
451
452CPCIISER4_config:	unconfig
453	@./mkconfig $(@:_config=) ppc ppc4xx cpciiser4 esd
454
455CRAYL1_config:unconfig
456	@./mkconfig $(@:_config=) ppc ppc4xx L1 cray
457
458DASA_SIM_config: unconfig
459	@./mkconfig $(@:_config=) ppc ppc4xx dasa_sim esd
460
461DU405_config:	unconfig
462	@./mkconfig $(@:_config=) ppc ppc4xx du405 esd
463
464EBONY_config:unconfig
465	@./mkconfig $(@:_config=) ppc ppc4xx ebony
466
467ERIC_config:unconfig
468	@./mkconfig $(@:_config=) ppc ppc4xx eric
469
470EXBITGEN_config:unconfig
471	@./mkconfig $(@:_config=) ppc ppc4xx exbitgen
472
473MIP405_config:unconfig
474	@./mkconfig $(@:_config=) ppc ppc4xx mip405 mpl
475
476MIP405T_config:unconfig
477	@echo "#define CONFIG_MIP405T" >include/config.h
478	@echo "Enable subset config for MIP405T"
479	@./mkconfig -a MIP405 ppc ppc4xx mip405 mpl
480
481ML2_config:unconfig
482	@./mkconfig $(@:_config=) ppc ppc4xx ml2
483
484OCRTC_config		\
485ORSG_config:	unconfig
486	@./mkconfig $(@:_config=) ppc ppc4xx ocrtc esd
487
488PCI405_config:	unconfig
489	@./mkconfig $(@:_config=) ppc ppc4xx pci405 esd
490
491PIP405_config:unconfig
492	@./mkconfig $(@:_config=) ppc ppc4xx pip405 mpl
493
494PMC405_config:	unconfig
495	@./mkconfig $(@:_config=) ppc ppc4xx pmc405 esd
496
497W7OLMC_config	\
498W7OLMG_config: unconfig
499	@./mkconfig $(@:_config=) ppc ppc4xx w7o
500
501WALNUT405_config:unconfig
502	@./mkconfig $(@:_config=) ppc ppc4xx walnut405
503
504#########################################################################
505## MPC824x Systems
506#########################################################################
507xtract_82xx = $(subst _ROMBOOT,,$(subst _L2,,$(subst _266MHz,,$(subst _300MHz,,$(subst _config,,$1)))))
508
509A3000_config: unconfig
510	@./mkconfig $(@:_config=) ppc mpc824x a3000
511
512BMW_config: unconfig
513	@./mkconfig $(@:_config=) ppc mpc824x bmw
514
515CPC45_config	\
516CPC45_ROMBOOT_config:	unconfig
517	@./mkconfig $(call xtract_82xx,$@) ppc mpc824x cpc45
518	@cd ./include ;				\
519	if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
520		echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
521		echo "... booting from 8-bit flash" ; \
522	else \
523		echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
524		echo "... booting from 64-bit flash" ; \
525	fi; \
526	echo "export CONFIG_BOOT_ROM" >> config.mk;
527
528CU824_config: unconfig
529	@./mkconfig $(@:_config=) ppc mpc824x cu824
530
531MOUSSE_config: unconfig
532	@./mkconfig $(@:_config=) ppc mpc824x mousse
533
534MUSENKI_config: unconfig
535	@./mkconfig $(@:_config=) ppc mpc824x musenki
536
537OXC_config: unconfig
538	@./mkconfig $(@:_config=) ppc mpc824x oxc
539
540PN62_config: unconfig
541	@./mkconfig $(@:_config=) ppc mpc824x pn62
542
543Sandpoint8240_config: unconfig
544	@./mkconfig $(@:_config=) ppc mpc824x sandpoint
545
546Sandpoint8245_config: unconfig
547	@./mkconfig $(@:_config=) ppc mpc824x sandpoint
548
549SL8245_config: unconfig
550	@./mkconfig $(@:_config=) ppc mpc824x sl8245
551
552utx8245_config: unconfig
553	@./mkconfig $(@:_config=) ppc mpc824x utx8245
554
555#########################################################################
556## MPC8260 Systems
557#########################################################################
558
559cogent_mpc8260_config:	unconfig
560	@./mkconfig $(@:_config=) ppc mpc8260 cogent
561
562CPU86_config	\
563CPU86_ROMBOOT_config: unconfig
564	@./mkconfig $(call xtract_82xx,$@) ppc mpc8260 cpu86
565	@cd ./include ;				\
566	if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
567		echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
568		echo "... booting from 8-bit flash" ; \
569	else \
570		echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
571		echo "... booting from 64-bit flash" ; \
572	fi; \
573	echo "export CONFIG_BOOT_ROM" >> config.mk;
574
575ep8260_config:	unconfig
576	@./mkconfig $(@:_config=) ppc mpc8260 ep8260
577
578gw8260_config:	unconfig
579	@./mkconfig $(@:_config=) ppc mpc8260 gw8260
580
581hymod_config:	unconfig
582	@./mkconfig $(@:_config=) ppc mpc8260 hymod
583
584IPHASE4539_config:	unconfig
585	@./mkconfig $(@:_config=) ppc mpc8260 iphase4539
586
587MPC8260ADS_config:	unconfig
588	@./mkconfig $(@:_config=) ppc mpc8260 mpc8260ads
589
590MPC8266ADS_config:	unconfig
591	@./mkconfig $(@:_config=) ppc mpc8260 mpc8266ads
592
593PM825_config	\
594PM825_ROMBOOT_config: unconfig
595	@echo "#define CONFIG_PCI"	>include/config.h
596	@./mkconfig -a PM826 ppc mpc8260 pm826
597	@cd ./include ;				\
598	if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
599		echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
600		echo "... booting from 8-bit flash" ; \
601	else \
602		echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
603		echo "... booting from 64-bit flash" ; \
604	fi; \
605	echo "export CONFIG_BOOT_ROM" >> config.mk; \
606
607PM826_config	\
608PM826_ROMBOOT_config: unconfig
609	@./mkconfig $(call xtract_82xx,$@) ppc mpc8260 pm826
610	@cd ./include ;				\
611	if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
612		echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
613		echo "... booting from 8-bit flash" ; \
614	else \
615		echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
616		echo "... booting from 64-bit flash" ; \
617	fi; \
618	echo "export CONFIG_BOOT_ROM" >> config.mk; \
619
620ppmc8260_config:	unconfig
621	@./mkconfig $(@:_config=) ppc mpc8260 ppmc8260
622
623RPXsuper_config:	unconfig
624	@./mkconfig $(@:_config=) ppc mpc8260 rpxsuper
625
626rsdproto_config:	unconfig
627	@./mkconfig $(@:_config=) ppc mpc8260 rsdproto
628
629sacsng_config:	unconfig
630	@./mkconfig $(@:_config=) ppc mpc8260 sacsng
631
632sbc8260_config:	unconfig
633	@./mkconfig $(@:_config=) ppc mpc8260 sbc8260
634
635SCM_config:		unconfig
636	@./mkconfig $(@:_config=) ppc mpc8260 SCM siemens
637
638TQM8255_config	\
639TQM8260_config	\
640TQM8260_L2_config	\
641TQM8255_266MHz_config	\
642TQM8260_266MHz_config	\
643TQM8260_L2_266MHz_config \
644TQM8255_300MHz_config	\
645TQM8260_300MHz_config:	unconfig
646	@ >include/config.h
647	@if [ "$(findstring _L2_,$@)" ] ; then \
648		echo "#define CONFIG_L2_CACHE"	>>include/config.h ; \
649		echo "... with L2 Cache support (60x Bus Mode)" ; \
650	else \
651		echo "#undef CONFIG_L2_CACHE"	>>include/config.h ; \
652		echo "... without L2 Cache support" ; \
653	fi
654	@[ -z "$(findstring _266MHz,$@)" ] || \
655		{ echo "#define CONFIG_266MHz"	>>include/config.h ; \
656		  echo "... with 266MHz system clock" ; \
657		}
658	@[ -z "$(findstring _300MHz,$@)" ] || \
659		{ echo "#define CONFIG_300MHz"	>>include/config.h ; \
660		  echo "... with 300MHz system clock" ; \
661		}
662	@[ -z "$(findstring TQM8255_,$@)" ] || \
663		{ echo "#define CONFIG_MPC8255"	>>include/config.h ; }
664	@./mkconfig -a TQM8260 ppc mpc8260 tqm8260
665
666atc_config:	unconfig
667	@./mkconfig $(@:_config=) ppc mpc8260 atc
668
669#########################################################################
670## 74xx/7xx Systems
671#########################################################################
672
673AmigaOneG3SE_config:	unconfig
674	@./mkconfig $(@:_config=) ppc 74xx_7xx AmigaOneG3SE MAI
675
676EVB64260_config	\
677EVB64260_750CX_config:	unconfig
678	@./mkconfig EVB64260 ppc 74xx_7xx evb64260
679
680ZUMA_config:	unconfig
681	@./mkconfig $(@:_config=) ppc 74xx_7xx evb64260
682
683PCIPPC2_config \
684PCIPPC6_config: unconfig
685	@./mkconfig $(@:_config=) ppc 74xx_7xx pcippc2
686
687BAB7xx_config: unconfig
688	@./mkconfig $(@:_config=) ppc 74xx_7xx bab7xx eltec
689
690ELPPC_config: unconfig
691	@./mkconfig $(@:_config=) ppc 74xx_7xx elppc eltec
692
693#========================================================================
694# ARM
695#========================================================================
696#########################################################################
697## StrongARM Systems
698#########################################################################
699
700at91rm9200dk_config	:	unconfig
701	@./mkconfig $(@:_config=) arm at91rm9200 at91rm9200dk
702
703lart_config	:	unconfig
704	@./mkconfig $(@:_config=) arm sa1100 lart
705
706dnp1110_config	:	unconfig
707	@./mkconfig $(@:_config=) arm sa1100 dnp1110
708
709shannon_config	:	unconfig
710	@./mkconfig $(@:_config=) arm sa1100 shannon
711
712#########################################################################
713## ARM920T Systems
714#########################################################################
715
716xtract_trab = $(subst _big_flash,,$(subst _config,,$1))
717
718smdk2400_config	:	unconfig
719	@./mkconfig $(@:_config=) arm arm920t smdk2400
720
721smdk2410_config	:	unconfig
722	@./mkconfig $(@:_config=) arm arm920t smdk2410
723
724trab_config \
725trab_big_flash_config:	unconfig
726	@ >include/config.h
727	@[ -z "$(findstring _big_flash,$@)" ] || \
728		{ echo "#define CONFIG_BIG_FLASH" >>include/config.h ; \
729		  echo "... with big flash support" ; \
730		}
731	@./mkconfig -a $(call xtract_trab,$@) arm arm920t trab
732
733VCMA9_config	:	unconfig
734	@./mkconfig $(@:_config=) arm arm920t vcma9 mpl
735
736#########################################################################
737## ARM720T Systems
738#########################################################################
739
740impa7_config	:	unconfig
741	@./mkconfig $(@:_config=) arm arm720t impa7
742
743ep7312_config	:	unconfig
744	@./mkconfig $(@:_config=) arm arm720t ep7312
745
746#########################################################################
747## XScale Systems
748#########################################################################
749
750cradle_config	:	unconfig
751	@./mkconfig $(@:_config=) arm pxa cradle
752
753csb226_config	:	unconfig
754	@./mkconfig $(@:_config=) arm pxa csb226
755
756innokom_config	:	unconfig
757	@./mkconfig $(@:_config=) arm pxa innokom
758
759lubbock_config	:	unconfig
760	@./mkconfig $(@:_config=) arm pxa lubbock
761
762logodl_config	:	unconfig
763	@./mkconfig $(@:_config=) arm pxa logodl
764
765wepep250_config	:	unconfig
766	@./mkconfig $(@:_config=) arm pxa wepep250
767
768#========================================================================
769# i386
770#========================================================================
771#########################################################################
772## AMD SC520 CDP
773#########################################################################
774sc520_cdp_config	:	unconfig
775	@./mkconfig $(@:_config=) i386 i386 sc520_cdp
776
777sc520_spunk_config	:	unconfig
778	@./mkconfig $(@:_config=) i386 i386 sc520_spunk
779
780sc520_spunk_rel_config	:	unconfig
781	@./mkconfig $(@:_config=) i386 i386 sc520_spunk
782
783#========================================================================
784# MIPS
785#========================================================================
786#########################################################################
787## MIPS32 4Kc
788#########################################################################
789
790incaip_config :		unconfig
791	@./mkconfig $(@:_config=) mips mips incaip
792
793purple_config :		unconfig
794	@./mkconfig $(@:_config=) mips mips purple
795
796#########################################################################
797#########################################################################
798
799clean:
800	find . -type f \
801		\( -name 'core' -o -name '*.bak' -o -name '*~' \
802		-o -name '*.o'  -o -name '*.a'  \) -print \
803		| xargs rm -f
804	rm -f examples/hello_world examples/timer \
805	      examples/eepro100_eeprom examples/sched \
806	      examples/mem_to_mem_idma2intr examples/82559_eeprom
807
808	rm -f tools/img2srec tools/mkimage tools/envcrc tools/gen_eth_addr
809	rm -f tools/easylogo/easylogo tools/bmp_logo
810	rm -f tools/gdb/astest tools/gdb/gdbcont tools/gdb/gdbsend
811	rm -f tools/env/fw_printenv tools/env/fw_setenv
812	rm -f board/cray/L1/bootscript.c board/cray/L1/bootscript.image
813
814clobber:	clean
815	find . -type f \
816		\( -name .depend -o -name '*.srec' -o -name '*.bin' \) \
817		-print \
818		| xargs rm -f
819	rm -f $(OBJS) *.bak tags TAGS
820	rm -fr *.*~
821	rm -f u-boot u-boot.bin u-boot.srec u-boot.map System.map
822	rm -f tools/crc32.c tools/environment.c tools/env/crc32.c
823	rm -f tools/inca-swap-bytes cpu/mpc824x/bedbug_603e.c
824	rm -f include/asm/proc include/asm/arch include/asm
825
826mrproper \
827distclean:	clobber unconfig
828
829backup:
830	F=`basename $(TOPDIR)` ; cd .. ; \
831	gtar --force-local -zcvf `date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
832
833#########################################################################
834