uboot-imx6: update to 2013.10
[openwrt/staging/wigyori.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.10
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:=a076a044b64371edc52f7e562b13f6b2
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) $(UBOOT_CONFIG)_config
102 endef
103
104 define Build/Compile
105 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS)
106 endef
107
108 define Package/uboot/install/default
109 $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
110 $(CP) \
111 $(PKG_BUILD_DIR)/u-boot.imx \
112 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.imx
113 endef
114
115 define Package/uboot/install/template
116 define Package/uboot-imx6-$(1)/install
117 $(call Package/uboot/install/default,$(2))
118 endef
119 endef
120
121 $(foreach u,$(UBOOTS), \
122 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
123 )
124
125 $(foreach u,$(UBOOTS), \
126 $(eval $(call BuildUBootPackage,$(u))) \
127 $(eval $(call BuildPackage,uboot-imx6-$(u))) \
128 )