Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # |
| 3 | # habanero_xml |
| 4 | # |
| 5 | ################################################################################ |
| 6 | |
hostboot | 95bc01d | 2016-11-18 00:07:39 -0600 | [diff] [blame] | 7 | HABANERO_XML_VERSION ?= 6a78496c286e284719a8201148a5088030b897de |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 8 | HABANERO_XML_SITE ?= $(call github,open-power,habanero-xml,$(HABANERO_XML_VERSION)) |
| 9 | |
| 10 | HABANERO_XML_LICENSE = Apache-2.0 |
Stewart Smith | b16ba5b | 2017-01-10 12:55:55 +1100 | [diff] [blame] | 11 | HABANERO_XML_LICENSE_FILES = LICENSE |
Jeremy Kerr | 28df94b | 2016-07-22 09:36:56 +0800 | [diff] [blame] | 12 | HABANERO_XML_DEPENDENCIES = hostboot openpower-mrw common-p8-xml |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 13 | |
| 14 | HABANERO_XML_INSTALL_IMAGES = YES |
Nick Bofferding | 10de73a | 2015-02-16 23:57:26 -0600 | [diff] [blame] | 15 | HABANERO_XML_INSTALL_TARGET = YES |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 16 | |
| 17 | MRW_SCRATCH=$(STAGING_DIR)/openpower_mrw_scratch |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 18 | MRW_HB_TOOLS=$(STAGING_DIR)/hostboot_build_images |
| 19 | |
Nick Bofferding | 82d02c2 | 2015-02-16 23:23:56 -0600 | [diff] [blame] | 20 | # Defines for BIOS metadata creation |
| 21 | BIOS_SCHEMA_FILE = $(MRW_HB_TOOLS)/bios.xsd |
Nick Bofferding | aa560f0 | 2015-02-17 00:56:54 -0600 | [diff] [blame] | 22 | HABANERO_BIOS_XML_CONFIG_FILE = $(MRW_SCRATCH)/$(BR2_HABANERO_BIOS_XML_FILENAME) |
Nick Bofferding | 82d02c2 | 2015-02-16 23:23:56 -0600 | [diff] [blame] | 23 | BIOS_XML_METADATA_FILE = \ |
| 24 | $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_CONFIG_NAME)_bios_metadata.xml |
| 25 | PETITBOOT_XSLT_FILE = $(MRW_HB_TOOLS)/bios_metadata_petitboot.xslt |
| 26 | PETITBOOT_BIOS_XML_METADATA_FILE = \ |
| 27 | $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_CONFIG_NAME)_bios_metadata_petitboot.xml |
| 28 | PETITBOOT_BIOS_XML_METADATA_INITRAMFS_FILE = \ |
| 29 | $(TARGET_DIR)/usr/share/bios_metadata.xml |
| 30 | |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 31 | define HABANERO_XML_BUILD_CMDS |
| 32 | # copy the habanero xml where the common lives |
| 33 | bash -c 'mkdir -p $(MRW_SCRATCH) && cp -r $(@D)/* $(MRW_SCRATCH)' |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 34 | |
Matt Ploetz | ed8800a | 2015-02-10 13:12:24 -0600 | [diff] [blame] | 35 | # generate the system mrw xml |
| 36 | perl -I $(MRW_HB_TOOLS) \ |
| 37 | $(MRW_HB_TOOLS)/processMrw.pl -x $(MRW_SCRATCH)/habanero.xml |
Nick Bofferding | 10de73a | 2015-02-16 23:57:26 -0600 | [diff] [blame] | 38 | |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 39 | # merge in any system specific attributes, hostboot attributes |
Matt Ploetz | ed8800a | 2015-02-10 13:12:24 -0600 | [diff] [blame] | 40 | $(MRW_HB_TOOLS)/mergexml.sh $(MRW_SCRATCH)/$(BR2_HABANERO_SYSTEM_XML_FILENAME) \ |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 41 | $(MRW_HB_TOOLS)/attribute_types.xml \ |
| 42 | $(MRW_HB_TOOLS)/attribute_types_hb.xml \ |
Elizabeth Liner | 271b619 | 2016-07-28 12:16:56 -0500 | [diff] [blame] | 43 | $(MRW_HB_TOOLS)/attribute_types_openpower.xml \ |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 44 | $(MRW_HB_TOOLS)/target_types_merged.xml \ |
| 45 | $(MRW_HB_TOOLS)/target_types_hb.xml \ |
Elizabeth Liner | 271b619 | 2016-07-28 12:16:56 -0500 | [diff] [blame] | 46 | $(MRW_HB_TOOLS)/target_types_openpower.xml \ |
Matt Ploetz | ed8800a | 2015-02-10 13:12:24 -0600 | [diff] [blame] | 47 | $(MRW_SCRATCH)/$(BR2_HABANERO_MRW_XML_FILENAME) > $(MRW_HB_TOOLS)/temporary_hb.hb.xml; |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 48 | |
| 49 | # creating the targeting binary |
| 50 | $(MRW_HB_TOOLS)/xmltohb.pl \ |
| 51 | --hb-xml-file=$(MRW_HB_TOOLS)/temporary_hb.hb.xml \ |
| 52 | --fapi-attributes-xml-file=$(MRW_HB_TOOLS)/fapiattrs.xml \ |
| 53 | --src-output-dir=none \ |
| 54 | --img-output-dir=$(MRW_HB_TOOLS)/ \ |
Nick Bofferding | 82d02c2 | 2015-02-16 23:23:56 -0600 | [diff] [blame] | 55 | --vmm-consts-file=$(MRW_HB_TOOLS)/vmmconst.h --noshort-enums \ |
Nick Bofferding | aa560f0 | 2015-02-17 00:56:54 -0600 | [diff] [blame] | 56 | --bios-xml-file=$(HABANERO_BIOS_XML_CONFIG_FILE) \ |
Nick Bofferding | 82d02c2 | 2015-02-16 23:23:56 -0600 | [diff] [blame] | 57 | --bios-schema-file=$(BIOS_SCHEMA_FILE) \ |
| 58 | --bios-output-file=$(BIOS_XML_METADATA_FILE) |
| 59 | |
| 60 | # Transform BIOS XML into Petitboot specific BIOS XML via the schema |
| 61 | xsltproc -o \ |
| 62 | $(PETITBOOT_BIOS_XML_METADATA_FILE) \ |
| 63 | $(PETITBOOT_XSLT_FILE) \ |
| 64 | $(BIOS_XML_METADATA_FILE) |
Nick Bofferding | 10de73a | 2015-02-16 23:57:26 -0600 | [diff] [blame] | 65 | endef |
Nick Bofferding | 82d02c2 | 2015-02-16 23:23:56 -0600 | [diff] [blame] | 66 | |
Nick Bofferding | 10de73a | 2015-02-16 23:57:26 -0600 | [diff] [blame] | 67 | define HABANERO_XML_INSTALL_IMAGES_CMDS |
| 68 | mv $(MRW_HB_TOOLS)/targeting.bin $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_TARGETING_BIN_FILENAME) |
| 69 | endef |
| 70 | |
Matt Ploetz | dcd7551 | 2015-02-25 23:48:19 -0600 | [diff] [blame] | 71 | define HABANERO_XML_INSTALL_TARGET_CMDS |
Nick Bofferding | 82d02c2 | 2015-02-16 23:23:56 -0600 | [diff] [blame] | 72 | # Install Petitboot specific BIOS XML into initramfs's usr/share/ dir |
| 73 | $(INSTALL) -D -m 0644 \ |
| 74 | $(PETITBOOT_BIOS_XML_METADATA_FILE) \ |
| 75 | $(PETITBOOT_BIOS_XML_METADATA_INITRAMFS_FILE) |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 76 | endef |
| 77 | |
| 78 | $(eval $(generic-package)) |