Skip to content

Commit

Permalink
P9 SBE EOL Toggle SBE Procedure
Browse files Browse the repository at this point in the history
Change-Id: I3ccf9c6f24e9f5f4c1af83f6fbc44f7ca080c2cc
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48693
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Gary A. Peterson <garyp@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/52414
  • Loading branch information
steffenchris authored and sgupta2m committed Jan 23, 2018
1 parent 9586bfb commit 1186568
Show file tree
Hide file tree
Showing 2 changed files with 153 additions and 0 deletions.
95 changes: 95 additions & 0 deletions src/import/chips/p9/procedures/hwp/io/p9_sbe_io_eol_toggle.C
@@ -0,0 +1,95 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/import/chips/p9/procedures/hwp/io/p9_sbe_io_eol_toggle.C $ */
/* */
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2017,2018 */
/* [+] 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 */
//------------------------------------------------------------------------------
/// @file p9_sbe_io_eol_toggle.H
///
/// @brief Toggles a pervasive bit on a coarse basis to preserve I/O end of life
///------------------------------------------------------------------------------
/// *HWP HW Owner : Chris Steffen <cwsteffen@us.ibm.com>
/// *HWP HW Backup Owner : Gary Peterson <garyp@us.ibm.com>
/// *HWP FW Owner : Jamie Knight <rjknight@us.ibm.com>
/// *HWP Team : IO
/// *HWP Level : 3
/// *HWP Consumed by : SBE
///------------------------------------------------------------------------------

#include "p9_sbe_io_eol_toggle.H"
#include "p9_perv_scom_addresses.H"

fapi2::ReturnCode run_p9_cplt_conf0_eol_toggle(const fapi2::Target<fapi2::TARGET_TYPE_PERV>& i_target_cplt)
{
FAPI_INF("run_p9_sbe_io_eol_toggle: Entering ...");
fapi2::buffer<uint64_t> l_data64;

FAPI_TRY(fapi2::getScom(i_target_cplt, PERV_CPLT_CONF0, l_data64));

if(l_data64.getBit<45>())
{
l_data64.clearBit<45>();
}
else
{
l_data64.setBit<45>();
}

FAPI_TRY(fapi2::putScom(i_target_cplt, PERV_CPLT_CONF0, l_data64));

fapi_try_exit:
FAPI_INF("run_p9_sbe_io_eol_toggle: Exiting ...");
return fapi2::current_err;
}

fapi2::ReturnCode p9_sbe_io_eol_toggle(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target_chip)
{
FAPI_INF("p9_sbe_io_eol_toggle: Entering ...");

// Xbus Targets
for(auto& l_target_cplt : i_target_chip.getChildren<fapi2::TARGET_TYPE_PERV>
(fapi2::TARGET_FILTER_XBUS, fapi2::TARGET_STATE_FUNCTIONAL))
{
FAPI_INF("Calling run_p9_cplt_conf0_eol_toggle on xbus unit.");
FAPI_TRY(run_p9_cplt_conf0_eol_toggle(l_target_cplt));
}

// Obus Targets
for(auto& l_target_cplt : i_target_chip.getChildren<fapi2::TARGET_TYPE_PERV>
(fapi2::TARGET_FILTER_ALL_OBUS, fapi2::TARGET_STATE_FUNCTIONAL))
{
FAPI_INF("Calling run_p9_cplt_conf0_eol_toggle on obus unit.");
FAPI_TRY(run_p9_cplt_conf0_eol_toggle(l_target_cplt));
}

// MC Targets
for(auto& l_target_cplt : i_target_chip.getChildren<fapi2::TARGET_TYPE_PERV>
(fapi2::TARGET_FILTER_ALL_MC, fapi2::TARGET_STATE_FUNCTIONAL))
{
FAPI_INF("Calling run_p9_cplt_conf0_eol_toggle on mc unit.");
FAPI_TRY(run_p9_cplt_conf0_eol_toggle(l_target_cplt));
}

fapi_try_exit:
FAPI_INF("p9_sbe_io_eol_toggle: Exiting ...");
return fapi2::current_err;
}
58 changes: 58 additions & 0 deletions src/import/chips/p9/procedures/hwp/io/p9_sbe_io_eol_toggle.H
@@ -0,0 +1,58 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/import/chips/p9/procedures/hwp/io/p9_sbe_io_eol_toggle.H $ */
/* */
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2017,2018 */
/* [+] 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 */
//------------------------------------------------------------------------------
/// @file p9_sbe_io_eol_toggle.H
///
/// @brief Toggles a pervasive bit on a coarse basis to preserve I/O end of life
///------------------------------------------------------------------------------
/// *HWP HW Owner : Chris Steffen <cwsteffen@us.ibm.com>
/// *HWP HW Backup Owner : Gary Peterson <garyp@us.ibm.com>
/// *HWP FW Owner : Jamie Knight <rjknight@us.ibm.com>
/// *HWP Team : IO
/// *HWP Level : 3
/// *HWP Consumed by : SBE
///------------------------------------------------------------------------------


#ifndef _P9_SBE_IO_EOL_TOGGLE_H_
#define _P9_SBE_IO_EOL_TOGGLE_H_


#include <fapi2.H>


typedef fapi2::ReturnCode (*p9_sbe_io_eol_toggle_FP_t)(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>&);

/// @brief Toggles a pervasive bit on a coarse basis to preserve I/O end of life
///
///
/// @param[in] i_target_chiplet Reference to TARGET_TYPE_PROC_CHIP target
/// @return FAPI2_RC_SUCCESS if success, else error code.
extern "C"
{
fapi2::ReturnCode p9_sbe_io_eol_toggle(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target);
}

#endif

0 comments on commit 1186568

Please sign in to comment.