summaryrefslogtreecommitdiffstats
path: root/src/usr/fapi2
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2017-10-28 16:59:40 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-10-29 12:15:17 -0400
commit8b06214f873babe01d422164651d49e990193182 (patch)
tree116d064d91cfe7b8cd32b0b6b492e9ec7116fb71 /src/usr/fapi2
parent12b6b45da2328eed329d94c8bb678580e1ef97ca (diff)
downloadtalos-hostboot-8b06214f873babe01d422164651d49e990193182.tar.gz
talos-hostboot-8b06214f873babe01d422164651d49e990193182.zip
Allow fuzzy matches to WOF tables in Simics
In Simics we deliberately use fewer parts than the module would normally support for better performance. This downbin means that we no longer are using a supported sort when we look for the WOF tables. Since we don't really model the voltage/current of the cores there is no harm in using a different table. Change-Id: If5b6db6fee1aed6a176a4aca470b1c82c95ee586 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48972 Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2')
-rw-r--r--src/usr/fapi2/plat_wof_access.C39
1 files changed, 37 insertions, 2 deletions
diff --git a/src/usr/fapi2/plat_wof_access.C b/src/usr/fapi2/plat_wof_access.C
index 6db703d5e..cb999e3b1 100644
--- a/src/usr/fapi2/plat_wof_access.C
+++ b/src/usr/fapi2/plat_wof_access.C
@@ -39,6 +39,7 @@
#include <initservice/initserviceif.H>
#include <sys/mm.h>
#include <errl/errlmanager.H>
+#include <util/misc.H>
namespace fapi2
{
@@ -109,7 +110,9 @@ fapi2::ReturnCode platParseWOFTables(uint8_t* o_wofData)
FAPI_DBG("Entering platParseWOFTables ....");
errlHndl_t l_errl = nullptr;
- fapi2::ReturnCode l_rc = fapi2::FAPI2_RC_SUCCESS;;
+ fapi2::ReturnCode l_rc = fapi2::FAPI2_RC_SUCCESS;
+ uint8_t* l_simMatch = nullptr;
+ size_t l_simMatchSize = 0;
TARGETING::Target * l_sys = nullptr;
TARGETING::Target * l_mProc = nullptr;
@@ -446,6 +449,23 @@ fapi2::ReturnCode platParseWOFTables(uint8_t* o_wofData)
{
// Save the header for later
l_headers.push_back(l_wth);
+
+ // We run with fewer cores in Simics, ignore the core field
+ // if we don't find a complete match
+ if( Util::isSimicsRunning() && l_simMatch == nullptr )
+ {
+ if( (l_wth->socket_power_w == l_socketPower) &&
+ (l_wth->sort_power_freq_mhz == l_sortFreq) )
+ {
+ FAPI_INF("Found a potential WOF table match for Simics");
+ // Copy the WOF table to a local var temporarily
+ l_simMatchSize = l_ste[l_ent].size;
+ l_simMatch = new uint8_t[l_simMatchSize];
+ memcpy(l_simMatch,
+ reinterpret_cast<uint8_t*>(l_wth),
+ l_simMatchSize);
+ }
+ }
}
}
@@ -454,8 +474,18 @@ fapi2::ReturnCode platParseWOFTables(uint8_t* o_wofData)
break;
}
+ if( Util::isSimicsRunning()
+ && (l_ent == l_img->entryCount)
+ && (l_simMatch != nullptr) )
+ {
+ FAPI_INF("Using fuzzy match for Simics");
+ // Copy the WOF table to the ouput pointer
+ memcpy(o_wofData,
+ l_simMatch,
+ l_simMatchSize);
+ }
//Check for no match
- if(l_ent == l_img->entryCount)
+ else if(l_ent == l_img->entryCount)
{
FAPI_ERR("No WOF table match found");
/*@
@@ -574,6 +604,11 @@ fapi2::ReturnCode platParseWOFTables(uint8_t* o_wofData)
}
+ if( l_simMatch )
+ {
+ delete[] l_simMatch;
+ }
+
FAPI_DBG("Exiting platParseWOFTables ....");
return l_rc;
OpenPOWER on IntegriCloud