Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # |
| 3 | # occ |
| 4 | # |
| 5 | ################################################################################ |
| 6 | |
hostboot | 44078ef | 2017-05-02 11:38:59 -0500 | [diff] [blame] | 7 | OCC_VERSION_BRANCH_MASTER_P8 ?= 28f2cec690b7f19548ce860a8820f519e6c39a6a |
hostboot | 2dd4dc2 | 2018-04-30 02:29:58 -0500 | [diff] [blame] | 8 | OCC_VERSION_BRANCH_MASTER ?= cd30b100eee09956a27b69f7893349451400e5ba |
Matt Ploetz | eaf71dc | 2016-09-01 18:28:19 -0500 | [diff] [blame] | 9 | |
| 10 | OCC_VERSION ?= $(if $(BR2_OPENPOWER_POWER9),$(OCC_VERSION_BRANCH_MASTER),$(OCC_VERSION_BRANCH_MASTER_P8)) |
Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 11 | OCC_SITE ?= $(call github,open-power,occ,$(OCC_VERSION)) |
| 12 | OCC_LICENSE = Apache-2.0 |
William Bryan | 849c669 | 2017-03-24 14:44:06 -0500 | [diff] [blame] | 13 | |
| 14 | OCC_LICENSE_FILES_P8 = src/LICENSE |
| 15 | OCC_LICENSE_FILES_P9 = LICENSE |
| 16 | OCC_LICENSE_FILES ?= $(if $(BR2_OPENPOWER_POWER9),$(OCC_LICENSE_FILES_P9),$(OCC_LICENSE_FILES_P8)) |
Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 17 | |
| 18 | OCC_INSTALL_IMAGES = YES |
| 19 | OCC_INSTALL_TARGET = NO |
| 20 | |
| 21 | OCC_STAGING_DIR = $(STAGING_DIR)/occ |
| 22 | |
Matt Ploetz | eaf71dc | 2016-09-01 18:28:19 -0500 | [diff] [blame] | 23 | OCC_IMAGE_BIN_PATH = $(if $(BR2_OPENPOWER_POWER9),obj/image.bin,src/image.bin) |
| 24 | |
| 25 | OCC_DEPENDENCIES_P8 = host-binutils host-p8-pore-binutils |
Bill Hoffa | 11a23f2 | 2017-10-03 07:58:12 -0500 | [diff] [blame] | 26 | OCC_DEPENDENCIES_P9 = host-binutils host-ppe42-gcc hostboot-binaries |
Stewart Smith | 6af7663 | 2018-04-27 06:45:42 +1000 | [diff] [blame^] | 27 | ifeq ($(BR2_OCC_GPU_BIN_BUILD),y) |
| 28 | OCC_DEPENDENCIES_P9 += hostboot-binaries |
| 29 | endif |
Matt Ploetz | eaf71dc | 2016-09-01 18:28:19 -0500 | [diff] [blame] | 30 | OCC_DEPENDENCIES ?= $(if $(BR2_OPENPOWER_POWER9),$(OCC_DEPENDENCIES_P9),$(OCC_DEPENDENCIES_P8)) |
| 31 | |
| 32 | define OCC_APPLY_PATCHES |
| 33 | if [ "$(BR2_OPENPOWER_POWER9)" == "y" ]; then \ |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 34 | $(APPLY_PATCHES) $(@D) $(BR2_EXTERNAL_OP_BUILD_PATH)/package/occ/p9Patches \*.patch; \ |
| 35 | if [ -d $(BR2_EXTERNAL_OP_BUILD_PATH)/custom/patches/occ/p9Patches ]; then \ |
| 36 | $(APPLY_PATCHES) $(@D) $(BR2_EXTERNAL_OP_BUILD_PATH)/custom/patches/occ/p9Patches \*.patch; \ |
Matt Ploetz | eaf71dc | 2016-09-01 18:28:19 -0500 | [diff] [blame] | 37 | fi; \ |
| 38 | fi; \ |
| 39 | if [ "$(BR2_OPENPOWER_POWER8)" == "y" ]; then \ |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 40 | $(APPLY_PATCHES) $(@D) $(BR2_EXTERNAL_OP_BUILD_PATH)/package/occ/p8Patches \*.patch; \ |
| 41 | if [ -d $(BR2_EXTERNAL_OP_BUILD_PATH)/custom/patches/occ/p8Patches ]; then \ |
| 42 | $(APPLY_PATCHES) $(@D) $(BR2_EXTERNAL_OP_BUILD_PATH)/custom/patches/occ/p8Patches \*.patch; \ |
Matt Ploetz | eaf71dc | 2016-09-01 18:28:19 -0500 | [diff] [blame] | 43 | fi; \ |
| 44 | fi; |
| 45 | endef |
| 46 | |
| 47 | OCC_POST_PATCH_HOOKS += OCC_APPLY_PATCHES |
| 48 | |
| 49 | define OCC_BUILD_CMDS_P8 |
Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 50 | cd $(@D)/src && \ |
| 51 | make POREPATH=$(P8_PORE_BINUTILS_BIN)/bin/ OCC_OP_BUILD=1 CROSS_PREFIX=$(TARGET_CROSS) all && \ |
Matt Ploetz | eaf71dc | 2016-09-01 18:28:19 -0500 | [diff] [blame] | 52 | make tracehash && \ |
Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 53 | make combineImage |
| 54 | endef |
Matt Ploetz | eaf71dc | 2016-09-01 18:28:19 -0500 | [diff] [blame] | 55 | define OCC_BUILD_CMDS_P9 |
Bill Hoffa | fbd4fbf | 2017-10-10 20:41:22 -0500 | [diff] [blame] | 56 | if [ "$(BR2_OCC_GPU_BIN_BUILD)" == "y" ]; then \ |
Bill Hoffa | 11a23f2 | 2017-10-03 07:58:12 -0500 | [diff] [blame] | 57 | cd $(@D)/src && \ |
Bill Hoffa | fbd4fbf | 2017-10-10 20:41:22 -0500 | [diff] [blame] | 58 | 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 Hoffa | 11a23f2 | 2017-10-03 07:58:12 -0500 | [diff] [blame] | 59 | else \ |
| 60 | cd $(@D)/src && \ |
| 61 | make PPE_TOOL_PATH=$(PPE42_GCC_BIN) OCC_OP_BUILD=1 CROSS_PREFIX=$(TARGET_CROSS) LD_LIBRARY_PATH=$(HOST_DIR)/usr/lib all; \ |
| 62 | fi; |
Matt Ploetz | eaf71dc | 2016-09-01 18:28:19 -0500 | [diff] [blame] | 63 | endef |
| 64 | OCC_BUILD_CMDS ?= $(if $(BR2_OPENPOWER_POWER9),$(OCC_BUILD_CMDS_P9),$(OCC_BUILD_CMDS_P8)) |
Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 65 | |
| 66 | define OCC_INSTALL_IMAGES_CMDS |
| 67 | mkdir -p $(STAGING_DIR)/occ |
Matt Ploetz | eaf71dc | 2016-09-01 18:28:19 -0500 | [diff] [blame] | 68 | cp $(@D)/$(OCC_IMAGE_BIN_PATH) $(OCC_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME) |
Brian Silver | cb56555 | 2014-12-11 12:51:36 -0600 | [diff] [blame] | 69 | endef |
| 70 | |
| 71 | $(eval $(generic-package)) |