Skip to content

Commit

Permalink
PRD: Centaur maint cmd complete attention
Browse files Browse the repository at this point in the history
Change-Id: I6ee6f96ac149c75371cea179426dc6710d97abe9
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/47087
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/47156
Tested-by: FSP CI Jenkins <fsp-CI-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>
  • Loading branch information
zane131 committed Oct 9, 2017
1 parent 87093b7 commit 782095a
Show file tree
Hide file tree
Showing 6 changed files with 319 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/usr/diag/prdf/common/plat/cen/cen_mba.rule
Expand Up @@ -513,7 +513,7 @@ group gMBASPA filter singlebit
/** MBASPA[0]
* Maintenance command complete
*/
(rMBASPA, bit(0)) ? TBDDefaultCallout;
(rMBASPA, bit(0)) ? maintenance_command_complete; # DD2+ only

/** MBASPA[1]
* Hard NCE ETE
Expand Down Expand Up @@ -553,7 +553,12 @@ group gMBASPA filter singlebit
/** MBASPA[8]
* Maintenance command complete
*/
(rMBASPA, bit(8)) ? TBDDefaultCallout;
# WORKAROUND: HW217608
# For Centaur DD1.0, the hardware team will utilize the WAT logic to look
# for a command complete and trigger this bit. Note that the HW will still
# trigger MBASPA[0], however, that bit should be masked for this
# workaround.
(rMBASPA, bit(8)) ? maintenance_command_complete; # DD1 only

/** MBASPA[9]
* Spare
Expand Down
31 changes: 31 additions & 0 deletions src/usr/diag/prdf/common/plat/cen/cen_mba_actions.rule
@@ -0,0 +1,31 @@
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/usr/diag/prdf/common/plat/cen/cen_mba_actions.rule $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2017
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG

/** Analyze maintenance command complete */
actionclass maintenance_command_complete
{
funccall("MaintCmdComplete");
};

80 changes: 80 additions & 0 deletions src/usr/diag/prdf/common/plat/cen/cen_mba_regs.rule
@@ -0,0 +1,80 @@
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/usr/diag/prdf/common/plat/cen/cen_mba_regs.rule $
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2017
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG

############################################################################
# Maintenance Command Registers
############################################################################

register MBMCT
{
name "MBA Maintenance Command Type Register";
scomaddr 0x0301060A;
capture group default;
capture group MaintCmdRegs;
};

# NOTE: PRD doesn't use MBMCC directly and the bits are cleared by HW so I
# see no reason to add it here.

register MBMSR
{
name "MBA Maintenance Command Status Register";
scomaddr 0x0301060C;
capture group default;
capture group MaintCmdRegs;
};

register MBMACA
{
name "MBA Maintenance Command Start Address Register";
scomaddr 0x0301060D;
capture group default;
capture group MaintCmdRegs;
};

register MBMEA
{
name "MBA Maintenance Command End Address Register";
scomaddr 0x0301060E;
capture group default;
capture group MaintCmdRegs;
};

register MBASCTL
{
name "MBA Memory Scrub/Read Control Register";
scomaddr 0x0301060F;
capture group default;
capture group MaintCmdRegs;
};

register MBAECTL
{
name "MBA Error Control Register";
scomaddr 0x03010610;
capture group default;
capture group MaintCmdRegs;
};

105 changes: 105 additions & 0 deletions src/usr/diag/prdf/plat/mem/prdfCenMba.C
@@ -0,0 +1,105 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/diag/prdf/plat/mem/prdfCenMba.C $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
/* You may obtain a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
/* implied. See the License for the specific language governing */
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */

// Framework includes
#include <iipServiceDataCollector.h>
#include <prdfExtensibleChip.H>
#include <prdfPluginDef.H>
#include <prdfPluginMap.H>

// Platform includes
#include <prdfCenMbaDataBundle.H>

using namespace TARGETING;

