2 # Copyright (C) 2013 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
11 PKG_VERSION:=2013.10-rc2-sunxi
14 PKG_SOURCE_URL:=git://github.com/linux-sunxi/u-boot-sunxi
15 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE_VERSION:=b322f6723d59b9bb88701991c7b8b15867bf3692
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
20 include $(INCLUDE_DIR)/package.mk
28 define uboot/A10-OLinuXino-Lime
29 TITLE:=U-Boot 2013.10-rc2 for the A10 OLinuXino LIME
32 define uboot/A13-OLinuXino
33 TITLE:=U-Boot 2013.10-rc2 for the A13 OlinuXino
36 define uboot/A20-OLinuXino_MICRO
37 TITLE:=U-Boot 2013.10-rc2 for A20 OLinuXino MICRO
40 define uboot/Cubieboard
41 TITLE:=U-Boot 2013.10-rc2 for Cubieboard
44 define uboot/Cubieboard2
45 TITLE:=U-Boot 2013.10-rc2 for Cubieboard2
48 define uboot/Cubietruck
49 TITLE:=U-Boot 2013.10-rc2 for Cubietruck
52 define uboot/Hackberry
53 TITLE:=U-Boot 2013.10-rc2 for the Hackbeery
57 TITLE:=U-Boot 2013.10-rc2 for pcDuino
60 UBOOTS:=A10-OLinuXino-Lime A13-OLinuXino A20-OLinuXino_MICRO Cubieboard Cubieboard2 Cubietruck Hackberry pcDuino
62 define Package/uboot/template
63 define Package/uboot-sunxi-$(1)
65 CATEGORY:=Boot Loaders
66 DEPENDS:=@TARGET_sunxi
68 URL:=http://www.denx.de/wiki/U-Boot
70 MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
74 define BuildUBootPackage
75 $(eval $(uboot/Default))
77 $(call Package/uboot/template,$(1),$(TITLE))
81 $(eval $(call uboot/$(BUILD_VARIANT)))
82 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
83 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
86 define Build/Configure
87 $(MAKE) -C $(PKG_BUILD_DIR) \
88 USE_PRIVATE_LIBGCC=yes $(UBOOT_CONFIG)_config
92 $(MAKE) -C $(PKG_BUILD_DIR) \
93 CROSS_COMPILE=$(TARGET_CROSS)
96 define Package/uboot/install/default
97 $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
98 $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
99 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
100 $(CP) $(PKG_BUILD_DIR)/spl/sunxi-spl.bin \
101 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-spl.bin
102 $(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \
103 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-with-spl.bin
105 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt
108 define Package/uboot/install/template
109 define Package/uboot-sunxi-$(1)/install
110 $(call Package/uboot/install/default,$(2))
114 $(foreach u,$(UBOOTS), \
115 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
118 $(foreach u,$(UBOOTS), \
119 $(eval $(call BuildUBootPackage,$(u))) \
120 $(eval $(call BuildPackage,uboot-sunxi-$(u))) \