Makefile 29 KB

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