namespace PRDF
{

using namespace PlatServices;

namespace cen_mba
{

//##############################################################################
//
// Special plugins
//
//##############################################################################

/**
* @brief Plugin that initializes the data bundle.
* @param i_mbaChip An MBA chip.
* @return SUCCESS
*/
int32_t Initialize( ExtensibleChip * i_mbaChip )
{
i_mbaChip->getDataBundle() = new MbaDataBundle( i_mbaChip );
return SUCCESS;
}
PRDF_PLUGIN_DEFINE( cen_mba, Initialize );

//##############################################################################
//
// MBASPA
//
//##############################################################################

/**
* @brief MBASPA[0,8] - Maintenance Command Complete.
* @param i_mbaChip An MBA chip.
* @param io_sc The step code data struct.
* @return SUCCESS
*/
int32_t MaintCmdComplete( ExtensibleChip * i_mbaChip,
STEP_CODE_DATA_STRUCT & io_sc )
{
#define PRDF_FUNC "[cen_mba::MaintCmdComplete] "

// Tell the TD controller there was a command complete attention.
MbaDataBundle * db = getMbaDataBundle( i_mbaChip );
if ( SUCCESS != db->getTdCtlr()->handleCmdComplete(io_sc) )
{
// Something failed. It is possible the command complete attention has
// not been cleared. Make the rule code do it.
return SUCCESS;
}
else
{
// Everything was successful. Whether we started a new command or told
// MDIA to do it, the command complete bit has already been cleared.
// Don't do it again.
return PRD_NO_CLEAR_FIR_BITS;
}

#undef PRDF_FUNC
}
PRDF_PLUGIN_DEFINE( cen_mba, MaintCmdComplete );

//------------------------------------------------------------------------------

} // end namespace cen_mba

} // end namespace PRDF

95 changes: 95 additions & 0 deletions src/usr/diag/prdf/plat/mem/prdfCenMbaDataBundle.H
@@ -0,0 +1,95 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/diag/prdf/plat/mem/prdfCenMbaDataBundle.H $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
/* You may obtain a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
/* implied. See the License for the specific language governing */
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */

#ifndef __prdfCenMbaDataBundle_H
#define __prdfCenMbaDataBundle_H

// Framework includes
#include <prdfExtensibleChip.H>

// Platform includes
#include <prdfMemTdCtlr.H>
#include <prdfPlatServices.H>

namespace PRDF
{

/** @brief Centaur MBA data bundle. */
class MbaDataBundle : public DataBundle
{
public: // functions

/**
* @brief Constructor.
* @param i_mbaChip The MBA chip.
*/
explicit MbaDataBundle( ExtensibleChip * i_mbaChip ) :
iv_chip(i_mbaChip)
{}

/** @brief Destructor. */
~MbaDataBundle()
{
delete iv_tdCtlr; iv_tdCtlr = nullptr;
}

// Don't allow copy or assignment.
MbaDataBundle( const MbaDataBundle & ) = delete;
const MbaDataBundle & operator=( const MbaDataBundle & ) = delete;

/** @return The Targeted Diagnostics controller. */
MemTdCtlr<TARGETING::TYPE_MBA> * getTdCtlr()
{
if ( nullptr == iv_tdCtlr )
{
iv_tdCtlr = new MemTdCtlr<TARGETING::TYPE_MBA>{iv_chip};
}

return iv_tdCtlr;
}

private: // instance variables

/** The MBA chip associated with this data bundle. */
ExtensibleChip * const iv_chip;

/** The Targeted Diagnostics controller. */
MemTdCtlr<TARGETING::TYPE_MBA> * iv_tdCtlr = nullptr;
};

/**
* @brief Wrapper function for the MbaDataBundle.
* @param i_mbaChip The MBA chip.
* @return This MBA's data bundle.
*/
inline MbaDataBundle * getMbaDataBundle( ExtensibleChip * i_mbaChip )
{
return static_cast<MbaDataBundle *>(i_mbaChip->getDataBundle());
}

} // end namespace PRDF

#endif // __prdfCenMbaDataBundle_H

1 change: 1 addition & 0 deletions src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk
Expand Up @@ -42,6 +42,7 @@ prd_obj += prdfMemScrubUtils.o
prd_obj += prdfMemTdCtlr.o

# plat/mem/ (rule plugin related)
prd_rule_plugin += prdfCenMba.o
prd_rule_plugin += prdfP9Mca.o
prd_rule_plugin += prdfP9Mcbist.o

Expand Down

0 comments on commit 782095a

Please sign in to comment.