Skip to content

Commit

Permalink
Hack to force OCMB presence detection
Browse files Browse the repository at this point in the history
Temporary code that assumes the OCMB is present if the target is
in the model.  Also adds a check to throw an error instead of
crashing if VPD_REC_NUM isn't set.

Change-Id: Iba87d13093f0044bdf28a10621561e02d10faaf6
RTC: 196805
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68488
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
  • Loading branch information
dcrowell77 authored and Nicholas E. Bofferding committed Dec 14, 2018
1 parent 1851aa0 commit 552d964
Show file tree
Hide file tree
Showing 10 changed files with 359 additions and 89 deletions.
46 changes: 27 additions & 19 deletions src/include/usr/devicefw/userif.H
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,29 @@ namespace DeviceFW

enum AccessType
{
SCOM = 0,
PNOR,
MAILBOX,
PRESENT,
FSI,
SPD,
SCOM = 0, // SCOM registers
PNOR, // PNOR flash
MAILBOX, // FSP mailbox
PRESENT, // Presence detection
FSI, // FSI/CFAM registers
SPD, // Serial Presence Detect Data for JEDEC DIMMs
MVPD, // Module (processor) VPD
CVPD, // Centaur (memory buffer) VPD
SCAN,
EEPROM,
GPIO,
LPC,
SCAN, // Scan rings
EEPROM, // Standard EEPROM/SEEPROM over i2c
GPIO, // GPIO registers
LPC, // Low Pin Count bus
IPMIBT, // As opposed to other phy's
PVPD,
TPM,
SIO,
AHB_SIO,
PVPD, // Planar VPD
TPM, // Trusted Platform Module
SIO, // BMC Super I/O registers
AHB_SIO, // AST Hostbridge via SIO
DVPD, // Direct access memory VPD
DEPRECATED_MEMD_VPD,
NODECOMM,
NVDIMM,
FAPI_I2C,
MMIO,
NODECOMM, // Internode communication
NVDIMM, // Non-volatile DIMM controller access
FAPI_I2C, // FAPI2-triggered i2c accesses
MMIO, // Memory Mapped I/O
IDEC, // Read and set EC and CHIPID values
LAST_ACCESS_TYPE,
};

Expand Down Expand Up @@ -405,6 +405,14 @@ namespace DeviceFW
static_cast<uint64_t>((i_offset)), \
static_cast<uint64_t>((i_accessLimit))

/**
* @brief Additional device addressing parameters for MMIO ops.
* Construct the device addressing parameters for the IDEC operation
* (no parameters)
*/
#define DEVICE_IDEC_ADDRESS()\
DeviceFW::IDEC

/**
* @brief Perform a hardware read operation.
*
Expand Down
10 changes: 8 additions & 2 deletions src/include/usr/vpd/vpdreasoncodes.H
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ enum vpdModuleId
VPD_WRITE_PNOR = 0x10,
VPD_ENSURE_CACHE_IS_IN_SYNC = 0x11,
VPD_GET_PN_AND_SN = 0x12,
VPD_GET_VPD_LOCATION = 0x13,

// IPVPD
VPD_IPVPD_TRANSLATE_RECORD = 0x20,
Expand Down Expand Up @@ -85,8 +86,6 @@ enum vpdModuleId
VPD_SPD_GET_MOD_TYPE = 0x6E,
VPD_SPD_FETCH_DATA = 0x6F,

// Centaur FRU VPD

// Runtime VPD
VPD_RT_GET_ADDR = 0x80,
VPD_RT_WRITE_PNOR = 0x81,
Expand All @@ -96,6 +95,12 @@ enum vpdModuleId
VPD_SEND_I2C_LOCK_MSG = 0x85,
VPD_FILL_I2C_LOCK_MSG = 0x86,

// DDIMM VPD
MOD_OCMBPRESENCEDETECT = 0x90,

// Centaur FRU VPD


};

/**
Expand Down Expand Up @@ -149,6 +154,7 @@ enum vpdReasonCode
VPD_RT_NODE_TOO_LARGE = VPD_COMP_ID | 0x3b,
VPD_CANNOT_WRITE_OVERRIDDEN_VPD = VPD_COMP_ID | 0x3c,
VPD_FAILED_TO_RESOLVE_NODE_TARGET = VPD_COMP_ID | 0x3d,
VPD_BAD_REC_NUM = VPD_COMP_ID | 0x3e,
};


Expand Down
6 changes: 4 additions & 2 deletions src/usr/fsi/fsipres.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2011,2017 */
/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
Expand Down Expand Up @@ -256,6 +256,7 @@ errlHndl_t membPresenceDetect(DeviceFW::OperationType i_opType,
* @moduleid FSI::MOD_FSIPRES_MEMBPRESENCEDETECT
* @reasoncode FSI::RC_INVALID_LENGTH
* @userdata1 Data Length
* @userdata2 HUID of target being detected
* @devdesc presenceDetect> Invalid data length (!= 1 bytes)
* @custdesc FSI buffer length is not 1 byte when finding
* a memory buffer chip
Expand All @@ -265,7 +266,8 @@ errlHndl_t membPresenceDetect(DeviceFW::OperationType i_opType,
FSI::MOD_FSIPRES_MEMBPRESENCEDETECT,
FSI::RC_INVALID_LENGTH,
TO_UINT64(io_buflen),
true /*SW error*/);
TARGETING::get_huid(i_target),
ERRORLOG::ErrlEntry::ADD_SW_CALLOUT);
io_buflen = 0;
return l_errl;
}
Expand Down
50 changes: 48 additions & 2 deletions src/usr/hwas/hwasPlat.C
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,41 @@ using namespace TARGETING;
// platReadIDEC function
//******************************************************************************
errlHndl_t platReadIDEC(const TargetHandle_t &i_target)
{
// Call over to the target-specific layer since every chip can have
// unique registers
size_t sz = 0;
errlHndl_t l_errl =
DeviceFW::deviceWrite(i_target,
nullptr,
sz,
DEVICE_IDEC_ADDRESS());

return l_errl;
}

