blob: 35cad030ffb974424e13422646e34a58c546eb11 [file] [log] [blame]
Nick Bofferdingf390b6f2019-10-08 11:55:42 -05001################################################################################
2#
3# Hostboot for POWER10
4#
5################################################################################
6
7HOSTBOOT_P10_VERSION = $(call qstrip,$(BR2_HOSTBOOT_P10_VERSION))
Ilya Smirnovd56cef72021-06-23 09:34:37 -05008HOSTBOOT_P10_SITE ?= $(call github,open-power,hostboot,$(HOSTBOOT_P10_VERSION))
Nick Bofferdingf390b6f2019-10-08 11:55:42 -05009
10HOSTBOOT_P10_LICENSE = Apache-2.0
11HOSTBOOT_P10_LICENSE_FILES = LICENSE
Bill Hoffa17ad4d02019-12-12 11:12:17 -060012HOSTBOOT_P10_DEPENDENCIES = host-binutils fsp-trace
Nick Bofferdingf390b6f2019-10-08 11:55:42 -050013
14HOSTBOOT_P10_INSTALL_IMAGES = YES
15HOSTBOOT_P10_INSTALL_TARGET = NO
16
17HOSTBOOT_P10_ENV_VARS=$(TARGET_MAKE_ENV) PERL_USE_UNSAFE_INC=1 \
18 CONFIG_FILE=$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/hostboot/$(BR2_HOSTBOOT_P10_CONFIG_FILE) \
19 OPENPOWER_BUILD=1 CROSS_PREFIX="$(CCACHE) $(TARGET_CROSS)" HOST_PREFIX="" HOST_BINUTILS_DIR=$(HOST_BINUTILS_DIR) \
Deb McLemore68215012022-02-11 10:59:34 -060020 HOSTBOOT_VERSION=`cat $(HOSTBOOT_P10_VERSION_FILE)` \
21 HOSTBOOT_FW_VERSION_SHORT=`cat $(HOSTBOOT_P10_FW_VERSION_SHORT_FILE)` \
22 HOSTBOOT_FW_VERSION_LONG=`cat $(HOSTBOOT_P10_FW_VERSION_LONG_FILE)`
Nick Bofferdingf390b6f2019-10-08 11:55:42 -050023
Bill Hoffa17ad4d02019-12-12 11:12:17 -060024FSP_TRACE_IMAGES_DIR = $(STAGING_DIR)/fsp-trace/
25
Roland Veloz3943c262021-07-07 21:26:06 -050026# If BR2_PACKAGE_IBM_FW_PROPRIETARY_P10 is defined then
27# * Include repo ibm-fw-proprietary-p10 as a dependency (HOSTBOOT_P10_DEPENDENCIES)
28# to get access to any needed IBM proprietary files.
29# * Create a variable (IBM_FW_PROPRIETARY_P10_BUILD_DIR) to point to the location
30# of the ibm-fw-proprietary-p10 repo for easy access to any files needed.
Zach Clark821ce2d2022-02-07 13:26:15 -060031# Note that if libecc_static.a exists in the $(HOSTBOOT_PRECOMPILED_LIBRARIES)
32# directory then we don't require access to the ibm-fw-proprietary repository.
Roland Veloz3943c262021-07-07 21:26:06 -050033ifeq ($(BR2_PACKAGE_IBM_FW_PROPRIETARY_P10),y)
Zach Clark821ce2d2022-02-07 13:26:15 -060034ifeq ($(wildcard $(HOSTBOOT_PRECOMPILED_LIBRARIES)/libecc_static.a),)
35 $(info Using ibm-fw-proprietary for ECC implementation)
Roland Veloz3943c262021-07-07 21:26:06 -050036 HOSTBOOT_P10_DEPENDENCIES += ibm-fw-proprietary-p10
37 IBM_FW_PROPRIETARY_P10_BUILD_DIR = $(BUILD_DIR)/ibm-fw-proprietary-p10-$(IBM_FW_PROPRIETARY_P10_VERSION)
Zach Clark821ce2d2022-02-07 13:26:15 -060038else
39 $(info Using $(HOSTBOOT_PRECOMPILED_LIBRARIES)/libecc_static.a for ECC implementation)
40endif
Roland Veloz3943c262021-07-07 21:26:06 -050041endif
42
Nick Bofferdingf390b6f2019-10-08 11:55:42 -050043# TODO: WORKAROUND: Currently the git clone causes a bad symlink
44# to be created for src/include/usr/tracinterface.H; so delete it and rebuild it
45# manually
Roland Veloz3943c262021-07-07 21:26:06 -050046# Copy the VPD ECC algorithm files from the repo ibm-fw-proprietary-p10 to hostboot's
47# 'src/user/vpd' directory if environment variable 'IBM_FW_PROPRIETARY_P10_BUILD_DIR'
48# is defined. Whether the VPD ECC algorithm files get compiled or not will be determined
49# by flag 'COMPILE_VPD_ECC_ALGORITHMS' within file openpower/configs/hostboot/<systemx>.config.
Nick Bofferdingf390b6f2019-10-08 11:55:42 -050050define HOSTBOOT_P10_BUILD_CMDS
Zach Clarkd77bd862021-01-08 16:47:37 -060051 $(HOSTBOOT_P10_ENV_VARS) bash -c 'cd $(@D) \
52 && if ! cmp --quiet src/include/usr/trace/interface.H src/include/usr/tracinterface.H ; then \
53 rm -f src/include/usr/tracinterface.H && cp src/include/usr/trace/interface.H src/include/usr/tracinterface.H ; \
54 fi \
Roland Veloz3943c262021-07-07 21:26:06 -050055 && if [ -n "$(IBM_FW_PROPRIETARY_P10_BUILD_DIR)" ] ; then \
Zach Clark821ce2d2022-02-07 13:26:15 -060056 cp --no-clobber $(IBM_FW_PROPRIETARY_P10_BUILD_DIR)/vpd/* src/usr/vpd ; \
57 mkdir -p src/build/tools/extern/ibm-fw-proprietary/ ; \
58 cp --no-clobber -r $(IBM_FW_PROPRIETARY_P10_BUILD_DIR)/* src/build/tools/extern/ibm-fw-proprietary/ ; \
59 echo $(IBM_FW_PROPRIETARY_P10_VERSION) >src/build/tools/extern/ibm-fw-proprietary/LIBECC_COMMIT_HASH ; \
Roland Veloz3943c262021-07-07 21:26:06 -050060 fi \
Zach Clarkd77bd862021-01-08 16:47:37 -060061 && source ./env.bash && $(MAKE)'
Nick Bofferdingf390b6f2019-10-08 11:55:42 -050062endef
63
64define HOSTBOOT_P10_INSTALL_IMAGES_CMDS
Nicholas E Bofferdingfcdf2482019-11-14 17:54:27 -060065 cd $(@D) && $(HOSTBOOT_P10_ENV_VARS) source ./env.bash && $(@D)/src/build/tools/hbDistribute --openpower $(STAGING_DIR)/hostboot_build_images/
Bill Hoffa17ad4d02019-12-12 11:12:17 -060066 cd $(@D) && $(HOSTBOOT_P10_ENV_VARS) source ./env.bash && $(@D)/src/build/tools/hbDistribute --openpower-sim $(STAGING_DIR)/hostboot_sim_data/
67 cp $(FSP_TRACE_IMAGES_DIR)/fsp-trace $(STAGING_DIR)/hostboot_sim_data/
68 mkdir -p $(OUTPUT_IMAGES_DIR)/sim/
69 tar -zcvf $(OUTPUT_IMAGES_DIR)/sim/hostboot_sim.tar -C $(STAGING_DIR)/hostboot_sim_data/ .
Nick Bofferdingf390b6f2019-10-08 11:55:42 -050070endef
71
72$(eval $(generic-package))