blob: 613a83192ec6daaf625ff04cf10d921bd04d2b1c [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
Dean Sannerc2776802017-03-17 07:45:41 -050011OPENPOWER_PNOR_VERSION ?= 52b1b91ea5ea7651688802f72d168139c29c4780
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
Stewart Smith898245e2016-03-30 15:26:23 +110018ifeq ($(BR2_PACKAGE_SKIBOOT_EMBED_PAYLOAD),n)
Joel Stanley2aff5ba2015-02-01 14:49:18 +103019
20ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
Stewart Smith906bdba2015-08-26 16:05:20 +100021OPENPOWER_PNOR_DEPENDENCIES += linux-rebuild-with-initramfs
Joel Stanley2aff5ba2015-02-01 14:49:18 +103022else
23OPENPOWER_PNOR_DEPENDENCIES += linux
24endif
25
26endif
27
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050028ifeq ($(BR2_OPENPOWER_PNOR_XZ_ENABLED),y)
Jeremy Kerrc7800842016-07-22 14:01:17 +080029OPENPOWER_PNOR_DEPENDENCIES += host-xz
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050030endif
31
Matt Ploetzb4d85b12016-09-29 20:24:14 -050032ifeq ($(BR2_OPENPOWER_POWER9),y)
33 OPENPOWER_RELEASE=p9
34else
35 OPENPOWER_RELEASE=p8
36endif
37
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050038
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050039OPENPOWER_PNOR_INSTALL_IMAGES = YES
40OPENPOWER_PNOR_INSTALL_TARGET = NO
41
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050042HOSTBOOT_IMAGE_DIR=$(STAGING_DIR)/hostboot_build_images/
43HOSTBOOT_BINARY_DIR = $(STAGING_DIR)/hostboot_binaries/
44OPENPOWER_PNOR_SCRATCH_DIR = $(STAGING_DIR)/openpower_pnor_scratch/
Stephen Cpreke7254c72015-02-19 14:33:38 -060045OPENPOWER_VERSION_DIR = $(STAGING_DIR)/openpower_version
46
47# Subpackages we want to include in the version info (do not include openpower-pnor)
Sam Mendoza-Jonas33f30442016-03-01 16:38:56 +110048OPENPOWER_VERSIONED_SUBPACKAGES = skiboot hostboot linux petitboot $(XML_PACKAGE) occ hostboot-binaries capp-ucode
Stephen Cpreke7254c72015-02-19 14:33:38 -060049OPENPOWER_PNOR = openpower-pnor
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050050
51define OPENPOWER_PNOR_INSTALL_IMAGES_CMDS
52 mkdir -p $(OPENPOWER_PNOR_SCRATCH_DIR)
Brian Silver015b5912014-08-07 15:50:15 -050053
Brian Silver137a00a2014-11-11 12:09:53 -060054 $(TARGET_MAKE_ENV) $(@D)/update_image.pl \
Matt Ploetzb4d85b12016-09-29 20:24:14 -050055 -release $(OPENPOWER_RELEASE) \
Brian Silver015b5912014-08-07 15:50:15 -050056 -op_target_dir $(HOSTBOOT_IMAGE_DIR) \
Brian Silver131189b2014-11-10 08:11:22 -060057 -hb_image_dir $(HOSTBOOT_IMAGE_DIR) \
58 -scratch_dir $(OPENPOWER_PNOR_SCRATCH_DIR) \
59 -hb_binary_dir $(HOSTBOOT_BINARY_DIR) \
60 -targeting_binary_filename $(BR2_OPENPOWER_TARGETING_ECC_FILENAME) \
Brian Silver137a00a2014-11-11 12:09:53 -060061 -targeting_binary_source $(BR2_OPENPOWER_TARGETING_BIN_FILENAME) \
62 -sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) \
Brian Silvercb565552014-12-11 12:51:36 -060063 -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) \
Matt Ploetzaf3f64e2015-05-14 14:49:55 -050064 -wink_binary_filename $(BR2_HOSTBOOT_BINARY_WINK_FILENAME) \
Michael Neuling94f8ab12015-02-11 14:01:28 +110065 -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME) \
Stephen Cpreke7254c72015-02-19 14:33:38 -060066 -capp_binary_filename $(BINARIES_DIR)/$(BR2_CAPP_UCODE_BIN_FILENAME) \
Matt Ploetzdfd5a472017-01-19 13:13:55 -060067 -ima_catalog_binary_filename $(BINARIES_DIR)/$(BR2_IMA_CATALOG_FILENAME) \
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050068 -openpower_version_filename $(OPENPOWER_PNOR_VERSION_FILE) \
69 -payload $(BINARIES_DIR)/$(BR2_SKIBOOT_LID_NAME) \
Elizabeth Linerff5fb5f2016-08-19 16:16:33 -050070 $(if ($(BR2_OPENPOWER_PNOR_XZ_ENABLED),y),-xz_compression)
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050071
72 mkdir -p $(STAGING_DIR)/pnor/
Brian Silver131189b2014-11-10 08:11:22 -060073 $(TARGET_MAKE_ENV) $(@D)/create_pnor_image.pl \
Matt Ploetzb4d85b12016-09-29 20:24:14 -050074 -release $(OPENPOWER_RELEASE) \
75 -xml_layout_file $(@D)/"$(OPENPOWER_RELEASE)"Layouts/$(BR2_OPENPOWER_PNOR_XML_LAYOUT_FILENAME) \
Brian Silver131189b2014-11-10 08:11:22 -060076 -pnor_filename $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) \
77 -hb_image_dir $(HOSTBOOT_IMAGE_DIR) \
78 -scratch_dir $(OPENPOWER_PNOR_SCRATCH_DIR) \
79 -outdir $(STAGING_DIR)/pnor/ \
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050080 -payload $(BINARIES_DIR)/$(BR2_SKIBOOT_LID_XZ_NAME) \
Joel Stanley2aff5ba2015-02-01 14:49:18 +103081 -bootkernel $(BINARIES_DIR)/$(LINUX_IMAGE_NAME) \
Brian Silver131189b2014-11-10 08:11:22 -060082 -sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) \
83 -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) \
Matt Ploetzaf3f64e2015-05-14 14:49:55 -050084 -wink_binary_filename $(BR2_HOSTBOOT_BINARY_WINK_FILENAME) \
Brian Silvercb565552014-12-11 12:51:36 -060085 -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_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)))