Makefile 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  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_MD5SUM:=a076a044b64371edc52f7e562b13f6b2
  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/arv7510pw_ram
  47. TITLE:=U-Boot for Arcadyan arv7510pw (RAM)
  48. SOC:=danube
  49. DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h
  50. DEPS:=@TARGET_lantiq_xway
  51. endef
  52. define uboot/arv7510pw_nor
  53. TITLE:=U-Boot for Arcadyan arv7510pw (NOR)
  54. SOC:=danube
  55. DEPS:=@TARGET_lantiq_xway
  56. endef
  57. define uboot/arv7510pw_brn
  58. TITLE:=U-Boot for Arcadyan arv7510pw (BRN)
  59. SOC:=danube
  60. DEPS:=@TARGET_lantiq_xway
  61. endef
  62. define uboot/arv7510pw22_ram
  63. TITLE:=U-Boot for Arcadyan arv7510pw22 (RAM)
  64. SOC:=danube
  65. DDR_SETTINGS:=board/arcadyan/arv7510pw22/ddr_settings.h
  66. DEPS:=@TARGET_lantiq_xway
  67. endef
  68. define uboot/arv7510pw22_nor
  69. TITLE:=U-Boot for Arcadyan arv7510pw22 (NOR)
  70. SOC:=danube
  71. DEPS:=@TARGET_lantiq_xway
  72. endef
  73. define uboot/arv7510pw22_brn
  74. TITLE:=U-Boot for Arcadyan arv7510pw22 (BRN)
  75. SOC:=danube
  76. DEPS:=@TARGET_lantiq_xway
  77. endef
  78. define uboot/arv7518pw_ram
  79. TITLE:=U-Boot for Arcadyan arv7518pw (RAM)
  80. SOC:=danube
  81. DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h
  82. DEPS:=@TARGET_lantiq_xway
  83. endef
  84. define uboot/arv7518pw_nor
  85. TITLE:=U-Boot for Arcadyan arv7518pw (NOR)
  86. SOC:=danube
  87. DEPS:=@TARGET_lantiq_xway
  88. endef
  89. define uboot/arv7518pw_brn
  90. TITLE:=U-Boot for Arcadyan arv7518pw (BRN)
  91. SOC:=danube
  92. DEPS:=@TARGET_lantiq_xway
  93. endef
  94. define uboot/arv752dpw_ram
  95. TITLE:=U-Boot for Arcadyan arv752dpw (RAM)
  96. SOC:=danube
  97. DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h
  98. DEPS:=@TARGET_lantiq_xway
  99. endef
  100. define uboot/arv752dpw_nor
  101. TITLE:=U-Boot for Arcadyan arv752dpw (NOR)
  102. SOC:=danube
  103. DEPS:=@TARGET_lantiq_xway
  104. endef
  105. define uboot/arv752dpw_brn
  106. TITLE:=U-Boot for Arcadyan arv752dpw (BRN)
  107. SOC:=danube
  108. DEPS:=@TARGET_lantiq_xway
  109. endef
  110. define uboot/arv752dpw22_ram
  111. TITLE:=U-Boot for Arcadyan arv752dpw22 (RAM)
  112. SOC:=danube
  113. DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h
  114. DEPS:=@TARGET_lantiq_xway
  115. endef
  116. define uboot/arv752dpw22_nor
  117. TITLE:=U-Boot for Arcadyan arv752dpw22 (NOR)
  118. SOC:=danube
  119. DEPS:=@TARGET_lantiq_xway
  120. endef
  121. define uboot/arv752dpw22_brn
  122. TITLE:=U-Boot for Arcadyan arv752dpw22 (BRN)
  123. SOC:=danube
  124. DEPS:=@TARGET_lantiq_xway
  125. endef
  126. define uboot/arv8539pw22_ram
  127. TITLE:=U-Boot for Speedport W 504V Typ A (RAM)
  128. SOC:=danube
  129. DDR_SETTINGS:=board/arcadyan/arv8539pw22/ddr_settings.h
  130. DEPS:=@TARGET_lantiq_xway
  131. endef
  132. define uboot/arv8539pw22_nor
  133. TITLE:=U-Boot for Speedport W 504V Typ A (NOR)
  134. SOC:=danube
  135. DEPS:=@TARGET_lantiq_xway
  136. endef
  137. define uboot/arv8539pw22_brn
  138. TITLE:=U-Boot for Speedport W 504V Typ A (BRN)
  139. SOC:=danube
  140. DEPS:=@TARGET_lantiq_xway
  141. endef
  142. define uboot/gigasx76x_ram
  143. TITLE:=U-Boot for Siemens Gigaset sx76x (RAM)
  144. SOC:=danube
  145. DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h
  146. DEPS:=@TARGET_lantiq_xway
  147. endef
  148. define uboot/gigasx76x_nor
  149. TITLE:=U-Boot for Siemens Gigaset sx76x (NOR)
  150. SOC:=danube
  151. DEPS:=@TARGET_lantiq_xway
  152. endef
  153. define uboot/acmp252_ram
  154. TITLE:=U-Boot for AudioCodes MP-252 (RAM)
  155. SOC:=danube
  156. DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h
  157. DEPS:=@TARGET_lantiq_xway
  158. endef
  159. define uboot/acmp252_nor
  160. TITLE:=U-Boot for AudioCodes MP-252 (NOR)
  161. SOC:=danube
  162. DEPS:=@TARGET_lantiq_xway
  163. endef
  164. define uboot/easy50712_ram
  165. TITLE:=U-Boot for Lantiq EASY50712 (RAM)
  166. SOC:=danube
  167. DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h
  168. DEPS:=@TARGET_lantiq_xway
  169. endef
  170. define uboot/easy50712_nor
  171. TITLE:=U-Boot for Lantiq EASY50712 (NOR)
  172. SOC:=danube
  173. DEPS:=@TARGET_lantiq_xway
  174. endef
  175. define uboot/easy50712_norspl
  176. TITLE:=U-Boot for Lantiq EASY50712 (NOR SPL)
  177. SOC:=danube
  178. IMAGE:=u-boot.ltq.lzo.norspl
  179. DEPS:=@TARGET_lantiq_xway
  180. endef
  181. define uboot/easy80920_ram
  182. TITLE:=U-Boot for Lantiq EASY80920 (RAM)
  183. SOC:=vr9
  184. DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h
  185. DEPS:=@TARGET_lantiq_xrx200
  186. endef
  187. define uboot/easy80920_nor
  188. TITLE:=U-Boot for Lantiq EASY80920 (NOR)
  189. SOC:=vr9
  190. DEPS:=@TARGET_lantiq_xrx200
  191. endef
  192. define uboot/easy80920_norspl
  193. TITLE:=U-Boot for Lantiq EASY80920 (NOR SPL)
  194. SOC:=vr9
  195. IMAGE:=u-boot.ltq.lzo.norspl
  196. DEPS:=@TARGET_lantiq_xrx200
  197. endef
  198. define uboot/easy80920_sfspl
  199. TITLE:=U-Boot for Lantiq EASY80920 (SPI SPL)
  200. SOC:=vr9
  201. IMAGE:=u-boot.ltq.lzo.sfspl
  202. DEPS:=@TARGET_lantiq_xrx200
  203. endef
  204. define uboot/fb3370_eva
  205. TITLE:=U-Boot for AVM FRITZ3370 (EVA)
  206. SOC:=vr9
  207. DEPS:=@TARGET_lantiq_xrx200
  208. endef
  209. define uboot/fb3370_ram
  210. TITLE:=U-Boot for AVM FRITZ3370 (RAM)
  211. SOC:=vr9
  212. DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h
  213. DEPS:=@TARGET_lantiq_xrx200
  214. endef
  215. define uboot/fb3370_sfspl
  216. TITLE:=U-Boot for AVM FRITZ3370 (SPI SPL)
  217. SOC:=vr9
  218. IMAGE:=u-boot.ltq.lzo.sfspl
  219. DEPS:=@TARGET_lantiq_xrx200
  220. endef
  221. define uboot/p2812hnufx_ram
  222. TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (RAM)
  223. SOC:=vr9
  224. DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h
  225. DEPS:=@TARGET_lantiq_xrx200
  226. endef
  227. define uboot/p2812hnufx_nandspl
  228. TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (NAND SPL)
  229. SOC:=vr9
  230. IMAGE:=u-boot.ltq.lzo.nandspl
  231. DEPS:=@TARGET_lantiq_xrx200
  232. endef
  233. define uboot/vgv7510kw22_brn
  234. TITLE:=U-Boot for Arcadyan VGV7510KW22 (BRN)
  235. SOC:=vr9
  236. DEPS:=@TARGET_lantiq_xrx200
  237. endef
  238. define uboot/vgv7510kw22_nor
  239. TITLE:=U-Boot for Arcadyan VGV7510KW22 (NOR)
  240. SOC:=vr9
  241. DEPS:=@TARGET_lantiq_xrx200
  242. endef
  243. define uboot/vgv7510kw22_ram
  244. TITLE:=U-Boot for Arcadyan VGV7510KW22 (RAM)
  245. SOC:=vr9
  246. DDR_SETTINGS:=board/arcadyan/vgv7510kw22/ddr_settings.h
  247. DEPS:=@TARGET_lantiq_xrx200
  248. endef
  249. define uboot/vgv7519_brn
  250. TITLE:=U-Boot for Arcadyan VGV7519 (BRN)
  251. SOC:=vr9
  252. DEPS:=@TARGET_lantiq_xrx200
  253. endef
  254. define uboot/vgv7519_nor
  255. TITLE:=U-Boot for Arcadyan VGV7519 (NOR)
  256. SOC:=vr9
  257. DEPS:=@TARGET_lantiq_xrx200
  258. endef
  259. define uboot/vgv7519_ram
  260. TITLE:=U-Boot for Arcadyan VGV7519 (RAM)
  261. SOC:=vr9
  262. DDR_SETTINGS:=board/arcadyan/vgv7519/ddr_settings.h
  263. DEPS:=@TARGET_lantiq_xrx200
  264. endef
  265. UBOOTS:= \
  266. arv4519pw_ram arv4519pw_nor arv4519pw_brn \
  267. arv7510pw_ram arv7510pw_nor arv7510pw_brn \
  268. arv7510pw22_ram arv7510pw22_nor arv7510pw22_brn \
  269. arv7518pw_ram arv7518pw_nor arv7518pw_brn \
  270. arv752dpw_ram arv752dpw_nor arv752dpw_brn \
  271. arv752dpw22_ram arv752dpw22_nor arv752dpw22_brn \
  272. arv8539pw22_brn arv8539pw22_nor arv8539pw22_ram \
  273. gigasx76x_ram gigasx76x_nor \
  274. acmp252_ram acmp252_nor \
  275. easy50712_ram easy50712_nor easy50712_norspl \
  276. easy80920_ram easy80920_nor easy80920_norspl easy80920_sfspl \
  277. fb3370_eva fb3370_ram fb3370_sfspl \
  278. p2812hnufx_ram p2812hnufx_nandspl \
  279. vgv7510kw22_brn vgv7510kw22_nor vgv7510kw22_ram \
  280. vgv7519_brn vgv7519_nor vgv7519_ram
  281. define Package/uboot/template
  282. define Package/uboot-lantiq-$(1)
  283. SECTION:=boot
  284. CATEGORY:=Boot Loaders
  285. DEPENDS:=$(3)
  286. TITLE:=$(2)
  287. URL:=http://www.denx.de/wiki/U-Boot
  288. VARIANT:=$(1)
  289. MAINTAINER:=Luka Perkov <luka@openwrt.org>
  290. endef
  291. endef
  292. define BuildUBootPackage
  293. $(eval $(uboot/Default))
  294. $(eval $(uboot/$(1)))
  295. DEPS:=$(uboot/$(1)/DEPS)
  296. $(call Package/uboot/template,$(1),$(TITLE),$(DEPS))
  297. endef
  298. define CompressVR9Firmware
  299. $(STAGING_DIR_HOST)/bin/lzma e \
  300. $(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \
  301. $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/fw_phy$(1)_a$(2)x.blob
  302. endef
  303. define Build/Prepare
  304. $(call Build/Prepare/Default)
  305. mkdir -p $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/
  306. $(call CompressVR9Firmware,11g,1)
  307. $(call CompressVR9Firmware,11g,2)
  308. $(call CompressVR9Firmware,22f,1)
  309. $(call CompressVR9Firmware,22f,2)
  310. endef
  311. define Build/Configure
  312. $(MAKE) -C $(PKG_BUILD_DIR) $(BUILD_VARIANT)_config
  313. endef
  314. define Build/Compile
  315. $(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS)
  316. endef
  317. define Package/uboot/install/default
  318. $(CP) \
  319. $(PKG_BUILD_DIR)/$(2) \
  320. $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img
  321. endef
  322. define Package/uboot/install/uart
  323. awk -f $(PKG_BUILD_DIR)/tools/lantiq_ram_init_uart.awk \
  324. -v soc=$(2) $(PKG_BUILD_DIR)/$(3) \
  325. > $(PKG_BUILD_DIR)/ddr_settings
  326. perl $(PKG_BUILD_DIR)/tools/gct.pl \
  327. $(PKG_BUILD_DIR)/ddr_settings $(PKG_BUILD_DIR)/u-boot.srec \
  328. $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.asc
  329. endef
  330. define Package/uboot/install/template
  331. define Package/uboot-lantiq-$(1)/install
  332. $(call Package/uboot/install/default,$(1),$(if $(IMAGE),$(IMAGE),u-boot.bin))
  333. $(if $(DDR_SETTINGS), \
  334. $(call Package/uboot/install/uart,$(1),$(SOC),$(DDR_SETTINGS)) \
  335. )
  336. endef
  337. endef
  338. $(foreach u,$(UBOOTS), \
  339. $(eval $(call BuildUBootPackage,$(u))) \
  340. $(eval $(call Package/uboot/install/template,$(u))) \
  341. $(eval $(call BuildPackage,uboot-lantiq-$(u))) \
  342. )