u-boot: prefer mirror2.openwrt.org over ftp.denx.de - the denx ftp is slow and unreliable
[openwrt.git] / package / boot / uboot-imx6 / Makefile
1 #
2 # Copyright (C) 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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=u-boot
11 PKG_VERSION:=2013.07
12 PKG_RELEASE:=1
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:= \
17         http://mirror2.openwrt.org/sources \
18         ftp://ftp.denx.de/pub/u-boot
19 PKG_MD5SUM:=8445162690052e6afd4b8f87af2bb557
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define uboot/Default
24   TITLE:=
25   CONFIG:=
26   IMAGE:=
27 endef
28
29 define uboot/nitrogen6dl
30   TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 1GB board
31 endef
32
33 define uboot/nitrogen6dl2g
34   TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 2GB board
35 endef
36
37 define uboot/nitrogen6q
38   TITLE:=U-Boot for Nitrogen6x/SABRE Lite (MX6Q/1GB)
39 endef
40
41 define uboot/nitrogen6q2g
42   TITLE:=U-Boot for Nitrogen6x i.MX6Quad 2GB board
43 endef
44
45 define uboot/nitrogen6s
46   TITLE:=U-Boot for Nitrogen6x i.MX6Solo 512MB board
47 endef
48
49 define uboot/nitrogen6s1g
50   TITLE:=U-Boot for Nitrogen6x i.MX6Solo 1GB board
51 endef
52
53 define uboot/wandboard_dl
54   TITLE:=U-Boot for the Wandboard Dual Lite
55 endef
56
57 define uboot/wandboard_quad
58   TITLE:=U-Boot for the Wandboard Quad
59 endef
60
61 define uboot/wandboard_solo
62   TITLE:=U-Boot for the Wandboard Solo
63 endef
64
65 UBOOTS := \
66         nitrogen6dl \
67         nitrogen6dl2g \
68         nitrogen6q \
69         nitrogen6q2g \
70         nitrogen6s \
71         nitrogen6s1g \
72         wandboard_dl \
73         wandboard_quad \
74         wandboard_solo
75
76 define Package/uboot/template
77 define Package/uboot-imx6-$(1)
78   SECTION:=boot
79   CATEGORY:=Boot Loaders
80   DEPENDS:=@TARGET_imx6
81   TITLE:=$(2)
82   URL:=http://www.denx.de/wiki/U-Boot
83   VARIANT:=$(1)
84   MAINTAINER:=Luka Perkov <luka@openwrt.org>
85 endef
86 endef
87
88 define BuildUBootPackage
89         $(eval $(uboot/Default))
90         $(eval $(uboot/$(1)))
91         $(call Package/uboot/template,$(1),$(TITLE))
92 endef
93
94 ifdef BUILD_VARIANT
95 $(eval $(call uboot/$(BUILD_VARIANT)))
96 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
97 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
98 endif
99
100 define Build/Configure
101         $(MAKE) -C $(PKG_BUILD_DIR) \
102                 $(UBOOT_CONFIG)_config
103 endef
104
105 define Build/Compile
106         $(MAKE) -C $(PKG_BUILD_DIR) \
107                 CROSS_COMPILE=$(TARGET_CROSS)
108 endef
109
110 define Package/uboot/install/default
111         $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
112         $(CP) \
113                 $(PKG_BUILD_DIR)/u-boot.imx \
114                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.imx
115 endef
116
117 define Package/uboot/install/template
118 define Package/uboot-imx6-$(1)/install
119         $(call Package/uboot/install/default,$(2))
120 endef
121 endef
122
123 $(foreach u,$(UBOOTS), \
124         $(eval $(call Package/uboot/install/template,$(u),$(u))) \
125 )
126
127 $(foreach u,$(UBOOTS), \
128         $(eval $(call BuildUBootPackage,$(u))) \
129         $(eval $(call BuildPackage,uboot-imx6-$(u))) \
130 )