uboot-sunxi: add support for Olimex A20-OLinuXino-LIME
[openwrt/svn-archive/archive.git] / package / boot / uboot-sunxi / 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_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:=6d2116d1385a66e9a59742caa9d62a54
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 for the A10 OLinuXino LIME
29 endef
30
31 define uboot/A13-OLinuXino
32 TITLE:=U-Boot for the A13 OlinuXino
33 endef
34
35 define uboot/A20-OLinuXino_Lime
36 TITLE:=U-Boot for the A20 OLinuXino LIME
37 endef
38
39 define uboot/A20-OLinuXino_MICRO
40 TITLE:=U-Boot for A20 OLinuXino MICRO
41 endef
42
43 define uboot/Bananapi
44 TITLE:=U-Boot for Bananapi
45 endef
46
47 define uboot/Cubieboard
48 TITLE:=U-Boot for Cubieboard
49 endef
50
51 define uboot/Cubieboard2
52 TITLE:=U-Boot for Cubieboard2
53 endef
54
55 define uboot/Cubietruck
56 TITLE:=U-Boot for Cubietruck
57 endef
58
59 define uboot/Hackberry
60 TITLE:=U-Boot for the Hackbeery
61 endef
62
63 define uboot/OLIMEX-A13-SOM
64 TITLE:=U-Boot for the Olimex A13 SOM
65 endef
66
67 define uboot/pcDuino
68 TITLE:=U-Boot for pcDuino
69 endef
70
71 define uboot/Linksprite_pcDuino3
72 TITLE:=U-Boot for Linksprite pcDuino3
73 endef
74
75 UBOOTS:= \
76 A10-OLinuXino-Lime \
77 A13-OLinuXino \
78 A20-OLinuXino_Lime \
79 A20-OLinuXino_MICRO \
80 Bananapi \
81 Cubieboard \
82 Cubieboard2 \
83 Cubietruck \
84 Hackberry \
85 OLIMEX-A13-SOM \
86 pcDuino \
87 Linksprite_pcDuino3 \
88
89 define Package/uboot/template
90 define Package/uboot-sunxi-$(1)
91 SECTION:=boot
92 CATEGORY:=Boot Loaders
93 DEPENDS:=@TARGET_sunxi
94 TITLE:=$(2)
95 URL:=http://www.denx.de/wiki/U-Boot
96 VARIANT:=$(1)
97 MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
98 endef
99 endef
100
101 define BuildUBootPackage
102 $(eval $(uboot/Default))
103 $(eval $(uboot/$(1)))
104 $(call Package/uboot/template,$(1),$(TITLE))
105 endef
106
107 ifdef BUILD_VARIANT
108 $(eval $(call uboot/$(BUILD_VARIANT)))
109 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
110 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
111 endif
112
113 define Build/Configure
114 $(MAKE) -C $(PKG_BUILD_DIR) \
115 USE_PRIVATE_LIBGCC=yes $(UBOOT_CONFIG)_config
116 endef
117
118 define Build/Compile
119 $(MAKE) -C $(PKG_BUILD_DIR) \
120 CROSS_COMPILE=$(TARGET_CROSS)
121 endef
122
123 define Package/uboot/install/default
124 $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
125 $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
126 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
127 $(CP) $(PKG_BUILD_DIR)/spl/sunxi-spl.bin \
128 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-spl.bin
129 $(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \
130 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-with-spl.bin
131 $(CP) uEnv.txt \
132 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-uEnv.txt
133 endef
134
135 define Package/uboot/install/template
136 define Package/uboot-sunxi-$(1)/install
137 $(call Package/uboot/install/default,$(2))
138 endef
139 endef
140
141 $(foreach u,$(UBOOTS), \
142 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
143 )
144
145 $(foreach u,$(UBOOTS), \
146 $(eval $(call BuildUBootPackage,$(u))) \
147 $(eval $(call BuildPackage,uboot-sunxi-$(u))) \
148 )