Nick Bofferding | f390b6f | 2019-10-08 11:55:42 -0500 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # |
| 3 | # Hostboot for POWER10 |
| 4 | # |
| 5 | ################################################################################ |
| 6 | |
| 7 | HOSTBOOT_P10_VERSION = $(call qstrip,$(BR2_HOSTBOOT_P10_VERSION)) |
Ilya Smirnov | d56cef7 | 2021-06-23 09:34:37 -0500 | [diff] [blame] | 8 | HOSTBOOT_P10_SITE ?= $(call github,open-power,hostboot,$(HOSTBOOT_P10_VERSION)) |
Nick Bofferding | f390b6f | 2019-10-08 11:55:42 -0500 | [diff] [blame] | 9 | |
| 10 | HOSTBOOT_P10_LICENSE = Apache-2.0 |
| 11 | HOSTBOOT_P10_LICENSE_FILES = LICENSE |
Bill Hoffa | 17ad4d0 | 2019-12-12 11:12:17 -0600 | [diff] [blame] | 12 | HOSTBOOT_P10_DEPENDENCIES = host-binutils fsp-trace |
Nick Bofferding | f390b6f | 2019-10-08 11:55:42 -0500 | [diff] [blame] | 13 | |
| 14 | HOSTBOOT_P10_INSTALL_IMAGES = YES |
| 15 | HOSTBOOT_P10_INSTALL_TARGET = NO |
| 16 | |
| 17 | HOSTBOOT_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 McLemore | 6821501 | 2022-02-11 10:59:34 -0600 | [diff] [blame] | 20 | 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 Bofferding | f390b6f | 2019-10-08 11:55:42 -0500 | [diff] [blame] | 23 | |
Bill Hoffa | 17ad4d0 | 2019-12-12 11:12:17 -0600 | [diff] [blame] | 24 | FSP_TRACE_IMAGES_DIR = $(STAGING_DIR)/fsp-trace/ |
| 25 | |
Roland Veloz | 3943c26 | 2021-07-07 21:26:06 -0500 | [diff] [blame] | 26 | # 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 Clark | 821ce2d | 2022-02-07 13:26:15 -0600 | [diff] [blame] | 31 | # 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 Veloz | 3943c26 | 2021-07-07 21:26:06 -0500 | [diff] [blame] | 33 | ifeq ($(BR2_PACKAGE_IBM_FW_PROPRIETARY_P10),y) |
Zach Clark | 821ce2d | 2022-02-07 13:26:15 -0600 | [diff] [blame] | 34 | ifeq ($(wildcard $(HOSTBOOT_PRECOMPILED_LIBRARIES)/libecc_static.a),) |
| 35 | $(info Using ibm-fw-proprietary for ECC implementation) |
Roland Veloz | 3943c26 | 2021-07-07 21:26:06 -0500 | [diff] [blame] | 36 | 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 Clark | 821ce2d | 2022-02-07 13:26:15 -0600 | [diff] [blame] | 38 | else |
| 39 | $(info Using $(HOSTBOOT_PRECOMPILED_LIBRARIES)/libecc_static.a for ECC implementation) |
| 40 | endif |
Roland Veloz | 3943c26 | 2021-07-07 21:26:06 -0500 | [diff] [blame] | 41 | endif |
| 42 | |
Nick Bofferding | f390b6f | 2019-10-08 11:55:42 -0500 | [diff] [blame] | 43 | # 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 Veloz | 3943c26 | 2021-07-07 21:26:06 -0500 | [diff] [blame] | 46 | # 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 Bofferding | f390b6f | 2019-10-08 11:55:42 -0500 | [diff] [blame] | 50 | define HOSTBOOT_P10_BUILD_CMDS |
Zach Clark | d77bd86 | 2021-01-08 16:47:37 -0600 | [diff] [blame] | 51 | $(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 Veloz | 3943c26 | 2021-07-07 21:26:06 -0500 | [diff] [blame] | 55 | && if [ -n "$(IBM_FW_PROPRIETARY_P10_BUILD_DIR)" ] ; then \ |
Zach Clark | 821ce2d | 2022-02-07 13:26:15 -0600 | [diff] [blame] | 56 | 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 Veloz | 3943c26 | 2021-07-07 21:26:06 -0500 | [diff] [blame] | 60 | fi \ |
Zach Clark | d77bd86 | 2021-01-08 16:47:37 -0600 | [diff] [blame] | 61 | && source ./env.bash && $(MAKE)' |
Nick Bofferding | f390b6f | 2019-10-08 11:55:42 -0500 | [diff] [blame] | 62 | endef |
| 63 | |
| 64 | define HOSTBOOT_P10_INSTALL_IMAGES_CMDS |
Nicholas E Bofferding | fcdf248 | 2019-11-14 17:54:27 -0600 | [diff] [blame] | 65 | cd $(@D) && $(HOSTBOOT_P10_ENV_VARS) source ./env.bash && $(@D)/src/build/tools/hbDistribute --openpower $(STAGING_DIR)/hostboot_build_images/ |
Bill Hoffa | 17ad4d0 | 2019-12-12 11:12:17 -0600 | [diff] [blame] | 66 | 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 Bofferding | f390b6f | 2019-10-08 11:55:42 -0500 | [diff] [blame] | 70 | endef |
| 71 | |
| 72 | $(eval $(generic-package)) |