blob: 165f63d018b767ff417d240885378718f4ae2451 [file] [log] [blame]
Brian Silver015b5912014-08-07 15:50:15 -05001################################################################################
2#
3# habanero_xml
4#
5################################################################################
6
hostboot95bc01d2016-11-18 00:07:39 -06007HABANERO_XML_VERSION ?= 6a78496c286e284719a8201148a5088030b897de
Brian Silver015b5912014-08-07 15:50:15 -05008HABANERO_XML_SITE ?= $(call github,open-power,habanero-xml,$(HABANERO_XML_VERSION))
9
10HABANERO_XML_LICENSE = Apache-2.0
Jeremy Kerr28df94b2016-07-22 09:36:56 +080011HABANERO_XML_DEPENDENCIES = hostboot openpower-mrw common-p8-xml
Brian Silver015b5912014-08-07 15:50:15 -050012
13HABANERO_XML_INSTALL_IMAGES = YES
Nick Bofferding10de73a2015-02-16 23:57:26 -060014HABANERO_XML_INSTALL_TARGET = YES
Brian Silver015b5912014-08-07 15:50:15 -050015
16MRW_SCRATCH=$(STAGING_DIR)/openpower_mrw_scratch
Brian Silver015b5912014-08-07 15:50:15 -050017MRW_HB_TOOLS=$(STAGING_DIR)/hostboot_build_images
18
Nick Bofferding82d02c22015-02-16 23:23:56 -060019# Defines for BIOS metadata creation
20BIOS_SCHEMA_FILE = $(MRW_HB_TOOLS)/bios.xsd
Nick Bofferdingaa560f02015-02-17 00:56:54 -060021HABANERO_BIOS_XML_CONFIG_FILE = $(MRW_SCRATCH)/$(BR2_HABANERO_BIOS_XML_FILENAME)
Nick Bofferding82d02c22015-02-16 23:23:56 -060022BIOS_XML_METADATA_FILE = \
23 $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_CONFIG_NAME)_bios_metadata.xml
24PETITBOOT_XSLT_FILE = $(MRW_HB_TOOLS)/bios_metadata_petitboot.xslt
25PETITBOOT_BIOS_XML_METADATA_FILE = \
26 $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_CONFIG_NAME)_bios_metadata_petitboot.xml
27PETITBOOT_BIOS_XML_METADATA_INITRAMFS_FILE = \
28 $(TARGET_DIR)/usr/share/bios_metadata.xml
29
Brian Silver015b5912014-08-07 15:50:15 -050030define HABANERO_XML_BUILD_CMDS
31 # copy the habanero xml where the common lives
32 bash -c 'mkdir -p $(MRW_SCRATCH) && cp -r $(@D)/* $(MRW_SCRATCH)'
Brian Silver015b5912014-08-07 15:50:15 -050033
Matt Ploetzed8800a2015-02-10 13:12:24 -060034 # generate the system mrw xml
35 perl -I $(MRW_HB_TOOLS) \
36 $(MRW_HB_TOOLS)/processMrw.pl -x $(MRW_SCRATCH)/habanero.xml
Nick Bofferding10de73a2015-02-16 23:57:26 -060037
Brian Silver015b5912014-08-07 15:50:15 -050038 # merge in any system specific attributes, hostboot attributes
Matt Ploetzed8800a2015-02-10 13:12:24 -060039 $(MRW_HB_TOOLS)/mergexml.sh $(MRW_SCRATCH)/$(BR2_HABANERO_SYSTEM_XML_FILENAME) \
Brian Silver015b5912014-08-07 15:50:15 -050040 $(MRW_HB_TOOLS)/attribute_types.xml \
41 $(MRW_HB_TOOLS)/attribute_types_hb.xml \
Elizabeth Liner271b6192016-07-28 12:16:56 -050042 $(MRW_HB_TOOLS)/attribute_types_openpower.xml \
Brian Silver015b5912014-08-07 15:50:15 -050043 $(MRW_HB_TOOLS)/target_types_merged.xml \
44 $(MRW_HB_TOOLS)/target_types_hb.xml \
Elizabeth Liner271b6192016-07-28 12:16:56 -050045 $(MRW_HB_TOOLS)/target_types_openpower.xml \
Matt Ploetzed8800a2015-02-10 13:12:24 -060046 $(MRW_SCRATCH)/$(BR2_HABANERO_MRW_XML_FILENAME) > $(MRW_HB_TOOLS)/temporary_hb.hb.xml;
Brian Silver015b5912014-08-07 15:50:15 -050047
48 # creating the targeting binary
49 $(MRW_HB_TOOLS)/xmltohb.pl \
50 --hb-xml-file=$(MRW_HB_TOOLS)/temporary_hb.hb.xml \
51 --fapi-attributes-xml-file=$(MRW_HB_TOOLS)/fapiattrs.xml \
52 --src-output-dir=none \
53 --img-output-dir=$(MRW_HB_TOOLS)/ \
Nick Bofferding82d02c22015-02-16 23:23:56 -060054 --vmm-consts-file=$(MRW_HB_TOOLS)/vmmconst.h --noshort-enums \
Nick Bofferdingaa560f02015-02-17 00:56:54 -060055 --bios-xml-file=$(HABANERO_BIOS_XML_CONFIG_FILE) \
Nick Bofferding82d02c22015-02-16 23:23:56 -060056 --bios-schema-file=$(BIOS_SCHEMA_FILE) \
57 --bios-output-file=$(BIOS_XML_METADATA_FILE)
58
59 # Transform BIOS XML into Petitboot specific BIOS XML via the schema
60 xsltproc -o \
61 $(PETITBOOT_BIOS_XML_METADATA_FILE) \
62 $(PETITBOOT_XSLT_FILE) \
63 $(BIOS_XML_METADATA_FILE)
Nick Bofferding10de73a2015-02-16 23:57:26 -060064endef
Nick Bofferding82d02c22015-02-16 23:23:56 -060065
Nick Bofferding10de73a2015-02-16 23:57:26 -060066define HABANERO_XML_INSTALL_IMAGES_CMDS
67 mv $(MRW_HB_TOOLS)/targeting.bin $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_TARGETING_BIN_FILENAME)
68endef
69
Matt Ploetzdcd75512015-02-25 23:48:19 -060070define HABANERO_XML_INSTALL_TARGET_CMDS
Nick Bofferding82d02c22015-02-16 23:23:56 -060071 # Install Petitboot specific BIOS XML into initramfs's usr/share/ dir
72 $(INSTALL) -D -m 0644 \
73 $(PETITBOOT_BIOS_XML_METADATA_FILE) \
74 $(PETITBOOT_BIOS_XML_METADATA_INITRAMFS_FILE)
Brian Silver015b5912014-08-07 15:50:15 -050075endef
76
77$(eval $(generic-package))