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