blob: da38f96208062b4fb88151b2130523495728e42f [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
Sachin Guptadf0b6a02017-03-16 08:59:51 -050011OPENPOWER_PNOR_VERSION ?= 86474de814334341cc6146174b6aee9afe0e5547
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
Stewart Smithb16ba5b2017-01-10 12:55:55 +110015OPENPOWER_PNOR_LICENSE_FILES = LICENSE
Michael Neuling94f8ab12015-02-11 14:01:28 +110016OPENPOWER_PNOR_DEPENDENCIES = hostboot hostboot-binaries $(XML_PACKAGE) skiboot host-openpower-ffs occ capp-ucode
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050017
William A. Kennington III036c7d72017-03-17 12:58:56 -070018ifeq ($(BR2_PACKAGE_IMA_CATALOG),y)
19OPENPOWER_PNOR_DEPENDENCIES += ima-catalog
20endif
21
Stewart Smith898245e2016-03-30 15:26:23 +110022ifeq ($(BR2_PACKAGE_SKIBOOT_EMBED_PAYLOAD),n)
Joel Stanley2aff5ba2015-02-01 14:49:18 +103023
24ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
Stewart Smith906bdba2015-08-26 16:05:20 +100025OPENPOWER_PNOR_DEPENDENCIES += linux-rebuild-with-initramfs
Joel Stanley2aff5ba2015-02-01 14:49:18 +103026else
27OPENPOWER_PNOR_DEPENDENCIES += linux
28endif
29
30endif
31
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050032ifeq ($(BR2_OPENPOWER_PNOR_XZ_ENABLED),y)
Jeremy Kerrc7800842016-07-22 14:01:17 +080033OPENPOWER_PNOR_DEPENDENCIES += host-xz
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050034endif
35
Matt Ploetzb4d85b12016-09-29 20:24:14 -050036ifeq ($(BR2_OPENPOWER_POWER9),y)
37 OPENPOWER_RELEASE=p9
38else
39 OPENPOWER_RELEASE=p8
40endif
41
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050042
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050043OPENPOWER_PNOR_INSTALL_IMAGES = YES
44OPENPOWER_PNOR_INSTALL_TARGET = NO
45
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050046HOSTBOOT_IMAGE_DIR=$(STAGING_DIR)/hostboot_build_images/
47HOSTBOOT_BINARY_DIR = $(STAGING_DIR)/hostboot_binaries/
Sachin Guptadf0b6a02017-03-16 08:59:51 -050048SBE_BINARY_DIR = $(STAGING_DIR)/sbe_binaries/
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050049OPENPOWER_PNOR_SCRATCH_DIR = $(STAGING_DIR)/openpower_pnor_scratch/
Stephen Cpreke7254c72015-02-19 14:33:38 -060050OPENPOWER_VERSION_DIR = $(STAGING_DIR)/openpower_version
51
52# Subpackages we want to include in the version info (do not include openpower-pnor)
Sam Mendoza-Jonas33f30442016-03-01 16:38:56 +110053OPENPOWER_VERSIONED_SUBPACKAGES = skiboot hostboot linux petitboot $(XML_PACKAGE) occ hostboot-binaries capp-ucode
Stephen Cpreke7254c72015-02-19 14:33:38 -060054OPENPOWER_PNOR = openpower-pnor
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050055
Sachin Guptadf0b6a02017-03-16 08:59:51 -050056ifeq ($(BR2_OPENPOWER_POWER9),y)
57 OPENPOWER_PNOR_DEPENDENCIES += sbe
58 OPENPOWER_VERSIONED_SUBPACKAGES += sbe
59endif
60
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050061define OPENPOWER_PNOR_INSTALL_IMAGES_CMDS
62 mkdir -p $(OPENPOWER_PNOR_SCRATCH_DIR)
Brian Silver015b5912014-08-07 15:50:15 -050063
Brian Silver137a00a2014-11-11 12:09:53 -060064 $(TARGET_MAKE_ENV) $(@D)/update_image.pl \
Matt Ploetzb4d85b12016-09-29 20:24:14 -050065 -release $(OPENPOWER_RELEASE) \
Brian Silver015b5912014-08-07 15:50:15 -050066 -op_target_dir $(HOSTBOOT_IMAGE_DIR) \
Brian Silver131189b2014-11-10 08:11:22 -060067 -hb_image_dir $(HOSTBOOT_IMAGE_DIR) \
68 -scratch_dir $(OPENPOWER_PNOR_SCRATCH_DIR) \
69 -hb_binary_dir $(HOSTBOOT_BINARY_DIR) \
70 -targeting_binary_filename $(BR2_OPENPOWER_TARGETING_ECC_FILENAME) \
Brian Silver137a00a2014-11-11 12:09:53 -060071 -targeting_binary_source $(BR2_OPENPOWER_TARGETING_BIN_FILENAME) \
72 -sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) \
Sachin Guptadf0b6a02017-03-16 08:59:51 -050073 -sbe_binary_dir $(SBE_BINARY_DIR) \
Brian Silvercb565552014-12-11 12:51:36 -060074 -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) \
Matt Ploetzaf3f64e2015-05-14 14:49:55 -050075 -wink_binary_filename $(BR2_HOSTBOOT_BINARY_WINK_FILENAME) \
Michael Neuling94f8ab12015-02-11 14:01:28 +110076 -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME) \
Stephen Cpreke7254c72015-02-19 14:33:38 -060077 -capp_binary_filename $(BINARIES_DIR)/$(BR2_CAPP_UCODE_BIN_FILENAME) \
Matt Ploetzdfd5a472017-01-19 13:13:55 -060078 -ima_catalog_binary_filename $(BINARIES_DIR)/$(BR2_IMA_CATALOG_FILENAME) \
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050079 -openpower_version_filename $(OPENPOWER_PNOR_VERSION_FILE) \
80 -payload $(BINARIES_DIR)/$(BR2_SKIBOOT_LID_NAME) \
Elizabeth Linerff5fb5f2016-08-19 16:16:33 -050081 $(if ($(BR2_OPENPOWER_PNOR_XZ_ENABLED),y),-xz_compression)
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050082
83 mkdir -p $(STAGING_DIR)/pnor/
Brian Silver131189b2014-11-10 08:11:22 -060084 $(TARGET_MAKE_ENV) $(@D)/create_pnor_image.pl \
Matt Ploetzb4d85b12016-09-29 20:24:14 -050085 -release $(OPENPOWER_RELEASE) \
86 -xml_layout_file $(@D)/"$(OPENPOWER_RELEASE)"Layouts/$(BR2_OPENPOWER_PNOR_XML_LAYOUT_FILENAME) \
Brian Silver131189b2014-11-10 08:11:22 -060087 -pnor_filename $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) \
88 -hb_image_dir $(HOSTBOOT_IMAGE_DIR) \
89 -scratch_dir $(OPENPOWER_PNOR_SCRATCH_DIR) \
90 -outdir $(STAGING_DIR)/pnor/ \
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050091 -payload $(BINARIES_DIR)/$(BR2_SKIBOOT_LID_XZ_NAME) \
Joel Stanley2aff5ba2015-02-01 14:49:18 +103092 -bootkernel $(BINARIES_DIR)/$(LINUX_IMAGE_NAME) \
Brian Silver131189b2014-11-10 08:11:22 -060093 -sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) \
94 -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) \
Matt Ploetzaf3f64e2015-05-14 14:49:55 -050095 -wink_binary_filename $(BR2_HOSTBOOT_BINARY_WINK_FILENAME) \
Brian Silvercb565552014-12-11 12:51:36 -060096 -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME) \
Stephen Cpreke7254c72015-02-19 14:33:38 -060097 -targeting_binary_filename $(BR2_OPENPOWER_TARGETING_ECC_FILENAME) \
Elizabeth Liner0ce28ef2016-07-11 09:34:09 -050098 -openpower_version_filename $(OPENPOWER_PNOR_VERSION_FILE)
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050099
Brian Silver131189b2014-11-10 08:11:22 -0600100 $(INSTALL) $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) $(BINARIES_DIR)
Brian Horton06c2a882015-04-09 13:32:55 -0500101
102 # if this config has an UPDATE_FILENAME defined, create a 32M (1/2 size)
103 # image that only updates the non-golden side
104 if [ "$(BR2_OPENPOWER_PNOR_UPDATE_FILENAME)" != "" ]; then \
105 dd if=$(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) of=$(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_UPDATE_FILENAME) bs=32M count=1; \
106 $(INSTALL) $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_UPDATE_FILENAME) $(BINARIES_DIR); \
107 fi
Bill Hoffa5f93f1d2014-06-26 21:02:48 -0500108endef
109
110$(eval $(generic-package))
Stephen Cpreke7254c72015-02-19 14:33:38 -0600111# Generate openPOWER pnor version string by combining subpackage version string files
112$(eval $(call OPENPOWER_VERSION,$(OPENPOWER_PNOR)))