summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/fsi/fsipres.C331
-rw-r--r--src/usr/hwpf/test/fapiwinkletest.H10
-rw-r--r--src/usr/mvpd/makefile2
-rw-r--r--src/usr/scom/test/scomtest.H2
-rw-r--r--src/usr/targeting/common/xmltohb/simics_MURANO.system.xml1
5 files changed, 298 insertions, 48 deletions
diff --git a/src/usr/fsi/fsipres.C b/src/usr/fsi/fsipres.C
index a22002a44..7332b09c3 100644
--- a/src/usr/fsi/fsipres.C
+++ b/src/usr/fsi/fsipres.C
@@ -1,43 +1,45 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/fsi/fsipres.C $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/usr/fsi/fsipres.C $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2011-2012
+ *
+ * p1
+ *
+ * Object Code Only (OCO) source materials
+ * Licensed Internal Code Source Materials
+ * IBM HostBoot Licensed Internal Code
+ *
+ * The source code for this program is not published or other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
#include <devicefw/driverif.H>
#include <targeting/common/attributes.H>
+#include <fsi/fsiif.H>
#include <fsi/fsi_reasoncodes.H>
-#include "fsidd.H"
+#include <mvpd/mvpdenums.H>
+#include <errl/errlmanager.H>
+#include <targeting/common/predicates/predicatectm.H>
extern trace_desc_t* g_trac_fsi;
namespace FSI
{
-// Forward declaration from fsidd.C.
-bool isSlavePresent( const TARGETING::Target* i_target );
-
/**
- * @brief Performs a presence detect operation.
+ * @brief Performs a presence detect operation on a Processor Chip.
*
- * This function does FSI presence detect, following the pre-defined prototype
- * for a device-driver framework function.
+ * This function does FSI presence detect and compares it to the Module
+ * VPD that is present, following the pre-defined prototype for a
+ * device-driver framework function.
*
* @param[in] i_opType Operation type, see DeviceFW::OperationType
* in driverif.H
@@ -51,35 +53,38 @@ bool isSlavePresent( const TARGETING::Target* i_target );
* In this function, there are no arguments.
* @return errlHndl_t
*/
-errlHndl_t presenceDetect(DeviceFW::OperationType i_opType,
- TARGETING::Target* i_target,
- void* io_buffer,
- size_t& io_buflen,
- int64_t i_accessType,
- va_list i_args)
+errlHndl_t procPresenceDetect(DeviceFW::OperationType i_opType,
+ TARGETING::Target* i_target,
+ void* io_buffer,
+ size_t& io_buflen,
+ int64_t i_accessType,
+ va_list i_args)
{
+ errlHndl_t l_errl = NULL;
+
if (unlikely(io_buflen < sizeof(bool)))
{
TRACFCOMP(g_trac_fsi,
- ERR_MRK "FSI::presenceDetect> Invalid data length: %d",
+ ERR_MRK "FSI::procPresenceDetect> Invalid data length: %d",
io_buflen);
/*@
* @errortype
- * @moduleid FSI::MOD_FSIPRES_PRESENCEDETECT
+ * @moduleid FSI::MOD_FSIPRES_PROCPRESENCEDETECT
* @reasoncode FSI::RC_INVALID_LENGTH
* @userdata1 Data Length
* @devdesc presenceDetect> Invalid data length (!= 1 bytes)
*/
- errlHndl_t l_errl =
+ l_errl =
new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- FSI::MOD_FSIPRES_PRESENCEDETECT,
+ FSI::MOD_FSIPRES_PROCPRESENCEDETECT,
FSI::RC_INVALID_LENGTH,
TO_UINT64(io_buflen));
io_buflen = 0;
return l_errl;
}
- bool present = false;
+ // First look for FSI presence bits
+ bool fsi_present = false;
TARGETING::Target* l_masterChip = NULL;
TARGETING::targetService().masterProcChipTargetHandle(l_masterChip);
@@ -87,27 +92,265 @@ errlHndl_t presenceDetect(DeviceFW::OperationType i_opType,
if ((i_target == TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL) ||
(i_target == l_masterChip))
{
- present = true;
+ fsi_present = true;
+ }
+ else
+ {
+ fsi_present = isSlavePresent(i_target);
+ }
+
+ // Next look for valid Module VPD by reading the PG record
+ bool mvpd_present = false;
+ size_t theSize = 0;
+ l_errl = deviceRead( i_target,
+ NULL,
+ theSize,
+ DEVICE_MVPD_ADDRESS( MVPD::CP00,
+ MVPD::VD ) );
+ if( l_errl )
+ {
+ if( fsi_present )
+ {
+ // commit this log because we expected to have VPD
+ errlCommit( l_errl,
+ FSI_COMP_ID );
+ }
+ else
+ {
+ // just delete this
+ delete l_errl;
+ }
+ }
+
+ if( theSize > 0 )
+ {
+ uint8_t theData[theSize];
+ l_errl = deviceRead( i_target,
+ theData,
+ theSize,
+ DEVICE_MVPD_ADDRESS( MVPD::CP00,
+ MVPD::VD ) );
+ if( l_errl )
+ {
+ if( fsi_present )
+ {
+ // commit this log because we expected to have VPD
+ errlCommit( l_errl,
+ FSI_COMP_ID );
+ }
+ else
+ {
+ // just delete this
+ delete l_errl;
+ }
+ }
+ else
+ {
+ mvpd_present = true;
+ }
+ }
+
+ //@fixme-RTC:35551 : FSI presence detection is wrong in VPO
+ // Force FSI to follow MVPD
+ if( (fsi_present != mvpd_present) && TARGETING::is_vpo() )
+ {
+ TRACFCOMP(g_trac_fsi,
+ ERR_MRK "FSI::procPresenceDetect> Lying about FSI presence for %.8X",
+ TARGETING::get_huid(i_target));
+ fsi_present = mvpd_present;
+ }
+
+ // Finally compare the 2 methods
+ if( fsi_present != mvpd_present )
+ {
+ TRACFCOMP(g_trac_fsi,
+ ERR_MRK "FSI::procPresenceDetect> FSI (=%d) and MVPD (=%d) do not agree for %.8X",
+ fsi_present, mvpd_present, TARGETING::get_huid(i_target));
+ /*@
+ * @errortype
+ * @moduleid FSI::MOD_FSIPRES_PROCPRESENCEDETECT
+ * @reasoncode FSI::RC_FSI_MVPD_MISMATCH
+ * @userdata1 HUID of processor
+ * @userdata2[0:31] FSI Presence
+ * @userdata2[32:63] MVPD Presence
+ * @devdesc presenceDetect> FSI and MVPD do not agree
+ */
+ l_errl =
+ new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ FSI::MOD_FSIPRES_PROCPRESENCEDETECT,
+ FSI::RC_FSI_MVPD_MISMATCH,
+ TWO_UINT32_TO_UINT64(
+ fsi_present,
+ mvpd_present));
+
+ //@todo-callout the processor
+ //l_errl->addHwCallout( i_target, LOW, NO_DECONFIG, NO_GARD );
+
+ // commit this log and move on
+ errlCommit( l_errl,
+ FSI_COMP_ID );
+ }
+
+
+ bool present = fsi_present & mvpd_present;
+ memcpy(io_buffer, &present, sizeof(present));
+ io_buflen = sizeof(present);
+
+ return NULL;
+}
+
+/**
+ * @brief Performs a presence detect operation on a Membuf Chip.
+ *
+ * This function does FSI presence detect, following the pre-defined prototype
+ * for a device-driver framework function.
+ *
+ * @param[in] i_opType Operation type, see DeviceFW::OperationType
+ * in driverif.H
+ * @param[in] i_target Presence detect target
+ * @param[in/out] io_buffer Read: Pointer to output data storage
+ * Write: Pointer to input data storage
+ * @param[in/out] io_buflen Input: size of io_buffer (in bytes, always 1)
+ * Output: Success = 1, Failure = 0
+ * @param[in] i_accessType DeviceFW::AccessType enum (userif.H)
+ * @param[in] i_args This is an argument list for DD framework.
+ * In this function, there are no arguments.
+ * @return errlHndl_t
+ */
+errlHndl_t membPresenceDetect(DeviceFW::OperationType i_opType,
+ TARGETING::Target* i_target,
+ void* io_buffer,
+ size_t& io_buflen,
+ int64_t i_accessType,
+ va_list i_args)
+{
+ errlHndl_t l_errl = NULL;
+
+ if (unlikely(io_buflen < sizeof(bool)))
+ {
+ TRACFCOMP(g_trac_fsi,
+ ERR_MRK "FSI::membPresenceDetect> Invalid data length: %d",
+ io_buflen);
+ /*@
+ * @errortype
+ * @moduleid FSI::MOD_FSIPRES_MEMBPRESENCEDETECT
+ * @reasoncode FSI::RC_INVALID_LENGTH
+ * @userdata1 Data Length
+ * @devdesc presenceDetect> Invalid data length (!= 1 bytes)
+ */
+ l_errl =
+ new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ FSI::MOD_FSIPRES_MEMBPRESENCEDETECT,
+ FSI::RC_INVALID_LENGTH,
+ TO_UINT64(io_buflen));
+ io_buflen = 0;
+ return l_errl;
+ }
+
+ // First look for FSI presence bits
+ bool fsi_present = isSlavePresent(i_target);
+
+
+ //@todo-RTC:44254 : Switch to FRU VPD (vs DIMM)
+
+ // Next look for some associated DIMM VPD
+ bool vpd_present = false;
+
+ // find all of the CDIMMs associated with this membuf
+ TARGETING::PredicateCTM l_dimm(TARGETING::CLASS_LOGICAL_CARD,
+ TARGETING::TYPE_DIMM,
+ TARGETING::MODEL_CDIMM);
+ TARGETING::PredicatePostfixExpr dimm_query;
+ dimm_query.push(&l_dimm);
+
+ TARGETING::TargetHandleList dimm_list;
+ TARGETING::targetService().getAssociated(dimm_list,
+ i_target,
+ TARGETING::TargetService::CHILD_BY_AFFINITY,
+ TARGETING::TargetService::ALL,
+ &dimm_query);
+
+ if( dimm_list.empty() )
+ {
+ vpd_present = false;
}
else
+ {
+ size_t presentSize = sizeof(vpd_present);
+ for( TARGETING::TargetHandleList::iterator dimm = dimm_list.begin();
+ (dimm != dimm_list.end()) && !vpd_present && !l_errl;
+ ++dimm )
+ {
+ l_errl = deviceRead(*dimm,
+ &vpd_present,
+ presentSize,
+ DEVICE_PRESENT_ADDRESS());
+ }
+ if( l_errl )
+ {
+ // commit this log because we never expect this call to fail
+ errlCommit( l_errl,
+ FSI_COMP_ID );
+ }
+ }
+
+ //@fixme-RTC:35551 : FSI presence detection is wrong in VPO
+ // Force FSI to follow VPD
+ if( (fsi_present != vpd_present) && TARGETING::is_vpo() )
{
- present = isSlavePresent(i_target);
+ TRACFCOMP(g_trac_fsi,
+ ERR_MRK "FSI::membPresenceDetect> Lying about FSI presence for %.8X",
+ TARGETING::get_huid(i_target));
+ fsi_present = vpd_present;
}
+ // Finally compare the 2 methods
+ if( fsi_present != vpd_present )
+ {
+ TRACFCOMP(g_trac_fsi,
+ ERR_MRK "FSI::membPresenceDetect> FSI (=%d) and VPD (=%d) do not agree for %.8X",
+ fsi_present, vpd_present, TARGETING::get_huid(i_target));
+ /*@
+ * @errortype
+ * @moduleid FSI::MOD_FSIPRES_MEMBPRESENCEDETECT
+ * @reasoncode FSI::RC_FSI_MVPD_MISMATCH
+ * @userdata1 HUID of processor
+ * @userdata2[0:31] FSI Presence
+ * @userdata2[32:63] VPD Presence
+ * @devdesc presenceDetect> FSI and MVPD do not agree
+ */
+ l_errl =
+ new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ FSI::MOD_FSIPRES_MEMBPRESENCEDETECT,
+ FSI::RC_FSI_MVPD_MISMATCH,
+ TWO_UINT32_TO_UINT64(
+ fsi_present,
+ vpd_present));
+
+ //@todo-callout the membuf
+ //l_errl->addHwCallout( i_target, LOW, NO_DECONFIG, NO_GARD );
+
+ // commit this log and move on
+ errlCommit( l_errl,
+ FSI_COMP_ID );
+ }
+
+ bool present = fsi_present & vpd_present;
memcpy(io_buffer, &present, sizeof(present));
io_buflen = sizeof(present);
return NULL;
}
+
// Register as the presence detect for processor and memory buffers.
DEVICE_REGISTER_ROUTE(DeviceFW::READ,
DeviceFW::PRESENT,
TARGETING::TYPE_PROC,
- presenceDetect);
+ procPresenceDetect);
DEVICE_REGISTER_ROUTE(DeviceFW::READ,
DeviceFW::PRESENT,
TARGETING::TYPE_MEMBUF,
- presenceDetect);
+ membPresenceDetect);
};
diff --git a/src/usr/hwpf/test/fapiwinkletest.H b/src/usr/hwpf/test/fapiwinkletest.H
index 365032932..ceaff03ad 100644
--- a/src/usr/hwpf/test/fapiwinkletest.H
+++ b/src/usr/hwpf/test/fapiwinkletest.H
@@ -96,6 +96,7 @@ public:
if ( l_fapirc != fapi::FAPI_RC_SUCCESS )
{
TS_FAIL( "testGetMvpdPdr: expected FAPI_RC_SUCCESS" );
+ fapiLogError(l_fapirc);
return;
}
@@ -106,6 +107,7 @@ public:
TS_FAIL( "testGetMvpdPdr: expected size = 0x%x, received 0x%x",
MVPD_PDR_TEST_SIZE,
l_pdRLen );
+ fapiLogError(l_fapirc);
return;
}
@@ -119,6 +121,7 @@ public:
if ( l_fapirc != fapi::FAPI_RC_SUCCESS )
{
TS_FAIL( "testGetMvpdPdr: expected FAPI_RC_SUCCESS" );
+ fapiLogError(l_fapirc);
return;
}
@@ -225,6 +228,7 @@ public:
TS_FAIL( "testRepairRings: rc FAIL: 0x%x, 0x%x",
fapi::RC_REPAIR_RING_INVALID_RINGBUF_PTR,
static_cast<uint32_t>(l_fapirc) );
+ fapiLogError(l_fapirc);
return;
}
// ----------------------------------------------------------------
@@ -247,6 +251,7 @@ public:
TS_FAIL( "testRepairRings: rc FAIL: 0x%x, 0x%x",
fapi::RC_REPAIR_RING_NOT_FOUND,
static_cast<uint32_t>(l_fapirc) );
+ fapiLogError(l_fapirc);
return;
}
@@ -271,7 +276,9 @@ public:
// note: "uint32_t" below is an _operator_ of fapi::ReturnCode
TS_FAIL( "testRepairRings: rc FAIL: 0x%x, 0x%x",
fapi::RC_REPAIR_RING_INVALID_SIZE,
- static_cast<uint32_t>(l_fapirc) );
+ static_cast<uint32_t>(l_fapirc));
+
+ fapiLogError(l_fapirc);
return;
}
if ( l_ringBufsize != l_ringModifiers[i].size )
@@ -303,6 +310,7 @@ public:
TS_FAIL( "testRepairRings: rc FAIL: 0x%x, 0x%x",
fapi::FAPI_RC_SUCCESS,
static_cast<uint32_t>(l_fapirc) );
+ fapiLogError(l_fapirc);
return;
}
if ( l_ringBufsize != l_ringModifiers[i].size )
diff --git a/src/usr/mvpd/makefile b/src/usr/mvpd/makefile
index 5833a9238..15186def4 100644
--- a/src/usr/mvpd/makefile
+++ b/src/usr/mvpd/makefile
@@ -27,6 +27,6 @@ OBJS = mvpd.o
SUBDIRS = test.d
-BINARY_FILES = $(IMGDIR)/procmvpd.dat:e23067dae839f5b434ec12b5c86d2ae4fbb51259
+BINARY_FILES = $(IMGDIR)/procmvpd.dat:2bdc54f37808b225a08a3a324f01e1b0d84b2277
include ${ROOTPATH}/config.mk
diff --git a/src/usr/scom/test/scomtest.H b/src/usr/scom/test/scomtest.H
index 3bd216635..5f622cb2f 100644
--- a/src/usr/scom/test/scomtest.H
+++ b/src/usr/scom/test/scomtest.H
@@ -121,7 +121,7 @@ public:
{ scom_targets[PROCWRAP], 0x120F0166, 0xFEDCBA9876543210},
{ scom_targets[PROCWRAP], 0x01010803, 0x0000000000000000},
{ scom_targets[PROCWRAP], 0x02040004, 0xFFFFFFFFFFFFFFFF},
- { scom_targets[PROC1], 0x00040005, 0x1234567887654321},
+ { scom_targets[PROC1], 0x01010803, 0x1234567887654321},
{ scom_targets[PROC1], 0x02040004, 0x1122334455667788},
};
const uint64_t NUM_ADDRS = sizeof(test_data)/sizeof(test_data[0]);
diff --git a/src/usr/targeting/common/xmltohb/simics_MURANO.system.xml b/src/usr/targeting/common/xmltohb/simics_MURANO.system.xml
index e3a700c96..3b5fdbc4d 100644
--- a/src/usr/targeting/common/xmltohb/simics_MURANO.system.xml
+++ b/src/usr/targeting/common/xmltohb/simics_MURANO.system.xml
@@ -35,7 +35,6 @@
* each Centaur membuf chip has 2 MBA chiplets
* each MBA chiplet has 2 ports
* each MBA port connects to 2 logical dimms
- * Adding dummy EX0 because that is what Simics currently gives us @fixme
================================================================= -->
<!-- System -->
OpenPOWER on IntegriCloud