blob: fdc488670feab86945e3816770b0b636150eb68b [file] [log] [blame]
Klaus Heinrich Kiwid2551242020-07-16 16:59:04 -03001################################################################################
2#
3# openpower_pnor_p10
4#
5################################################################################
6
hostboot43fcdcf2021-09-21 00:55:55 -05007OPENPOWER_PNOR_P10_VERSION ?= 192f6727949d8420196fc5f88ef71f4224393616
Ilya Smirnovd56cef72021-06-23 09:34:37 -05008OPENPOWER_PNOR_P10_SITE ?= $(call github,open-power,pnor,$(OPENPOWER_PNOR_P10_VERSION))
Klaus Heinrich Kiwid2551242020-07-16 16:59:04 -03009
10OPENPOWER_PNOR_P10_LICENSE = Apache-2.0
11OPENPOWER_PNOR_P10_LICENSE_FILES = LICENSE
Adriana Kobylak35a21ce2021-01-19 15:05:25 -060012OPENPOWER_PNOR_P10_DEPENDENCIES = hostboot-binaries skiboot host-openpower-ffs host-openpower-pnor-util host-xz host-sb-signing-utils hostboot-p10 occ-p10 sbe-p10 hcode-p10 ocmb-explorer-fw $(call qstrip,$(BR2_OPENPOWER_P10_XMLS))
Klaus Heinrich Kiwid2551242020-07-16 16:59:04 -030013
14ifeq ($(BR2_PACKAGE_IMA_CATALOG),y)
15OPENPOWER_PNOR_P10_DEPENDENCIES += ima-catalog
16endif
17
18ifeq ($(BR2_OPENPOWER_P10_SECUREBOOT_KEY_TRANSITION_TO_DEV),y)
19OPENPOWER_PNOR_P10_KEY_TRANSITION_ARG = -key_transition imprint
20else ifeq ($(BR2_OPENPOWER_P10_SECUREBOOT_KEY_TRANSITION_TO_PROD),y)
21OPENPOWER_PNOR_P10_KEY_TRANSITION_ARG = -key_transition production
22endif
23
24ifneq ($(BR2_OPENPOWER_P10_SECUREBOOT_SIGN_MODE),"")
25OPENPOWER_PNOR_P10_SIGN_MODE_ARG = -sign_mode $(BR2_OPENPOWER_P10_SECUREBOOT_SIGN_MODE)
26endif
27
28OPENPOWER_PNOR_P10_INSTALL_IMAGES = YES
29OPENPOWER_PNOR_P10_INSTALL_TARGET = NO
30
31# Subpackages we want to include in the version info (do not include openpower-pnor-p10)
32# This is used inside pkg-versions.mk
Adriana Kobylak35a21ce2021-01-19 15:05:25 -060033OPENPOWER_PNOR_P10_VERSIONED_SUBPACKAGES = skiboot linux petitboot hostboot-binaries pdata hostboot-p10 occ-p10 sbe-p10 hcode-p10 ocmb-explorer-fw $(call qstrip,$(BR2_OPENPOWER_P10_XMLS))
Klaus Heinrich Kiwid2551242020-07-16 16:59:04 -030034
35OPENPOWER_PNOR_P10_OCMB_URL = $(call qstrip,$(OCMB_EXPLORER_FW_SITE)/$(OCMB_EXPLORER_FW_SOURCE))
36
37#######
38# OPENPOWER_PNOR_P10_UPDATE_IMAGE - process/sign PNOR partitions
39# Arguments:
40# $1 - The target-specific mrw package name (i.e., rainier-2u-xml)
41#######
42define OPENPOWER_PNOR_P10_UPDATE_IMAGE
43 echo "***Signing images for target:$(call qstrip,$(1))"
44
45 $(eval XML_VAR = $$(call UPPERCASE,$$(call qstrip,$(1))))
46 echo "***XML_VAR: $(XML_VAR)"
47
48 $(eval TARGETING_BINARY_SOURCE = $$(BR2_$(XML_VAR)_TARGETING_BIN_FILENAME))
49 echo "***TARGETING_BINARY_SOURCE: $(TARGETING_BINARY_SOURCE)"
50
51 $(eval TARGETING_BINARY_FILENAME = $$(BR2_$(XML_VAR)_TARGETING_ECC_FILENAME))
52 echo "***TARGETING_BINARY_FILENAME: $(TARGETING_BINARY_FILENAME)"
53
54 $(eval XML_FILENAME = $$(call qstrip,$$(BR2_$(XML_VAR)_FILENAME)))
55 echo "***XML_FILENAME: $(XML_FILENAME)"
56
57 $(eval WOF_BINARY_FILENAME = $$(patsubst %.xml,%.wofdata,$(XML_FILENAME)))
58 echo "***WOF_BINARY_FILENAME: $(WOF_BINARY_FILENAME)"
59
60 $(eval MEMD_BINARY_FILENAME = $$(patsubst %.xml,%.memd_output.dat,$(XML_FILENAME)))
61 echo "***MEMD_BINARY_FILENAME: $(MEMD_BINARY_FILENAME)"
62
63 $(eval DEVTREE_BINARY_FILENAME = $$(patsubst %.xml,%.dtb,$(XML_FILENAME)))
64 echo "***DEVTREE_BINARY_FILENAME: $(DEVTREE_BINARY_FILENAME)"
65
66 $(eval PNOR_SCRATCH_DIR = $(STAGING_DIR)/openpower_pnor_scratch.$(XML_VAR))
67 echo "***PNOR scratch directory: $(PNOR_SCRATCH_DIR)"
68 mkdir -p $(PNOR_SCRATCH_DIR)
69
Deb McLemoree6a30482021-09-10 09:31:45 -050070 echo "***BINARIES_DIR: $(BINARIES_DIR)"
71 echo "***STAGING_DIR: $(STAGING_DIR)"
72
Klaus Heinrich Kiwid2551242020-07-16 16:59:04 -030073
74 $(TARGET_MAKE_ENV) $(@D)/update_image.pl \
75 -release p10 \
76 -op_target_dir $(STAGING_DIR)/hostboot_build_images \
77 -hb_image_dir $(STAGING_DIR)/hostboot_build_images \
78 -scratch_dir $(PNOR_SCRATCH_DIR) \
79 -hb_binary_dir $(STAGING_DIR)/hostboot_binaries \
80 -hcode_dir $(STAGING_DIR)/hcode \
81 -targeting_binary_filename $(TARGETING_BINARY_FILENAME) \
82 -targeting_binary_source $(TARGETING_BINARY_SOURCE) \
83 -targeting_RO_binary_filename $(TARGETING_BINARY_FILENAME).protected \
84 -targeting_RO_binary_source $(TARGETING_BINARY_SOURCE).protected \
85 -targeting_RW_binary_filename $(TARGETING_BINARY_FILENAME).unprotected \
86 -targeting_RW_binary_source $(TARGETING_BINARY_SOURCE).unprotected \
87 -sbe_binary_filename $(BR2_HOSTBOOT_P10_BINARY_SBE_FILENAME) \
88 -sbe_binary_dir $(STAGING_DIR)/sbe_binaries \
89 -sbec_binary_filename $(BR2_HOSTBOOT_P10_BINARY_SBEC_FILENAME) \
90 -wink_binary_filename $(BR2_HOSTBOOT_P10_BINARY_WINK_FILENAME) \
91 -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_P10_BIN_FILENAME) \
Klaus Heinrich Kiwid2551242020-07-16 16:59:04 -030092 -ima_catalog_binary_filename $(BINARIES_DIR)/$(BR2_IMA_CATALOG_P10_FILENAME) \
93 -openpower_version_filename $(OPENPOWER_PNOR_P10_VERSION_FILE) \
94 -wof_binary_filename $(STAGING_DIR)/openpower_mrw_scratch/$(WOF_BINARY_FILENAME) \
95 -memd_binary_filename $(STAGING_DIR)/openpower_mrw_scratch/$(MEMD_BINARY_FILENAME) \
96 -payload $(BINARIES_DIR)/$(BR2_SKIBOOT_P10_LID_NAME) \
97 -payload_filename skiboot.lid.xz \
98 -binary_dir $(BINARIES_DIR) \
99 -bootkernel_filename $(LINUX_IMAGE_NAME) \
100 -ocmbfw_version $(OCMB_EXPLORER_FW_VERSION) \
101 -ocmbfw_url $(OPENPOWER_PNOR_P10_OCMB_URL) \
102 -ocmbfw_original_filename $(BINARIES_DIR)/$(BR2_OCMBFW_P10_FILENAME) \
103 -ocmbfw_binary_filename $(PNOR_SCRATCH_DIR)/$(BR2_OCMBFW_P10_PROCESSED_FILENAME) \
104 -pnor_layout $(@D)/p10Layouts/$(BR2_OPENPOWER_P10_PNOR_XML_LAYOUT_FILENAME) \
105 -sbe_img_dir $(BUILD_DIR)/sbe-p10-$(call qstrip,$(BR2_SBE_P10_VERSION))/images \
106 -devtree_binary_filename $(STAGING_DIR)/usr/share/pdata/$(DEVTREE_BINARY_FILENAME) \
107 -xz_compression \
108 $(OPENPOWER_PNOR_P10_KEY_TRANSITION_ARG) \
109 $(OPENPOWER_PNOR_P10_SIGN_MODE_ARG)
110
111 if [ -n "$(BR2_OPENPOWER_PNOR_P10_LEGACY_PNOR_TARGET)" ] ; then \
112 echo "***Generating legacy pnor targets..." ;\
113 mkdir -p $(STAGING_DIR)/pnor.$(XML_VAR) ; \
114 $(TARGET_MAKE_ENV) $(@D)/create_pnor_image.pl \
115 -release p10 \
116 -xml_layout_file $(@D)/p10Layouts/$(BR2_OPENPOWER_P10_PNOR_XML_LAYOUT_FILENAME) \
117 -pnor_filename $(STAGING_DIR)/pnor.$(XML_VAR)/$(XML_VAR).pnor \
118 -hb_image_dir $(STAGING_DIR)/hostboot_build_images \
119 -scratch_dir $(PNOR_SCRATCH_DIR) \
120 -outdir $(STAGING_DIR)/pnor.$(XML_VAR)/ \
121 -payload $(PNOR_SCRATCH_DIR)/$(BR2_SKIBOOT_LID_XZ_NAME) \
122 -bootkernel $(PNOR_SCRATCH_DIR)/$(LINUX_IMAGE_NAME) \
123 -sbe_binary_filename $(BR2_HOSTBOOT_P10_BINARY_SBE_FILENAME) \
124 -sbec_binary_filename $(BR2_HOSTBOOT_P10_BINARY_SBEC_FILENAME) \
125 -wink_binary_filename $(BR2_HOSTBOOT_P10_BINARY_WINK_FILENAME) \
126 -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_P10_BIN_FILENAME) \
127 -targeting_binary_filename $(TARGETING_BINARY_FILENAME) \
128 -targeting_RO_binary_filename $(TARGETING_BINARY_FILENAME).protected \
129 -targeting_RW_binary_filename $(TARGETING_BINARY_FILENAME).unprotected \
130 -wofdata_binary_filename $(PNOR_SCRATCH_DIR)/wofdata.bin.ecc \
131 -memddata_binary_filename $(PNOR_SCRATCH_DIR)/memd_extra_data.bin.ecc \
132 -ocmbfw_binary_filename $(PNOR_SCRATCH_DIR)/$(BR2_OCMBFW_P10_PROCESSED_FILENAME) \
133 -openpower_version_filename $(PNOR_SCRATCH_DIR)/openpower_pnor_version.bin \
134 -devtree_binary_filename $(PNOR_SCRATCH_DIR)/DEVTREE.bin ;\
135 $(INSTALL) $(STAGING_DIR)/pnor.$(XML_VAR)/$(XML_VAR).pnor $(BINARIES_DIR) ;\
136 PATH=$(HOST_DIR)/usr/bin:$(PATH) $(HOST_DIR)/usr/bin/generate-tar -i squashfs \
137 -m $(XML_VAR) \
138 -f $(STAGING_DIR)/pnor.$(XML_VAR)/$(XML_VAR).pnor.squashfs.tar \
139 $(STAGING_DIR)/pnor.$(XML_VAR)/$(XML_VAR).pnor -s ;\
140 $(INSTALL) $(STAGING_DIR)/pnor.$(XML_VAR)/$(XML_VAR).pnor.squashfs.tar $(BINARIES_DIR) ;\
141 cd $(STAGING_DIR)/pnor.$(XML_VAR) ;\
142 PATH=$(HOST_DIR)/usr/sbin:$(PATH) $(HOST_DIR)/usr/bin/generate-ubi \
143 $(XML_VAR).pnor.squashfs.tar ;\
144 $(INSTALL) $(STAGING_DIR)/pnor.$(XML_VAR)/$(XML_VAR).pnor.ubi.mtd $(BINARIES_DIR) ;\
145 $(TARGET_MAKE_ENV) $(@D)/makelidpkg \
146 $(BINARIES_DIR)/$(XML_VAR).ebmc_lids.tar.gz \
147 $(PNOR_SCRATCH_DIR); \
148 if [ -e $(STAGING_DIR)/openpower_pnor_scratch ] ; then \
149 echo "*** Reusing existing $(STAGING_DIR)/openpower_pnor_scratch => $$(readlink -f $(STAGING_DIR)/openpower_pnor_scratch)";\
150 else \
151 ln -rs $(PNOR_SCRATCH_DIR) $(STAGING_DIR)/openpower_pnor_scratch ;\
152 ln -rs $(BINARIES_DIR)/$(XML_VAR).ebmc_lids.tar.gz \
153 $(BINARIES_DIR)/ebmc_lids.tar.gz ;\
154 ln -rs $(BINARIES_DIR)/$(XML_VAR).pnor \
155 $(BINARIES_DIR)/$(BR2_OPENPOWER_PNOR_P10_LEGACY_PNOR_TARGET).pnor ;\
156 ln -rs $(BINARIES_DIR)/$(XML_VAR).pnor.squashfs.tar \
157 $(BINARIES_DIR)/$(BR2_OPENPOWER_PNOR_P10_LEGACY_PNOR_TARGET).pnor.squashfs.tar ;\
158 ln -rs $(BINARIES_DIR)/$(XML_VAR).pnor.ubi.mtd \
159 $(BINARIES_DIR)/$(BR2_OPENPOWER_PNOR_P10_LEGACY_PNOR_TARGET).pnor.ubi.mtd ;\
160 fi ;\
161 fi
162 # Copy images to mmc dir
163 # HBBL
164 test -f "$(BINARIES_DIR)/mmc/HBBL.P10" ||\
165 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/hbbl.bin.ecc \
166 $(BINARIES_DIR)/mmc/HBBL.P10
167
168 # HBB
169 test -f "$(BINARIES_DIR)/mmc/HBB.P10" ||\
170 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/hostboot.header.bin.ecc \
171 $(BINARIES_DIR)/mmc/HBB.P10
172
173 # HBI
174 test -f "$(BINARIES_DIR)/mmc/HBI.P10" ||\
175 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/hostboot_extended.header.bin.ecc \
176 $(BINARIES_DIR)/mmc/HBI.P10
177
Deb McLemoree6a30482021-09-10 09:31:45 -0500178 # HBD.bin SECTION is the COMBO (RO and RW) as built by genPnorImages.pl
Klaus Heinrich Kiwid2551242020-07-16 16:59:04 -0300179 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/$(TARGETING_BINARY_FILENAME) \
180 $(BINARIES_DIR)/mmc/HBD.$(XML_VAR)
181
Deb McLemoree6a30482021-09-10 09:31:45 -0500182 # HBD_RW.bin SECTION conditionally built by genPnorImages.pl
183 # Not consumed as a LID today since its a PNOR partition
184 if [ -e $(PNOR_SCRATCH_DIR)/$(TARGETING_BINARY_FILENAME).unprotected ]; then \
185 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/$(TARGETING_BINARY_FILENAME).unprotected \
186 $(BINARIES_DIR)/mmc/HBD_RW.$(XML_VAR) ; \
187 fi
188
Klaus Heinrich Kiwid2551242020-07-16 16:59:04 -0300189 # SBE
190 test -f "$(BINARIES_DIR)/mmc/SBE.P10" ||\
191 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/$(BR2_HOSTBOOT_P10_BINARY_SBE_FILENAME) \
192 $(BINARIES_DIR)/mmc/SBE.P10
193
194 # PAYLOAD
195 test -f "$(BINARIES_DIR)/mmc/PAYLOAD.P10" ||\
196 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/skiboot.lid.xz \
197 $(BINARIES_DIR)/mmc/PAYLOAD.P10
198
199 # HCODE
200 test -f "$(BINARIES_DIR)/mmc/HCODE.P10" ||\
201 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/$(BR2_HOSTBOOT_P10_BINARY_WINK_FILENAME) \
202 $(BINARIES_DIR)/mmc/HCODE.P10
203
204 # HBRT
205 test -f "$(BINARIES_DIR)/mmc/HBRT.P10" ||\
206 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/hostboot_runtime.header.bin.ecc \
207 $(BINARIES_DIR)/mmc/HBRT.P10
208
209 # OCC
210 test -f "$(BINARIES_DIR)/mmc/OCC.P10" ||\
211 $(INSTALL) -m 0644 -D $(OCC_STAGING_DIR)/$(BR2_OCC_P10_BIN_FILENAME).ecc \
212 $(BINARIES_DIR)/mmc/OCC.P10
213
214 # BOOTKERNEL
215 test -f "$(BINARIES_DIR)/mmc/BOOTKERNEL.P10" ||\
216 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/$(LINUX_IMAGE_NAME) \
217 $(BINARIES_DIR)/mmc/BOOTKERNEL.P10
218
Klaus Heinrich Kiwid2551242020-07-16 16:59:04 -0300219 # VERSION
220 test -f "$(BINARIES_DIR)/mmc/VERSION.P10" ||\
221 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/openpower_pnor_version.bin \
222 $(BINARIES_DIR)/mmc/VERSION.P10
223
224 # IMA_CATALOG
225 test -f "$(BINARIES_DIR)/mmc/IMA_CATALOG.P10" ||\
226 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/ima_catalog.bin.ecc \
227 $(BINARIES_DIR)/mmc/IMA_CATALOG.P10
228
229 # SBKT (special content)
230 test -f "$(BINARIES_DIR)/mmc/SBKT.P10" ||\
231 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/SBKT.bin \
232 $(BINARIES_DIR)/mmc/SBKT.P10
233
234 # HBEL (blank)
235 test -f "$(BINARIES_DIR)/mmc/HBEL.P10" ||\
236 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/hbel.bin.ecc \
237 $(BINARIES_DIR)/mmc/HBEL.P10
238
239 # GUARD (blank)
240 test -f "$(BINARIES_DIR)/mmc/GUARD.P10" ||\
241 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/guard.bin.ecc \
242 $(BINARIES_DIR)/mmc/GUARD.P10
243
244 # HB_VOLATILE (blank)
245 test -f "$(BINARIES_DIR)/mmc/HB_VOLATILE.P10" ||\
246 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/hb_volatile.bin \
247 $(BINARIES_DIR)/mmc/HB_VOLATILE.P10
248
249 # NVRAM (blank)
250 test -f "$(BINARIES_DIR)/mmc/NVRAM.P10" ||\
251 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/nvram.bin \
252 $(BINARIES_DIR)/mmc/NVRAM.P10
253
254 # ATTR_TMP (blank)
255 test -f "$(BINARIES_DIR)/mmc/ATTR_TMP.P10" ||\
256 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/attr_tmp.bin.ecc \
257 $(BINARIES_DIR)/mmc/ATTR_TMP.P10
258
259 # ATTR_PERM (blank)
260 test -f "$(BINARIES_DIR)/mmc/ATTR_PERM.P10" ||\
261 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/attr_perm.bin.ecc \
262 $(BINARIES_DIR)/mmc/ATTR_PERM.P10
263
264 # FIRDATA (blank, optional)
265 if [ -f "$(PNOR_SCRATCH_DIR)/firdata.bin.ecc" ] ; then \
266 test -f "$(BINARIES_DIR)/mmc/FIRDATA.P10" || \
267 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/firdata.bin.ecc \
268 $(BINARIES_DIR)/mmc/FIRDATA.P10 ; \
269 fi
270
271 # SECBOOT (blank)
272 test -f "$(BINARIES_DIR)/mmc/SECBOOT.P10" ||\
273 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/secboot.bin.ecc \
274 $(BINARIES_DIR)/mmc/SECBOOT.P10
275
276 # RINGOVD (blank)
277 test -f "$(BINARIES_DIR)/mmc/RINGOVD.P10" ||\
278 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/ringOvd.bin \
279 $(BINARIES_DIR)/mmc/RINGOVD.P10
280
281 # CVPD (blank, optional)
282 if [ -f "$(PNOR_SCRATCH_DIR)/cvpd.bin.ecc" ] ; then \
283 test -f "$(BINARIES_DIR)/mmc/CVPD.P10" ||\
284 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/cvpd.bin.ecc \
285 $(BINARIES_DIR)/mmc/CVPD.P10 ; \
286 fi
287
288 # DJVPD (blank, optional)
289 if [ -f "$(PNOR_SCRATCH_DIR)/djvpd_fill.bin.ecc" ] ; then \
290 test -f "$(BINARIES_DIR)/mmc/DJVPD.P10" ||\
291 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/djvpd_fill.bin.ecc \
292 $(BINARIES_DIR)/mmc/DJVPD.P10 ; \
293 fi
294
295 # MVPD (blank, optional)
296 if [ -f "$(PNOR_SCRATCH_DIR)/mvpd_fill.bin.ecc" ] ; then \
297 test -f "$(BINARIES_DIR)/mmc/MVPD.P10" ||\
298 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/mvpd_fill.bin.ecc \
299 $(BINARIES_DIR)/mmc/MVPD.P10 ; \
300 fi
301
302 # EECACHE (blank, optional)
303 if [ -f "$(PNOR_SCRATCH_DIR)/eecache_fill.bin.ecc" ] ; then \
304 test -f "$(BINARIES_DIR)/mmc/EECACHE.P10" ||\
305 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/eecache_fill.bin.ecc \
306 $(BINARIES_DIR)/mmc/EECACHE.P10 ; \
307 fi
308
309 # WOFDATA
310 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/wofdata.bin.ecc \
311 $(BINARIES_DIR)/mmc/WOFDATA.$(XML_VAR)
312
313 # MEMD (optional)
314 if [ -f "$(PNOR_SCRATCH_DIR)/memd_extra_data.bin.ecc" ] ; then \
315 test -f "$(BINARIES_DIR)/mmc/MEMD.P10" ||\
316 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/memd_extra_data.bin.ecc \
317 $(BINARIES_DIR)/mmc/MEMD.P10 ; \
318 fi
319
320 # HDAT
321 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/hdat.bin.ecc \
322 $(BINARIES_DIR)/mmc/HDAT.$(XML_VAR)
323
324 # OCMBFW (optional)
325 if [ -f "$(PNOR_SCRATCH_DIR)/$(BR2_OCMBFW_P10_PROCESSED_FILENAME)" ] ; then \
326 test -f "$(BINARIES_DIR)/mmc/OCMBFW.P10" ||\
327 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/$(BR2_OCMBFW_P10_PROCESSED_FILENAME) \
328 $(BINARIES_DIR)/mmc/OCMBFW.P10 ; \
329 fi
330
331 # DEVTREE
332 $(INSTALL) -m 0644 -D $(PNOR_SCRATCH_DIR)/DEVTREE.bin \
333 $(BINARIES_DIR)/mmc/DEVTREE.$(XML_VAR)
334
335endef
336
337define OPENPOWER_PNOR_P10_INSTALL_IMAGES_CMDS
338
Deb McLemoree6a30482021-09-10 09:31:45 -0500339 # CLEANUP OLD IMAGES
Klaus Heinrich Kiwid2551242020-07-16 16:59:04 -0300340 if [ -n "$(BR2_OPENPOWER_PNOR_P10_LEGACY_PNOR_TARGET)" ] ; then \
341 rm -f $(BINARIES_DIR)/*.pnor \
342 $(BINARIES_DIR)/*.pnor.squashfs.tar \
343 $(BINARIES_DIR)/*.ubi.mtd ;\
344 rm -rf $(BINARIES_DIR)/ebmc_lids.tar.gz \
345 $(BINARIES_DIR)/*.ebmc_lids.tar.gz ;\
346 rm -rf $(STAGING_DIR)/openpower_pnor_scratch \
347 $(STAGING_DIR)/openpower_pnor_scratch.* ;\
Deb McLemoree6a30482021-09-10 09:31:45 -0500348 rm -rf $(BINARIES_DIR)/mmc \
349 $(BINARIES_DIR)/mmc.tar.gz ;\
Klaus Heinrich Kiwid2551242020-07-16 16:59:04 -0300350 fi
351
352 $(foreach xmlpkg,$(BR2_OPENPOWER_P10_XMLS),\
353 $(call OPENPOWER_PNOR_P10_UPDATE_IMAGE,\
354 $(xmlpkg)))
355
Klaus Heinrich Kiwi78620d82020-10-06 15:33:25 -0300356 # Create MMC Tarball
357 tar -zcvf $(BINARIES_DIR)/mmc.tar.gz -C $(BINARIES_DIR) mmc
358
Klaus Heinrich Kiwid2551242020-07-16 16:59:04 -0300359 # Create Debug Tarball (target-agnostic)
360 mkdir -p $(STAGING_DIR)/pnor/host_fw_debug_tarball_files/
361 cp -r $(STAGING_DIR)/hostboot_build_images/* \
362 $(BUILD_DIR)/skiboot-$(SKIBOOT_VERSION)/skiboot.elf \
363 $(BUILD_DIR)/skiboot-$(SKIBOOT_VERSION)/skiboot.map \
364 $(BUILD_DIR)/linux-$(LINUX_VERSION)/.config \
365 $(BUILD_DIR)/linux-$(LINUX_VERSION)/vmlinux \
366 $(BUILD_DIR)/linux-$(LINUX_VERSION)/System.map \
367 $(STAGING_DIR)/fsp-trace/fsp-trace \
368 $(BINARIES_DIR)/zImage.epapr \
369 $(STAGING_DIR)/pnor/host_fw_debug_tarball_files/
370 tar -zcvf $(BINARIES_DIR)/host_fw_debug.tar -C $(STAGING_DIR)/pnor/host_fw_debug_tarball_files/ .
371
372endef
373
374$(eval $(generic-package))
375# Generate openPOWER pnor version string by combining subpackage version string files
376$(eval $(OPENPOWER_VERSION))
377