uboot-sunxi: bump u-boot version
[openwrt.git] / package / boot / uboot-sunxi / 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:=2014.01-rc1
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_SOURCE_VERSION:=1552fe43c3e827d56c9cd212fba3dcba
17 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define uboot/Default
22   TITLE:=
23   CONFIG:=
24   IMAGE:=
25 endef
26
27 define uboot/A10-OLinuXino-Lime
28   TITLE:=U-Boot 2014.01-rc1 for the A10 OLinuXino LIME
29 endef
30
31 define uboot/A13-OLinuXino
32   TITLE:=U-Boot 2014.01-rc1 for the A13 OlinuXino
33 endef
34
35 define uboot/A20-OLinuXino_MICRO
36   TITLE:=U-Boot 2014.01-rc1 for A20 OLinuXino MICRO
37 endef
38
39 define uboot/Cubieboard
40   TITLE:=U-Boot 2014.01-rc1 for Cubieboard
41 endef
42
43 define uboot/Cubieboard2
44   TITLE:=U-Boot 2014.01-rc1 for Cubieboard2
45 endef
46
47 define uboot/Cubietruck
48   TITLE:=U-Boot 2014.01-rc1 for Cubietruck
49 endef
50
51 define uboot/Hackberry
52   TITLE:=U-Boot 2014.01-rc1 for the Hackbeery
53 endef
54
55 define uboot/pcDuino
56   TITLE:=U-Boot 2014.01-rc1 for pcDuino
57 endef  
58
59 UBOOTS:=A10-OLinuXino-Lime A13-OLinuXino A20-OLinuXino_MICRO Cubieboard Cubieboard2 Cubietruck Hackberry pcDuino
60
61 define Package/uboot/template
62 define Package/uboot-sunxi-$(1)
63   SECTION:=boot
64   CATEGORY:=Boot Loaders
65   DEPENDS:=@TARGET_sunxi
66   TITLE:=$(2)
67   URL:=http://www.denx.de/wiki/U-Boot
68   VARIANT:=$(1)
69   MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
70 endef
71 endef
72
73 define BuildUBootPackage
74         $(eval $(uboot/Default))
75         $(eval $(uboot/$(1)))
76         $(call Package/uboot/template,$(1),$(TITLE))
77 endef
78
79 ifdef BUILD_VARIANT
80 $(eval $(call uboot/$(BUILD_VARIANT)))
81 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
82 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
83 endif
84
85 define Build/Configure
86         $(MAKE) -C $(PKG_BUILD_DIR) \
87                 USE_PRIVATE_LIBGCC=yes $(UBOOT_CONFIG)_config
88 endef
89
90 define Build/Compile
91         $(MAKE) -C $(PKG_BUILD_DIR) \
92                 CROSS_COMPILE=$(TARGET_CROSS)
93 endef
94
95 define Package/uboot/install/default
96         $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
97         $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
98                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
99         $(CP) $(PKG_BUILD_DIR)/spl/sunxi-spl.bin \
100                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-spl.bin
101         $(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \
102                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-with-spl.bin
103         $(CP) uEnv.txt \
104                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt
105 endef
106
107 define Package/uboot/install/template
108 define Package/uboot-sunxi-$(1)/install
109         $(call Package/uboot/install/default,$(2))
110 endef
111 endef
112
113 $(foreach u,$(UBOOTS), \
114         $(eval $(call Package/uboot/install/template,$(u),$(u))) \
115 )
116
117 $(foreach u,$(UBOOTS), \
118         $(eval $(call BuildUBootPackage,$(u))) \
119         $(eval $(call BuildPackage,uboot-sunxi-$(u))) \
120 )