Merge pull request #4 from bofferdn/fix-config-and-occ

Update p10 Rainier config and OCC version handling
diff --git a/openpower/configs/hostboot/rainier.config b/openpower/configs/hostboot/rainier.config
index 97c94f4..c8c34e4 100755
--- a/openpower/configs/hostboot/rainier.config
+++ b/openpower/configs/hostboot/rainier.config
@@ -3,8 +3,8 @@
 unset SFC_IS_AST2400
 set   PNORDD_IS_IPMI
 unset PNORDD_IS_SFC
-set   ALLOW_MICRON_PNOR
-set   ALLOW_MACRONIX_PNOR
+unset ALLOW_MICRON_PNOR
+unset ALLOW_MACRONIX_PNOR
 
 # VPD options - Enable EECACHE
 set MVPD_READ_FROM_HW
@@ -22,18 +22,18 @@
 unset MEMVPD_READ_FROM_PNOR
 unset MEMVPD_WRITE_TO_PNOR
 
+# PLDM will be read via PLDM which is not supported yet
 #set PVPD_READ_FROM_HW
 #set PVPD_WRITE_TO_HW
 #unset PVPD_READ_FROM_PNOR
 #unset PVPD_WRITE_TO_PNOR
 
-unset CDIMM_FORMAT_FOR_CVPD
-
 # gpio config
 set GPIODD
 unset PALMETTO_VDDR
 
-# Enable Consecutive SBE Updates
+# Disable SBE updates until it is supported
+# TODO: Re-enable SBE Updates when supported
 unset SBE_UPDATE_CONSECUTIVE
 unset SBE_UPDATE_INDEPENDENT
 unset SBE_UPDATE_SEQUENTIAL
@@ -60,16 +60,20 @@
 unset PNOR_TWO_SIDE_SUPPORT
 
 set BMC_BT_LPC_IPMI
+
+# AXONE configs must be set until those flags are reworked in Hostboot
 set AXONE
 set AXONE_BRINGUP
 set SUPPORT_EEPROM_CACHING
 
-# Enable Checkstop Analysis for both
-#   Runtime and IPLtime scenarios
+# Disable checkstop analysis for IPL and runtime scenarios
 unset IPLTIME_CHECKSTOP_ANALYSIS
+unset ENABLE_CHECKSTOP_ANALYSIS
 
 # set for trace debug to console
 set CONSOLE_OUTPUT_TRACE
+
+# TODO Re-enable when able to compile
 #set CONSOLE_OUTPUT_FFDCDISPLAY
 
 # Terminate Hostboot when errors occur in manufacturing mode
diff --git a/openpower/package/occ-p10/Config.in b/openpower/package/occ-p10/Config.in
index 6a2e284..363bce2 100644
--- a/openpower/package/occ-p10/Config.in
+++ b/openpower/package/occ-p10/Config.in
@@ -1,5 +1,5 @@
 config BR2_PACKAGE_OCC_P10
-        bool "OCC for P10"
+        bool "OCC (POWER10)"
         default y if (BR2_OPENPOWER_PLATFORM && BR2_OPENPOWER_POWER10)
         select BR2_CPP
         help
@@ -8,9 +8,43 @@
 if BR2_PACKAGE_OCC_P10
 
 config BR2_OCC_P10_BIN_FILENAME
-    string "Name of OCC P10 image file"
-    default "occ.bin"
-    help
-        String used to define name of the OCC binary image file
+        string "Name of P10 OCC image file"
+	default "occ.bin"
+        help
+            String used to define name of the P10 OCC binary image file
+
+config BR2_OCC_P10_GPU_BIN_BUILD
+        bool "Enables Compilation of P10 GPU Binary Image"
+        default n
+        select BR2_PACKAGE_HOSTBOOT_BINARIES
+        help
+            Boolean used to flag whether to compile P10 OCC GPU binary
+
+config BR2_OCC_P10_GPU_GPE_BIN_FILENAME
+        string "Name of P10 OCC GPU GPE Binary file"
+        help
+            String used to define name of the P10 OCC GPUE GPE binary image file
+
+choice
+	prompt "P10 OCC version"
+	default BR2_OCC_P10_LATEST_VERSION
+
+config BR2_OCC_P10_LATEST_VERSION
+	bool "Use latest P10 OCC master"
+
+config BR2_OCC_P10_CUSTOM_VERSION
+	bool "Custom P10 OCC version"
+
+endchoice
+
+config BR2_OCC_P10_CUSTOM_VERSION_VALUE
+	string "P10 OCC version"
+	depends on BR2_OCC_P10_CUSTOM_VERSION
+
+config BR2_OCC_P10_VERSION
+	string
+	default "36b56e72c2dd6c2a2fb21667c55a594f86f6132e" if BR2_OCC_P10_LATEST_VERSION
+	default BR2_OCC_P10_CUSTOM_VERSION_VALUE \
+		if BR2_OCC_P10_CUSTOM_VERSION
 
 endif
diff --git a/openpower/package/occ-p10/occ-p10.mk b/openpower/package/occ-p10/occ-p10.mk
index 586e00d..be927fd 100644
--- a/openpower/package/occ-p10/occ-p10.mk
+++ b/openpower/package/occ-p10/occ-p10.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-OCC_P10_VERSION ?= 36b56e72c2dd6c2a2fb21667c55a594f86f6132e
+OCC_P10_VERSION = $(call qstrip,$(BR2_OCC_P10_VERSION))
 # TODO: WORKAROUND: Need to reenable next line and comment out the two lines
 # after that, when code is propagated to a public repo
 #OCC_P10_SITE ?= $(call github,open-power,occ,$(OCC_P10_VERSION))
@@ -23,12 +23,12 @@
 OCC_P10_IMAGE_BIN_PATH = obj/image.bin
 
 OCC_P10_DEPENDENCIES = host-binutils host-ppe42-gcc
-ifeq ($(BR2_OCC_GPU_BIN_BUILD),y)
+ifeq ($(BR2_OCC_P10_GPU_BIN_BUILD),y)
 	OCC_P10_DEPENDENCIES += hostboot-binaries
 endif
 
 define OCC_P10_BUILD_CMDS
-	if [ "$(BR2_OCC_GPU_BIN_BUILD)" == "y"  ]; then \
+	if [ "$(BR2_OCC_P10_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; \
 	else \
@@ -41,7 +41,7 @@
 
 define OCC_P10_INSTALL_IMAGES_CMDS
        mkdir -p $(STAGING_DIR)/occ
-       cp $(@D)/$(OCC_P10_IMAGE_BIN_PATH) $(OCC_P10_STAGING_DIR)/$(BR2_OCC_BIN_FILENAME)
+       cp $(@D)/$(OCC_P10_IMAGE_BIN_PATH) $(OCC_P10_STAGING_DIR)/$(BR2_OCC_P10_BIN_FILENAME)
 endef
 
 $(eval $(generic-package))