layerscape: put u-boot and ucode images into image staging directory
[openwrt/openwrt.git] / package / firmware / fman-ucode / 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:=fman-ucode
12 PKG_VERSION:=fsl-sdk-v2.0
13 PKG_RELEASE:=1
14
15 PKG_SOURCE_PROTO:=git
16 PKG_MIRROR_HASH:=209c60e4efaa3ce9c9a954266a7210fa0047a2de47ce00a412aa0318d94d0d88
17 PKG_SOURCE_URL:=https://github.com/fsl-jyt/fm-ucode.git
18 PKG_SOURCE_VERSION:=b19c645821941493fbef32e616b5a16404259976
19
20 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
21
22 PKG_LICENSE:=GPL-2.0 GPL-2.0+
23 PKG_LICENSE_FILES:=Licenses/README
24
25 PKG_FLAGS:=nonshared
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define fman/Default
30 TITLE:=
31 CONFIG:=
32 endef
33
34 define fman/ls1043ardb
35 TITLE=FMAN UCODE $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 64b/32b Dev Board
36 CONFIG=fsl_fman_ucode_ls1043_r1.0_108_4_5.bin
37 endef
38
39 define fman/ls1046ardb
40 TITLE=FMAN UCODE $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 64b/32b Dev Board
41 CONFIG=fsl_fman_ucode_t2080_r1.1_106_4_18.bin
42 endef
43
44 FMANS := \
45 ls1043ardb \
46 ls1046ardb
47
48 define Package/fman/template
49 define Package/fman-layerscape-$(1)
50 SECTION:=firmware
51 CATEGORY:=Firmware
52 DEPENDS:=@TARGET_layerscape
53 TITLE:=$(2)
54 URL:=http://git.freescale.com/git/cgit.cgi/ppc/sdk/fm-ucode.git
55 VARIANT:=$(1)
56 MAINTAINER:=Jiang Yutang <jiangyutang1978@gmail.com>
57 endef
58 endef
59
60 define BuildFMANPackage
61 $(eval $(fman/Default))
62 $(eval $(fman/$(1)))
63 $(call Package/fman/template,$(1),$(TITLE))
64 endef
65
66 ifdef BUILD_VARIANT
67 $(eval $(call fman/$(BUILD_VARIANT)))
68 FMAN_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
69 endif
70
71 define Build/Compile
72 endef
73
74 define Package/fman/install/default
75 $(INSTALL_DIR) $(STAGING_DIR_IMAGE)
76 $(CP) $(PKG_BUILD_DIR)/$(FMAN_CONFIG) $(STAGING_DIR_IMAGE)/$(1)-fman.bin
77 endef
78
79 define Package/fman/install/template
80 define Package/fman-layerscape-$(1)/install
81 $(call Package/fman/install/default,$(2))
82 endef
83 endef
84
85 $(foreach f,$(FMANS), \
86 $(eval $(call Package/fman/install/template,$(f),$(f))) \
87 )
88
89 $(foreach f,$(FMANS), \
90 $(eval $(call BuildFMANPackage,$(f))) \
91 $(eval $(call BuildPackage,fman-layerscape-$(f))) \
92 )