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