]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - Makefile
* Patch by Gary Jennejohn, 11 Sep 2003:
[karo-tx-uboot.git] / Makefile
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
24 HOSTARCH := $(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
32 HOSTOS := $(shell uname -s | tr A-Z a-z | \
33             sed -e 's/\(cygwin\).*/cygwin/')
34
35 export  HOSTARCH
36
37 # Deal with colliding definitions from tcsh etc.
38 VENDOR=
39
40 #########################################################################
41
42 TOPDIR  := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
43 export  TOPDIR
44
45 ifeq (include/config.mk,$(wildcard include/config.mk))
46 # load ARCH, BOARD, and CPU configuration
47 include include/config.mk
48 export  ARCH CPU BOARD VENDOR
49 # load other configuration
50 include $(TOPDIR)/config.mk
51
52 ifndef CROSS_COMPILE
53 ifeq ($(HOSTARCH),ppc)
54 CROSS_COMPILE =
55 else
56 ifeq ($(ARCH),ppc)
57 CROSS_COMPILE = ppc_8xx-
58 endif
59 ifeq ($(ARCH),arm)
60 CROSS_COMPILE = arm-linux-
61 endif
62 ifeq ($(ARCH),i386)
63 ifeq ($(HOSTARCH),i386)
64 CROSS_COMPILE =
65 else
66 CROSS_COMPILE = i386-linux-
67 endif
68 endif
69 ifeq ($(ARCH),mips)
70 CROSS_COMPILE = mips_4KC-
71 endif
72 endif
73 endif
74
75 export  CROSS_COMPILE
76
77 # The "tools" are needed early, so put this first
78 SUBDIRS = 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
98 OBJS  = cpu/$(CPU)/start.o
99 ifeq ($(CPU),i386)
100 OBJS += cpu/$(CPU)/start16.o
101 OBJS += cpu/$(CPU)/reset.o
102 endif
103 ifeq ($(CPU),ppc4xx)
104 OBJS += cpu/$(CPU)/resetvec.o
105 endif
106
107 LIBS  = board/$(BOARDDIR)/lib$(BOARD).a
108 LIBS += cpu/$(CPU)/lib$(CPU).a
109 LIBS += lib_$(ARCH)/lib$(ARCH).a
110 LIBS += fs/jffs2/libjffs2.a fs/fdos/libfdos.a fs/fat/libfat.a
111 LIBS += net/libnet.a
112 LIBS += disk/libdisk.a
113 LIBS += rtc/librtc.a
114 LIBS += dtt/libdtt.a
115 LIBS += drivers/libdrivers.a
116 LIBS += drivers/sk98lin/libsk98lin.a
117 LIBS += post/libpost.a post/cpu/libcpu.a
118 LIBS += common/libcommon.a
119 LIBS += lib_generic/libgeneric.a
120
121 #########################################################################
122 #########################################################################
123
124 ALL = u-boot.srec u-boot.bin System.map
125
126 all:            $(ALL)
127
128 u-boot.srec:    u-boot
129                 $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
130
131 u-boot.bin:     u-boot
132                 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
133
134 u-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
141 u-boot.dis:     u-boot
142                 $(OBJDUMP) -d $< > $@
143
144 u-boot:         depend subdirs $(OBJS) $(LIBS) $(LDSCRIPT)
145                 UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
146                 $(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
147                         --start-group $(LIBS) $(PLATFORM_LIBS) --end-group \
148                         -Map u-boot.map -o u-boot
149
150 subdirs:
151                 @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir || exit 1 ; done
152
153 gdbtools:
154                 $(MAKE) -C tools/gdb || exit 1
155
156 depend dep:
157                 @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir .depend ; done
158
159 tags:
160                 ctags -w `find $(SUBDIRS) include \
161                         \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
162
163 etags:
164                 etags -a `find $(SUBDIRS) include \
165                         \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
166
167 System.map:     u-boot
168                 @$(NM) $< | \
169                 grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
170                 sort > System.map
171
172 #########################################################################
173 else
174 all install u-boot u-boot.srec depend dep:
175         @echo "System not configured - see README" >&2
176         @ exit 1
177 endif
178
179 #########################################################################
180
181 unconfig:
182         rm -f include/config.h include/config.mk
183
184 #========================================================================
185 # PowerPC
186 #========================================================================
187
188 #########################################################################
189 ## MPC5xx Systems
190 #########################################################################
191
192 cmi_mpc5xx_config:      unconfig
193         @./mkconfig $(@:_config=) ppc mpc5xx cmi
194
195 #########################################################################
196 ## MPC5xxx Systems
197 #########################################################################
198 IceCube_5200_config     \
199 IceCube_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 #########################################################################
212 ## MPC8xx Systems
213 #########################################################################
214
215 AdderII_config: unconfig
216         @./mkconfig $(@:_config=) ppc mpc8xx adderII
217
218 ADS860_config:  unconfig
219         @./mkconfig $(@:_config=) ppc mpc8xx fads
220
221 AMX860_config   :       unconfig
222         @./mkconfig $(@:_config=) ppc mpc8xx amx860 westel
223
224 c2mon_config:           unconfig
225         @./mkconfig $(@:_config=) ppc mpc8xx c2mon
226
227 CCM_config:             unconfig
228         @./mkconfig $(@:_config=) ppc mpc8xx CCM siemens
229
230 cogent_mpc8xx_config:   unconfig
231         @./mkconfig $(@:_config=) ppc mpc8xx cogent
232
233 ELPT860_config:         unconfig
234         @./mkconfig $(@:_config=) ppc mpc8xx elpt860 LEOX
235
236 ESTEEM192E_config:      unconfig
237         @./mkconfig $(@:_config=) ppc mpc8xx esteem192e
238
239 ETX094_config   :       unconfig
240         @./mkconfig $(@:_config=) ppc mpc8xx etx094
241
242 FADS823_config  \
243 FADS850SAR_config \
244 MPC86xADS_config \
245 FADS860T_config:        unconfig
246         @./mkconfig $(@:_config=) ppc mpc8xx fads
247
248 FLAGADM_config: unconfig
249         @./mkconfig $(@:_config=) ppc mpc8xx flagadm
250
251 xtract_GEN860T = $(subst _SC,,$(subst _config,,$1))
252
253 GEN860T_SC_config       \
254 GEN860T_config: unconfig
255         @ >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
261
262 GENIETV_config: unconfig
263         @./mkconfig $(@:_config=) ppc mpc8xx genietv
264
265 GTH_config:     unconfig
266         @./mkconfig $(@:_config=) ppc mpc8xx gth
267
268 hermes_config   :       unconfig
269         @./mkconfig $(@:_config=) ppc mpc8xx hermes
270
271 IAD210_config: unconfig
272         @./mkconfig $(@:_config=) ppc mpc8xx IAD210 siemens
273
274 xtract_ICU862 = $(subst _100MHz,,$(subst _config,,$1))
275
276 ICU862_100MHz_config    \
277 ICU862_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
285 IP860_config    :       unconfig
286         @./mkconfig $(@:_config=) ppc mpc8xx ip860
287
288 IVML24_256_config \
289 IVML24_128_config \
290 IVML24_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
303 IVMS8_256_config \
304 IVMS8_128_config \
305 IVMS8_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
318 KUP4K_config    :       unconfig
319         @./mkconfig $(@:_config=) ppc mpc8xx kup4k
320
321 LANTEC_config   :       unconfig
322         @./mkconfig $(@:_config=) ppc mpc8xx lantec
323
324 lwmon_config:           unconfig
325         @./mkconfig $(@:_config=) ppc mpc8xx lwmon
326
327 MBX_config      \
328 MBX860T_config: unconfig
329         @./mkconfig $(@:_config=) ppc mpc8xx mbx8xx
330
331 MHPC_config:            unconfig
332         @./mkconfig $(@:_config=) ppc mpc8xx mhpc eltec
333
334 MVS1_config :           unconfig
335         @./mkconfig $(@:_config=) ppc mpc8xx mvs1
336
337 xtract_NETVIA = $(subst _V2,,$(subst _config,,$1))
338
339 NETVIA_V2_config \
340 NETVIA_config:          unconfig
341         @ >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
351
352 NX823_config:           unconfig
353         @./mkconfig $(@:_config=) ppc mpc8xx nx823
354
355 pcu_e_config:           unconfig
356         @./mkconfig $(@:_config=) ppc mpc8xx pcu_e siemens
357
358 R360MPI_config: unconfig
359         @./mkconfig $(@:_config=) ppc mpc8xx r360mpi
360
361 RBC823_config:  unconfig
362         @./mkconfig $(@:_config=) ppc mpc8xx rbc823
363
364 RPXClassic_config:      unconfig
365         @./mkconfig $(@:_config=) ppc mpc8xx RPXClassic
366
367 RPXlite_config:         unconfig
368         @./mkconfig $(@:_config=) ppc mpc8xx RPXlite
369
370 rmu_config:     unconfig
371         @./mkconfig $(@:_config=) ppc mpc8xx rmu
372
373 RRvision_config:        unconfig
374         @./mkconfig $(@:_config=) ppc mpc8xx RRvision
375
376 RRvision_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
381 SM850_config    :       unconfig
382         @./mkconfig $(@:_config=) ppc mpc8xx tqm8xx
383
384 SPD823TS_config:        unconfig
385         @./mkconfig $(@:_config=) ppc mpc8xx spd8xx
386
387 svm_sc8xx_config:       unconfig
388         @ >include/config.h
389         @./mkconfig $(@:_config=) ppc mpc8xx svm_sc8xx
390
391 SXNI855T_config:        unconfig
392         @./mkconfig $(@:_config=) ppc mpc8xx sixnet
393
394 # EMK MPC8xx based modules
395 TOP860_config:          unconfig
396         @./mkconfig $(@:_config=) ppc mpc8xx top860 emk
397
398 # Play some tricks for configuration selection
399 # All boards can come with 50 MHz (default), 66MHz, 80MHz or 100 MHz clock,
400 # but only 855 and 860 boards may come with FEC
401 # and 823 boards may have LCD support
402 xtract_8xx = $(subst _66MHz,,$(subst _80MHz,,$(subst _100MHz,,$(subst _LCD,,$(subst _config,,$1)))))
403
404 FPS850L_config          \
405 FPS860L_config          \
406 NSCU_config             \
407 TQM823L_config          \
408 TQM823L_66MHz_config    \
409 TQM823L_80MHz_config    \
410 TQM823L_LCD_config      \
411 TQM823L_LCD_66MHz_config \
412 TQM823L_LCD_80MHz_config \
413 TQM850L_config          \
414 TQM850L_66MHz_config    \
415 TQM850L_80MHz_config    \
416 TQM855L_config          \
417 TQM855L_66MHz_config    \
418 TQM855L_80MHz_config    \
419 TQM860L_config          \
420 TQM860L_66MHz_config    \
421 TQM860L_80MHz_config    \
422 TQM862L_config          \
423 TQM862L_66MHz_config    \
424 TQM862L_80MHz_config    \
425 TQM823M_config          \
426 TQM823M_66MHz_config    \
427 TQM823M_80MHz_config    \
428 TQM850M_config          \
429 TQM850M_66MHz_config    \
430 TQM850M_80MHz_config    \
431 TQM855M_config          \
432 TQM855M_66MHz_config    \
433 TQM855M_80MHz_config    \
434 TQM860M_config          \
435 TQM860M_66MHz_config    \
436 TQM860M_80MHz_config    \
437 TQM862M_config          \
438 TQM862M_66MHz_config    \
439 TQM862M_80MHz_config    \
440 TQM862M_100MHz_config:  unconfig
441         @ >include/config.h
442         @[ -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                 }
450         @[ -z "$(findstring _100MHz,$@)" ] || \
451                 { echo "#define CONFIG_100MHz"          >>include/config.h ; \
452                   echo "... with 100MHz system clock" ; \
453                 }
454         @[ -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
461 TTTech_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
466 v37_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
471 #########################################################################
472 ## PPC4xx Systems
473 #########################################################################
474
475 ADCIOP_config:  unconfig
476         @./mkconfig $(@:_config=) ppc ppc4xx adciop esd
477
478 AR405_config:   unconfig
479         @./mkconfig $(@:_config=) ppc ppc4xx ar405 esd
480
481 ASH405_config:  unconfig
482         @./mkconfig $(@:_config=) ppc ppc4xx ash405 esd
483
484 BUBINGA405EP_config:unconfig
485         @./mkconfig $(@:_config=) ppc ppc4xx bubinga405ep
486
487 CANBT_config:   unconfig
488         @./mkconfig $(@:_config=) ppc ppc4xx canbt esd
489
490 CPCI405_config  \
491 CPCI4052_config \
492 CPCI405AB_config:       unconfig
493         @./mkconfig $(@:_config=) ppc ppc4xx cpci405 esd
494         @echo "BOARD_REVISION = $(@:_config=)"  >>include/config.mk
495
496 CPCI440_config: unconfig
497         @./mkconfig $(@:_config=) ppc ppc4xx cpci440 esd
498
499 CPCIISER4_config:       unconfig
500         @./mkconfig $(@:_config=) ppc ppc4xx cpciiser4 esd
501
502 CRAYL1_config:unconfig
503         @./mkconfig $(@:_config=) ppc ppc4xx L1 cray
504
505 DASA_SIM_config: unconfig
506         @./mkconfig $(@:_config=) ppc ppc4xx dasa_sim esd
507
508 DU405_config:   unconfig
509         @./mkconfig $(@:_config=) ppc ppc4xx du405 esd
510
511 EBONY_config:unconfig
512         @./mkconfig $(@:_config=) ppc ppc4xx ebony
513
514 ERIC_config:unconfig
515         @./mkconfig $(@:_config=) ppc ppc4xx eric
516
517 EXBITGEN_config:unconfig
518         @./mkconfig $(@:_config=) ppc ppc4xx exbitgen
519
520 MIP405_config:unconfig
521         @./mkconfig $(@:_config=) ppc ppc4xx mip405 mpl
522
523 MIP405T_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
528 ML2_config:unconfig
529         @./mkconfig $(@:_config=) ppc ppc4xx ml2
530
531 OCRTC_config            \
532 ORSG_config:    unconfig
533         @./mkconfig $(@:_config=) ppc ppc4xx ocrtc esd
534
535 PCI405_config:  unconfig
536         @./mkconfig $(@:_config=) ppc ppc4xx pci405 esd
537
538 PIP405_config:unconfig
539         @./mkconfig $(@:_config=) ppc ppc4xx pip405 mpl
540
541 PMC405_config:  unconfig
542         @./mkconfig $(@:_config=) ppc ppc4xx pmc405 esd
543
544 PPChameleonEVB_config:  unconfig
545         @./mkconfig $(@:_config=) ppc ppc4xx PPChameleonEVB dave
546
547 W7OLMC_config   \
548 W7OLMG_config: unconfig
549         @./mkconfig $(@:_config=) ppc ppc4xx w7o
550
551 WALNUT405_config:unconfig
552         @./mkconfig $(@:_config=) ppc ppc4xx walnut405
553
554 #########################################################################
555 ## MPC824x Systems
556 #########################################################################
557 xtract_82xx = $(subst _ROMBOOT,,$(subst _L2,,$(subst _266MHz,,$(subst _300MHz,,$(subst _config,,$1)))))
558
559 A3000_config: unconfig
560         @./mkconfig $(@:_config=) ppc mpc824x a3000
561
562 BMW_config: unconfig
563         @./mkconfig $(@:_config=) ppc mpc824x bmw
564
565 CPC45_config    \
566 CPC45_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
578 CU824_config: unconfig
579         @./mkconfig $(@:_config=) ppc mpc824x cu824
580
581 MOUSSE_config: unconfig
582         @./mkconfig $(@:_config=) ppc mpc824x mousse
583
584 MUSENKI_config: unconfig
585         @./mkconfig $(@:_config=) ppc mpc824x musenki
586
587 OXC_config: unconfig
588         @./mkconfig $(@:_config=) ppc mpc824x oxc
589
590 PN62_config: unconfig
591         @./mkconfig $(@:_config=) ppc mpc824x pn62
592
593 Sandpoint8240_config: unconfig
594         @./mkconfig $(@:_config=) ppc mpc824x sandpoint
595
596 Sandpoint8245_config: unconfig
597         @./mkconfig $(@:_config=) ppc mpc824x sandpoint
598
599 SL8245_config: unconfig
600         @./mkconfig $(@:_config=) ppc mpc824x sl8245
601
602 utx8245_config: unconfig
603         @./mkconfig $(@:_config=) ppc mpc824x utx8245
604
605 #########################################################################
606 ## MPC8260 Systems
607 #########################################################################
608
609 cogent_mpc8260_config:  unconfig
610         @./mkconfig $(@:_config=) ppc mpc8260 cogent
611
612 CPU86_config    \
613 CPU86_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
625 ep8260_config:  unconfig
626         @./mkconfig $(@:_config=) ppc mpc8260 ep8260
627
628 gw8260_config:  unconfig
629         @./mkconfig $(@:_config=) ppc mpc8260 gw8260
630
631 hymod_config:   unconfig
632         @./mkconfig $(@:_config=) ppc mpc8260 hymod
633
634 IPHASE4539_config:      unconfig
635         @./mkconfig $(@:_config=) ppc mpc8260 iphase4539
636
637 MPC8260ADS_config:      unconfig
638         @./mkconfig $(@:_config=) ppc mpc8260 mpc8260ads
639
640 MPC8266ADS_config:      unconfig
641         @./mkconfig $(@:_config=) ppc mpc8260 mpc8266ads
642
643 PM825_config    \
644 PM825_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
657 PM826_config    \
658 PM826_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
670 ppmc8260_config:        unconfig
671         @./mkconfig $(@:_config=) ppc mpc8260 ppmc8260
672
673 RPXsuper_config:        unconfig
674         @./mkconfig $(@:_config=) ppc mpc8260 rpxsuper
675
676 rsdproto_config:        unconfig
677         @./mkconfig $(@:_config=) ppc mpc8260 rsdproto
678
679 sacsng_config:  unconfig
680         @./mkconfig $(@:_config=) ppc mpc8260 sacsng
681
682 sbc8260_config: unconfig
683         @./mkconfig $(@:_config=) ppc mpc8260 sbc8260
684
685 SCM_config:             unconfig
686         @./mkconfig $(@:_config=) ppc mpc8260 SCM siemens
687
688 TQM8255_AA_config \
689 TQM8260_AA_config \
690 TQM8260_AB_config \
691 TQM8260_AC_config \
692 TQM8260_AD_config \
693 TQM8260_AE_config \
694 TQM8260_AF_config \
695 TQM8260_AG_config \
696 TQM8260_AH_config \
697 TQM8265_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 \
717                 echo "#define CONFIG_L2_CACHE"  >>include/config.h ; \
718                 echo "... with L2 Cache support" ; \
719         else \
720                 echo "#undef CONFIG_L2_CACHE"   >>include/config.h ; \
721                 echo "... without L2 Cache support" ; \
722         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" ; \
729         fi
730         @./mkconfig -a TQM8260 ppc mpc8260 tqm8260
731
732 atc_config:     unconfig
733         @./mkconfig $(@:_config=) ppc mpc8260 atc
734
735 #########################################################################
736 ## 74xx/7xx Systems
737 #########################################################################
738
739 AmigaOneG3SE_config:    unconfig
740         @./mkconfig $(@:_config=) ppc 74xx_7xx AmigaOneG3SE MAI
741
742 EVB64260_config \
743 EVB64260_750CX_config:  unconfig
744         @./mkconfig EVB64260 ppc 74xx_7xx evb64260
745
746 ZUMA_config:    unconfig
747         @./mkconfig $(@:_config=) ppc 74xx_7xx evb64260
748
749 PCIPPC2_config \
750 PCIPPC6_config: unconfig
751         @./mkconfig $(@:_config=) ppc 74xx_7xx pcippc2
752
753 BAB7xx_config: unconfig
754         @./mkconfig $(@:_config=) ppc 74xx_7xx bab7xx eltec
755
756 ELPPC_config: unconfig
757         @./mkconfig $(@:_config=) ppc 74xx_7xx elppc eltec
758
759 P3G4_config: unconfig
760         @./mkconfig $(@:_config=) ppc 74xx_7xx evb64260
761
762 #========================================================================
763 # ARM
764 #========================================================================
765 #########################################################################
766 ## StrongARM Systems
767 #########################################################################
768
769 at91rm9200dk_config     :       unconfig
770         @./mkconfig $(@:_config=) arm at91rm9200 at91rm9200dk
771
772 lart_config     :       unconfig
773         @./mkconfig $(@:_config=) arm sa1100 lart
774
775 dnp1110_config  :       unconfig
776         @./mkconfig $(@:_config=) arm sa1100 dnp1110
777
778 shannon_config  :       unconfig
779         @./mkconfig $(@:_config=) arm sa1100 shannon
780
781 #########################################################################
782 ## ARM92xT Systems
783 #########################################################################
784
785 xtract_trab = $(subst _big_flash,,$(subst _config,,$1))
786
787 omap1510inn_config :    unconfig
788         @./mkconfig $(@:_config=) arm arm925t omap1510inn
789
790 omap1610inn_config :    unconfig
791         @./mkconfig $(@:_config=) arm arm926ejs omap1610inn
792
793 smdk2400_config :       unconfig
794         @./mkconfig $(@:_config=) arm arm920t smdk2400
795
796 smdk2410_config :       unconfig
797         @./mkconfig $(@:_config=) arm arm920t smdk2410
798
799 trab_config \
800 trab_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
807
808 VCMA9_config    :       unconfig
809         @./mkconfig $(@:_config=) arm arm920t vcma9 mpl
810
811 #########################################################################
812 ## ARM720T Systems
813 #########################################################################
814
815 impa7_config    :       unconfig
816         @./mkconfig $(@:_config=) arm arm720t impa7
817
818 ep7312_config   :       unconfig
819         @./mkconfig $(@:_config=) arm arm720t ep7312
820
821 #########################################################################
822 ## XScale Systems
823 #########################################################################
824
825 cradle_config   :       unconfig
826         @./mkconfig $(@:_config=) arm pxa cradle
827
828 csb226_config   :       unconfig
829         @./mkconfig $(@:_config=) arm pxa csb226
830
831 innokom_config  :       unconfig
832         @./mkconfig $(@:_config=) arm pxa innokom
833
834 lubbock_config  :       unconfig
835         @./mkconfig $(@:_config=) arm pxa lubbock
836
837 logodl_config   :       unconfig
838         @./mkconfig $(@:_config=) arm pxa logodl
839
840 wepep250_config :       unconfig
841         @./mkconfig $(@:_config=) arm pxa wepep250
842
843 #========================================================================
844 # i386
845 #========================================================================
846 #########################################################################
847 ## AMD SC520 CDP
848 #########################################################################
849 sc520_cdp_config        :       unconfig
850         @./mkconfig $(@:_config=) i386 i386 sc520_cdp
851
852 sc520_spunk_config      :       unconfig
853         @./mkconfig $(@:_config=) i386 i386 sc520_spunk
854
855 sc520_spunk_rel_config  :       unconfig
856         @./mkconfig $(@:_config=) i386 i386 sc520_spunk
857
858 #========================================================================
859 # MIPS
860 #========================================================================
861 #########################################################################
862 ## MIPS32 4Kc
863 #########################################################################
864
865 xtract_incaip = $(subst _100MHz,,$(subst _133MHz,,$(subst _150MHz,,$(subst _config,,$1))))
866
867 incaip_100MHz_config    \
868 incaip_133MHz_config    \
869 incaip_150MHz_config    \
870 incaip_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 #########################################################################
889
890 purple_config :         unconfig
891         @./mkconfig $(@:_config=) mips mips purple
892
893 #########################################################################
894 #########################################################################
895
896 clean:
897         find . -type f \
898                 \( -name 'core' -o -name '*.bak' -o -name '*~' \
899                 -o -name '*.o'  -o -name '*.a'  \) -print \
900                 | xargs rm -f
901         rm -f examples/hello_world examples/timer \
902               examples/eepro100_eeprom examples/sched \
903               examples/mem_to_mem_idma2intr examples/82559_eeprom
904
905         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
908         rm -f tools/env/fw_printenv tools/env/fw_setenv
909         rm -f board/cray/L1/bootscript.c board/cray/L1/bootscript.image
910
911 clobber:        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 *.*~
918         rm -f u-boot u-boot.map $(ALL)
919         rm -f tools/crc32.c tools/environment.c tools/env/crc32.c
920         rm -f tools/inca-swap-bytes cpu/mpc824x/bedbug_603e.c
921         rm -f include/asm/proc include/asm/arch include/asm
922
923 mrproper \
924 distclean:      clobber unconfig
925
926 backup:
927         F=`basename $(TOPDIR)` ; cd .. ; \
928         gtar --force-local -zcvf `date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
929
930 #########################################################################