summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2012-01-09 10:29:43 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-01-09 15:50:49 -0600
commitcecc38a1b5782b5ddaa351d37e064200d407c8fb (patch)
treeb77d1efe61ae159e589984209b7be10bcb5fc4dd /src
parent0700cb28c8c52a9cc675db648adddcf822af8652 (diff)
downloadblackbird-hostboot-cecc38a1b5782b5ddaa351d37e064200d407c8fb.tar.gz
blackbird-hostboot-cecc38a1b5782b5ddaa351d37e064200d407c8fb.zip
Switching FSI Scom Driver over to use a separate attribute mutex
for each chip versus a single global mutex. RTC Story 4389 Also stuck in a quick fix for Issue 4493 at the same time. Verified against VENICE model with a Centaur. Change-Id: I62fc2c979315b60594104550f8095aa80996c40f Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/599 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/usr/fsi/fsidd.C20
-rw-r--r--src/usr/fsiscom/fsiscom.C17
-rw-r--r--src/usr/targeting/xmltohb/attribute_types.xml13
-rw-r--r--src/usr/targeting/xmltohb/target_types.xml6
4 files changed, 44 insertions, 12 deletions
diff --git a/src/usr/fsi/fsidd.C b/src/usr/fsi/fsidd.C
index f2938d518..cac859f53 100644
--- a/src/usr/fsi/fsidd.C
+++ b/src/usr/fsi/fsidd.C
@@ -766,7 +766,7 @@ errlHndl_t FsiDD::read(const FsiAddrInfo_t& i_addrInfo,
errlHndl_t FsiDD::write(const FsiAddrInfo_t& i_addrInfo,
uint32_t* i_buffer)
{
- TRACDCOMP(g_trac_fsi, "FsiDD::write(relAddr=0x%llx,absAddr=0x%11x)> ", i_addrInfo.relAddr, i_addrInfo.absAddr );
+ TRACDCOMP(g_trac_fsi, "FsiDD::write(relAddr=0x%.llX,absAddr=0x%.11X)> ", i_addrInfo.relAddr, i_addrInfo.absAddr );
errlHndl_t l_err = NULL;
bool need_unlock = false;
mutex_t* l_mutex = NULL;
@@ -826,7 +826,7 @@ errlHndl_t FsiDD::write(const FsiAddrInfo_t& i_addrInfo,
mutex_unlock(l_mutex);
}
- //TRACDCOMP(g_trac_fsi, "< FsiDD::write() ", i_address); //TODO BUG!
+ TRACDCOMP(g_trac_fsi, "< FsiDD::write() " );
return l_err;
}
@@ -1177,7 +1177,13 @@ errlHndl_t FsiDD::initPort(FsiChipInfo_t i_fsiInfo,
if( !isSlavePresent(i_fsiInfo.master,i_fsiInfo.type,i_fsiInfo.port) )
{
TRACDCOMP( g_trac_fsi, "FsiDD::initPort> Slave %.8X is not present", i_fsiInfo.linkid.id );
- //TRACDCOMP( g_trac_fsi, " : sensebits=%.2X, portbit=%.2X", iv_slaves[getSlaveEnableIndex(i_fsiInfo.master,i_fsiInfo.type)], portbit ); TODO BUG!!
+#ifdef HOSTBOOT_DEBUG
+ uint64_t slave_index = getSlaveEnableIndex(i_fsiInfo.master,i_fsiInfo.type);
+ if( slave_index != INVALID_SLAVE_INDEX )
+ {
+ TRACDCOMP( g_trac_fsi, " : sensebits=%.2X, portbit=%.2X", iv_slaves[slave_index], portbit );
+ }
+#endif
break;
}
TRACFCOMP( g_trac_fsi, "FsiDD::initPort> Slave %.8X is present", i_fsiInfo.linkid.id );
@@ -1423,6 +1429,11 @@ uint64_t FsiDD::getPortOffset(TARGETING::FSI_MASTER_TYPE i_type,
uint64_t FsiDD::getSlaveEnableIndex( const TARGETING::Target* i_master,
TARGETING::FSI_MASTER_TYPE i_type )
{
+ if( i_master == NULL )
+ {
+ return INVALID_SLAVE_INDEX;
+ }
+
//default to local slave ports
uint64_t slave_index = MAX_SLAVE_PORTS+i_type;
if( i_master != iv_master )
@@ -1458,7 +1469,8 @@ FsiDD::FsiChipInfo_t FsiDD::getFsiInfo( const TARGETING::Target* i_target )
EntityPath epath;
- if( i_target->tryGetAttr<ATTR_FSI_MASTER_TYPE>(info.type) )
+ if( (i_target != NULL) &&
+ i_target->tryGetAttr<ATTR_FSI_MASTER_TYPE>(info.type) )
{
if( info.type != FSI_MASTER_TYPE_NO_MASTER )
{
diff --git a/src/usr/fsiscom/fsiscom.C b/src/usr/fsiscom/fsiscom.C
index a09e52835..a88210a7f 100644
--- a/src/usr/fsiscom/fsiscom.C
+++ b/src/usr/fsiscom/fsiscom.C
@@ -32,8 +32,6 @@
#include "fsiscom.H"
//Globals/Constants
-// @todo - change to target-specific MUTEX so devices can be accessed in parallel.
-static mutex_t g_fsiScomMutex = MUTEX_INITIALIZER;
// Trace definition
trace_desc_t* g_trac_fsiscom = NULL;
@@ -76,6 +74,7 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,
uint32_t l_status = 0;
bool need_unlock = false;
size_t op_size = sizeof(uint32_t);
+ mutex_t* l_mutex = NULL;
do{
@@ -123,6 +122,8 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,
l_command = static_cast<uint32_t>(l_scomAddr & 0x000000007FFFFFFF);
+ // use the chip-specific mutex attribute
+ l_mutex = i_target->getHbMutexAttr<TARGETING::ATTR_FSI_SCOM_MUTEX>();
if(i_opType == DeviceFW::WRITE)
{
@@ -132,7 +133,7 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,
// atomic section >>
- mutex_lock(&g_fsiScomMutex);
+ mutex_lock(l_mutex);
need_unlock = true;
@@ -184,7 +185,7 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,
// atomic section <<
need_unlock = false;
- mutex_unlock(&g_fsiScomMutex);
+ mutex_unlock(l_mutex);
//bits 17-19 indicates PCB/PIB error
if(l_status & 0x00007000)
@@ -219,7 +220,7 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,
TRACUCOMP( g_trac_fsiscom, "fsiScomPerformOp: Read(l_scomAddr=0x%.8X)", l_scomAddr);
// atomic section >>
- mutex_lock(&g_fsiScomMutex);
+ mutex_lock(l_mutex);
need_unlock = true;
@@ -295,7 +296,7 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,
// atomic section <<
need_unlock = false;
- mutex_unlock(&g_fsiScomMutex);
+ mutex_unlock(l_mutex);
TRACUCOMP( g_trac_fsiscom, "fsiScomPerformOp: Read: l_scomAddr=0x%X, l_data0=0x%X, l_data1=0x%X", l_scomAddr, scratchData.data32_0, scratchData.data32_1);
@@ -327,9 +328,9 @@ errlHndl_t fsiScomPerformOp(DeviceFW::OperationType i_opType,
}while(0);
- if( need_unlock )
+ if( need_unlock && l_mutex )
{
- mutex_unlock(&g_fsiScomMutex);
+ mutex_unlock(l_mutex);
}
diff --git a/src/usr/targeting/xmltohb/attribute_types.xml b/src/usr/targeting/xmltohb/attribute_types.xml
index d823e291f..b2433ffc7 100644
--- a/src/usr/targeting/xmltohb/attribute_types.xml
+++ b/src/usr/targeting/xmltohb/attribute_types.xml
@@ -2568,4 +2568,17 @@
</hwpfToHbAttrMap>
</attribute>
+<attribute>
+ <id>FSI_SCOM_MUTEX</id>
+ <description>Mutex for FSI-based SCOM Operations</description>
+ <simpleType>
+ <hbmutex>
+ <default>0</default>
+ </hbmutex>
+ </simpleType>
+ <persistency>volatile-zeroed</persistency>
+ <readable/>
+ <writeable/>
+</attribute>
+
</attributes>
diff --git a/src/usr/targeting/xmltohb/target_types.xml b/src/usr/targeting/xmltohb/target_types.xml
index 83839d509..e801816da 100644
--- a/src/usr/targeting/xmltohb/target_types.xml
+++ b/src/usr/targeting/xmltohb/target_types.xml
@@ -138,6 +138,9 @@
<attribute>
<id>FSI_MASTER_MUTEX</id>
</attribute>
+ <attribute>
+ <id>FSI_SCOM_MUTEX</id>
+ </attribute>
</targetType>
<targetType>
@@ -646,6 +649,9 @@
</attribute>
<attribute><id>MSS_VOLT</id></attribute>
<attribute><id>MSS_FREQ</id></attribute>
+ <attribute>
+ <id>FSI_SCOM_MUTEX</id>
+ </attribute>
</targetType>
<!-- Centaur MBS -->
OpenPOWER on IntegriCloud