summaryrefslogtreecommitdiffstats
path: root/src/usr/vpd
diff options
context:
space:
mode:
authorCorey Swenson <cswenson@us.ibm.com>2014-05-19 10:13:25 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-05-22 17:48:36 -0500
commit8c539bfca3dc0e557828dee6a6cf5c3ea68ebcec (patch)
treebfb5962982e6b8047f15e7b618d5d359cf523bbf /src/usr/vpd
parentaa0446e9d1c2f0fb17a6ef40b689ec7281d65387 (diff)
downloadtalos-hostboot-8c539bfca3dc0e557828dee6a6cf5c3ea68ebcec.tar.gz
talos-hostboot-8c539bfca3dc0e557828dee6a6cf5c3ea68ebcec.zip
Create PRES SPD function to avoid unnecessary error log
Change-Id: Ic2258748d9e430440133e2772fd58f805ffa09bd RTC: 98917 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/11163 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/vpd')
-rwxr-xr-xsrc/usr/vpd/dimmPres.C21
-rwxr-xr-xsrc/usr/vpd/spd.C41
-rwxr-xr-xsrc/usr/vpd/spd.H10
3 files changed, 55 insertions, 17 deletions
diff --git a/src/usr/vpd/dimmPres.C b/src/usr/vpd/dimmPres.C
index 2eb0bab59..fa7fdc63f 100755
--- a/src/usr/vpd/dimmPres.C
+++ b/src/usr/vpd/dimmPres.C
@@ -117,29 +117,16 @@ errlHndl_t dimmPresenceDetect( DeviceFW::OperationType i_opType,
break;
}
- // Read Byte 2 (BASIC_MEMORY_TYPE) for the target passed in.
- uint16_t data = 0x0;
- size_t dataSz = sizeof(data);
- err = deviceRead( i_target,
- &data,
- dataSz,
- DEVICE_SPD_ADDRESS( SPD::BASIC_MEMORY_TYPE ) );
-
- if( err )
+ // Is the target present
+ present = spdPresent( i_target );
+
+ if( present == false )
{
- // If an error is returned, the DIMM is not present.
- present = false;
TRACUCOMP( g_trac_spd,
INFO_MRK"Dimm was found to be NOT present." );
-
- // Delete the error
- delete err;
- err = NULL;
}
else
{
- // DIMM is present...
- present = true;
TRACUCOMP( g_trac_spd,
INFO_MRK"Dimm was found to be present." );
}
diff --git a/src/usr/vpd/spd.C b/src/usr/vpd/spd.C
index 9e3985424..235c07dc2 100755
--- a/src/usr/vpd/spd.C
+++ b/src/usr/vpd/spd.C
@@ -800,6 +800,47 @@ errlHndl_t spdWriteValue ( uint64_t i_keyword,
}
// ------------------------------------------------------------------
+// spdPresent
+// ------------------------------------------------------------------
+bool spdPresent ( TARGETING::Target * i_target )
+{
+ errlHndl_t err = NULL;
+ bool pres = false;
+
+ TRACSSCOMP( g_trac_spd,
+ ENTER_MRK"spdPresent()" );
+
+ do
+ {
+ // Read the Basic Memory Type
+ uint8_t memType = 0x0;
+ err = getMemType( memType,
+ i_target );
+
+ if( err )
+ {
+ delete err;
+ err = NULL;
+ break;
+ }
+
+ TRACDCOMP( g_trac_spd,
+ INFO_MRK"Mem Type: %04x",
+ memType );
+
+ if(( SPD_DDR3 == memType ) ||
+ ( SPD_DDR4 == memType ))
+ {
+ pres = true;
+ }
+ } while( 0 );
+
+ return pres;
+}
+
+
+
+// ------------------------------------------------------------------
// ddr3SpecialCases
// ------------------------------------------------------------------
errlHndl_t ddr3SpecialCases(const KeywordData & i_kwdData,
diff --git a/src/usr/vpd/spd.H b/src/usr/vpd/spd.H
index 4e341c2d8..4ba41cc90 100755
--- a/src/usr/vpd/spd.H
+++ b/src/usr/vpd/spd.H
@@ -322,6 +322,16 @@ errlHndl_t spdReadBinaryFile ( uint64_t i_byteAddr,
void * o_data );
/**
+ * @brief This function is used to check if the given target
+ * is present
+ *
+ * @param[in] i_target - DIMM Target device
+ *
+ * @return bool - true if present, false if not present
+ */
+bool spdPresent ( TARGETING::Target * i_target );
+
+/**
* @brief This function performs the presence detect for all DIMMs.
*
* @param[in] i_opType - Operation type, see DeviceFW::OperationType
OpenPOWER on IntegriCloud