Makefile 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. #
  2. # Copyright (C) 2012-2013 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=u-boot
  9. PKG_VERSION:=2013.10
  10. PKG_RELEASE:=1
  11. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:= \
  14. http://mirror2.openwrt.org/sources \
  15. ftp://ftp.denx.de/pub/u-boot
  16. PKG_HASH:=0d71e62beb952b41ebafb20a7ee4df2f960db64c31b054721ceb79ff14014c55
  17. PKG_TARGETS:=bin
  18. PKG_LICENSE:=GPL-2.0 GPL-2.0+
  19. PKG_LICENSE_FILES:=Licenses/README
  20. PKG_BUILD_PARALLEL:=1
  21. FIRMWARE_LANTIQ_SOURCE:=$(TOPDIR)/target/linux/lantiq/files/firmware/lantiq
  22. include $(INCLUDE_DIR)/package.mk
  23. define uboot/Default
  24. TITLE:=
  25. SOC:=
  26. DDR_SETTINGS:=
  27. IMAGE:=
  28. DEPS:=
  29. endef
  30. define uboot/arv4519pw_ram
  31. TITLE:=U-Boot for Arcadyan arv4519pw (RAM)
  32. SOC:=danube
  33. DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h
  34. DEPS:=@TARGET_lantiq_xway
  35. endef
  36. define uboot/arv4519pw_nor
  37. TITLE:=U-Boot for Arcadyan arv4519pw (NOR)
  38. SOC:=danube
  39. DEPS:=@TARGET_lantiq_xway
  40. endef
  41. define uboot/arv4519pw_brn
  42. TITLE:=U-Boot for Arcadyan arv4519pw (BRN)
  43. SOC:=danube
  44. DEPS:=@TARGET_lantiq_xway
  45. endef
  46. define uboot/arv7506pw11_ram
  47. TITLE:=U-Boot for Arcadyan ARV7506PW11 (RAM)
  48. SOC:=danube
  49. DDR_SETTINGS:=board/arcadyan/arv7506pw11/ddr_settings.h
  50. DEPS:=@TARGET_lantiq_xway
  51. endef
  52. define uboot/arv7506pw11_nor
  53. TITLE:=U-Boot for Arcadyan ARV7506PW11 (NOR)
  54. SOC:=danube
  55. DEPS:=@TARGET_lantiq_xway
  56. endef
  57. define uboot/arv7506pw11_brn
  58. TITLE:=U-Boot for Arcadyan ARV7506PW11 (BRN)
  59. SOC:=danube
  60. DEPS:=@TARGET_lantiq_xway
  61. endef
  62. define uboot/arv7510pw_ram
  63. TITLE:=U-Boot for Arcadyan arv7510pw (RAM)
  64. SOC:=danube
  65. DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h
  66. DEPS:=@TARGET_lantiq_xway
  67. endef
  68. define uboot/arv7510pw_nor
  69. TITLE:=U-Boot for Arcadyan arv7510pw (NOR)
  70. SOC:=danube
  71. DEPS:=@TARGET_lantiq_xway
  72. endef
  73. define uboot/arv7510pw_brn
  74. TITLE:=U-Boot for Arcadyan arv7510pw (BRN)
  75. SOC:=danube
  76. DEPS:=@TARGET_lantiq_xway
  77. endef
  78. define uboot/arv7510pw22_ram
  79. TITLE:=U-Boot for Arcadyan arv7510pw22 (RAM)
  80. SOC:=danube
  81. DDR_SETTINGS:=board/arcadyan/arv7510pw22/ddr_settings.h
  82. DEPS:=@TARGET_lantiq_xway
  83. endef
  84. define uboot/arv7510pw22_nor
  85. TITLE:=U-Boot for Arcadyan arv7510pw22 (NOR)
  86. SOC:=danube
  87. DEPS:=@TARGET_lantiq_xway
  88. endef
  89. define uboot/arv7510pw22_brn
  90. TITLE:=U-Boot for Arcadyan arv7510pw22 (BRN)
  91. SOC:=danube
  92. DEPS:=@TARGET_lantiq_xway
  93. endef
  94. define uboot/arv7518pw_ram
  95. TITLE:=U-Boot for Arcadyan arv7518pw (RAM)
  96. SOC:=danube
  97. DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h
  98. DEPS:=@TARGET_lantiq_xway
  99. endef
  100. define uboot/arv7518pw_nor
  101. TITLE:=U-Boot for Arcadyan arv7518pw (NOR)
  102. SOC:=danube
  103. DEPS:=@TARGET_lantiq_xway
  104. endef
  105. define uboot/arv7518pw_brn
  106. TITLE:=U-Boot for Arcadyan arv7518pw (BRN)
  107. SOC:=danube
  108. DEPS:=@TARGET_lantiq_xway
  109. endef
  110. define uboot/arv752dpw_ram
  111. TITLE:=U-Boot for Arcadyan arv752dpw (RAM)
  112. SOC:=danube
  113. DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h
  114. DEPS:=@TARGET_lantiq_xway
  115. endef
  116. define uboot/arv752dpw_nor
  117. TITLE:=U-Boot for Arcadyan arv752dpw (NOR)
  118. SOC:=danube
  119. DEPS:=@TARGET_lantiq_xway
  120. endef
  121. define uboot/arv752dpw_brn
  122. TITLE:=U-Boot for Arcadyan arv752dpw (BRN)
  123. SOC:=danube
  124. DEPS:=@TARGET_lantiq_xway
  125. endef
  126. define uboot/arv752dpw22_ram
  127. TITLE:=U-Boot for Arcadyan arv752dpw22 (RAM)
  128. SOC:=danube
  129. DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h
  130. DEPS:=@TARGET_lantiq_xway
  131. endef
  132. define uboot/arv752dpw22_nor
  133. TITLE:=U-Boot for Arcadyan arv752dpw22 (NOR)
  134. SOC:=danube
  135. DEPS:=@TARGET_lantiq_xway
  136. endef
  137. define uboot/arv752dpw22_brn
  138. TITLE:=U-Boot for Arcadyan arv752dpw22 (BRN)
  139. SOC:=danube
  140. DEPS:=@TARGET_lantiq_xway
  141. endef
  142. define uboot/arv8539pw22_ram
  143. TITLE:=U-Boot for Speedport W 504V Typ A (RAM)
  144. SOC:=danube
  145. DDR_SETTINGS:=board/arcadyan/arv8539pw22/ddr_settings.h
  146. DEPS:=@TARGET_lantiq_xway
  147. endef
  148. define uboot/arv8539pw22_nor
  149. TITLE:=U-Boot for Speedport W 504V Typ A (NOR)
  150. SOC:=danube
  151. DEPS:=@TARGET_lantiq_xway
  152. endef
  153. define uboot/arv8539pw22_brn
  154. TITLE:=U-Boot for Speedport W 504V Typ A (BRN)
  155. SOC:=danube
  156. DEPS:=@TARGET_lantiq_xway
  157. endef
  158. define uboot/gigasx76x_ram
  159. TITLE:=U-Boot for Siemens Gigaset sx76x (RAM)
  160. SOC:=danube
  161. DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h
  162. DEPS:=@TARGET_lantiq_xway
  163. endef
  164. define uboot/gigasx76x_nor
  165. TITLE:=U-Boot for Siemens Gigaset sx76x (NOR)
  166. SOC:=danube
  167. DEPS:=@TARGET_lantiq_xway
  168. endef
  169. define uboot/acmp252_ram
  170. TITLE:=U-Boot for AudioCodes MP-252 (RAM)
  171. SOC:=danube
  172. DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h
  173. DEPS:=@TARGET_lantiq_xway
  174. endef
  175. define uboot/acmp252_nor
  176. TITLE:=U-Boot for AudioCodes MP-252 (NOR)
  177. SOC:=danube
  178. DEPS:=@TARGET_lantiq_xway
  179. endef
  180. define uboot/bthomehubv5a_ram
  181. TITLE:=U-Boot for BT Home Hub 5A (RAM)
  182. SOC:=vr9
  183. DDR_SETTINGS:=board/bt/bthomehubv5a/ddr_settings.h
  184. DEPS:=@TARGET_lantiq_xrx200
  185. endef
  186. define uboot/easy50712_ram
  187. TITLE:=U-Boot for Lantiq EASY50712 (RAM)
  188. SOC:=danube
  189. DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h
  190. DEPS:=@TARGET_lantiq_xway
  191. endef
  192. define uboot/easy50712_nor
  193. TITLE:=U-Boot for Lantiq EASY50712 (NOR)
  194. SOC:=danube
  195. DEPS:=@TARGET_lantiq_xway
  196. endef
  197. define uboot/easy50712_norspl
  198. TITLE:=U-Boot for Lantiq EASY50712 (NOR SPL)
  199. SOC:=danube
  200. IMAGE:=u-boot.ltq.lzo.norspl
  201. DEPS:=@TARGET_lantiq_xway
  202. endef
  203. define uboot/easy80920_ram
  204. TITLE:=U-Boot for Lantiq EASY80920 (RAM)
  205. SOC:=vr9
  206. DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h
  207. DEPS:=@TARGET_lantiq_xrx200
  208. endef
  209. define uboot/easy80920_nor
  210. TITLE:=U-Boot for Lantiq EASY80920 (NOR)
  211. SOC:=vr9
  212. DEPS:=@TARGET_lantiq_xrx200
  213. endef
  214. define uboot/easy80920_norspl
  215. TITLE:=U-Boot for Lantiq EASY80920 (NOR SPL)
  216. SOC:=vr9
  217. IMAGE:=u-boot.ltq.lzo.norspl
  218. DEPS:=@TARGET_lantiq_xrx200
  219. endef
  220. define uboot/easy80920_sfspl
  221. TITLE:=U-Boot for Lantiq EASY80920 (SPI SPL)
  222. SOC:=vr9
  223. IMAGE:=u-boot.ltq.lzo.sfspl
  224. DEPS:=@TARGET_lantiq_xrx200
  225. endef
  226. define uboot/fb3370_eva
  227. TITLE:=U-Boot for AVM FRITZ3370 (EVA)
  228. SOC:=vr9
  229. DEPS:=@TARGET_lantiq_xrx200
  230. endef
  231. define uboot/fb3370_ram
  232. TITLE:=U-Boot for AVM FRITZ3370 (RAM)
  233. SOC:=vr9
  234. DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h
  235. DEPS:=@TARGET_lantiq_xrx200
  236. endef
  237. define uboot/fb3370_sfspl
  238. TITLE:=U-Boot for AVM FRITZ3370 (SPI SPL)
  239. SOC:=vr9
  240. IMAGE:=u-boot.ltq.lzo.sfspl
  241. DEPS:=@TARGET_lantiq_xrx200
  242. endef
  243. define uboot/p2812hnufx_ram
  244. TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (RAM)
  245. SOC:=vr9
  246. DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h
  247. DEPS:=@TARGET_lantiq_xrx200
  248. endef
  249. define uboot/p2812hnufx_nandspl
  250. TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (NAND SPL)
  251. SOC:=vr9
  252. IMAGE:=u-boot.ltq.lzo.nandspl
  253. DEPS:=@TARGET_lantiq_xrx200
  254. endef
  255. define uboot/vgv7510kw22_brn
  256. TITLE:=U-Boot for Arcadyan VGV7510KW22 (BRN)
  257. SOC:=vr9
  258. DEPS:=@TARGET_lantiq_xrx200
  259. endef
  260. define uboot/vgv7510kw22_nor
  261. TITLE:=U-Boot for Arcadyan VGV7510KW22 (NOR)
  262. SOC:=vr9
  263. DEPS:=@TARGET_lantiq_xrx200
  264. endef
  265. define uboot/vgv7510kw22_ram
  266. TITLE:=U-Boot for Arcadyan VGV7510KW22 (RAM)
  267. SOC:=vr9
  268. DDR_SETTINGS:=board/arcadyan/vgv7510kw22/ddr_settings.h
  269. DEPS:=@TARGET_lantiq_xrx200
  270. endef
  271. define uboot/vgv7519_brn
  272. TITLE:=U-Boot for Arcadyan VGV7519 (BRN)
  273. SOC:=vr9
  274. DEPS:=@TARGET_lantiq_xrx200
  275. endef
  276. define uboot/vgv7519_nor
  277. TITLE:=U-Boot for Arcadyan VGV7519 (NOR)
  278. SOC:=vr9
  279. DEPS:=@TARGET_lantiq_xrx200
  280. endef
  281. define uboot/vgv7519_ram
  282. TITLE:=U-Boot for Arcadyan VGV7519 (RAM)
  283. SOC:=vr9
  284. DDR_SETTINGS:=board/arcadyan/vgv7519/ddr_settings.h
  285. DEPS:=@TARGET_lantiq_xrx200
  286. endef
  287. UBOOTS:= \
  288. arv4519pw_ram arv4519pw_nor arv4519pw_brn \
  289. arv7506pw11_ram arv7506pw11_nor arv7506pw11_brn \
  290. arv7510pw_ram arv7510pw_nor arv7510pw_brn \
  291. arv7510pw22_ram arv7510pw22_nor arv7510pw22_brn \
  292. arv7518pw_ram arv7518pw_nor arv7518pw_brn \
  293. arv752dpw_ram arv752dpw_nor arv752dpw_brn \
  294. arv752dpw22_ram arv752dpw22_nor arv752dpw22_brn \
  295. arv8539pw22_brn arv8539pw22_nor arv8539pw22_ram \
  296. bthomehubv5a_ram \
  297. gigasx76x_ram gigasx76x_nor \
  298. acmp252_ram acmp252_nor \
  299. easy50712_ram easy50712_nor easy50712_norspl \
  300. easy80920_ram easy80920_nor easy80920_norspl easy80920_sfspl \
  301. fb3370_eva fb3370_ram fb3370_sfspl \
  302. p2812hnufx_ram p2812hnufx_nandspl \
  303. vgv7510kw22_brn vgv7510kw22_nor vgv7510kw22_ram \
  304. vgv7519_brn vgv7519_nor vgv7519_ram
  305. define Package/uboot/template
  306. define Package/uboot-lantiq-$(1)
  307. SECTION:=boot
  308. CATEGORY:=Boot Loaders
  309. DEPENDS:=$(3) @!IN_SDK
  310. TITLE:=$(2)
  311. URL:=http://www.denx.de/wiki/U-Boot
  312. VARIANT:=$(1)
  313. MAINTAINER:=Luka Perkov <luka@openwrt.org>
  314. endef
  315. endef
  316. define BuildUBootPackage
  317. $(eval $(uboot/Default))
  318. $(eval $(uboot/$(1)))
  319. DEPS:=$(uboot/$(1)/DEPS)
  320. $(call Package/uboot/template,$(1),$(TITLE),$(DEPS))
  321. endef
  322. define CompressVR9Firmware
  323. $(STAGING_DIR_HOST)/bin/lzma e \
  324. $(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \
  325. $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/fw_phy$(1)_a$(2)x.blob
  326. endef
  327. define Build/Prepare
  328. $(call Build/Prepare/Default)
  329. mkdir -p $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/
  330. $(call CompressVR9Firmware,11g,1)
  331. $(call CompressVR9Firmware,11g,2)
  332. $(call CompressVR9Firmware,22f,1)
  333. $(call CompressVR9Firmware,22f,2)
  334. endef
  335. define Build/Configure
  336. $(MAKE) -C $(PKG_BUILD_DIR) $(BUILD_VARIANT)_config
  337. endef
  338. define Build/Compile
  339. $(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS)
  340. endef
  341. define Package/uboot/install/default
  342. $(CP) \
  343. $(PKG_BUILD_DIR)/$(2) \
  344. $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img
  345. endef
  346. define Package/uboot/install/uart
  347. awk -f $(PKG_BUILD_DIR)/tools/lantiq_ram_init_uart.awk \
  348. -v soc=$(2) $(PKG_BUILD_DIR)/$(3) \
  349. > $(PKG_BUILD_DIR)/ddr_settings
  350. perl $(PKG_BUILD_DIR)/tools/gct.pl \
  351. $(PKG_BUILD_DIR)/ddr_settings $(PKG_BUILD_DIR)/u-boot.srec \
  352. $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.asc
  353. endef
  354. define Package/uboot/install/template
  355. define Package/uboot-lantiq-$(1)/install
  356. $(call Package/uboot/install/default,$(1),$(if $(IMAGE),$(IMAGE),u-boot.bin))
  357. $(if $(DDR_SETTINGS), \
  358. $(call Package/uboot/install/uart,$(1),$(SOC),$(DDR_SETTINGS)) \
  359. )
  360. endef
  361. endef
  362. $(foreach u,$(UBOOTS), \
  363. $(eval $(call BuildUBootPackage,$(u))) \
  364. $(eval $(call Package/uboot/install/template,$(u))) \
  365. $(eval $(call BuildPackage,uboot-lantiq-$(u))) \
  366. )