Support building p10 PNOR images
Implements initial experimental support for building P10 PNOR images using
GCC8 (host and cross compiler) as the toolchain
- Introduced rainier configuration files
- Added p10 specific packages for sbe, hcode, hostboot, occ
- Pointed at starting commits for various pacakges to build op-build for p10
- Created various patches to fully compile all packages, to be removed
when package owners have time to address them
- Generally updated package configurations to support p10 and p10 package
variants
Signed-off-by: Nick Bofferding <bofferdn@us.ibm.com>
diff --git a/openpower/package/sbe-p10/0001-Update-SBE-distribute-to-export-P10-DD1-files.patch b/openpower/package/sbe-p10/0001-Update-SBE-distribute-to-export-P10-DD1-files.patch
new file mode 100644
index 0000000..26cea10
--- /dev/null
+++ b/openpower/package/sbe-p10/0001-Update-SBE-distribute-to-export-P10-DD1-files.patch
@@ -0,0 +1,37 @@
+From b0a445addc19754ebea92ea3ee46185a3716267a Mon Sep 17 00:00:00 2001
+From: Nick Bofferding <bofferdn@us.ibm.com>
+Date: Thu, 3 Oct 2019 13:22:58 -0500
+Subject: [PATCH] Update SBE distribute to export P10 DD1 files
+
+Change-Id: I8bda043e0fe69187923abcfb1e79dd4de98e98ae
+---
+ src/build/sbeOpDistribute.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/build/sbeOpDistribute.py b/src/build/sbeOpDistribute.py
+index 14546d9..32b0cff 100755
+--- a/src/build/sbeOpDistribute.py
++++ b/src/build/sbeOpDistribute.py
+@@ -5,7 +5,7 @@
+ #
+ # OpenPOWER sbe Project
+ #
+-# Contributors Listed Below - COPYRIGHT 2017,2018
++# Contributors Listed Below - COPYRIGHT 2017,2019
+ # [+] International Business Machines Corp.
+ #
+ #
+@@ -26,8 +26,8 @@ import os
+ import sys
+ import getopt
+
+-CHIPID = 'p9n'
+-p9n_EC = {'21':'DD2', '22':'DD2', '23':'DD2'}
++CHIPID = 'p10'
++p9n_EC = {'10':'DD1'}
+
+ def usage():
+ print "usage:sbeOpDistribute.py [--sbe_binary_dir] <sbe binary path> [--img_dir] <images path>"
+--
+1.8.2.2
+
diff --git a/openpower/package/sbe-p10/0002-Temporarily-disabled-install-directive-in-SBE-distri.patch b/openpower/package/sbe-p10/0002-Temporarily-disabled-install-directive-in-SBE-distri.patch
new file mode 100644
index 0000000..c0fb22d
--- /dev/null
+++ b/openpower/package/sbe-p10/0002-Temporarily-disabled-install-directive-in-SBE-distri.patch
@@ -0,0 +1,36 @@
+From e34aaa2b68ec05f85f3d47ef37bdbd2aa5a162ae Mon Sep 17 00:00:00 2001
+From: Nick Bofferding <bofferdn@us.ibm.com>
+Date: Mon, 7 Oct 2019 15:58:41 -0500
+Subject: [PATCH] Temporarily disabled install directive in SBE distribute
+
+Change-Id: I3f54da025cde5944b098ced69be43995c495ec66
+---
+ src/build/sbeOpDistribute.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/build/sbeOpDistribute.py b/src/build/sbeOpDistribute.py
+index 32b0cff..373edb7 100755
+--- a/src/build/sbeOpDistribute.py
++++ b/src/build/sbeOpDistribute.py
+@@ -3,7 +3,7 @@
+ #
+ # $Source: src/build/sbeOpDistribute.py $
+ #
+-# OpenPOWER sbe Project
++# OpenPOWER HostBoot Project
+ #
+ # Contributors Listed Below - COPYRIGHT 2017,2019
+ # [+] International Business Machines Corp.
+@@ -103,7 +103,8 @@ def main(argv):
+ # Copy sbe raw binary to scratch folder
+ run_system_cmd('cp '+sbe_binary_dir+'/'+basename+'.bin'+' '+scratch_dir+'/'+basename+'.bin')
+ # Add HW ref image
+- run_system_cmd('p9_ipl_build '+scratch_dir+'/'+basename+'.bin '+hw_ref_image+' 0x'+ecLevel)
++ #TODO: This is currently not working in p10 op-build
++ # run_system_cmd('p9_ipl_build '+scratch_dir+'/'+basename+'.bin '+hw_ref_image+' 0x'+ecLevel)
+ #add pnor header
+ run_system_cmd("env echo -en VERSION\\\\0 > "+scratch_dir+"/"+basename+".sha.bin")
+ run_system_cmd("sha512sum "+scratch_dir+"/"+basename+".bin | awk '{print $1}' | xxd -pr -r >> "+scratch_dir+"/"+basename+".sha.bin")
+--
+1.8.2.2
+
diff --git a/openpower/package/sbe-p10/Config.in b/openpower/package/sbe-p10/Config.in
new file mode 100644
index 0000000..3468511
--- /dev/null
+++ b/openpower/package/sbe-p10/Config.in
@@ -0,0 +1,33 @@
+config BR2_PACKAGE_SBE_P10
+ bool "sbe-p10"
+ default y if (BR2_OPENPOWER_PLATFORM && BR2_OPENPOWER_POWER10)
+ select BR2_CPP
+ depends on BR2_PACKAGE_HCODE_P10
+ help
+ Project to build the sbe firmware codebase for P10
+
+if BR2_PACKAGE_SBE_P10
+
+choice
+ prompt "SBE version"
+ default BR2_SBE_P10_LATEST_VERSION
+
+config BR2_SBE_P10_LATEST_VERSION
+ bool "Use latest SBE master"
+
+config BR2_SBE_P10_CUSTOM_VERSION
+ bool "Custom SBE version"
+
+endchoice
+
+config BR2_SBE_P10_CUSTOM_VERSION_VALUE
+ string "SBE version"
+ depends on BR2_SBE_P10_CUSTOM_VERSION
+
+config BR2_SBE_P10_VERSION
+ string
+ default "59ca18cfdb3f2585e95e664be751440ad2557550" if BR2_SBE_P10_LATEST_VERSION
+ default BR2_SBE_P10_CUSTOM_VERSION_VALUE \
+ if BR2_SBE_P10_CUSTOM_VERSION
+
+endif
diff --git a/openpower/package/sbe-p10/sbe-p10.mk b/openpower/package/sbe-p10/sbe-p10.mk
new file mode 100644
index 0000000..35af089
--- /dev/null
+++ b/openpower/package/sbe-p10/sbe-p10.mk
@@ -0,0 +1,35 @@
+################################################################################
+#
+# SBE for P10
+#
+################################################################################
+
+SBE_P10_VERSION = $(call qstrip,$(BR2_SBE_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
+#SBE_P10_SITE = $(call github,open-power,sbe,$(SBE_P10_VERSION))
+SBE_P10_SITE = https://github.ibm.com/open-power/sbe.git
+SBE_P10_SITE_METHOD=git
+
+SBE_P10_LICENSE = Apache-2.0
+SBE_P10_DEPENDENCIES = host-ppe42-gcc hcode-p10
+# TODO WORKAROUND ... host-ppe42-gc not compiling
+# host-ppe42-gcc hcode-p10
+
+SBE_P10_INSTALL_IMAGES = YES
+SBE_P10_INSTALL_TARGET = NO
+
+define SBE_P10_BUILD_CMDS
+ SBE_COMMIT_ID=$(SBE_P10_VERSION) $(MAKE) -C $(@D) \
+ LD_LIBRARY_PATH=$(HOST_DIR)/usr/lib \
+ CROSS_COMPILER_PATH=$(PPE42_GCC_BIN) \
+ all
+endef
+
+define SBE_P10_INSTALL_IMAGES_CMDS
+ $(INSTALL) -D $(@D)/images/ipl_image_tool $(HOST_DIR)/usr/bin/
+ python $(@D)/src/build/sbeOpDistribute.py --sbe_binary_dir=$(STAGING_DIR)/sbe_binaries --img_dir=$(@D)/images --sbe_binary_filename $(BR2_HOSTBOOT_BINARY_SBE_FILENAME)
+ cp $(@D)/src/build/sbeOpDistribute.py $(STAGING_DIR)/sbe_binaries/
+endef
+
+$(eval $(generic-package))