Makefile 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  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_ARV4519PW
  35. endef
  36. define uboot/arv4519pw_nor
  37. TITLE:=U-Boot for Arcadyan arv4519pw (NOR)
  38. SOC:=danube
  39. DEPS:=@TARGET_lantiq_xway_ARV4519PW
  40. endef
  41. define uboot/arv4519pw_brn
  42. TITLE:=U-Boot for Arcadyan arv4519pw (BRN)
  43. SOC:=danube
  44. DEPS:=@TARGET_lantiq_xway_ARV4519PW
  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_ARV4510PW
  51. endef
  52. define uboot/arv7510pw_nor
  53. TITLE:=U-Boot for Arcadyan arv7510pw (NOR)
  54. SOC:=danube
  55. DEPS:=@TARGET_lantiq_xway_ARV4510PW
  56. endef
  57. define uboot/arv7510pw_brn
  58. TITLE:=U-Boot for Arcadyan arv7510pw (BRN)
  59. SOC:=danube
  60. DEPS:=@TARGET_lantiq_xway_ARV4510PW
  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_ARV7510PW22
  67. endef
  68. define uboot/arv7510pw22_nor
  69. TITLE:=U-Boot for Arcadyan arv7510pw22 (NOR)
  70. SOC:=danube
  71. DEPS:=@TARGET_lantiq_xway_ARV7510PW22
  72. endef
  73. define uboot/arv7510pw22_brn
  74. TITLE:=U-Boot for Arcadyan arv7510pw22 (BRN)
  75. SOC:=danube
  76. DEPS:=@TARGET_lantiq_xway_ARV7510PW22
  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_ARV7518PW
  83. endef
  84. define uboot/arv7518pw_nor
  85. TITLE:=U-Boot for Arcadyan arv7518pw (NOR)
  86. SOC:=danube
  87. DEPS:=@TARGET_lantiq_xway_ARV7518PW
  88. endef
  89. define uboot/arv7518pw_brn
  90. TITLE:=U-Boot for Arcadyan arv7518pw (BRN)
  91. SOC:=danube
  92. DEPS:=@TARGET_lantiq_xway_ARV7518PW
  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_ARV752DPW
  99. endef
  100. define uboot/arv752dpw_nor
  101. TITLE:=U-Boot for Arcadyan arv752dpw (NOR)
  102. SOC:=danube
  103. DEPS:=@TARGET_lantiq_xway_ARV752DPW
  104. endef
  105. define uboot/arv752dpw_brn
  106. TITLE:=U-Boot for Arcadyan arv752dpw (BRN)
  107. SOC:=danube
  108. DEPS:=@TARGET_lantiq_xway_ARV752DPW
  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_ARV752DPW22
  115. endef
  116. define uboot/arv752dpw22_nor
  117. TITLE:=U-Boot for Arcadyan arv752dpw22 (NOR)
  118. SOC:=danube
  119. DEPS:=@TARGET_lantiq_xway_ARV752DPW22
  120. endef
  121. define uboot/arv752dpw22_brn
  122. TITLE:=U-Boot for Arcadyan arv752dpw22 (BRN)
  123. SOC:=danube
  124. DEPS:=@TARGET_lantiq_xway_ARV752DPW22
  125. endef
  126. define uboot/gigasx76x_ram
  127. TITLE:=U-Boot for Siemens Gigaset sx76x (RAM)
  128. SOC:=danube
  129. DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h
  130. DEPS:=@TARGET_lantiq_xway_GIGASX76X
  131. endef
  132. define uboot/gigasx76x_nor
  133. TITLE:=U-Boot for Siemens Gigaset sx76x (NOR)
  134. SOC:=danube
  135. DEPS:=@TARGET_lantiq_xway_GIGASX76X
  136. endef
  137. define uboot/acmp252_ram
  138. TITLE:=U-Boot for AudioCodes MP-252 (RAM)
  139. SOC:=danube
  140. DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h
  141. DEPS:=@TARGET_lantiq_xway_ACMP252
  142. endef
  143. define uboot/acmp252_nor
  144. TITLE:=U-Boot for AudioCodes MP-252 (NOR)
  145. SOC:=danube
  146. DEPS:=@TARGET_lantiq_xway_ACMP252
  147. endef
  148. define uboot/easy50712_ram
  149. TITLE:=U-Boot for Lantiq EASY50712 (RAM)
  150. SOC:=danube
  151. DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h
  152. DEPS:=@TARGET_lantiq_xway_EASY50712
  153. endef
  154. define uboot/easy50712_nor
  155. TITLE:=U-Boot for Lantiq EASY50712 (NOR)
  156. SOC:=danube
  157. DEPS:=@TARGET_lantiq_xway_EASY50712
  158. endef
  159. define uboot/easy50712_norspl
  160. TITLE:=U-Boot for Lantiq EASY50712 (NOR SPL)
  161. SOC:=danube
  162. IMAGE:=u-boot.ltq.lzo.norspl
  163. DEPS:=@TARGET_lantiq_xway_EASY50712
  164. endef
  165. define uboot/easy80920_ram
  166. TITLE:=U-Boot for Lantiq EASY80920 (RAM)
  167. SOC:=vr9
  168. DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h
  169. DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
  170. endef
  171. define uboot/easy80920_nor
  172. TITLE:=U-Boot for Lantiq EASY80920 (NOR)
  173. SOC:=vr9
  174. DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
  175. endef
  176. define uboot/easy80920_norspl
  177. TITLE:=U-Boot for Lantiq EASY80920 (NOR SPL)
  178. SOC:=vr9
  179. IMAGE:=u-boot.ltq.lzo.norspl
  180. DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
  181. endef
  182. define uboot/easy80920_sfspl
  183. TITLE:=U-Boot for Lantiq EASY80920 (SPI SPL)
  184. SOC:=vr9
  185. IMAGE:=u-boot.ltq.lzo.sfspl
  186. DEPS:=@(TARGET_lantiq_xrx200_EASY80920NOR||TARGET_lantiq_xrx200_EASY80920NAND)
  187. endef
  188. define uboot/fb3370_eva
  189. TITLE:=U-Boot for AVM FRITZ3370 (EVA)
  190. SOC:=vr9
  191. DEPS:=@TARGET_lantiq_xrx200_FRITZ3370
  192. endef
  193. define uboot/fb3370_ram
  194. TITLE:=U-Boot for AVM FRITZ3370 (RAM)
  195. SOC:=vr9
  196. DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h
  197. DEPS:=@TARGET_lantiq_xrx200_FRITZ3370
  198. endef
  199. define uboot/fb3370_sfspl
  200. TITLE:=U-Boot for AVM FRITZ3370 (SPI SPL)
  201. SOC:=vr9
  202. IMAGE:=u-boot.ltq.lzo.sfspl
  203. DEPS:=@TARGET_lantiq_xrx200_FRITZ3370
  204. endef
  205. define uboot/p2812hnufx_ram
  206. TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (RAM)
  207. SOC:=vr9
  208. DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h
  209. DEPS:=@TARGET_lantiq_xrx200_P2812HNUF1||@TARGET_lantiq_xrx200_P2812HNUF3
  210. endef
  211. define uboot/p2812hnufx_nandspl
  212. TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (NAND SPL)
  213. SOC:=vr9
  214. IMAGE:=u-boot.ltq.lzo.nandspl
  215. DEPS:=@TARGET_lantiq_xrx200_P2812HNUF1||@TARGET_lantiq_xrx200_P2812HNUF3
  216. endef
  217. define uboot/vgv7510kw22_brn
  218. TITLE:=U-Boot for Arcadyan VGV7510KW22 (BRN)
  219. SOC:=vr9
  220. DEPS:=@TARGET_lantiq_xrx200_VGV7510KW22NOR||@TARGET_lantiq_xrx200_VGV7510KW22BRN
  221. endef
  222. define uboot/vgv7510kw22_nor
  223. TITLE:=U-Boot for Arcadyan VGV7510KW22 (NOR)
  224. SOC:=vr9
  225. DEPS:=@TARGET_lantiq_xrx200_VGV7510KW22NOR||@TARGET_lantiq_xrx200_VGV7510KW22BRN
  226. endef
  227. define uboot/vgv7510kw22_ram
  228. TITLE:=U-Boot for Arcadyan VGV7510KW22 (RAM)
  229. SOC:=vr9
  230. DDR_SETTINGS:=board/arcadyan/vgv7510kw22/ddr_settings.h
  231. DEPS:=@TARGET_lantiq_xrx200_VGV7510KW22NOR||@TARGET_lantiq_xrx200_VGV7510KW22BRN
  232. endef
  233. UBOOTS:= \
  234. arv4519pw_ram arv4519pw_nor arv4519pw_brn \
  235. arv7510pw_ram arv7510pw_nor arv7510pw_brn \
  236. arv7510pw22_ram arv7510pw22_nor arv7510pw22_brn \
  237. arv7518pw_ram arv7518pw_nor arv7518pw_brn \
  238. arv752dpw_ram arv752dpw_nor arv752dpw_brn \
  239. arv752dpw22_ram arv752dpw22_nor arv752dpw22_brn \
  240. gigasx76x_ram gigasx76x_nor \
  241. acmp252_ram acmp252_nor \
  242. easy50712_ram easy50712_nor easy50712_norspl \
  243. easy80920_ram easy80920_nor easy80920_norspl easy80920_sfspl \
  244. fb3370_eva fb3370_ram fb3370_sfspl \
  245. p2812hnufx_ram p2812hnufx_nandspl \
  246. vgv7510kw22_brn vgv7510kw22_nor vgv7510kw22_ram
  247. define Package/uboot/template
  248. define Package/uboot-lantiq-$(1)
  249. SECTION:=boot
  250. CATEGORY:=Boot Loaders
  251. DEPENDS:=$(3)
  252. TITLE:=$(2)
  253. URL:=http://www.denx.de/wiki/U-Boot
  254. VARIANT:=$(1)
  255. MAINTAINER:=Luka Perkov <luka@openwrt.org>
  256. endef
  257. endef
  258. define BuildUBootPackage
  259. $(eval $(uboot/Default))
  260. $(eval $(uboot/$(1)))
  261. DEPS:=$(uboot/$(1)/DEPS)
  262. $(call Package/uboot/template,$(1),$(TITLE),$(DEPS))
  263. endef
  264. define CopyVR9Firmware
  265. $(CP) $(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \
  266. $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/fw_phy$(1)_a$(2)x.blob
  267. endef
  268. define Build/Prepare
  269. $(call Build/Prepare/Default)
  270. mkdir -p $(PKG_BUILD_DIR)/arch/mips/cpu/mips32/vrx200/
  271. $(call CopyVR9Firmware,11g,1)
  272. $(call CopyVR9Firmware,11g,2)
  273. $(call CopyVR9Firmware,22f,1)
  274. $(call CopyVR9Firmware,22f,2)
  275. endef
  276. define Build/Configure
  277. $(MAKE) -C $(PKG_BUILD_DIR) $(BUILD_VARIANT)_config
  278. endef
  279. define Build/Compile
  280. $(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS)
  281. endef
  282. define Package/uboot/install/default
  283. $(CP) \
  284. $(PKG_BUILD_DIR)/$(2) \
  285. $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img
  286. endef
  287. define Package/uboot/install/uart
  288. awk -f $(PKG_BUILD_DIR)/tools/lantiq_ram_init_uart.awk \
  289. -v soc=$(2) $(PKG_BUILD_DIR)/$(3) \
  290. > $(PKG_BUILD_DIR)/ddr_settings
  291. perl $(PKG_BUILD_DIR)/tools/gct.pl \
  292. $(PKG_BUILD_DIR)/ddr_settings $(PKG_BUILD_DIR)/u-boot.srec \
  293. $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.asc
  294. endef
  295. define Package/uboot/install/template
  296. define Package/uboot-lantiq-$(1)/install
  297. $(call Package/uboot/install/default,$(1),$(if $(IMAGE),$(IMAGE),u-boot.bin))
  298. $(if $(DDR_SETTINGS), \
  299. $(call Package/uboot/install/uart,$(1),$(SOC),$(DDR_SETTINGS)) \
  300. )
  301. endef
  302. endef
  303. $(foreach u,$(UBOOTS), \
  304. $(eval $(call BuildUBootPackage,$(u))) \
  305. $(eval $(call Package/uboot/install/template,$(u))) \
  306. $(eval $(call BuildPackage,uboot-lantiq-$(u))) \
  307. )