Merge pull request #4564 from ojayanth/master-p10

pdata: Bumped dc5f985..28882b8
diff --git a/openpower/configs/p10ebmc_defconfig b/openpower/configs/p10ebmc_defconfig
index 7d99c8b..81fbdd4 100644
--- a/openpower/configs/p10ebmc_defconfig
+++ b/openpower/configs/p10ebmc_defconfig
@@ -55,7 +55,7 @@
 #BR2_RAINIER_2U_XML_CUSTOM_GIT_VALUE="git@github.com:open-power/rainier-xml.git"
 #BR2_RAINIER_2U_XML_VERSION="d5127bbed1a181d39cbc24ea33ea7b6df15baa4e"
 BR2_RAINIER_2U_XML_CUSTOM_GIT_VALUE="git@github.ibm.com:openbmc/rainier-xml.git"
-BR2_RAINIER_2U_XML_VERSION="4530f3c7f4fbf57f547c0bb38c7fc57d141db639"
+BR2_RAINIER_2U_XML_VERSION="8cd37ec2ded012563ec79c57f33d1d53bf7eae23"
 BR2_RAINIER_2U_XML_SYSTEM_FILENAME="Rainier-2U-MRW_hb.system.xml"
 BR2_RAINIER_2U_XML_TARGETING_FILENAME="Rainier-2U-MRW_hb.mrw.xml"
 BR2_RAINIER_4U_XML_CUSTOM_GIT=y
@@ -63,7 +63,7 @@
 #BR2_RAINIER_4U_XML_CUSTOM_GIT_VALUE="git@github.com:open-power/rainier-xml.git"
 #BR2_RAINIER_4U_XML_VERSION="d5127bbed1a181d39cbc24ea33ea7b6df15baa4e"
 BR2_RAINIER_4U_XML_CUSTOM_GIT_VALUE="git@github.ibm.com:openbmc/rainier-xml.git"
-BR2_RAINIER_4U_XML_VERSION="4530f3c7f4fbf57f547c0bb38c7fc57d141db639"
+BR2_RAINIER_4U_XML_VERSION="8cd37ec2ded012563ec79c57f33d1d53bf7eae23"
 BR2_RAINIER_4U_XML_SYSTEM_FILENAME="Rainier-4U-MRW_hb.system.xml"
 BR2_RAINIER_4U_XML_TARGETING_FILENAME="Rainier-4U-MRW_hb.mrw.xml"
 BR2_PACKAGE_EVEREST_XML=y
@@ -72,7 +72,7 @@
 #BR2_EVEREST_XML_CUSTOM_GIT_VALUE="git@github.com:open-power/everest-xml.git"
 #BR2_EVEREST_XML_VERSION="f3461debbbde70d33d5264411ee37abde9be6815"
 BR2_EVEREST_XML_CUSTOM_GIT_VALUE="git@github.ibm.com:openbmc/everest-xml.git"
-BR2_EVEREST_XML_VERSION="5a68371aad43092706be34f4aec063ef177b0288"
+BR2_EVEREST_XML_VERSION="164a47d65eb2428be11df16fcc1d16ce6b83e507"
 BR2_EVEREST_XML_SYSTEM_FILENAME="Everest-MRW_hb.system.xml"
 BR2_EVEREST_XML_TARGETING_FILENAME="Everest-MRW_hb.mrw.xml"
 BR2_PACKAGE_OPENPOWER_PNOR_P10=y
diff --git a/openpower/package/hcode-p10/Config.in b/openpower/package/hcode-p10/Config.in
index 5e91693..11a3b39 100644
--- a/openpower/package/hcode-p10/Config.in
+++ b/openpower/package/hcode-p10/Config.in
@@ -31,7 +31,7 @@
 
 config BR2_HCODE_P10_VERSION
 	string
-	default "hw022522a.opmst10" if BR2_HCODE_P10_LATEST_VERSION
+	default "hw022822b.opmst10" if BR2_HCODE_P10_LATEST_VERSION
 	default BR2_HCODE_P10_CUSTOM_VERSION_VALUE \
 		if BR2_HCODE_P10_CUSTOM_VERSION
 
