blob: 1e777adae6a973151d43957f11c6282cdacc25db [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
hostboot46543bd2016-08-02 00:07:36 -050011OPENPOWER_PNOR_VERSION ?= cdfe37976dae7d3171ce9b999cf91f1b5d80e9cc
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
31
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050032OPENPOWER_PNOR_INSTALL_IMAGES = YES
33OPENPOWER_PNOR_INSTALL_TARGET = NO
34
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050035HOSTBOOT_IMAGE_DIR=$(STAGING_DIR)/hostboot_build_images/
36HOSTBOOT_BINARY_DIR = $(STAGING_DIR)/hostboot_binaries/
37OPENPOWER_PNOR_SCRATCH_DIR = $(STAGING_DIR)/openpower_pnor_scratch/
Stephen Cpreke7254c72015-02-19 14:33:38 -060038OPENPOWER_VERSION_DIR = $(STAGING_DIR)/openpower_version
39
40# Subpackages we want to include in the version info (do not include openpower-pnor)
Sam Mendoza-Jonas33f30442016-03-01 16:38:56 +110041OPENPOWER_VERSIONED_SUBPACKAGES = skiboot hostboot linux petitboot $(XML_PACKAGE) occ hostboot-binaries capp-ucode
Stephen Cpreke7254c72015-02-19 14:33:38 -060042OPENPOWER_PNOR = openpower-pnor
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050043
44define OPENPOWER_PNOR_INSTALL_IMAGES_CMDS
45 mkdir -p $(OPENPOWER_PNOR_SCRATCH_DIR)
Brian Silver015b5912014-08-07 15:50:15 -050046
Brian Silver137a00a2014-11-11 12:09:53 -060047 $(TARGET_MAKE_ENV) $(@D)/update_image.pl \
Brian Silver015b5912014-08-07 15:50:15 -050048 -op_target_dir $(HOSTBOOT_IMAGE_DIR) \
Brian Silver131189b2014-11-10 08:11:22 -060049 -hb_image_dir $(HOSTBOOT_IMAGE_DIR) \
50 -scratch_dir $(OPENPOWER_PNOR_SCRATCH_DIR) \
51 -hb_binary_dir $(HOSTBOOT_BINARY_DIR) \
52 -targeting_binary_filename $(BR2_OPENPOWER_TARGETING_ECC_FILENAME) \
Brian Silver137a00a2014-11-11 12:09:53 -060053 -targeting_binary_source $(BR2_OPENPOWER_TARGETING_BIN_FILENAME) \
54 -sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) \
Brian Silvercb565552014-12-11 12:51:36 -060055 -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) \
Matt Ploetzaf3f64e2015-05-14 14:49:55 -050056 -wink_binary_filename $(BR2_HOSTBOOT_BINARY_WINK_FILENAME) \
Michael Neuling94f8ab12015-02-11 14:01:28 +110057 -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME) \
Stephen Cpreke7254c72015-02-19 14:33:38 -060058 -capp_binary_filename $(BINARIES_DIR)/$(BR2_CAPP_UCODE_BIN_FILENAME) \
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050059 -openpower_version_filename $(OPENPOWER_PNOR_VERSION_FILE) \
60 -payload $(BINARIES_DIR)/$(BR2_SKIBOOT_LID_NAME) \
Jeremy Kerr4c5e6e22016-07-22 13:59:47 +080061 $(if ($(BR2_OPENPOWER_PNOR_XZ_ENABLED),y),-xz_compression true)
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050062
63 mkdir -p $(STAGING_DIR)/pnor/
Brian Silver131189b2014-11-10 08:11:22 -060064 $(TARGET_MAKE_ENV) $(@D)/create_pnor_image.pl \
65 -xml_layout_file $(@D)/$(BR2_OPENPOWER_PNOR_XML_LAYOUT_FILENAME) \
66 -pnor_filename $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) \
67 -hb_image_dir $(HOSTBOOT_IMAGE_DIR) \
68 -scratch_dir $(OPENPOWER_PNOR_SCRATCH_DIR) \
69 -outdir $(STAGING_DIR)/pnor/ \
Elizabeth Linerfbd6c452016-03-31 10:38:17 -050070 -payload $(BINARIES_DIR)/$(BR2_SKIBOOT_LID_XZ_NAME) \
Joel Stanley2aff5ba2015-02-01 14:49:18 +103071 -bootkernel $(BINARIES_DIR)/$(LINUX_IMAGE_NAME) \
Brian Silver131189b2014-11-10 08:11:22 -060072 -sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) \
73 -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) \
Matt Ploetzaf3f64e2015-05-14 14:49:55 -050074 -wink_binary_filename $(BR2_HOSTBOOT_BINARY_WINK_FILENAME) \
Brian Silvercb565552014-12-11 12:51:36 -060075 -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME) \
Stephen Cpreke7254c72015-02-19 14:33:38 -060076 -targeting_binary_filename $(BR2_OPENPOWER_TARGETING_ECC_FILENAME) \
Elizabeth Liner0ce28ef2016-07-11 09:34:09 -050077 -openpower_version_filename $(OPENPOWER_PNOR_VERSION_FILE)
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050078
Brian Silver131189b2014-11-10 08:11:22 -060079 $(INSTALL) $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) $(BINARIES_DIR)
Brian Horton06c2a882015-04-09 13:32:55 -050080
81 # if this config has an UPDATE_FILENAME defined, create a 32M (1/2 size)
82 # image that only updates the non-golden side
83 if [ "$(BR2_OPENPOWER_PNOR_UPDATE_FILENAME)" != "" ]; then \
84 dd if=$(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) of=$(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_UPDATE_FILENAME) bs=32M count=1; \
85 $(INSTALL) $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_UPDATE_FILENAME) $(BINARIES_DIR); \
86 fi
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050087endef
88
89$(eval $(generic-package))
Stephen Cpreke7254c72015-02-19 14:33:38 -060090# Generate openPOWER pnor version string by combining subpackage version string files
91$(eval $(call OPENPOWER_VERSION,$(OPENPOWER_PNOR)))