blob: 1d11f1492b5fabd292158da6a39ac28818466d72 [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
Jay Azurine48917b2015-08-26 20:49:00 -050011OPENPOWER_PNOR_VERSION ?= 40e407735b317d0174645b7543e0a72019709ce2
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
Joel Stanley2aff5ba2015-02-01 14:49:18 +103017ifeq ($(BR2_TARGET_SKIBOOT_EMBED_PAYLOAD),n)
18
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
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050027OPENPOWER_PNOR_INSTALL_IMAGES = YES
28OPENPOWER_PNOR_INSTALL_TARGET = NO
29
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050030HOSTBOOT_IMAGE_DIR=$(STAGING_DIR)/hostboot_build_images/
31HOSTBOOT_BINARY_DIR = $(STAGING_DIR)/hostboot_binaries/
32OPENPOWER_PNOR_SCRATCH_DIR = $(STAGING_DIR)/openpower_pnor_scratch/
Stephen Cpreke7254c72015-02-19 14:33:38 -060033OPENPOWER_VERSION_DIR = $(STAGING_DIR)/openpower_version
34
35# Subpackages we want to include in the version info (do not include openpower-pnor)
36OPENPOWER_VERSIONED_SUBPACKAGES = hostboot occ skiboot hostboot-binaries $(XML_PACKAGE) capp-ucode
37OPENPOWER_PNOR = openpower-pnor
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050038
39define OPENPOWER_PNOR_INSTALL_IMAGES_CMDS
40 mkdir -p $(OPENPOWER_PNOR_SCRATCH_DIR)
Brian Silver015b5912014-08-07 15:50:15 -050041
Brian Silver137a00a2014-11-11 12:09:53 -060042 $(TARGET_MAKE_ENV) $(@D)/update_image.pl \
Brian Silver015b5912014-08-07 15:50:15 -050043 -op_target_dir $(HOSTBOOT_IMAGE_DIR) \
Brian Silver131189b2014-11-10 08:11:22 -060044 -hb_image_dir $(HOSTBOOT_IMAGE_DIR) \
45 -scratch_dir $(OPENPOWER_PNOR_SCRATCH_DIR) \
46 -hb_binary_dir $(HOSTBOOT_BINARY_DIR) \
47 -targeting_binary_filename $(BR2_OPENPOWER_TARGETING_ECC_FILENAME) \
Brian Silver137a00a2014-11-11 12:09:53 -060048 -targeting_binary_source $(BR2_OPENPOWER_TARGETING_BIN_FILENAME) \
49 -sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) \
Brian Silvercb565552014-12-11 12:51:36 -060050 -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) \
Matt Ploetzaf3f64e2015-05-14 14:49:55 -050051 -wink_binary_filename $(BR2_HOSTBOOT_BINARY_WINK_FILENAME) \
Michael Neuling94f8ab12015-02-11 14:01:28 +110052 -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME) \
Stephen Cpreke7254c72015-02-19 14:33:38 -060053 -capp_binary_filename $(BINARIES_DIR)/$(BR2_CAPP_UCODE_BIN_FILENAME) \
54 -openpower_version_filename $(OPENPOWER_PNOR_VERSION_FILE)
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050055
56 mkdir -p $(STAGING_DIR)/pnor/
Brian Silver131189b2014-11-10 08:11:22 -060057 $(TARGET_MAKE_ENV) $(@D)/create_pnor_image.pl \
58 -xml_layout_file $(@D)/$(BR2_OPENPOWER_PNOR_XML_LAYOUT_FILENAME) \
59 -pnor_filename $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) \
60 -hb_image_dir $(HOSTBOOT_IMAGE_DIR) \
61 -scratch_dir $(OPENPOWER_PNOR_SCRATCH_DIR) \
62 -outdir $(STAGING_DIR)/pnor/ \
63 -payload $(BINARIES_DIR)/$(BR2_SKIBOOT_LID_NAME) \
Joel Stanley2aff5ba2015-02-01 14:49:18 +103064 -bootkernel $(BINARIES_DIR)/$(LINUX_IMAGE_NAME) \
Brian Silver131189b2014-11-10 08:11:22 -060065 -sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME) \
66 -sbec_binary_filename $(BR2_HOSTBOOT_BINARY_SBEC_FILENAME) \
Matt Ploetzaf3f64e2015-05-14 14:49:55 -050067 -wink_binary_filename $(BR2_HOSTBOOT_BINARY_WINK_FILENAME) \
Brian Silvercb565552014-12-11 12:51:36 -060068 -occ_binary_filename $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME) \
Stephen Cpreke7254c72015-02-19 14:33:38 -060069 -targeting_binary_filename $(BR2_OPENPOWER_TARGETING_ECC_FILENAME) \
70 -openpower_version_filename $(OPENPOWER_PNOR_VERSION_FILE)
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050071
Brian Silver131189b2014-11-10 08:11:22 -060072 $(INSTALL) $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) $(BINARIES_DIR)
Brian Horton06c2a882015-04-09 13:32:55 -050073
74 # if this config has an UPDATE_FILENAME defined, create a 32M (1/2 size)
75 # image that only updates the non-golden side
76 if [ "$(BR2_OPENPOWER_PNOR_UPDATE_FILENAME)" != "" ]; then \
77 dd if=$(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_FILENAME) of=$(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_UPDATE_FILENAME) bs=32M count=1; \
78 $(INSTALL) $(STAGING_DIR)/pnor/$(BR2_OPENPOWER_PNOR_UPDATE_FILENAME) $(BINARIES_DIR); \
79 fi
Bill Hoffa5f93f1d2014-06-26 21:02:48 -050080endef
81
82$(eval $(generic-package))
Stephen Cpreke7254c72015-02-19 14:33:38 -060083# Generate openPOWER pnor version string by combining subpackage version string files
84$(eval $(call OPENPOWER_VERSION,$(OPENPOWER_PNOR)))