diff --git a/openpower/package/hostboot-binaries/Config.in b/openpower/package/hostboot-binaries/Config.in
index 45aa723..3e2cdc8 100644
--- a/openpower/package/hostboot-binaries/Config.in
+++ b/openpower/package/hostboot-binaries/Config.in
@@ -24,7 +24,7 @@
 
 config BR2_HOSTBOOT_BINARIES_VERSION
 	string
-	default "hw022522a.opmst10" if BR2_HOSTBOOT_BINARIES_LATEST_VERSION
+	default "hw030322a.opmst10" if BR2_HOSTBOOT_BINARIES_LATEST_VERSION
 	default BR2_HOSTBOOT_BINARIES_CUSTOM_VERSION_VALUE \
 		if BR2_HOSTBOOT_BINARIES_CUSTOM_VERSION
 
diff --git a/openpower/package/hostboot-p10/Config.in b/openpower/package/hostboot-p10/Config.in
index 54dd594..67a7d15 100644
--- a/openpower/package/hostboot-p10/Config.in
+++ b/openpower/package/hostboot-p10/Config.in
@@ -25,7 +25,7 @@
 
 config BR2_HOSTBOOT_P10_VERSION
 	string
-	default "71a956ca400e33151b2c433ef38c31865b042b79" if BR2_HOSTBOOT_P10_LATEST_VERSION
+	default "5d404fa2e30ab9d4466bc863010a09d99a31c758" if BR2_HOSTBOOT_P10_LATEST_VERSION
 	default BR2_HOSTBOOT_P10_CUSTOM_VERSION_VALUE \
 		if BR2_HOSTBOOT_P10_CUSTOM_VERSION
 
diff --git a/openpower/package/hostboot-p10/hostboot-p10.mk b/openpower/package/hostboot-p10/hostboot-p10.mk
index 2bbc8ef..35cad03 100644
--- a/openpower/package/hostboot-p10/hostboot-p10.mk
+++ b/openpower/package/hostboot-p10/hostboot-p10.mk
@@ -17,7 +17,9 @@
 HOSTBOOT_P10_ENV_VARS=$(TARGET_MAKE_ENV) PERL_USE_UNSAFE_INC=1 \
     CONFIG_FILE=$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/hostboot/$(BR2_HOSTBOOT_P10_CONFIG_FILE) \
     OPENPOWER_BUILD=1 CROSS_PREFIX="$(CCACHE) $(TARGET_CROSS)" HOST_PREFIX="" HOST_BINUTILS_DIR=$(HOST_BINUTILS_DIR) \
-    HOSTBOOT_VERSION=`cat $(HOSTBOOT_P10_VERSION_FILE)`
+    HOSTBOOT_VERSION=`cat $(HOSTBOOT_P10_VERSION_FILE)` \
+    HOSTBOOT_FW_VERSION_SHORT=`cat $(HOSTBOOT_P10_FW_VERSION_SHORT_FILE)` \
+    HOSTBOOT_FW_VERSION_LONG=`cat $(HOSTBOOT_P10_FW_VERSION_LONG_FILE)`
 
 FSP_TRACE_IMAGES_DIR = $(STAGING_DIR)/fsp-trace/
 
diff --git a/openpower/package/occ-p10/Config.in b/openpower/package/occ-p10/Config.in
index b62e080..0ee9667 100644
--- a/openpower/package/occ-p10/Config.in
+++ b/openpower/package/occ-p10/Config.in
@@ -43,7 +43,7 @@
 
 config BR2_OCC_P10_VERSION
 	string
-	default "637ae1e399cfc1c8bdcab95a2ad98961ec1b012a" if BR2_OCC_P10_LATEST_VERSION
+	default "031fb7b25eba29ba3e1b56021c01701cc4721198" if BR2_OCC_P10_LATEST_VERSION
 	default BR2_OCC_P10_CUSTOM_VERSION_VALUE \
 		if BR2_OCC_P10_CUSTOM_VERSION
 
