blob: 773c66afa703680e17f07b0001a6ad99ccf59ce6 [file] [log] [blame]
Bill Hoffa5f93f1d2014-06-26 21:02:48 -05001################################################################################
2#
3# openpower_pnor
4#
5################################################################################
6
Brian Silver015b5912014-08-07 15:50:15 -05007# remove the quotes from the XML/Targeting package as
8# make doesn't care for quotes in the dependencies.
9XML_PACKAGE=$(subst $\",,$(BR2_OPENPOWER_XML_PACKAGE))
Brian Silver137a00a2014-11-11 12:09:53 -060010
Matt Ploetzb4d85b12016-09-29 20:24:14 -050011OPENPOWER_PNOR_VERSION ?= fbd1f54baa655872aa21c5953a436f679386ffde
Nick Bofferdingb82aaef2014-11-07 14:29:18 -060012OPENPOWER_PNOR_SITE ?= $(call github,open-power,pnor,$(OPENPOWER_PNOR_VERSION))
Brian Silvercb565552014-12-11 12:51:36 -060013
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050014OPENPOWER_PNOR_LICENSE = Apache-2.0
Michael Neuling94f8ab12015-02-11 14:01:28 +110015OPENPOWER_PNOR_DEPENDENCIES = hostboot hostboot-binaries $(XML_PACKAGE) skiboot host-openpower-ffs occ capp-ucode
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050016
Stewart Smith898245e2016-03-30 15:26:23 +110017ifeq ($(BR2_PACKAGE_SKIBOOT_EMBED_PAYLOAD),n)
Joel Stanley2aff5ba2015-02-01 14:49:18 +103018
19ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
Stewart Smith906bdba2015-08-26 16:05:20 +100020OPENPOWER_PNOR_DEPENDENCIES += linux-rebuild-with-initramfs
Joel Stanley2aff5ba2015-02-01 14:49:18 +103021else
22OPENPOWER_PNOR_DEPENDENCIES += linux
23endif
24
25endif
26
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050027ifeq ($(BR2_OPENPOWER_PNOR_XZ_ENABLED),y)
Jeremy Kerrc7800842016-07-22 14:01:17 +080028OPENPOWER_PNOR_DEPENDENCIES += host-xz
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050029endif
30
Matt Ploetzb4d85b12016-09-29 20:24:14 -050031ifeq ($(BR2_OPENPOWER_POWER9),y)
32 OPENPOWER_RELEASE=p9
33else
34 OPENPOWER_RELEASE=p8
35endif
36
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050037
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050038OPENPOWER_PNOR_INSTALL_IMAGES = YES
39OPENPOWER_PNOR_INSTALL_TARGET = NO
40
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050041HOSTBOOT_IMAGE_DIR=$(STAGING_DIR)/hostboot_build_images/
42HOSTBOOT_BINARY_DIR = $(STAGING_DIR)/hostboot_binaries/
43OPENPOWER_PNOR_SCRATCH_DIR = $(STAGING_DIR)/openpower_pnor_scratch/
Stephen Cpreke7254c72015-02-19 14:33:38 -060044OPENPOWER_VERSION_DIR = $(STAGING_DIR)/openpower_version
45
46# Subpackages we want to include in the version info (do not include openpower-pnor)
Sam Mendoza-Jonas33f30442016-03-01 16:38:56 +110047OPENPOWER_VERSIONED_SUBPACKAGES = skiboot hostboot linux petitboot $(XML_PACKAGE) occ hostboot-binaries capp-ucode
Stephen Cpreke7254c72015-02-19 14:33:38 -060048OPENPOWER_PNOR = openpower-pnor
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050049
50define OPENPOWER_PNOR_INSTALL_IMAGES_CMDS
51 mkdir -p $(OPENPOWER_PNOR_SCRATCH_DIR)
Brian Silver015b5912014-08-07 15:50:15 -050052
Brian Silver137a00a2014-11-11 12:09:53 -060053 $(TARGET_MAKE_ENV) $(@D)/update_image.pl \
Matt Ploetzb4d85b12016-09-29 20:24:14 -050054 -release $(OPENPOWER_RELEASE) \
Brian Silver015b5912014-08-07 15:50:15 -050055 -op_target_dir $(HOSTBOOT_IMAGE_DIR) \
Brian Silver131189b2014-11-10 08:11:22 -060056 -hb_image_dir $(HOSTBOOT_IMAGE_DIR) \
57 -scratch_dir $(OPENPOWER_PNOR_SCRATCH_DIR) \
58 -hb_binary_dir $(HOSTBOOT_BINARY_DIR) \
59 -targeting_binary_filename $(BR2_OPENPOWER_TARGETING_ECC_FILENAME) \
Brian Silver137a00a2014-11-11 12:09:53 -060060 -targeting_binary_source $(BR2_OPENPOWER_TARGETING_BIN_FILENAME) \
61 -sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) \
Brian Silvercb565552014-12-11 12:51:36 -060062 -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) \
Matt Ploetzaf3f64e2015-05-14 14:49:55 -050063 -wink_binary_filename $(BR2_HOSTBOOT_BINARY_WINK_FILENAME) \
Michael Neuling94f8ab12015-02-11 14:01:28 +110064 -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME) \
Stephen Cpreke7254c72015-02-19 14:33:38 -060065 -capp_binary_filename $(BINARIES_DIR)/$(BR2_CAPP_UCODE_BIN_FILENAME) \
Matt Ploetz02aa69d2016-09-12 18:17:15 -050066 -ima_catalog_filename $(BR2_IMA_CATALOG_FILENAME) \
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050067 -openpower_version_filename $(OPENPOWER_PNOR_VERSION_FILE) \
68 -payload $(BINARIES_DIR)/$(BR2_SKIBOOT_LID_NAME) \
Elizabeth Linerff5fb5f2016-08-19 16:16:33 -050069 $(if ($(BR2_OPENPOWER_PNOR_XZ_ENABLED),y),-xz_compression)
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050070
71 mkdir -p $(STAGING_DIR)/pnor/
Brian Silver131189b2014-11-10 08:11:22 -060072 $(TARGET_MAKE_ENV) $(@D)/create_pnor_image.pl \
Matt Ploetzb4d85b12016-09-29 20:24:14 -050073 -release $(OPENPOWER_RELEASE) \
74 -xml_layout_file $(@D)/"$(OPENPOWER_RELEASE)"Layouts/$(BR2_OPENPOWER_PNOR_XML_LAYOUT_FILENAME) \
Brian Silver131189b2014-11-10 08:11:22 -060075 -pnor_filename $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) \
76 -hb_image_dir $(HOSTBOOT_IMAGE_DIR) \
77 -scratch_dir $(OPENPOWER_PNOR_SCRATCH_DIR) \
78 -outdir $(STAGING_DIR)/pnor/ \
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050079 -payload $(BINARIES_DIR)/$(BR2_SKIBOOT_LID_XZ_NAME) \
Joel Stanley2aff5ba2015-02-01 14:49:18 +103080 -bootkernel $(BINARIES_DIR)/$(LINUX_IMAGE_NAME) \
Brian Silver131189b2014-11-10 08:11:22 -060081 -sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) \
82 -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) \
Matt Ploetzaf3f64e2015-05-14 14:49:55 -050083 -wink_binary_filename $(BR2_HOSTBOOT_BINARY_WINK_FILENAME) \
Brian Silvercb565552014-12-11 12:51:36 -060084 -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME) \
Matt Ploetz02aa69d2016-09-12 18:17:15 -050085 -ima_catalog_filename $(BR2_IMA_CATALOG_ECC_FILENAME) \
Stephen Cpreke7254c72015-02-19 14:33:38 -060086 -targeting_binary_filename $(BR2_OPENPOWER_TARGETING_ECC_FILENAME) \
Elizabeth Liner0ce28ef2016-07-11 09:34:09 -050087 -openpower_version_filename $(OPENPOWER_PNOR_VERSION_FILE)
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050088
Brian Silver131189b2014-11-10 08:11:22 -060089 $(INSTALL) $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) $(BINARIES_DIR)
Brian Horton06c2a882015-04-09 13:32:55 -050090
91 # if this config has an UPDATE_FILENAME defined, create a 32M (1/2 size)
92 # image that only updates the non-golden side
93 if [ "$(BR2_OPENPOWER_PNOR_UPDATE_FILENAME)" != "" ]; then \
94 dd if=$(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) of=$(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_UPDATE_FILENAME) bs=32M count=1; \
95 $(INSTALL) $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_UPDATE_FILENAME) $(BINARIES_DIR); \
96 fi
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050097endef
98
99$(eval $(generic-package))
Stephen Cpreke7254c72015-02-19 14:33:38 -0600100# Generate openPOWER pnor version string by combining subpackage version string files
101$(eval $(call OPENPOWER_VERSION,$(OPENPOWER_PNOR)))