blob: b9b92290b605b1165f4d2b562ea1d9a2343837d9 [file] [log] [blame]
Brian Silvercb565552014-12-11 12:51:36 -06001################################################################################
2#
3# occ
4#
5################################################################################
6
hostboot44078ef2017-05-02 11:38:59 -05007OCC_VERSION_BRANCH_MASTER_P8 ?= 28f2cec690b7f19548ce860a8820f519e6c39a6a
hostboot7ad4d562017-10-06 02:30:02 -05008OCC_VERSION_BRANCH_MASTER ?= ba4e81e804275ced6c1793f818e5fc1fd8d1ecae
Matt Ploetzeaf71dc2016-09-01 18:28:19 -05009
10OCC_VERSION ?= $(if $(BR2_OPENPOWER_POWER9),$(OCC_VERSION_BRANCH_MASTER),$(OCC_VERSION_BRANCH_MASTER_P8))
Brian Silvercb565552014-12-11 12:51:36 -060011OCC_SITE ?= $(call github,open-power,occ,$(OCC_VERSION))
12OCC_LICENSE = Apache-2.0
William Bryan849c6692017-03-24 14:44:06 -050013
14OCC_LICENSE_FILES_P8 = src/LICENSE
15OCC_LICENSE_FILES_P9 = LICENSE
16OCC_LICENSE_FILES ?= $(if $(BR2_OPENPOWER_POWER9),$(OCC_LICENSE_FILES_P9),$(OCC_LICENSE_FILES_P8))
Brian Silvercb565552014-12-11 12:51:36 -060017
18OCC_INSTALL_IMAGES = YES
19OCC_INSTALL_TARGET = NO
20
21OCC_STAGING_DIR = $(STAGING_DIR)/occ
22
Matt Ploetzeaf71dc2016-09-01 18:28:19 -050023OCC_IMAGE_BIN_PATH = $(if $(BR2_OPENPOWER_POWER9),obj/image.bin,src/image.bin)
24
25OCC_DEPENDENCIES_P8 = host-binutils host-p8-pore-binutils
Bill Hoffa11a23f22017-10-03 07:58:12 -050026OCC_DEPENDENCIES_P9 = host-binutils host-ppe42-gcc hostboot-binaries
Matt Ploetzeaf71dc2016-09-01 18:28:19 -050027OCC_DEPENDENCIES ?= $(if $(BR2_OPENPOWER_POWER9),$(OCC_DEPENDENCIES_P9),$(OCC_DEPENDENCIES_P8))
28
29define OCC_APPLY_PATCHES
30 if [ "$(BR2_OPENPOWER_POWER9)" == "y" ]; then \
Joel Stanley5ab5fdb2016-10-31 23:10:24 +103031 $(APPLY_PATCHES) $(@D) $(BR2_EXTERNAL_OP_BUILD_PATH)/package/occ/p9Patches \*.patch; \
32 if [ -d $(BR2_EXTERNAL_OP_BUILD_PATH)/custom/patches/occ/p9Patches ]; then \
33 $(APPLY_PATCHES) $(@D) $(BR2_EXTERNAL_OP_BUILD_PATH)/custom/patches/occ/p9Patches \*.patch; \
Matt Ploetzeaf71dc2016-09-01 18:28:19 -050034 fi; \
35 fi; \
36 if [ "$(BR2_OPENPOWER_POWER8)" == "y" ]; then \
Joel Stanley5ab5fdb2016-10-31 23:10:24 +103037 $(APPLY_PATCHES) $(@D) $(BR2_EXTERNAL_OP_BUILD_PATH)/package/occ/p8Patches \*.patch; \
38 if [ -d $(BR2_EXTERNAL_OP_BUILD_PATH)/custom/patches/occ/p8Patches ]; then \
39 $(APPLY_PATCHES) $(@D) $(BR2_EXTERNAL_OP_BUILD_PATH)/custom/patches/occ/p8Patches \*.patch; \
Matt Ploetzeaf71dc2016-09-01 18:28:19 -050040 fi; \
41 fi;
42endef
43
44OCC_POST_PATCH_HOOKS += OCC_APPLY_PATCHES
45
46define OCC_BUILD_CMDS_P8
Brian Silvercb565552014-12-11 12:51:36 -060047 cd $(@D)/src && \
48 make POREPATH=$(P8_PORE_BINUTILS_BIN)/bin/ OCC_OP_BUILD=1 CROSS_PREFIX=$(TARGET_CROSS) all && \
Matt Ploetzeaf71dc2016-09-01 18:28:19 -050049 make tracehash && \
Brian Silvercb565552014-12-11 12:51:36 -060050 make combineImage
51endef
Matt Ploetzeaf71dc2016-09-01 18:28:19 -050052define OCC_BUILD_CMDS_P9
Bill Hoffafbd4fbf2017-10-10 20:41:22 -050053 if [ "$(BR2_OCC_GPU_BIN_BUILD)" == "y" ]; then \
Bill Hoffa11a23f22017-10-03 07:58:12 -050054 cd $(@D)/src && \
Bill Hoffafbd4fbf2017-10-10 20:41:22 -050055 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; \
Bill Hoffa11a23f22017-10-03 07:58:12 -050056 else \
57 cd $(@D)/src && \
58 make PPE_TOOL_PATH=$(PPE42_GCC_BIN) OCC_OP_BUILD=1 CROSS_PREFIX=$(TARGET_CROSS) LD_LIBRARY_PATH=$(HOST_DIR)/usr/lib all; \
59 fi;
Matt Ploetzeaf71dc2016-09-01 18:28:19 -050060endef
61OCC_BUILD_CMDS ?= $(if $(BR2_OPENPOWER_POWER9),$(OCC_BUILD_CMDS_P9),$(OCC_BUILD_CMDS_P8))
Brian Silvercb565552014-12-11 12:51:36 -060062
63define OCC_INSTALL_IMAGES_CMDS
64 mkdir -p $(STAGING_DIR)/occ
Matt Ploetzeaf71dc2016-09-01 18:28:19 -050065 cp $(@D)/$(OCC_IMAGE_BIN_PATH) $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME)
Brian Silvercb565552014-12-11 12:51:36 -060066endef
67
68$(eval $(generic-package))