diff --git a/openpower/package/pkg-versions.mk b/openpower/package/pkg-versions.mk
index 032e864..39c608f 100644
--- a/openpower/package/pkg-versions.mk
+++ b/openpower/package/pkg-versions.mk
@@ -10,6 +10,8 @@
 define OPENPOWER_SUBPACKAGE_VERSION
 
 $(2)_VERSION_FILE = $$(OPENPOWER_VERSION_DIR)/$(1).version.txt
+$(2)_FW_VERSION_SHORT_FILE = $$(OPENPOWER_VERSION_DIR)/$(1).fwversion_short.txt
+$(2)_FW_VERSION_LONG_FILE = $$(OPENPOWER_VERSION_DIR)/$(1).fwversion_long.txt
 ALL_SUBPACKAGE_VERSIONS += $$($(2)_VERSION_FILE)
 
 ### Create subpackage patch file
@@ -100,8 +102,48 @@
 	cat $$(OPENPOWER_VERSION_DIR)/$(1).patch.txt >> $$($(2)_VERSION_FILE); fi \
 fi
 
+# Check the package name against HOSTBOOT_P to filter out other
+# packages such as HOSTBOOT_BINARIES, we only want HOSTBOOT_P10, HOSTBOOT_P11, etc.
+# This allows future usage of this logic since the Hostboot repo build process
+# seeds from this output file and does -NOT- know about package names, etc.
+# All Hostboot repo build needs is the git hashes built which are cat'd to the
+# _FW_VERSION_*_FILE
+#
+# If OPBUILD_VERSION is used in the environment then we trim
+# the string since we are limited to 16 chars for the PELs in Hostboot.
+# If OPBUILD_VERSION is empty we run the git commands to get the hashes.
+# Sample OPBUILD_VERSION  OP10-v2.7-10.146 gets trimmed to v2.7-10.146
+# sed 's/[^\-]*-//' up until first dash
+#
+# The *_FW_VERSION_SHORT_FILE is the FW subsystem identifier to aide
+# mapping op-build images to proper build level.  The FW subsystem
+# string is subsequently embedded in the Hostboot images built.
+#
+$(if $(findstring HOSTBOOT_P, $(2)),
+if [ -n "$$(OPBUILD_VERSION)" ]; then \
+	echo -n "$$(OPBUILD_VERSION)" \
+	| sed 's/[^\-]*-//' | xargs echo -n\
+	> $$($(2)_FW_VERSION_SHORT_FILE); \
+else \
+cd "$$(BR2_EXTERNAL_OP_BUILD_PATH)"; (git describe --always || echo "unknown") \
+	| sed -e 's/\(.*\)-.*/\1/' | xargs echo -n\
+	> $$($(2)_FW_VERSION_SHORT_FILE); \
+fi\)
+
+# Remove with sed any empty line
+# /./ matches any character, including newline
+# ! negates the select, makes the command apply to lines which do -NOT- match selector, i.e. empty lines
+# d deletes the selected lines
+# sed `/./!d'
+$(if $(findstring HOSTBOOT_P, $(2)),
+cd "$$(BR2_EXTERNAL_OP_BUILD_PATH)"; (git describe --always --long || echo "unknown") \
+	| sed '/./!d' | xargs echo -n\
+	> $$($(2)_FW_VERSION_LONG_FILE); \)
+
 # Add new line to version.txt
 echo "" >> $$($(2)_VERSION_FILE);
+echo "" >> $$($(2)_FW_VERSION_SHORT_FILE);
+echo "" >> $$($(2)_FW_VERSION_LONG_FILE);
 
 endef # $(2)_OPENPOWER_VERSION_FILE
 
@@ -161,6 +203,7 @@
 mkdir -p "$$(OPENPOWER_VERSION_DIR)"
 
 # Add vendor or default open-power
+
 if [ -n "$$(OPBUILD_VENDOR)" ]; then \
 echo -n "$$(OPBUILD_VENDOR)-" > $$($(2)_VERSION_FILE); \
 else \