summaryrefslogtreecommitdiffstats
path: root/openpower/patches/p8dtu-patches/hostboot-p8/0012-Set-OPAL_MODEL-to-p8dtu1u-or-p8dtu2u-for-1U-and-2U-s.patch
diff options
context:
space:
mode:
authorJim Yuan <jim.yuan@supermicro.com>2019-03-25 09:49:24 -0700
committerStewart Smith <stewart@linux.ibm.com>2019-04-05 14:46:19 +1100
commitf5da1def3a765f66a837707202e7087e2b40469f (patch)
treede33c1cfb319747c3791c62ec867a177deb48273 /openpower/patches/p8dtu-patches/hostboot-p8/0012-Set-OPAL_MODEL-to-p8dtu1u-or-p8dtu2u-for-1U-and-2U-s.patch
parentdc7af34d2c160fa2144d09d5a7772d367cdce638 (diff)
downloadtalos-op-build-f5da1def3a765f66a837707202e7087e2b40469f.tar.gz
talos-op-build-f5da1def3a765f66a837707202e7087e2b40469f.zip
Add p8dtu platform
This contains the p8dtu platform from SuperMicro. It has previously lived out of tree. Like other POWER8 platforms, several Hostboot patches are required. Since Hostboot does not have the ability to have per-platform code, this comes in as patches. Signed-off-by: Jim Yuan <jim.yuan@supermicro.com> [stewart: cleanup and longer commit message] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'openpower/patches/p8dtu-patches/hostboot-p8/0012-Set-OPAL_MODEL-to-p8dtu1u-or-p8dtu2u-for-1U-and-2U-s.patch')
-rw-r--r--openpower/patches/p8dtu-patches/hostboot-p8/0012-Set-OPAL_MODEL-to-p8dtu1u-or-p8dtu2u-for-1U-and-2U-s.patch118
1 files changed, 118 insertions, 0 deletions
diff --git a/openpower/patches/p8dtu-patches/hostboot-p8/0012-Set-OPAL_MODEL-to-p8dtu1u-or-p8dtu2u-for-1U-and-2U-s.patch b/openpower/patches/p8dtu-patches/hostboot-p8/0012-Set-OPAL_MODEL-to-p8dtu1u-or-p8dtu2u-for-1U-and-2U-s.patch
new file mode 100644
index 00000000..bc4f4926
--- /dev/null
+++ b/openpower/patches/p8dtu-patches/hostboot-p8/0012-Set-OPAL_MODEL-to-p8dtu1u-or-p8dtu2u-for-1U-and-2U-s.patch
@@ -0,0 +1,118 @@
+From 1e6bb450cf94fc3ade70f82703e6c57a30bbebaa Mon Sep 17 00:00:00 2001
+From: Jim Yuan <jim.yuan@supermicro.com>
+Date: Wed, 10 Aug 2016 10:41:32 -0700
+Subject: [PATCH 12/14] Set OPAL_MODEL to p8dtu1u or p8dtu2u for 1U and 2U
+ system.
+
+Signed-off-by: Jim Yuan <jim.yuan@supermicro.com>
+---
+ src/usr/hwpf/hwp/start_payload/start_payload.C | 66 +++++++++++++++++++++-
+ .../common/xmltohb/attribute_types_hb.xml | 1 +
+ 2 files changed, 66 insertions(+), 1 deletion(-)
+
+diff --git a/src/usr/hwpf/hwp/start_payload/start_payload.C b/src/usr/hwpf/hwp/start_payload/start_payload.C
+index ad155f19e..80e62a0b6 100644
+--- a/src/usr/hwpf/hwp/start_payload/start_payload.C
++++ b/src/usr/hwpf/hwp/start_payload/start_payload.C
+@@ -89,6 +89,8 @@
+ #include <config.h>
+ #include <ipmi/ipmiwatchdog.H>
+ #include <ipmi/ipmiif.H> //jim
++#include <string.h> //jim
++
+ #include <vpd/vpd_if.H>
+
+ #include <hwpf/hwpf_reasoncodes.H>
+@@ -487,6 +489,67 @@ void setAPSSGainOffsetFromPWSInfo(void)
+ assert(0);
+ }
+ }
++
++
++void setOpalMode (void)
++{
++
++ uint8_t riser_id = 0 ;
++ errlHndl_t l_err = NULL;
++ size_t len = 4;
++
++ //create request data buffer
++ uint8_t* data = new uint8_t[len];
++
++ IPMI::completion_code cc = IPMI::CC_UNKBAD;
++
++ data[0] = 0x3;
++ data[1] = 0x70;
++ data[2] = 0x1;
++ data[3] = 0x2; //offset 0x2 for UIO info
++ l_err = IPMI::sendrecv(IPMI::master_readwrite(), cc, len, data);
++
++ if( l_err == NULL )
++ {
++ if( cc == IPMI::CC_OK )
++ {
++ riser_id = data[0];
++ }
++
++ delete[] data;
++ }
++
++ATTR_OPAL_MODEL_type l_model = {0};
++
++TARGETING::Target* sys = NULL;
++targetService().getTopLevelTarget(sys);
++
++sys->tryGetAttr<TARGETING::ATTR_OPAL_MODEL>(l_model);
++TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "OPAL Mode is %s", l_model);
++TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "Riser ID is %d", riser_id);
++
++if (riser_id == 0x9)
++ {
++ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "1U OPAL Mode");
++ strcpy (l_model, "supermicro,p8dtu1u");
++
++ }
++else //(riser_id == 0x19)
++ {
++ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "2U OPAL Mode");
++ strcpy (l_model, "supermicro,p8dtu2u");
++ }
++
++if (!sys->trySetAttr<TARGETING::ATTR_OPAL_MODEL>(l_model))
++ {
++ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "set OPAL Mode failed");
++ assert(0);
++ }
++
++sys->tryGetAttr<TARGETING::ATTR_OPAL_MODEL>(l_model);
++TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "after set, OPAL Mode is %s", l_model);
++
++}
+ //
+ // Wrapper function to call host_runtime_setup
+ //
+@@ -529,7 +592,8 @@ void* call_host_runtime_setup( void *io_pArgs )
+ }
+
+ setAPSSGainOffsetFromPWSInfo(); //jim add code before activate OCC. START_OCC_DURING_BOOT is defined in config.
+-
++ setOpalMode(); //jim
++
+ bool l_activateOCC = is_avp_load();
+
+ #ifdef CONFIG_START_OCC_DURING_BOOT
+diff --git a/src/usr/targeting/common/xmltohb/attribute_types_hb.xml b/src/usr/targeting/common/xmltohb/attribute_types_hb.xml
+index 64a0c9bae..3cfdb9aa0 100644
+--- a/src/usr/targeting/common/xmltohb/attribute_types_hb.xml
++++ b/src/usr/targeting/common/xmltohb/attribute_types_hb.xml
+@@ -966,6 +966,7 @@
+ </simpleType>
+ <persistency>non-volatile</persistency>
+ <readable/>
++ <writeable/>
+ </attribute>
+
+ <attribute>
+--
+2.16.2.windows.1
+
OpenPOWER on IntegriCloud