2 # Copyright (C) 2013-2014 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
9 include $(INCLUDE_DIR)/kernel.mk
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 http://mirror2.openwrt.org/sources \
16 ftp://ftp.denx.de/pub/u-boot
18 PKG_MD5SUM:=7f08dc9e98a71652bd6968888ed6ec95
20 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
22 PKG_LICENSE:=GPL-2.0 GPL-2.0+
23 PKG_LICENSE_FILES:=Licenses/README
25 include $(INCLUDE_DIR)/package.mk
33 define uboot/A10-OLinuXino-Lime
34 TITLE:=U-Boot for the A10 OLinuXino LIME
37 define uboot/A13-OLinuXino
38 TITLE:=U-Boot for the A13 OlinuXino
41 define uboot/A20-OLinuXino-Lime
42 TITLE:=U-Boot for the A20 OLinuXino LIME
45 define uboot/A20-OLinuXino_MICRO
46 TITLE:=U-Boot for A20 OLinuXino MICRO
50 TITLE:=U-Boot for Bananapi
53 define uboot/Bananapro
54 TITLE:=U-Boot for Bananapro
57 define uboot/Cubieboard
58 TITLE:=U-Boot for Cubieboard
61 define uboot/Cubieboard2
62 TITLE:=U-Boot for Cubieboard2
65 define uboot/Cubietruck
66 TITLE:=U-Boot for Cubietruck
70 TITLE:=U-Boot for the Mele M9 (A31)
73 define uboot/OLIMEX_A13_SOM
74 TITLE:=U-Boot for the Olimex A13 SOM
77 define uboot/Linksprite_pcDuino
78 TITLE:=U-Boot for Linksprite pcDuino
81 define uboot/Linksprite_pcDuino3
82 TITLE:=U-Boot for Linksprite pcDuino3
85 define uboot/Lamobo_R1
86 TITLE:=U-Boot for Lamobo R1
102 Linksprite_pcDuino3 \
105 define Package/uboot/template
106 define Package/uboot-sunxi-$(1)
108 CATEGORY:=Boot Loaders
109 DEPENDS:=@TARGET_sunxi
111 URL:=http://www.denx.de/wiki/U-Boot
113 MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
117 define BuildUBootPackage
118 $(eval $(uboot/Default))
119 $(eval $(uboot/$(1)))
120 $(call Package/uboot/template,$(1),$(TITLE))
124 $(eval $(call uboot/$(BUILD_VARIANT)))
125 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
126 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
129 define Build/Configure
130 $(MAKE) -C $(PKG_BUILD_DIR) \
131 USE_PRIVATE_LIBGCC=yes $(UBOOT_CONFIG)_defconfig
135 $(MAKE) -C $(PKG_BUILD_DIR) \
136 CROSS_COMPILE=$(TARGET_CROSS)
139 define Package/uboot/install/default
140 $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
141 $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot.bin
142 $(CP) $(PKG_BUILD_DIR)/spl/sunxi-spl.bin \
143 $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-spl.bin
144 $(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \
145 $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot-with-spl.bin
147 $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-uEnv.txt
148 mkimage -C none -A arm -T script -d $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-uEnv.txt \
149 $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-boot.scr
152 define Package/uboot/install/template
153 define Package/uboot-sunxi-$(1)/install
154 $(call Package/uboot/install/default,$(2))
158 $(foreach u,$(UBOOTS), \
159 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
162 $(foreach u,$(UBOOTS), \
163 $(eval $(call BuildUBootPackage,$(u))) \
164 $(eval $(call BuildPackage,uboot-sunxi-$(u))) \