b0d582ef20f2fe049525ac9d0718e8f3051ccacd
[openwrt/openwrt.git] / package / firmware / layerscape / ls-rcw / 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:=ls-rcw
12 PKG_SOURCE_DATE:=2017-09-26
13 PKG_RELEASE:=1
14
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE_URL:=https://github.com/qoriq-open-source/rcw.git
17 PKG_SOURCE_VERSION:=6719b046ee87b04026fe163e6c8fbbebba2186aa
18 PKG_MIRROR_HASH:=9645ecf148640ec7d1029bce65950f2a0b0e6b351a25ef60c8a839c42c6ed56d
19
20 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
21
22 PKG_LICENSE:=BSD-3-Clause
23 PKG_LICENSE_FILES:=LICENSE
24
25 PKG_FLAGS:=nonshared
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define rcw/Default
30 TITLE:=
31 CONFIG:=
32 endef
33
34 define rcw/ls1043ardb
35 TITLE=RCW binary $(PKG_VERSION) for NXP ls1043ardb 64b/32b Dev Board
36 CONFIG=ls1043ardb/RR_FQPP_1455/rcw_1600.bin
37 endef
38
39 define rcw/ls1046ardb
40 TITLE=RCW binary $(PKG_VERSION) for NXP ls1046ardb 64b/32b Dev Board
41 CONFIG=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot_swap.bin
42 endef
43
44 define rcw/ls1012ardb
45 TITLE=RCW binary $(PKG_VERSION) for NXP ls1012ardb 64b/32b Dev Board
46 CONFIG=ls1012ardb/R_SPNH_3508/PBL_0x35_0x08_1000_250_1000_default.bin
47 endef
48
49 define rcw/ls1088ardb
50 TITLE=RCW binary $(PKG_VERSION) for NXP ls1088ardb 64b/32b Dev Board
51 CONFIG=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/PBL_QSPI_1600_700_2100_0x1d_0x0d.bin
52 endef
53
54 define rcw/ls2088ardb
55 TITLE=RCW binary $(PKG_VERSION) for NXP ls2088ardb 64b/32b Dev Board
56 CONFIG=ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41/PBL_0x2a_0x41_1800_700_1866_1600.bin
57 endef
58
59 define rcw/ls1012afrdm
60 TITLE=RCW binary $(PKG_VERSION) for NXP ls1012afrdm 64b/32b Dev Board
61 CONFIG=ls1012afrdm/N_SSNP_3305/PBL_0x33_0x05_800_250_1000_default.bin
62 endef
63
64 RCWS := \
65 ls1043ardb \
66 ls1046ardb \
67 ls1012ardb \
68 ls1088ardb \
69 ls2088ardb \
70 ls1012afrdm
71
72 define Package/rcw/template
73 define Package/rcw-layerscape-$(1)
74 SECTION:=firmware
75 CATEGORY:=Firmware
76 DEPENDS:= @TARGET_layerscape
77 TITLE:=$(2)
78 URL:=http://git.freescale.com/git/cgit.cgi/ppc/sdk/rcw.git
79 VARIANT:=$(1)
80 MAINTAINER:=Jiang Yutang <jiangyutang1978@gmail.com>
81 endef
82 endef
83
84 define BuildRCWPackage
85 $(eval $(rcw/Default))
86 $(eval $(rcw/$(1)))
87 $(call Package/rcw/template,$(1),$(TITLE))
88 endef
89
90 ifdef BUILD_VARIANT
91 $(eval $(call rcw/$(BUILD_VARIANT)))
92 RCW_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
93 endif
94
95 define Build/Configure
96 endef
97
98 define Package/rcw/install/default
99 $(INSTALL_DIR) $(STAGING_DIR_IMAGE)
100 $(CP) $(PKG_BUILD_DIR)/$(RCW_CONFIG) $(STAGING_DIR_IMAGE)/$(1)-rcw.bin
101 endef
102
103 define Package/rcw/install/template
104 define Package/rcw-layerscape-$(1)/install
105 $(call Package/rcw/install/default,$(2))
106 endef
107 endef
108
109 $(foreach r,$(RCWS), \
110 $(eval $(call Package/rcw/install/template,$(r),$(r))) \
111 )
112
113 $(foreach r,$(RCWS), \
114 $(eval $(call BuildRCWPackage,$(r))) \
115 $(eval $(call BuildPackage,rcw-layerscape-$(r))) \
116 )