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