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
12 PKG_VERSION:=2016.01-rc3
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:=8ec1743d75448bd3d0c73f8722db9213
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
69 define uboot/Hummingbird_A31
70 TITLE:=U-Boot for the Hummingbird A31 board
74 TITLE:=U-Boot for the Mele M9 (A31)
77 define uboot/OLIMEX_A13_SOM
78 TITLE:=U-Boot for the Olimex A13 SOM
81 define uboot/Linksprite_pcDuino
82 TITLE:=U-Boot for Linksprite pcDuino
85 define uboot/Linksprite_pcDuino3
86 TITLE:=U-Boot for Linksprite pcDuino3
89 define uboot/Lamobo_R1
90 TITLE:=U-Boot for Lamobo R1
93 define uboot/orangepi_plus
94 TITLE:=U-Boot for Orange Pi Plus (H3)
101 A20-OLinuXino_MICRO \
111 Linksprite_pcDuino3 \
115 define Package/uboot/template
116 define Package/uboot-sunxi-$(1)
118 CATEGORY:=Boot Loaders
119 DEPENDS:=@TARGET_sunxi
121 URL:=http://www.denx.de/wiki/U-Boot
123 MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
127 define BuildUBootPackage
128 $(eval $(uboot/Default))
129 $(eval $(uboot/$(1)))
130 $(call Package/uboot/template,$(1),$(TITLE))
134 $(eval $(call uboot/$(BUILD_VARIANT)))
135 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
136 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
139 define Build/Configure
140 $(MAKE) -C $(PKG_BUILD_DIR) \
141 USE_PRIVATE_LIBGCC=yes $(UBOOT_CONFIG)_defconfig
145 $(MAKE) -C $(PKG_BUILD_DIR) \
146 CROSS_COMPILE=$(TARGET_CROSS) \
147 DTCDIR=$(LINUX_DIR)/scripts/dtc/
150 define Package/uboot/install/default
151 $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
152 $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot.bin
153 $(CP) $(PKG_BUILD_DIR)/spl/sunxi-spl.bin \
154 $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-spl.bin
155 $(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \
156 $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot-with-spl.bin
158 $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-uEnv.txt
159 mkimage -C none -A arm -T script -d $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-uEnv.txt \
160 $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-boot.scr
163 define Package/uboot/install/template
164 define Package/uboot-sunxi-$(1)/install
165 $(call Package/uboot/install/default,$(2))
169 $(foreach u,$(UBOOTS), \
170 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
173 $(foreach u,$(UBOOTS), \
174 $(eval $(call BuildUBootPackage,$(u))) \
175 $(eval $(call BuildPackage,uboot-sunxi-$(u))) \