Split P8 and P9 Hostboot and OCC packages
This was causing a couple of issues:
1) increased complexity in build files
2) It breaks the pkg-version patch detection/checksum
3) Failing to apply patches to would silently fail
The split makes this a bit easier and requires less custom code.
We keep the P9 hostboot/occ named hostboot/occ, so that day-to-day,
nobody notices a difference. The only difference you'll notice
is if doing POWER8 hostboot/occ development, as the package name
will be 'hostboot-p8' or 'occ-p8'.
Fixes: https://github.com/open-power/op-build/issues/876
Fixes: https://github.com/open-power/op-build/issues/1194
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
diff --git a/openpower/package/occ/Config.in b/openpower/package/occ/Config.in
index a71f25d..2512e24 100644
--- a/openpower/package/occ/Config.in
+++ b/openpower/package/occ/Config.in
@@ -1,12 +1,15 @@
config BR2_PACKAGE_OCC
- bool "occ"
- default y if (BR2_OPENPOWER_PLATFORM)
+ bool "OCC (POWER9)"
+ default y if (BR2_OPENPOWER_PLATFORM && BR2_OPENPOWER_POWER9)
select BR2_CPP
help
Project to build OCC
+if BR2_PACKAGE_OCC
+
config BR2_OCC_BIN_FILENAME
- string "Name of OCC image file"
+ string "Name of OCC P9 image file"
+ default "occ.bin"
help
String used to define name of the OCC binary image file
@@ -22,3 +25,5 @@
help
String used to define name of the OCC GPUE GPE binary image file
+endif
+
diff --git a/openpower/package/occ/occ.mk b/openpower/package/occ/occ.mk
index e733af9..f6b27cf 100644
--- a/openpower/package/occ/occ.mk
+++ b/openpower/package/occ/occ.mk
@@ -1,58 +1,29 @@
################################################################################
#
-# occ
+# occ for POWER9
#
################################################################################
-OCC_VERSION_BRANCH_MASTER_P8 ?= 28f2cec690b7f19548ce860a8820f519e6c39a6a
-OCC_VERSION_BRANCH_MASTER ?= cd30b100eee09956a27b69f7893349451400e5ba
+OCC_VERSION ?= cd30b100eee09956a27b69f7893349451400e5ba
-OCC_VERSION ?= $(if $(BR2_OPENPOWER_POWER9),$(OCC_VERSION_BRANCH_MASTER),$(OCC_VERSION_BRANCH_MASTER_P8))
OCC_SITE ?= $(call github,open-power,occ,$(OCC_VERSION))
OCC_LICENSE = Apache-2.0
-OCC_LICENSE_FILES_P8 = src/LICENSE
-OCC_LICENSE_FILES_P9 = LICENSE
-OCC_LICENSE_FILES ?= $(if $(BR2_OPENPOWER_POWER9),$(OCC_LICENSE_FILES_P9),$(OCC_LICENSE_FILES_P8))
+OCC_LICENSE_FILES = LICENSE
OCC_INSTALL_IMAGES = YES
OCC_INSTALL_TARGET = NO
OCC_STAGING_DIR = $(STAGING_DIR)/occ
-OCC_IMAGE_BIN_PATH = $(if $(BR2_OPENPOWER_POWER9),obj/image.bin,src/image.bin)
+OCC_IMAGE_BIN_PATH = obj/image.bin
-OCC_DEPENDENCIES_P8 = host-binutils host-p8-pore-binutils
-OCC_DEPENDENCIES_P9 = host-binutils host-ppe42-gcc hostboot-binaries
+OCC_DEPENDENCIES = host-binutils host-ppe42-gcc
ifeq ($(BR2_OCC_GPU_BIN_BUILD),y)
- OCC_DEPENDENCIES_P9 += hostboot-binaries
+ OCC_DEPENDENCIES += hostboot-binaries
endif
-OCC_DEPENDENCIES ?= $(if $(BR2_OPENPOWER_POWER9),$(OCC_DEPENDENCIES_P9),$(OCC_DEPENDENCIES_P8))
-define OCC_APPLY_PATCHES
- if [ "$(BR2_OPENPOWER_POWER9)" == "y" ]; then \
- $(APPLY_PATCHES) $(@D) $(BR2_EXTERNAL_OP_BUILD_PATH)/package/occ/p9Patches \*.patch; \
- if [ -d $(BR2_EXTERNAL_OP_BUILD_PATH)/custom/patches/occ/p9Patches ]; then \
- $(APPLY_PATCHES) $(@D) $(BR2_EXTERNAL_OP_BUILD_PATH)/custom/patches/occ/p9Patches \*.patch; \
- fi; \
- fi; \
- if [ "$(BR2_OPENPOWER_POWER8)" == "y" ]; then \
- $(APPLY_PATCHES) $(@D) $(BR2_EXTERNAL_OP_BUILD_PATH)/package/occ/p8Patches \*.patch; \
- if [ -d $(BR2_EXTERNAL_OP_BUILD_PATH)/custom/patches/occ/p8Patches ]; then \
- $(APPLY_PATCHES) $(@D) $(BR2_EXTERNAL_OP_BUILD_PATH)/custom/patches/occ/p8Patches \*.patch; \
- fi; \
- fi;
-endef
-
-OCC_POST_PATCH_HOOKS += OCC_APPLY_PATCHES
-
-define OCC_BUILD_CMDS_P8
- cd $(@D)/src && \
- make POREPATH=$(P8_PORE_BINUTILS_BIN)/bin/ OCC_OP_BUILD=1 CROSS_PREFIX=$(TARGET_CROSS) all && \
- make tracehash && \
- make combineImage
-endef
-define OCC_BUILD_CMDS_P9
+define OCC_BUILD_CMDS
if [ "$(BR2_OCC_GPU_BIN_BUILD)" == "y" ]; then \
cd $(@D)/src && \
make PPE_TOOL_PATH=$(PPE42_GCC_BIN) OCC_OP_BUILD=1 CROSS_PREFIX=$(TARGET_CROSS) LD_LIBRARY_PATH=$(HOST_DIR)/usr/lib GPE1_BIN_IMAGE_PATH=$(STAGING_DIR)/hostboot_binaries/ OPOCC_GPU_SUPPORT=1 all; \
@@ -61,7 +32,7 @@
make PPE_TOOL_PATH=$(PPE42_GCC_BIN) OCC_OP_BUILD=1 CROSS_PREFIX=$(TARGET_CROSS) LD_LIBRARY_PATH=$(HOST_DIR)/usr/lib all; \
fi;
endef
-OCC_BUILD_CMDS ?= $(if $(BR2_OPENPOWER_POWER9),$(OCC_BUILD_CMDS_P9),$(OCC_BUILD_CMDS_P8))
+OCC_BUILD_CMDS ?= $(OCC_BUILD_CMDS_P9)
define OCC_INSTALL_IMAGES_CMDS
mkdir -p $(STAGING_DIR)/occ