Bill Hoffa | 5f93f1d | 2014-06-26 21:02:48 -0500 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # |
| 3 | # openpower_pnor |
| 4 | # |
| 5 | ################################################################################ |
| 6 | |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 7 | # remove the quotes from the XML/Targeting package as |
| 8 | # make doesn't care for quotes in the dependencies. |
| 9 | XML_PACKAGE=$(subst $\",,$(BR2_OPENPOWER_XML_PACKAGE)) |
Brian Silver | 137a00a | 2014-11-11 12:09:53 -0600 | [diff] [blame] | 10 | |
Dean Sanner | c277680 | 2017-03-17 07:45:41 -0500 | [diff] [blame] | 11 | OPENPOWER_PNOR_VERSION ?= 52b1b91ea5ea7651688802f72d168139c29c4780 |
Nick Bofferding | b82aaef | 2014-11-07 14:29:18 -0600 | [diff] [blame] | 12 | OPENPOWER_PNOR_SITE ?= $(call github,open-power,pnor,$(OPENPOWER_PNOR_VERSION)) |
Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 13 | |
Bill Hoffa | 5f93f1d | 2014-06-26 21:02:48 -0500 | [diff] [blame] | 14 | OPENPOWER_PNOR_LICENSE = Apache-2.0 |
Stewart Smith | b16ba5b | 2017-01-10 12:55:55 +1100 | [diff] [blame] | 15 | OPENPOWER_PNOR_LICENSE_FILES = LICENSE |
Michael Neuling | 94f8ab1 | 2015-02-11 14:01:28 +1100 | [diff] [blame] | 16 | OPENPOWER_PNOR_DEPENDENCIES = hostboot hostboot-binaries $(XML_PACKAGE) skiboot host-openpower-ffs occ capp-ucode |
Bill Hoffa | 5f93f1d | 2014-06-26 21:02:48 -0500 | [diff] [blame] | 17 | |
William A. Kennington III | 036c7d7 | 2017-03-17 12:58:56 -0700 | [diff] [blame] | 18 | ifeq ($(BR2_PACKAGE_IMA_CATALOG),y) |
| 19 | OPENPOWER_PNOR_DEPENDENCIES += ima-catalog |
| 20 | endif |
| 21 | |
Stewart Smith | 898245e | 2016-03-30 15:26:23 +1100 | [diff] [blame] | 22 | ifeq ($(BR2_PACKAGE_SKIBOOT_EMBED_PAYLOAD),n) |
Joel Stanley | 2aff5ba | 2015-02-01 14:49:18 +1030 | [diff] [blame] | 23 | |
| 24 | ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y) |
Stewart Smith | 906bdba | 2015-08-26 16:05:20 +1000 | [diff] [blame] | 25 | OPENPOWER_PNOR_DEPENDENCIES += linux-rebuild-with-initramfs |
Joel Stanley | 2aff5ba | 2015-02-01 14:49:18 +1030 | [diff] [blame] | 26 | else |
| 27 | OPENPOWER_PNOR_DEPENDENCIES += linux |
| 28 | endif |
| 29 | |
| 30 | endif |
| 31 | |
Elizabeth Liner | fbd6c45 | 2016-03-31 10:38:17 -0500 | [diff] [blame] | 32 | ifeq ($(BR2_OPENPOWER_PNOR_XZ_ENABLED),y) |
Jeremy Kerr | c780084 | 2016-07-22 14:01:17 +0800 | [diff] [blame] | 33 | OPENPOWER_PNOR_DEPENDENCIES += host-xz |
Elizabeth Liner | fbd6c45 | 2016-03-31 10:38:17 -0500 | [diff] [blame] | 34 | endif |
| 35 | |
Matt Ploetz | b4d85b1 | 2016-09-29 20:24:14 -0500 | [diff] [blame] | 36 | ifeq ($(BR2_OPENPOWER_POWER9),y) |
| 37 | OPENPOWER_RELEASE=p9 |
| 38 | else |
| 39 | OPENPOWER_RELEASE=p8 |
| 40 | endif |
| 41 | |
Elizabeth Liner | fbd6c45 | 2016-03-31 10:38:17 -0500 | [diff] [blame] | 42 | |
Bill Hoffa | 5f93f1d | 2014-06-26 21:02:48 -0500 | [diff] [blame] | 43 | OPENPOWER_PNOR_INSTALL_IMAGES = YES |
| 44 | OPENPOWER_PNOR_INSTALL_TARGET = NO |
| 45 | |
Bill Hoffa | 5f93f1d | 2014-06-26 21:02:48 -0500 | [diff] [blame] | 46 | HOSTBOOT_IMAGE_DIR=$(STAGING_DIR)/hostboot_build_images/ |
| 47 | HOSTBOOT_BINARY_DIR = $(STAGING_DIR)/hostboot_binaries/ |
| 48 | OPENPOWER_PNOR_SCRATCH_DIR = $(STAGING_DIR)/openpower_pnor_scratch/ |
Stephen Cprek | e7254c7 | 2015-02-19 14:33:38 -0600 | [diff] [blame] | 49 | OPENPOWER_VERSION_DIR = $(STAGING_DIR)/openpower_version |
| 50 | |
| 51 | # Subpackages we want to include in the version info (do not include openpower-pnor) |
Sam Mendoza-Jonas | 33f3044 | 2016-03-01 16:38:56 +1100 | [diff] [blame] | 52 | OPENPOWER_VERSIONED_SUBPACKAGES = skiboot hostboot linux petitboot $(XML_PACKAGE) occ hostboot-binaries capp-ucode |
Stephen Cprek | e7254c7 | 2015-02-19 14:33:38 -0600 | [diff] [blame] | 53 | OPENPOWER_PNOR = openpower-pnor |
Bill Hoffa | 5f93f1d | 2014-06-26 21:02:48 -0500 | [diff] [blame] | 54 | |
| 55 | define OPENPOWER_PNOR_INSTALL_IMAGES_CMDS |
| 56 | mkdir -p $(OPENPOWER_PNOR_SCRATCH_DIR) |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 57 | |
Brian Silver | 137a00a | 2014-11-11 12:09:53 -0600 | [diff] [blame] | 58 | $(TARGET_MAKE_ENV) $(@D)/update_image.pl \ |
Matt Ploetz | b4d85b1 | 2016-09-29 20:24:14 -0500 | [diff] [blame] | 59 | -release $(OPENPOWER_RELEASE) \ |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 60 | -op_target_dir $(HOSTBOOT_IMAGE_DIR) \ |
Brian Silver | 131189b | 2014-11-10 08:11:22 -0600 | [diff] [blame] | 61 | -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 Silver | 137a00a | 2014-11-11 12:09:53 -0600 | [diff] [blame] | 65 | -targeting_binary_source $(BR2_OPENPOWER_TARGETING_BIN_FILENAME) \ |
| 66 | -sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) \ |
Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 67 | -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) \ |
Matt Ploetz | af3f64e | 2015-05-14 14:49:55 -0500 | [diff] [blame] | 68 | -wink_binary_filename $(BR2_HOSTBOOT_BINARY_WINK_FILENAME) \ |
Michael Neuling | 94f8ab1 | 2015-02-11 14:01:28 +1100 | [diff] [blame] | 69 | -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME) \ |
Stephen Cprek | e7254c7 | 2015-02-19 14:33:38 -0600 | [diff] [blame] | 70 | -capp_binary_filename $(BINARIES_DIR)/$(BR2_CAPP_UCODE_BIN_FILENAME) \ |
Matt Ploetz | dfd5a47 | 2017-01-19 13:13:55 -0600 | [diff] [blame] | 71 | -ima_catalog_binary_filename $(BINARIES_DIR)/$(BR2_IMA_CATALOG_FILENAME) \ |
Elizabeth Liner | fbd6c45 | 2016-03-31 10:38:17 -0500 | [diff] [blame] | 72 | -openpower_version_filename $(OPENPOWER_PNOR_VERSION_FILE) \ |
| 73 | -payload $(BINARIES_DIR)/$(BR2_SKIBOOT_LID_NAME) \ |
Elizabeth Liner | ff5fb5f | 2016-08-19 16:16:33 -0500 | [diff] [blame] | 74 | $(if ($(BR2_OPENPOWER_PNOR_XZ_ENABLED),y),-xz_compression) |
Bill Hoffa | 5f93f1d | 2014-06-26 21:02:48 -0500 | [diff] [blame] | 75 | |
| 76 | mkdir -p $(STAGING_DIR)/pnor/ |
Brian Silver | 131189b | 2014-11-10 08:11:22 -0600 | [diff] [blame] | 77 | $(TARGET_MAKE_ENV) $(@D)/create_pnor_image.pl \ |
Matt Ploetz | b4d85b1 | 2016-09-29 20:24:14 -0500 | [diff] [blame] | 78 | -release $(OPENPOWER_RELEASE) \ |
| 79 | -xml_layout_file $(@D)/"$(OPENPOWER_RELEASE)"Layouts/$(BR2_OPENPOWER_PNOR_XML_LAYOUT_FILENAME) \ |
Brian Silver | 131189b | 2014-11-10 08:11:22 -0600 | [diff] [blame] | 80 | -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 Liner | fbd6c45 | 2016-03-31 10:38:17 -0500 | [diff] [blame] | 84 | -payload $(BINARIES_DIR)/$(BR2_SKIBOOT_LID_XZ_NAME) \ |
Joel Stanley | 2aff5ba | 2015-02-01 14:49:18 +1030 | [diff] [blame] | 85 | -bootkernel $(BINARIES_DIR)/$(LINUX_IMAGE_NAME) \ |
Brian Silver | 131189b | 2014-11-10 08:11:22 -0600 | [diff] [blame] | 86 | -sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) \ |
| 87 | -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) \ |
Matt Ploetz | af3f64e | 2015-05-14 14:49:55 -0500 | [diff] [blame] | 88 | -wink_binary_filename $(BR2_HOSTBOOT_BINARY_WINK_FILENAME) \ |
Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 89 | -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME) \ |
Stephen Cprek | e7254c7 | 2015-02-19 14:33:38 -0600 | [diff] [blame] | 90 | -targeting_binary_filename $(BR2_OPENPOWER_TARGETING_ECC_FILENAME) \ |
Elizabeth Liner | 0ce28ef | 2016-07-11 09:34:09 -0500 | [diff] [blame] | 91 | -openpower_version_filename $(OPENPOWER_PNOR_VERSION_FILE) |
Bill Hoffa | 5f93f1d | 2014-06-26 21:02:48 -0500 | [diff] [blame] | 92 | |
Brian Silver | 131189b | 2014-11-10 08:11:22 -0600 | [diff] [blame] | 93 | $(INSTALL) $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) $(BINARIES_DIR) |
Brian Horton | 06c2a88 | 2015-04-09 13:32:55 -0500 | [diff] [blame] | 94 | |
| 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 Hoffa | 5f93f1d | 2014-06-26 21:02:48 -0500 | [diff] [blame] | 101 | endef |
| 102 | |
| 103 | $(eval $(generic-package)) |
Stephen Cprek | e7254c7 | 2015-02-19 14:33:38 -0600 | [diff] [blame] | 104 | # Generate openPOWER pnor version string by combining subpackage version string files |
| 105 | $(eval $(call OPENPOWER_VERSION,$(OPENPOWER_PNOR))) |