blob: 72fcc64129857d6b9da30be2ce46bb7fc6b0866e [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
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/
48OPENPOWER_PNOR_SCRATCH_DIR = $(STAGING_DIR)/openpower_pnor_scratch/
Stephen Cpreke7254c72015-02-19 14:33:38 -060049OPENPOWER_VERSION_DIR = $(STAGING_DIR)/openpower_version
50
51# Subpackages we want to include in the version info (do not include openpower-pnor)
Sam Mendoza-Jonas33f30442016-03-01 16:38:56 +110052OPENPOWER_VERSIONED_SUBPACKAGES = skiboot hostboot linux petitboot $(XML_PACKAGE) occ hostboot-binaries capp-ucode
Stephen Cpreke7254c72015-02-19 14:33:38 -060053OPENPOWER_PNOR = openpower-pnor
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050054
55define OPENPOWER_PNOR_INSTALL_IMAGES_CMDS
56 mkdir -p $(OPENPOWER_PNOR_SCRATCH_DIR)
Brian Silver015b5912014-08-07 15:50:15 -050057
Brian Silver137a00a2014-11-11 12:09:53 -060058 $(TARGET_MAKE_ENV) $(@D)/update_image.pl \
Matt Ploetzb4d85b12016-09-29 20:24:14 -050059 -release $(OPENPOWER_RELEASE) \
Brian Silver015b5912014-08-07 15:50:15 -050060 -op_target_dir $(HOSTBOOT_IMAGE_DIR) \
Brian Silver131189b2014-11-10 08:11:22 -060061 -hb_image_dir $(HOSTBOOT_IMAGE_DIR) \
62 -scratch_dir $(OPENPOWER_PNOR_SCRATCH_DIR) \
63 -hb_binary_dir $(HOSTBOOT_BINARY_DIR) \
64 -targeting_binary_filename $(BR2_OPENPOWER_TARGETING_ECC_FILENAME) \
Brian Silver137a00a2014-11-11 12:09:53 -060065 -targeting_binary_source $(BR2_OPENPOWER_TARGETING_BIN_FILENAME) \
66 -sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) \
Brian Silvercb565552014-12-11 12:51:36 -060067 -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) \
Matt Ploetzaf3f64e2015-05-14 14:49:55 -050068 -wink_binary_filename $(BR2_HOSTBOOT_BINARY_WINK_FILENAME) \
Michael Neuling94f8ab12015-02-11 14:01:28 +110069 -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME) \
Stephen Cpreke7254c72015-02-19 14:33:38 -060070 -capp_binary_filename $(BINARIES_DIR)/$(BR2_CAPP_UCODE_BIN_FILENAME) \
Matt Ploetzdfd5a472017-01-19 13:13:55 -060071 -ima_catalog_binary_filename $(BINARIES_DIR)/$(BR2_IMA_CATALOG_FILENAME) \
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050072 -openpower_version_filename $(OPENPOWER_PNOR_VERSION_FILE) \
73 -payload $(BINARIES_DIR)/$(BR2_SKIBOOT_LID_NAME) \
Elizabeth Linerff5fb5f2016-08-19 16:16:33 -050074 $(if ($(BR2_OPENPOWER_PNOR_XZ_ENABLED),y),-xz_compression)
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050075
76 mkdir -p $(STAGING_DIR)/pnor/
Brian Silver131189b2014-11-10 08:11:22 -060077 $(TARGET_MAKE_ENV) $(@D)/create_pnor_image.pl \
Matt Ploetzb4d85b12016-09-29 20:24:14 -050078 -release $(OPENPOWER_RELEASE) \
79 -xml_layout_file $(@D)/"$(OPENPOWER_RELEASE)"Layouts/$(BR2_OPENPOWER_PNOR_XML_LAYOUT_FILENAME) \
Brian Silver131189b2014-11-10 08:11:22 -060080 -pnor_filename $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) \
81 -hb_image_dir $(HOSTBOOT_IMAGE_DIR) \
82 -scratch_dir $(OPENPOWER_PNOR_SCRATCH_DIR) \
83 -outdir $(STAGING_DIR)/pnor/ \
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050084 -payload $(BINARIES_DIR)/$(BR2_SKIBOOT_LID_XZ_NAME) \
Joel Stanley2aff5ba2015-02-01 14:49:18 +103085 -bootkernel $(BINARIES_DIR)/$(LINUX_IMAGE_NAME) \
Brian Silver131189b2014-11-10 08:11:22 -060086 -sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) \
87 -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) \
Matt Ploetzaf3f64e2015-05-14 14:49:55 -050088 -wink_binary_filename $(BR2_HOSTBOOT_BINARY_WINK_FILENAME) \
Brian Silvercb565552014-12-11 12:51:36 -060089 -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME) \
Stephen Cpreke7254c72015-02-19 14:33:38 -060090 -targeting_binary_filename $(BR2_OPENPOWER_TARGETING_ECC_FILENAME) \
Elizabeth Liner0ce28ef2016-07-11 09:34:09 -050091 -openpower_version_filename $(OPENPOWER_PNOR_VERSION_FILE)
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050092
Brian Silver131189b2014-11-10 08:11:22 -060093 $(INSTALL) $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) $(BINARIES_DIR)
Brian Horton06c2a882015-04-09 13:32:55 -050094
95 # if this config has an UPDATE_FILENAME defined, create a 32M (1/2 size)
96 # image that only updates the non-golden side
97 if [ "$(BR2_OPENPOWER_PNOR_UPDATE_FILENAME)" != "" ]; then \
98 dd if=$(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) of=$(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_UPDATE_FILENAME) bs=32M count=1; \
99 $(INSTALL) $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_UPDATE_FILENAME) $(BINARIES_DIR); \
100 fi
Bill Hoffa5f93f1d2014-06-26 21:02:48 -0500101endef
102
103$(eval $(generic-package))
Stephen Cpreke7254c72015-02-19 14:33:38 -0600104# Generate openPOWER pnor version string by combining subpackage version string files
105$(eval $(call OPENPOWER_VERSION,$(OPENPOWER_PNOR)))