uboot-imx6: add support for Nitrogen6x boards
[openwrt/staging/wigyori.git] / package / boot / uboot-imx6 / 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:=2013.07
12 PKG_RELEASE:=1
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot
17 PKG_MD5SUM:=8445162690052e6afd4b8f87af2bb557
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define uboot/Default
22 TITLE:=
23 CONFIG:=
24 IMAGE:=
25 endef
26
27 define uboot/nitrogen6dl
28 TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 1GB board
29 endef
30
31 define uboot/nitrogen6dl2g
32 TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 2GB board
33 endef
34
35 define uboot/nitrogen6q
36 TITLE:=U-Boot for Nitrogen6x/SABRE Lite (MX6Q/1GB)
37 endef
38
39 define uboot/nitrogen6q2g
40 TITLE:=U-Boot for Nitrogen6x i.MX6Quad 2GB board
41 endef
42
43 define uboot/nitrogen6s
44 TITLE:=U-Boot for Nitrogen6x i.MX6Solo 512MB board
45 endef
46
47 define uboot/nitrogen6s1g
48 TITLE:=U-Boot for Nitrogen6x i.MX6Solo 1GB board
49 endef
50
51 define uboot/wandboard_dl
52 TITLE:=U-Boot for the Wandboard Dual Lite
53 endef
54
55 define uboot/wandboard_quad
56 TITLE:=U-Boot for the Wandboard Quad
57 endef
58
59 define uboot/wandboard_solo
60 TITLE:=U-Boot for the Wandboard Solo
61 endef
62
63 UBOOTS := \
64 nitrogen6dl \
65 nitrogen6dl1g \
66 nitrogen6q \
67 nitrogen6q2g \
68 nitrogen6s \
69 nitrogen6s1g \
70 wandboard_dl \
71 wandboard_quad \
72 wandboard_solo
73
74 define Package/uboot/template
75 define Package/uboot-imx6-$(1)
76 SECTION:=boot
77 CATEGORY:=Boot Loaders
78 DEPENDS:=@TARGET_imx6
79 TITLE:=$(2)
80 URL:=http://www.denx.de/wiki/U-Boot
81 VARIANT:=$(1)
82 MAINTAINER:=Luka Perkov <luka@openwrt.org>
83 endef
84 endef
85
86 define BuildUBootPackage
87 $(eval $(uboot/Default))
88 $(eval $(uboot/$(1)))
89 $(call Package/uboot/template,$(1),$(TITLE))
90 endef
91
92 ifdef BUILD_VARIANT
93 $(eval $(call uboot/$(BUILD_VARIANT)))
94 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
95 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
96 endif
97
98 define Build/Configure
99 $(MAKE) -C $(PKG_BUILD_DIR) \
100 $(UBOOT_CONFIG)_config
101 endef
102
103 define Build/Compile
104 $(MAKE) -C $(PKG_BUILD_DIR) \
105 CROSS_COMPILE=$(TARGET_CROSS)
106 endef
107
108 define Package/uboot/install/default
109 $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
110 $(CP) \
111 $(PKG_BUILD_DIR)/u-boot.imx \
112 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.imx
113 endef
114
115 define Package/uboot/install/template
116 define Package/uboot-imx6-$(1)/install
117 $(call Package/uboot/install/default,$(2))
118 endef
119 endef
120
121 $(foreach u,$(UBOOTS), \
122 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
123 )
124
125 $(foreach u,$(UBOOTS), \
126 $(eval $(call BuildUBootPackage,$(u))) \
127 $(eval $(call BuildPackage,uboot-imx6-$(u))) \
128 )