Makefile 31 KB

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