layerscape: add 64b/32b target for ls1046ardb device
[openwrt/staging/wigyori.git] / package / boot / uboot-layerscape-32b / Makefile
1 #
2 # Copyright (C) 2016 Jiang Yutang <jiangyutang1978@gmail.com>
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 include $(INCLUDE_DIR)/image.mk
10
11 PKG_NAME:=uboot-layerscape-32bit
12 PKG_VERSION:=v1.0
13 PKG_RELEASE:=1
14
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_URL:=https://github.com/fsl-jyt/uboot-ls-32b.git
19 PKG_SOURCE_VERSION:=763de09cc7265e3147e2df2e15f91c73231907f4
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
22
23 PKG_LICENSE:=GPL-2.0 GPL-2.0+
24 PKG_LICENSE_FILES:=Licenses/README
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define uboot/Default
29 TITLE:=
30 CONFIG:=
31 endef
32
33 define uboot/ls1043ardb
34 TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 32b Dev Board
35 CONFIG=ls1043ardb-uboot.bin
36 endef
37
38 define uboot/ls1046ardb
39 TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 32b Dev Board
40 CONFIG=ls1046ardb-uboot.bin
41 endef
42
43 define uboot/ls1012ardb
44 TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 32b Dev Board
45 CONFIG=ls1012ardb-uboot.bin.swap
46 endef
47
48 UBOOTS := \
49 ls1043ardb \
50 ls1046ardb \
51 ls1012ardb
52
53 define Package/uboot/template
54 define Package/uboot-layerscape-32b-$(1)
55 SECTION:=boot
56 CATEGORY:=Boot Loaders
57 DEPENDS:= @TARGET_layerscape_32b
58 TITLE:=$(2)
59 URL:=https://github.com/fsl-jyt/uboot-ls-32b.git
60 VARIANT:=$(1)
61 MAINTAINER:=Jiang Yutang <jiangyutang1978@gmail.com>
62 endef
63 endef
64
65 define BuildUBootPackage
66 $(eval $(uboot/Default))
67 $(eval $(uboot/$(1)))
68 $(call Package/uboot/template,$(1),$(TITLE))
69 endef
70
71 ifdef BUILD_VARIANT
72 $(eval $(call uboot/$(BUILD_VARIANT)))
73 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
74 endif
75
76 define Build/Configure
77 endef
78
79 define Build/Compile
80 endef
81
82 define Package/uboot/install/default
83 $(CP) $(PKG_BUILD_DIR)/$(UBOOT_CONFIG) $(KDIR)/$(1)-32b-uboot.bin
84 endef
85
86 define Package/uboot/install/template
87 define Package/uboot-layerscape-32b-$(1)/install
88 $(call Package/uboot/install/default,$(2))
89 endef
90 endef
91
92 $(foreach u,$(UBOOTS), \
93 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
94 )
95
96 $(foreach u,$(UBOOTS), \
97 $(eval $(call BuildUBootPackage,$(u))) \
98 $(eval $(call BuildPackage,uboot-layerscape-32b-$(u))) \
99 )