blob: f634880054aba2e9e9e7f62fd2a0b81afa594e3c [file] [log] [blame]
wdenk7ebf7442002-11-02 23:17:16 +00001#
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
wdenk7ebf7442002-11-02 23:17:16 +000056ifeq ($(ARCH),ppc)
57CROSS_COMPILE = ppc_8xx-
58endif
59ifeq ($(ARCH),arm)
wdenkc8434db2003-03-26 06:55:25 +000060CROSS_COMPILE = arm-linux-
wdenk7ebf7442002-11-02 23:17:16 +000061endif
wdenk591dda52002-11-18 00:14:45 +000062ifeq ($(ARCH),i386)
wdenkabda5ca2003-05-31 18:35:21 +000063ifeq ($(HOSTARCH),i386)
64CROSS_COMPILE =
65else
66CROSS_COMPILE = i386-linux-
67endif
wdenk7ebf7442002-11-02 23:17:16 +000068endif
wdenk4a5c8a72003-03-06 00:02:04 +000069ifeq ($(ARCH),mips)
70CROSS_COMPILE = mips_4KC-
wdenk7ebf7442002-11-02 23:17:16 +000071endif
wdenk591dda52002-11-18 00:14:45 +000072endif
wdenk4a5c8a72003-03-06 00:02:04 +000073endif
wdenk7ebf7442002-11-02 23:17:16 +000074
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 \
wdenkeb20ad32003-09-05 23:19:14 +000090 drivers/sk98lin \
wdenk7ebf7442002-11-02 23:17:16 +000091 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
wdenk591dda52002-11-18 00:14:45 +000099ifeq ($(CPU),i386)
100OBJS += cpu/$(CPU)/start16.o
101OBJS += cpu/$(CPU)/reset.o
102endif
wdenk7ebf7442002-11-02 23:17:16 +0000103ifeq ($(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
wdenk7a428cc2003-06-15 22:40:42 +0000110LIBS += fs/jffs2/libjffs2.a fs/fdos/libfdos.a fs/fat/libfat.a
wdenk7ebf7442002-11-02 23:17:16 +0000111LIBS += net/libnet.a
112LIBS += disk/libdisk.a
113LIBS += rtc/librtc.a
114LIBS += dtt/libdtt.a
115LIBS += drivers/libdrivers.a
wdenkeb20ad32003-09-05 23:19:14 +0000116LIBS += drivers/sk98lin/libsk98lin.a
wdenk7ebf7442002-11-02 23:17:16 +0000117LIBS += post/libpost.a post/cpu/libcpu.a
118LIBS += common/libcommon.a
119LIBS += lib_generic/libgeneric.a
120
121#########################################################################
wdenk0a658552003-08-05 17:43:17 +0000122#########################################################################
wdenk7ebf7442002-11-02 23:17:16 +0000123
wdenk0a658552003-08-05 17:43:17 +0000124ALL = u-boot.srec u-boot.bin System.map
wdenk7ebf7442002-11-02 23:17:16 +0000125
wdenk0a658552003-08-05 17:43:17 +0000126all: $(ALL)
wdenk7ebf7442002-11-02 23:17:16 +0000127
128u-boot.srec: u-boot
129 $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
130
131u-boot.bin: u-boot
132 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
133
wdenk0a658552003-08-05 17:43:17 +0000134u-boot.img: u-boot.bin
135 ./tools/mkimage -A $(ARCH) -T firmware -C none \
136 -a $(TEXT_BASE) -e 0 \
137 -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' include/version.h | \
138 sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \
139 -d $< $@
140
wdenk7ebf7442002-11-02 23:17:16 +0000141u-boot.dis: u-boot
142 $(OBJDUMP) -d $< > $@
143
144u-boot: depend subdirs $(OBJS) $(LIBS) $(LDSCRIPT)
wdenk57b2d802003-06-27 21:31:46 +0000145 UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
146 $(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
wdenkeb20ad32003-09-05 23:19:14 +0000147 --start-group $(LIBS) $(PLATFORM_LIBS) --end-group \
wdenk67ff36c2002-11-19 23:01:07 +0000148 -Map u-boot.map -o u-boot
wdenk7ebf7442002-11-02 23:17:16 +0000149
150subdirs:
151 @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir || exit 1 ; done
152
dzu9b10ef982003-08-07 14:20:31 +0000153gdbtools:
154 $(MAKE) -C tools/gdb || exit 1
155
wdenk7ebf7442002-11-02 23:17:16 +0000156depend dep:
157 @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir .depend ; done
158
159tags:
160 ctags -w `find $(SUBDIRS) include \
161 \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
162
163etags:
164 etags -a `find $(SUBDIRS) include \
165 \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
166
167System.map: u-boot
168 @$(NM) $< | \
169 grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
170 sort > System.map
171
172#########################################################################
173else
174all install u-boot u-boot.srec depend dep:
175 @echo "System not configured - see README" >&2
176 @ exit 1
177endif
178
179#########################################################################
180
181unconfig:
182 rm -f include/config.h include/config.mk
183
184#========================================================================
185# PowerPC
186#========================================================================
wdenk359733b2003-03-31 17:27:09 +0000187
188#########################################################################
189## MPC5xx Systems
190#########################################################################
191
192cmi_mpc5xx_config: unconfig
193 @./mkconfig $(@:_config=) ppc mpc5xx cmi
194
wdenk7ebf7442002-11-02 23:17:16 +0000195#########################################################################
wdenk21136db2003-07-16 21:53:01 +0000196## MPC5xxx Systems
197#########################################################################
198IceCube_5200_config \
199IceCube_5100_config: unconfig
200 @ >include/config.h
201 @[ -z "$(findstring _5200,$@)" ] || \
202 { echo "#define CONFIG_MPC5200" >>include/config.h ; \
203 echo "... with MPC5200 processor" ; \
204 }
205 @[ -z "$(findstring _5100,$@)" ] || \
206 { echo "#define CONFIG_MGT5100" >>include/config.h ; \
207 echo "... with MGT5100 processor" ; \
208 }
209 @./mkconfig -a IceCube ppc mpc5xxx icecube
210
211#########################################################################
wdenk7ebf7442002-11-02 23:17:16 +0000212## MPC8xx Systems
213#########################################################################
214
wdenk84650f52003-08-30 00:05:50 +0000215AdderII_config: unconfig
216 @./mkconfig $(@:_config=) ppc mpc8xx adderII
217
wdenk7ebf7442002-11-02 23:17:16 +0000218ADS860_config: unconfig
219 @./mkconfig $(@:_config=) ppc mpc8xx fads
220
221AMX860_config : unconfig
222 @./mkconfig $(@:_config=) ppc mpc8xx amx860 westel
223
224c2mon_config: unconfig
225 @./mkconfig $(@:_config=) ppc mpc8xx c2mon
226
227CCM_config: unconfig
228 @./mkconfig $(@:_config=) ppc mpc8xx CCM siemens
229
230cogent_mpc8xx_config: unconfig
231 @./mkconfig $(@:_config=) ppc mpc8xx cogent
232
wdenkef5fe752003-03-12 10:41:04 +0000233ELPT860_config: unconfig
234 @./mkconfig $(@:_config=) ppc mpc8xx elpt860 LEOX
235
wdenk7ebf7442002-11-02 23:17:16 +0000236ESTEEM192E_config: unconfig
237 @./mkconfig $(@:_config=) ppc mpc8xx esteem192e
238
239ETX094_config : unconfig
240 @./mkconfig $(@:_config=) ppc mpc8xx etx094
241
242FADS823_config \
243FADS850SAR_config \
wdenk2bb11052003-07-17 23:16:40 +0000244MPC86xADS_config \
wdenk7ebf7442002-11-02 23:17:16 +0000245FADS860T_config: unconfig
246 @./mkconfig $(@:_config=) ppc mpc8xx fads
247
248FLAGADM_config: unconfig
249 @./mkconfig $(@:_config=) ppc mpc8xx flagadm
250
wdenk541a76d2003-05-03 15:50:43 +0000251xtract_GEN860T = $(subst _SC,,$(subst _config,,$1))
252
253GEN860T_SC_config \
wdenk7ebf7442002-11-02 23:17:16 +0000254GEN860T_config: unconfig
wdenk541a76d2003-05-03 15:50:43 +0000255 @ >include/config.h
256 @[ -z "$(findstring _SC,$@)" ] || \
257 { echo "#define CONFIG_SC" >>include/config.h ; \
258 echo "With reduced H/W feature set (SC)..." ; \
259 }
260 @./mkconfig -a $(call xtract_GEN860T,$@) ppc mpc8xx gen860t
wdenk7ebf7442002-11-02 23:17:16 +0000261
262GENIETV_config: unconfig
263 @./mkconfig $(@:_config=) ppc mpc8xx genietv
264
265GTH_config: unconfig
266 @./mkconfig $(@:_config=) ppc mpc8xx gth
267
268hermes_config : unconfig
269 @./mkconfig $(@:_config=) ppc mpc8xx hermes
270
271IAD210_config: unconfig
272 @./mkconfig $(@:_config=) ppc mpc8xx IAD210 siemens
273
274xtract_ICU862 = $(subst _100MHz,,$(subst _config,,$1))
275
276ICU862_100MHz_config \
277ICU862_config: unconfig
278 @ >include/config.h
279 @[ -z "$(findstring _100MHz,$@)" ] || \
280 { echo "#define CONFIG_100MHz" >>include/config.h ; \
281 echo "... with 100MHz system clock" ; \
282 }
283 @./mkconfig -a $(call xtract_ICU862,$@) ppc mpc8xx icu862
284
285IP860_config : unconfig
286 @./mkconfig $(@:_config=) ppc mpc8xx ip860
287
288IVML24_256_config \
289IVML24_128_config \
290IVML24_config: unconfig
291 @ >include/config.h
292 @[ -z "$(findstring IVML24_config,$@)" ] || \
293 { echo "#define CONFIG_IVML24_16M" >>include/config.h ; \
294 }
295 @[ -z "$(findstring IVML24_128_config,$@)" ] || \
296 { echo "#define CONFIG_IVML24_32M" >>include/config.h ; \
297 }
298 @[ -z "$(findstring IVML24_256_config,$@)" ] || \
299 { echo "#define CONFIG_IVML24_64M" >>include/config.h ; \
300 }
301 @./mkconfig -a IVML24 ppc mpc8xx ivm
302
303IVMS8_256_config \
304IVMS8_128_config \
305IVMS8_config: unconfig
306 @ >include/config.h
307 @[ -z "$(findstring IVMS8_config,$@)" ] || \
308 { echo "#define CONFIG_IVMS8_16M" >>include/config.h ; \
309 }
310 @[ -z "$(findstring IVMS8_128_config,$@)" ] || \
311 { echo "#define CONFIG_IVMS8_32M" >>include/config.h ; \
312 }
313 @[ -z "$(findstring IVMS8_256_config,$@)" ] || \
314 { echo "#define CONFIG_IVMS8_64M" >>include/config.h ; \
315 }
316 @./mkconfig -a IVMS8 ppc mpc8xx ivm
317
wdenk56f94be2002-11-05 16:35:14 +0000318KUP4K_config : unconfig
319 @./mkconfig $(@:_config=) ppc mpc8xx kup4k
320
wdenk7ebf7442002-11-02 23:17:16 +0000321LANTEC_config : unconfig
322 @./mkconfig $(@:_config=) ppc mpc8xx lantec
323
324lwmon_config: unconfig
325 @./mkconfig $(@:_config=) ppc mpc8xx lwmon
326
327MBX_config \
328MBX860T_config: unconfig
329 @./mkconfig $(@:_config=) ppc mpc8xx mbx8xx
330
331MHPC_config: unconfig
332 @./mkconfig $(@:_config=) ppc mpc8xx mhpc eltec
333
334MVS1_config : unconfig
335 @./mkconfig $(@:_config=) ppc mpc8xx mvs1
336
wdenk70764a32003-06-26 22:04:09 +0000337xtract_NETVIA = $(subst _V2,,$(subst _config,,$1))
338
339NETVIA_V2_config \
wdenk7ebf7442002-11-02 23:17:16 +0000340NETVIA_config: unconfig
wdenk70764a32003-06-26 22:04:09 +0000341 @ >include/config.h
342 @[ -z "$(findstring NETVIA_config,$@)" ] || \
343 { echo "#define CONFIG_NETVIA_VERSION 1" >>include/config.h ; \
344 echo "... Version 1" ; \
345 }
346 @[ -z "$(findstring NETVIA_V2_config,$@)" ] || \
347 { echo "#define CONFIG_NETVIA_VERSION 2" >>include/config.h ; \
348 echo "... Version 2" ; \
349 }
350 @./mkconfig -a $(call xtract_NETVIA,$@) ppc mpc8xx netvia
wdenk7ebf7442002-11-02 23:17:16 +0000351
352NX823_config: unconfig
353 @./mkconfig $(@:_config=) ppc mpc8xx nx823
354
355pcu_e_config: unconfig
356 @./mkconfig $(@:_config=) ppc mpc8xx pcu_e siemens
357
358R360MPI_config: unconfig
359 @./mkconfig $(@:_config=) ppc mpc8xx r360mpi
360
wdenk4e112c12003-06-03 23:54:09 +0000361RBC823_config: unconfig
362 @./mkconfig $(@:_config=) ppc mpc8xx rbc823
363
wdenk7ebf7442002-11-02 23:17:16 +0000364RPXClassic_config: unconfig
365 @./mkconfig $(@:_config=) ppc mpc8xx RPXClassic
366
367RPXlite_config: unconfig
368 @./mkconfig $(@:_config=) ppc mpc8xx RPXlite
369
wdenke6466f62003-06-05 19:27:42 +0000370rmu_config: unconfig
371 @./mkconfig $(@:_config=) ppc mpc8xx rmu
372
wdenk7ebf7442002-11-02 23:17:16 +0000373RRvision_config: unconfig
374 @./mkconfig $(@:_config=) ppc mpc8xx RRvision
375
376RRvision_LCD_config: unconfig
377 @echo "#define CONFIG_LCD" >include/config.h
378 @echo "#define CONFIG_SHARP_LQ104V7DS01" >>include/config.h
379 @./mkconfig -a RRvision ppc mpc8xx RRvision
380
381SM850_config : unconfig
382 @./mkconfig $(@:_config=) ppc mpc8xx tqm8xx
383
384SPD823TS_config: unconfig
385 @./mkconfig $(@:_config=) ppc mpc8xx spd8xx
386
wdenkc8434db2003-03-26 06:55:25 +0000387svm_sc8xx_config: unconfig
388 @ >include/config.h
389 @./mkconfig $(@:_config=) ppc mpc8xx svm_sc8xx
390
wdenk7ebf7442002-11-02 23:17:16 +0000391SXNI855T_config: unconfig
392 @./mkconfig $(@:_config=) ppc mpc8xx sixnet
393
wdenkb666c8f2003-03-06 00:58:30 +0000394# EMK MPC8xx based modules
395TOP860_config: unconfig
396 @./mkconfig $(@:_config=) ppc mpc8xx top860 emk
397
wdenk7ebf7442002-11-02 23:17:16 +0000398# Play some tricks for configuration selection
wdenke6466f62003-06-05 19:27:42 +0000399# All boards can come with 50 MHz (default), 66MHz, 80MHz or 100 MHz clock,
wdenk7ebf7442002-11-02 23:17:16 +0000400# but only 855 and 860 boards may come with FEC
401# and 823 boards may have LCD support
wdenke6466f62003-06-05 19:27:42 +0000402xtract_8xx = $(subst _66MHz,,$(subst _80MHz,,$(subst _100MHz,,$(subst _LCD,,$(subst _config,,$1)))))
wdenk7ebf7442002-11-02 23:17:16 +0000403
404FPS850L_config \
wdenk384ae022002-11-05 00:17:55 +0000405FPS860L_config \
wdenk69141282003-07-07 20:07:54 +0000406NSCU_config \
wdenk7ebf7442002-11-02 23:17:16 +0000407TQM823L_config \
408TQM823L_66MHz_config \
409TQM823L_80MHz_config \
410TQM823L_LCD_config \
411TQM823L_LCD_66MHz_config \
412TQM823L_LCD_80MHz_config \
413TQM850L_config \
414TQM850L_66MHz_config \
415TQM850L_80MHz_config \
416TQM855L_config \
417TQM855L_66MHz_config \
418TQM855L_80MHz_config \
wdenk7ebf7442002-11-02 23:17:16 +0000419TQM860L_config \
420TQM860L_66MHz_config \
421TQM860L_80MHz_config \
wdenk6bd14892003-04-10 11:18:18 +0000422TQM862L_config \
423TQM862L_66MHz_config \
wdenke6466f62003-06-05 19:27:42 +0000424TQM862L_80MHz_config \
wdenkfb229ae2003-08-07 22:18:11 +0000425TQM823M_config \
426TQM823M_66MHz_config \
427TQM823M_80MHz_config \
428TQM850M_config \
429TQM850M_66MHz_config \
430TQM850M_80MHz_config \
wdenk69141282003-07-07 20:07:54 +0000431TQM855M_config \
432TQM855M_66MHz_config \
433TQM855M_80MHz_config \
434TQM860M_config \
435TQM860M_66MHz_config \
436TQM860M_80MHz_config \
437TQM862M_config \
438TQM862M_66MHz_config \
439TQM862M_80MHz_config \
wdenk7a428cc2003-06-15 22:40:42 +0000440TQM862M_100MHz_config: unconfig
wdenk7ebf7442002-11-02 23:17:16 +0000441 @ >include/config.h
wdenk7ebf7442002-11-02 23:17:16 +0000442 @[ -z "$(findstring _66MHz,$@)" ] || \
443 { echo "#define CONFIG_66MHz" >>include/config.h ; \
444 echo "... with 66MHz system clock" ; \
445 }
446 @[ -z "$(findstring _80MHz,$@)" ] || \
447 { echo "#define CONFIG_80MHz" >>include/config.h ; \
448 echo "... with 80MHz system clock" ; \
449 }
wdenke6466f62003-06-05 19:27:42 +0000450 @[ -z "$(findstring _100MHz,$@)" ] || \
451 { echo "#define CONFIG_100MHz" >>include/config.h ; \
452 echo "... with 100MHz system clock" ; \
453 }
wdenk7ebf7442002-11-02 23:17:16 +0000454 @[ -z "$(findstring _LCD,$@)" ] || \
455 { echo "#define CONFIG_LCD" >>include/config.h ; \
456 echo "#define CONFIG_NEC_NL6648BC20" >>include/config.h ; \
457 echo "... with LCD display" ; \
458 }
459 @./mkconfig -a $(call xtract_8xx,$@) ppc mpc8xx tqm8xx
460
461TTTech_config: unconfig
462 @echo "#define CONFIG_LCD" >include/config.h
463 @echo "#define CONFIG_SHARP_LQ104V7DS01" >>include/config.h
464 @./mkconfig -a TQM823L ppc mpc8xx tqm8xx
465
wdenk2dad91b2003-01-13 23:54:46 +0000466v37_config: unconfig
467 @echo "#define CONFIG_LCD" >include/config.h
468 @echo "#define CONFIG_SHARP_LQ084V1DG21" >>include/config.h
469 @./mkconfig $(@:_config=) ppc mpc8xx v37
470
wdenk7ebf7442002-11-02 23:17:16 +0000471#########################################################################
472## PPC4xx Systems
473#########################################################################
474
475ADCIOP_config: unconfig
476 @./mkconfig $(@:_config=) ppc ppc4xx adciop esd
477
478AR405_config: unconfig
479 @./mkconfig $(@:_config=) ppc ppc4xx ar405 esd
480
stroesebfcc82b2003-05-23 11:41:44 +0000481ASH405_config: unconfig
482 @./mkconfig $(@:_config=) ppc ppc4xx ash405 esd
483
484BUBINGA405EP_config:unconfig
485 @./mkconfig $(@:_config=) ppc ppc4xx bubinga405ep
486
wdenk7ebf7442002-11-02 23:17:16 +0000487CANBT_config: unconfig
488 @./mkconfig $(@:_config=) ppc ppc4xx canbt esd
489
stroesebfcc82b2003-05-23 11:41:44 +0000490CPCI405_config \
491CPCI4052_config \
492CPCI405AB_config: unconfig
wdenk7ebf7442002-11-02 23:17:16 +0000493 @./mkconfig $(@:_config=) ppc ppc4xx cpci405 esd
494 @echo "BOARD_REVISION = $(@:_config=)" >>include/config.mk
495
496CPCI440_config: unconfig
497 @./mkconfig $(@:_config=) ppc ppc4xx cpci440 esd
498
499CPCIISER4_config: unconfig
500 @./mkconfig $(@:_config=) ppc ppc4xx cpciiser4 esd
501
502CRAYL1_config:unconfig
503 @./mkconfig $(@:_config=) ppc ppc4xx L1 cray
504
505DASA_SIM_config: unconfig
506 @./mkconfig $(@:_config=) ppc ppc4xx dasa_sim esd
507
508DU405_config: unconfig
509 @./mkconfig $(@:_config=) ppc ppc4xx du405 esd
510
511EBONY_config:unconfig
512 @./mkconfig $(@:_config=) ppc ppc4xx ebony
513
514ERIC_config:unconfig
515 @./mkconfig $(@:_config=) ppc ppc4xx eric
516
wdenkd9fce812003-06-28 17:24:46 +0000517EXBITGEN_config:unconfig
518 @./mkconfig $(@:_config=) ppc ppc4xx exbitgen
519
wdenk7ebf7442002-11-02 23:17:16 +0000520MIP405_config:unconfig
521 @./mkconfig $(@:_config=) ppc ppc4xx mip405 mpl
522
wdenke39c2842003-06-04 15:05:30 +0000523MIP405T_config:unconfig
524 @echo "#define CONFIG_MIP405T" >include/config.h
525 @echo "Enable subset config for MIP405T"
526 @./mkconfig -a MIP405 ppc ppc4xx mip405 mpl
527
wdenk7ebf7442002-11-02 23:17:16 +0000528ML2_config:unconfig
529 @./mkconfig $(@:_config=) ppc ppc4xx ml2
530
531OCRTC_config \
532ORSG_config: unconfig
533 @./mkconfig $(@:_config=) ppc ppc4xx ocrtc esd
534
535PCI405_config: unconfig
536 @./mkconfig $(@:_config=) ppc ppc4xx pci405 esd
537
538PIP405_config:unconfig
539 @./mkconfig $(@:_config=) ppc ppc4xx pip405 mpl
540
stroesebfcc82b2003-05-23 11:41:44 +0000541PMC405_config: unconfig
542 @./mkconfig $(@:_config=) ppc ppc4xx pmc405 esd
543
wdenk232fe0b2003-09-02 22:48:03 +0000544PPChameleonEVB_config: unconfig
545 @./mkconfig $(@:_config=) ppc ppc4xx PPChameleonEVB dave
546
wdenk7ebf7442002-11-02 23:17:16 +0000547W7OLMC_config \
548W7OLMG_config: unconfig
549 @./mkconfig $(@:_config=) ppc ppc4xx w7o
550
551WALNUT405_config:unconfig
552 @./mkconfig $(@:_config=) ppc ppc4xx walnut405
553
554#########################################################################
555## MPC824x Systems
556#########################################################################
wdenkef5fe752003-03-12 10:41:04 +0000557xtract_82xx = $(subst _ROMBOOT,,$(subst _L2,,$(subst _266MHz,,$(subst _300MHz,,$(subst _config,,$1)))))
558
wdenk8aeb24e2003-06-20 22:36:30 +0000559A3000_config: unconfig
560 @./mkconfig $(@:_config=) ppc mpc824x a3000
561
wdenk7ebf7442002-11-02 23:17:16 +0000562BMW_config: unconfig
563 @./mkconfig $(@:_config=) ppc mpc824x bmw
564
wdenkef5fe752003-03-12 10:41:04 +0000565CPC45_config \
566CPC45_ROMBOOT_config: unconfig
567 @./mkconfig $(call xtract_82xx,$@) ppc mpc824x cpc45
568 @cd ./include ; \
569 if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
570 echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
571 echo "... booting from 8-bit flash" ; \
572 else \
573 echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
574 echo "... booting from 64-bit flash" ; \
575 fi; \
576 echo "export CONFIG_BOOT_ROM" >> config.mk;
577
wdenk7ebf7442002-11-02 23:17:16 +0000578CU824_config: unconfig
579 @./mkconfig $(@:_config=) ppc mpc824x cu824
580
581MOUSSE_config: unconfig
582 @./mkconfig $(@:_config=) ppc mpc824x mousse
583
584MUSENKI_config: unconfig
585 @./mkconfig $(@:_config=) ppc mpc824x musenki
586
587OXC_config: unconfig
588 @./mkconfig $(@:_config=) ppc mpc824x oxc
589
590PN62_config: unconfig
591 @./mkconfig $(@:_config=) ppc mpc824x pn62
592
593Sandpoint8240_config: unconfig
594 @./mkconfig $(@:_config=) ppc mpc824x sandpoint
595
596Sandpoint8245_config: unconfig
597 @./mkconfig $(@:_config=) ppc mpc824x sandpoint
598
wdenkd9fce812003-06-28 17:24:46 +0000599SL8245_config: unconfig
600 @./mkconfig $(@:_config=) ppc mpc824x sl8245
601
wdenk7ebf7442002-11-02 23:17:16 +0000602utx8245_config: unconfig
603 @./mkconfig $(@:_config=) ppc mpc824x utx8245
604
605#########################################################################
606## MPC8260 Systems
607#########################################################################
wdenk7ebf7442002-11-02 23:17:16 +0000608
609cogent_mpc8260_config: unconfig
610 @./mkconfig $(@:_config=) ppc mpc8260 cogent
611
612CPU86_config \
613CPU86_ROMBOOT_config: unconfig
614 @./mkconfig $(call xtract_82xx,$@) ppc mpc8260 cpu86
615 @cd ./include ; \
616 if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
617 echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
618 echo "... booting from 8-bit flash" ; \
619 else \
620 echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
621 echo "... booting from 64-bit flash" ; \
622 fi; \
623 echo "export CONFIG_BOOT_ROM" >> config.mk;
624
625ep8260_config: unconfig
626 @./mkconfig $(@:_config=) ppc mpc8260 ep8260
627
628gw8260_config: unconfig
629 @./mkconfig $(@:_config=) ppc mpc8260 gw8260
630
631hymod_config: unconfig
632 @./mkconfig $(@:_config=) ppc mpc8260 hymod
633
634IPHASE4539_config: unconfig
635 @./mkconfig $(@:_config=) ppc mpc8260 iphase4539
636
637MPC8260ADS_config: unconfig
638 @./mkconfig $(@:_config=) ppc mpc8260 mpc8260ads
639
wdenkb666c8f2003-03-06 00:58:30 +0000640MPC8266ADS_config: unconfig
641 @./mkconfig $(@:_config=) ppc mpc8260 mpc8266ads
642
wdenk4b57dcc2003-03-25 18:06:06 +0000643PM825_config \
644PM825_ROMBOOT_config: unconfig
645 @echo "#define CONFIG_PCI" >include/config.h
646 @./mkconfig -a PM826 ppc mpc8260 pm826
647 @cd ./include ; \
648 if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
649 echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
650 echo "... booting from 8-bit flash" ; \
651 else \
652 echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
653 echo "... booting from 64-bit flash" ; \
654 fi; \
655 echo "export CONFIG_BOOT_ROM" >> config.mk; \
656
wdenk7ebf7442002-11-02 23:17:16 +0000657PM826_config \
658PM826_ROMBOOT_config: unconfig
659 @./mkconfig $(call xtract_82xx,$@) ppc mpc8260 pm826
660 @cd ./include ; \
661 if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
662 echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
663 echo "... booting from 8-bit flash" ; \
664 else \
665 echo "CONFIG_BOOT_ROM = n" >> config.mk ; \
666 echo "... booting from 64-bit flash" ; \
667 fi; \
668 echo "export CONFIG_BOOT_ROM" >> config.mk; \
669
670ppmc8260_config: unconfig
671 @./mkconfig $(@:_config=) ppc mpc8260 ppmc8260
672
673RPXsuper_config: unconfig
674 @./mkconfig $(@:_config=) ppc mpc8260 rpxsuper
675
676rsdproto_config: unconfig
677 @./mkconfig $(@:_config=) ppc mpc8260 rsdproto
678
679sacsng_config: unconfig
680 @./mkconfig $(@:_config=) ppc mpc8260 sacsng
681
682sbc8260_config: unconfig
683 @./mkconfig $(@:_config=) ppc mpc8260 sbc8260
684
685SCM_config: unconfig
686 @./mkconfig $(@:_config=) ppc mpc8260 SCM siemens
687
wdenk874ac262003-07-24 23:38:38 +0000688TQM8255_AA_config \
689TQM8260_AA_config \
690TQM8260_AB_config \
691TQM8260_AC_config \
692TQM8260_AD_config \
693TQM8260_AE_config \
694TQM8260_AF_config \
695TQM8260_AG_config \
696TQM8260_AH_config \
697TQM8265_AA_config: unconfig
698 @case "$@" in \
699 TQM8255_AA_config) CTYPE=MPC8255; CFREQ=300; CACHE=no; BMODE=8260;; \
700 TQM8260_AA_config) CTYPE=MPC8260; CFREQ=200; CACHE=no; BMODE=8260;; \
701 TQM8260_AB_config) CTYPE=MPC8260; CFREQ=200; CACHE=yes; BMODE=60x;; \
702 TQM8260_AC_config) CTYPE=MPC8260; CFREQ=200; CACHE=yes; BMODE=60x;; \
703 TQM8260_AD_config) CTYPE=MPC8260; CFREQ=300; CACHE=no; BMODE=60x;; \
704 TQM8260_AE_config) CTYPE=MPC8260; CFREQ=266; CACHE=no; BMODE=8260;; \
705 TQM8260_AF_config) CTYPE=MPC8260; CFREQ=300; CACHE=no; BMODE=60x;; \
706 TQM8260_AG_config) CTYPE=MPC8260; CFREQ=300; CACHE=no; BMODE=8260;; \
707 TQM8260_AH_config) CTYPE=MPC8260; CFREQ=300; CACHE=yes; BMODE=60x;; \
708 TQM8265_AA_config) CTYPE=MPC8265; CFREQ=300; CACHE=no; BMODE=60x;; \
709 esac; \
710 >include/config.h ; \
711 if [ "$${CTYPE}" != "MPC8260" ] ; then \
712 echo "#define CONFIG_$${CTYPE}" >>include/config.h ; \
713 fi; \
714 echo "#define CONFIG_$${CFREQ}MHz" >>include/config.h ; \
715 echo "... with $${CFREQ}MHz system clock" ; \
716 if [ "$${CACHE}" == "yes" ] ; then \
wdenk7ebf7442002-11-02 23:17:16 +0000717 echo "#define CONFIG_L2_CACHE" >>include/config.h ; \
wdenk874ac262003-07-24 23:38:38 +0000718 echo "... with L2 Cache support" ; \
wdenk7ebf7442002-11-02 23:17:16 +0000719 else \
720 echo "#undef CONFIG_L2_CACHE" >>include/config.h ; \
721 echo "... without L2 Cache support" ; \
wdenk874ac262003-07-24 23:38:38 +0000722 fi; \
723 if [ "$${BMODE}" == "60x" ] ; then \
724 echo "#define CONFIG_BUSMODE_60x" >>include/config.h ; \
725 echo "... with 60x Bus Mode" ; \
726 else \
727 echo "#undef CONFIG_BUSMODE_60x" >>include/config.h ; \
728 echo "... without 60x Bus Mode" ; \
wdenk7ebf7442002-11-02 23:17:16 +0000729 fi
wdenkc08f1582003-04-27 22:52:51 +0000730 @./mkconfig -a TQM8260 ppc mpc8260 tqm8260
wdenk7ebf7442002-11-02 23:17:16 +0000731
wdenk541a76d2003-05-03 15:50:43 +0000732atc_config: unconfig
733 @./mkconfig $(@:_config=) ppc mpc8260 atc
734
wdenk7ebf7442002-11-02 23:17:16 +0000735#########################################################################
736## 74xx/7xx Systems
737#########################################################################
738
wdenk452cfd62002-11-19 11:04:11 +0000739AmigaOneG3SE_config: unconfig
740 @./mkconfig $(@:_config=) ppc 74xx_7xx AmigaOneG3SE MAI
741
wdenk7ebf7442002-11-02 23:17:16 +0000742EVB64260_config \
743EVB64260_750CX_config: unconfig
744 @./mkconfig EVB64260 ppc 74xx_7xx evb64260
745
746ZUMA_config: unconfig
747 @./mkconfig $(@:_config=) ppc 74xx_7xx evb64260
748
749PCIPPC2_config \
750PCIPPC6_config: unconfig
751 @./mkconfig $(@:_config=) ppc 74xx_7xx pcippc2
752
753BAB7xx_config: unconfig
754 @./mkconfig $(@:_config=) ppc 74xx_7xx bab7xx eltec
755
756ELPPC_config: unconfig
757 @./mkconfig $(@:_config=) ppc 74xx_7xx elppc eltec
758
wdenk232fe0b2003-09-02 22:48:03 +0000759P3G4_config: unconfig
760 @./mkconfig $(@:_config=) ppc 74xx_7xx evb64260
761
wdenk7ebf7442002-11-02 23:17:16 +0000762#========================================================================
763# ARM
764#========================================================================
765#########################################################################
766## StrongARM Systems
767#########################################################################
768
wdenkc8434db2003-03-26 06:55:25 +0000769at91rm9200dk_config : unconfig
770 @./mkconfig $(@:_config=) arm at91rm9200 at91rm9200dk
771
wdenk7ebf7442002-11-02 23:17:16 +0000772lart_config : unconfig
773 @./mkconfig $(@:_config=) arm sa1100 lart
774
775dnp1110_config : unconfig
776 @./mkconfig $(@:_config=) arm sa1100 dnp1110
777
778shannon_config : unconfig
779 @./mkconfig $(@:_config=) arm sa1100 shannon
780
781#########################################################################
wdenkf6f96f72003-07-15 20:04:06 +0000782## ARM92xT Systems
wdenk7ebf7442002-11-02 23:17:16 +0000783#########################################################################
784
wdenk4a5c8a72003-03-06 00:02:04 +0000785xtract_trab = $(subst _big_flash,,$(subst _config,,$1))
786
wdenkf6f96f72003-07-15 20:04:06 +0000787omap1510inn_config : unconfig
788 @./mkconfig $(@:_config=) arm arm925t omap1510inn
789
wdenk7eaacc52003-08-29 22:00:43 +0000790omap1610inn_config : unconfig
791 @./mkconfig $(@:_config=) arm arm926ejs omap1610inn
792
wdenk7ebf7442002-11-02 23:17:16 +0000793smdk2400_config : unconfig
794 @./mkconfig $(@:_config=) arm arm920t smdk2400
795
796smdk2410_config : unconfig
797 @./mkconfig $(@:_config=) arm arm920t smdk2410
798
wdenk4a5c8a72003-03-06 00:02:04 +0000799trab_config \
800trab_big_flash_config: unconfig
801 @ >include/config.h
802 @[ -z "$(findstring _big_flash,$@)" ] || \
803 { echo "#define CONFIG_BIG_FLASH" >>include/config.h ; \
804 echo "... with big flash support" ; \
805 }
806 @./mkconfig -a $(call xtract_trab,$@) arm arm920t trab
wdenk7ebf7442002-11-02 23:17:16 +0000807
wdenk1fe2c702003-03-06 21:55:29 +0000808VCMA9_config : unconfig
809 @./mkconfig $(@:_config=) arm arm920t vcma9 mpl
810
wdenk7ebf7442002-11-02 23:17:16 +0000811#########################################################################
812## ARM720T Systems
813#########################################################################
814
815impa7_config : unconfig
816 @./mkconfig $(@:_config=) arm arm720t impa7
817
818ep7312_config : unconfig
819 @./mkconfig $(@:_config=) arm arm720t ep7312
820
821#########################################################################
wdenk4a5c8a72003-03-06 00:02:04 +0000822## XScale Systems
wdenk7ebf7442002-11-02 23:17:16 +0000823#########################################################################
824
wdenk7ebf7442002-11-02 23:17:16 +0000825cradle_config : unconfig
wdenk57b2d802003-06-27 21:31:46 +0000826 @./mkconfig $(@:_config=) arm pxa cradle
wdenk7ebf7442002-11-02 23:17:16 +0000827
828csb226_config : unconfig
wdenk0463e042003-05-23 12:36:20 +0000829 @./mkconfig $(@:_config=) arm pxa csb226
wdenk7ebf7442002-11-02 23:17:16 +0000830
wdenk4a5c8a72003-03-06 00:02:04 +0000831innokom_config : unconfig
wdenk0463e042003-05-23 12:36:20 +0000832 @./mkconfig $(@:_config=) arm pxa innokom
wdenk4a5c8a72003-03-06 00:02:04 +0000833
834lubbock_config : unconfig
wdenk0463e042003-05-23 12:36:20 +0000835 @./mkconfig $(@:_config=) arm pxa lubbock
wdenk4a5c8a72003-03-06 00:02:04 +0000836
wdenk88e72a32003-06-19 23:04:19 +0000837logodl_config : unconfig
838 @./mkconfig $(@:_config=) arm pxa logodl
839
wdenkb02744a2003-04-05 00:53:31 +0000840wepep250_config : unconfig
wdenk0463e042003-05-23 12:36:20 +0000841 @./mkconfig $(@:_config=) arm pxa wepep250
wdenkb02744a2003-04-05 00:53:31 +0000842
wdenk591dda52002-11-18 00:14:45 +0000843#========================================================================
844# i386
845#========================================================================
846#########################################################################
wdenk1fe2c702003-03-06 21:55:29 +0000847## AMD SC520 CDP
wdenk591dda52002-11-18 00:14:45 +0000848#########################################################################
849sc520_cdp_config : unconfig
850 @./mkconfig $(@:_config=) i386 i386 sc520_cdp
851
wdenkabda5ca2003-05-31 18:35:21 +0000852sc520_spunk_config : unconfig
853 @./mkconfig $(@:_config=) i386 i386 sc520_spunk
854
855sc520_spunk_rel_config : unconfig
856 @./mkconfig $(@:_config=) i386 i386 sc520_spunk
857
wdenk4a5c8a72003-03-06 00:02:04 +0000858#========================================================================
859# MIPS
860#========================================================================
wdenk7ebf7442002-11-02 23:17:16 +0000861#########################################################################
wdenk4a5c8a72003-03-06 00:02:04 +0000862## MIPS32 4Kc
863#########################################################################
864
wdenk5d841732003-08-17 18:55:18 +0000865xtract_incaip = $(subst _100MHz,,$(subst _133MHz,,$(subst _150MHz,,$(subst _config,,$1))))
866
867incaip_100MHz_config \
868incaip_133MHz_config \
869incaip_150MHz_config \
870incaip_config: unconfig
871 @ >include/config.h
872 @[ -z "$(findstring _100MHz,$@)" ] || \
873 { echo "#define CPU_CLOCK_RATE 100000000" >>include/config.h ; \
874 echo "... with 100MHz system clock" ; \
875 }
876 @[ -z "$(findstring _133MHz,$@)" ] || \
877 { echo "#define CPU_CLOCK_RATE 133000000" >>include/config.h ; \
878 echo "... with 133MHz system clock" ; \
879 }
880 @[ -z "$(findstring _150MHz,$@)" ] || \
881 { echo "#define CPU_CLOCK_RATE 150000000" >>include/config.h ; \
882 echo "... with 150MHz system clock" ; \
883 }
884 @./mkconfig -a $(call xtract_incaip,$@) mips mips incaip
885
886#########################################################################
887## MIPS64 5Kc
888#########################################################################
wdenk4a5c8a72003-03-06 00:02:04 +0000889
wdenkb02744a2003-04-05 00:53:31 +0000890purple_config : unconfig
891 @./mkconfig $(@:_config=) mips mips purple
wdenk4a5c8a72003-03-06 00:02:04 +0000892
wdenkb02744a2003-04-05 00:53:31 +0000893#########################################################################
894#########################################################################
wdenk7ebf7442002-11-02 23:17:16 +0000895
896clean:
897 find . -type f \
898 \( -name 'core' -o -name '*.bak' -o -name '*~' \
899 -o -name '*.o' -o -name '*.a' \) -print \
900 | xargs rm -f
wdenk8dba0502003-03-31 16:34:49 +0000901 rm -f examples/hello_world examples/timer \
wdenkb02744a2003-04-05 00:53:31 +0000902 examples/eepro100_eeprom examples/sched \
wdenkabda5ca2003-05-31 18:35:21 +0000903 examples/mem_to_mem_idma2intr examples/82559_eeprom
904
wdenk7ebf7442002-11-02 23:17:16 +0000905 rm -f tools/img2srec tools/mkimage tools/envcrc tools/gen_eth_addr
906 rm -f tools/easylogo/easylogo tools/bmp_logo
907 rm -f tools/gdb/astest tools/gdb/gdbcont tools/gdb/gdbsend
wdenk9dfa8d12002-12-08 09:53:23 +0000908 rm -f tools/env/fw_printenv tools/env/fw_setenv
wdenk0893c472003-05-20 14:25:27 +0000909 rm -f board/cray/L1/bootscript.c board/cray/L1/bootscript.image
wdenk7ebf7442002-11-02 23:17:16 +0000910
911clobber: clean
912 find . -type f \
913 \( -name .depend -o -name '*.srec' -o -name '*.bin' \) \
914 -print \
915 | xargs rm -f
916 rm -f $(OBJS) *.bak tags TAGS
917 rm -fr *.*~
wdenk0a658552003-08-05 17:43:17 +0000918 rm -f u-boot u-boot.map $(ALL)
wdenk9dfa8d12002-12-08 09:53:23 +0000919 rm -f tools/crc32.c tools/environment.c tools/env/crc32.c
wdenkb02744a2003-04-05 00:53:31 +0000920 rm -f tools/inca-swap-bytes cpu/mpc824x/bedbug_603e.c
wdenkbb2d9272003-06-25 22:26:29 +0000921 rm -f include/asm/proc include/asm/arch include/asm
wdenk7ebf7442002-11-02 23:17:16 +0000922
923mrproper \
924distclean: clobber unconfig
925
926backup:
927 F=`basename $(TOPDIR)` ; cd .. ; \
928 gtar --force-local -zcvf `date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
929
930#########################################################################