/**
* @brief Read the chipid and EC/DD-level for standard CFAM chips and set
* the attributes.
*
* @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 (bytes, must equal 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 cfamIDEC(DeviceFW::OperationType i_opType,
TARGETING::Target* i_target,
void* io_buffer,
size_t& io_buflen,
int64_t i_accessType,
va_list i_args)
{
// we got a target - read the ID/EC
// and update the appropriate ATTR_ field.
Expand Down Expand Up @@ -181,6 +216,17 @@ errlHndl_t platReadIDEC(const TargetHandle_t &i_target)
return errl;
} // platReadIDEC

// Register the standard CFAM function for IDEC calls for processors
// and memory buffers
DEVICE_REGISTER_ROUTE(DeviceFW::WRITE,
DeviceFW::IDEC,
TARGETING::TYPE_PROC,
cfamIDEC);
DEVICE_REGISTER_ROUTE(DeviceFW::WRITE,
DeviceFW::IDEC,
TARGETING::TYPE_MEMBUF,
cfamIDEC);

//******************************************************************************
// platIsMinHwCheckingAllowed function
// Description: This function will return false always because when Hostboot
Expand Down Expand Up @@ -528,15 +574,15 @@ errlHndl_t platPresenceDetect(TargetHandleList &io_targets)

if (present == true)
{
HWAS_DBG( "pTarget %.8X - detected present",
HWAS_INF( "pTarget %.8X - detected present",
pTarget->getAttr<ATTR_HUID>());

// advance to next entry in the list
pTarget_it++;
}
else
{ // chip not present -- remove from list
HWAS_DBG( "pTarget %.8X - no presence",
HWAS_INF( "pTarget %.8X - no presence",
pTarget->getAttr<ATTR_HUID>());

// erase this target, and 'increment' to next
Expand Down
87 changes: 24 additions & 63 deletions src/usr/targeting/common/xmltohb/target_types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@
<default>OCMB_CHIP</default>
<id>TYPE</id>
</attribute>
<attribute>
<id>VPD_REC_NUM</id>
</attribute>
</targetType>

<!-- Explorer OCMB -->
Expand All @@ -390,6 +393,27 @@
<default>EXPLORER</default>
<id>MODEL</id>
</attribute>
<attribute>
<default>
<field>
<id>reserved</id>
<value>0</value>
</field>
<field>
<id>supportsFsiScom</id>
<value>0</value>
</field>
<field>
<id>supportsInbandScom</id>
<value>0</value>
</field>
<field>
<id>supportsXscom</id>
<value>0</value>
</field>
</default>
<id>PRIMARY_CAPABILITIES</id>
</attribute>
<attribute>
<default>
<field>
Expand Down Expand Up @@ -1593,27 +1617,6 @@
<attribute>
<id>PRD_HWP_PLID</id>
</attribute>
<attribute>
<default>
<field>
<id>reserved</id>
<value>0</value>
</field>
<field>
<id>supportsFsiScom</id>
<value>1</value>
</field>
<field>
<id>supportsInbandScom</id>
<value>0</value>
</field>
<field>
<id>supportsXscom</id>
<value>1</value>
</field>
</default>
<id>PRIMARY_CAPABILITIES</id>
</attribute>
<attribute>
<id>REL_POS</id>
</attribute>
Expand Down Expand Up @@ -1667,27 +1670,6 @@
<attribute>
<id>PARENT_PERVASIVE</id>
</attribute>
<attribute>
<default>
<field>
<id>reserved</id>
<value>0</value>
</field>
<field>
<id>supportsFsiScom</id>
<value>0</value>
</field>
<field>
<id>supportsInbandScom</id>
<value>0</value>
</field>
<field>
<id>supportsXscom</id>
<value>0</value>
</field>
</default>
<id>PRIMARY_CAPABILITIES</id>
</attribute>
<attribute>
<default>CAPP</default>
<id>TYPE</id>
Expand Down Expand Up @@ -2249,27 +2231,6 @@
<default>0x00000031</default>
<id>HWAS_STATE_CHANGED_SUBSCRIPTION_MASK</id>
</attribute>
<attribute>
<default>
<field>
<id>reserved</id>
<value>0</value>
</field>
<field>
<id>supportsFsiScom</id>
<value>0</value>
</field>
<field>
<id>supportsInbandScom</id>
<value>0</value>
</field>
<field>
<id>supportsXscom</id>
<value>0</value>
</field>
</default>
<id>PRIMARY_CAPABILITIES</id>
</attribute>
<attribute>
<default>NX</default>
<id>TYPE</id>
Expand Down

0 comments on commit 552d964

Please sign in to comment.