Skip to content

Commit

Permalink
Update exp_draminit to read values from attributes
Browse files Browse the repository at this point in the history
Change-Id: Ie2e72c0bff21c3a27a37708b3bd06a940a2c29e9
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69194
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: ANDRE A. MARIN <aamarin@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69982
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
shamanj4 authored and dcrowell77 committed Mar 7, 2019
1 parent e7f0582 commit bdaa5b1
Show file tree
Hide file tree
Showing 12 changed files with 2,405 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <exp_inband.H>
#include <generic/memory/lib/utils/c_str.H>
#include <lib/exp_draminit_utils.H>
#include <lib/shared/exp_consts.H>

///
/// @brief Initializes DRAM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,90 @@ void setup_cmd_params(const uint32_t i_cmd_data_crc, host_fw_command_struct& o_c
memset(o_cmd.padding, 0, sizeof(o_cmd.padding));
}

///
/// @brief user_input_msdg structure setup
/// @tparam T the fapi2 TargetType
/// @param[in] i_target the fapi2 target
/// @param[out] o_phy_params the phy params data struct
/// @return FAPI2_RC_SUCCESS iff okay
///
fapi2::ReturnCode setup_phy_params(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
user_input_msdg& o_phy_params)
{
for (const auto l_port : mss::find_targets<fapi2::TARGET_TYPE_MEM_PORT>(i_target))
{
fapi2::ReturnCode l_rc;

// Create an object
auto l_set_phy_params = phy_params(l_port, l_rc);
FAPI_TRY(l_rc, "Unable to set parameters for target %s", mss::c_str(i_target));

// Set the params by fetching them from the attributes
FAPI_TRY(l_set_phy_params.setup_DimmType(l_port, o_phy_params));
FAPI_TRY(l_set_phy_params.setup_CsPresent(l_port, o_phy_params));
FAPI_TRY(l_set_phy_params.setup_DramDataWidth(l_port, o_phy_params));
FAPI_TRY(l_set_phy_params.setup_Height3DS(l_port, o_phy_params));
FAPI_TRY(l_set_phy_params.set_ActiveDBYTE(o_phy_params));
FAPI_TRY(l_set_phy_params.set_ActiveNibble(o_phy_params));
FAPI_TRY(l_set_phy_params.set_AddrMirror(o_phy_params));
FAPI_TRY(l_set_phy_params.set_ColumnAddrWidth(o_phy_params));
FAPI_TRY(l_set_phy_params.set_RowAddrWidth(o_phy_params));
FAPI_TRY(l_set_phy_params.set_SpdCLSupported(o_phy_params));
FAPI_TRY(l_set_phy_params.set_SpdtAAmin(o_phy_params));
FAPI_TRY(l_set_phy_params.set_Rank4Mode(o_phy_params));
FAPI_TRY(l_set_phy_params.set_DDPCompatible(o_phy_params));
FAPI_TRY(l_set_phy_params.set_TSV8HSupport(o_phy_params));
FAPI_TRY(l_set_phy_params.set_MRAMSupport(o_phy_params));
FAPI_TRY(l_set_phy_params.set_NumPStates(o_phy_params));
FAPI_TRY(l_set_phy_params.set_Frequency(o_phy_params));
FAPI_TRY(l_set_phy_params.set_PhyOdtImpedance(o_phy_params));
FAPI_TRY(l_set_phy_params.set_PhyDrvImpedancePU(o_phy_params));
FAPI_TRY(l_set_phy_params.set_PhyDrvImpedancePD(o_phy_params));
FAPI_TRY(l_set_phy_params.set_PhySlewRate(o_phy_params));
FAPI_TRY(l_set_phy_params.set_ATxImpedance(o_phy_params));
FAPI_TRY(l_set_phy_params.set_ATxSlewRate(o_phy_params));
FAPI_TRY(l_set_phy_params.set_CKTxImpedance(o_phy_params));
FAPI_TRY(l_set_phy_params.set_CKTxSlewRate(o_phy_params));
FAPI_TRY(l_set_phy_params.set_AlertOdtImpedance(o_phy_params));

// TK to use the rank API once it's available
// For now we are assuming ranks 2 and 3 are on DIMM1 for RttNom, RttWr and RttPark
FAPI_TRY(l_set_phy_params.set_RttNom(o_phy_params));
FAPI_TRY(l_set_phy_params.set_RttWr(o_phy_params));
FAPI_TRY(l_set_phy_params.set_RttPark(o_phy_params));

FAPI_TRY(l_set_phy_params.set_DramDic(o_phy_params));
FAPI_TRY(l_set_phy_params.set_DramWritePreamble(o_phy_params));
FAPI_TRY(l_set_phy_params.set_DramReadPreamble(o_phy_params));
FAPI_TRY(l_set_phy_params.set_PhyEqualization(o_phy_params));
FAPI_TRY(l_set_phy_params.set_InitVrefDQ(o_phy_params));
FAPI_TRY(l_set_phy_params.set_InitPhyVref(o_phy_params));
FAPI_TRY(l_set_phy_params.set_OdtWrMapCs(o_phy_params));
FAPI_TRY(l_set_phy_params.set_OdtRdMapCs(o_phy_params));
FAPI_TRY(l_set_phy_params.set_Geardown(o_phy_params));

// TK need to check if this also includes RC0E
FAPI_TRY(l_set_phy_params.set_CALatencyAdder(o_phy_params));

FAPI_TRY(l_set_phy_params.set_BistCALMode(o_phy_params));
FAPI_TRY(l_set_phy_params.set_BistCAParityLatency(o_phy_params));
FAPI_TRY(l_set_phy_params.set_RcdDic(o_phy_params));
FAPI_TRY(l_set_phy_params.set_RcdVoltageCtrl(o_phy_params));

// TK check bit ordering here for RcdIBTCtrl and RcdDBDic
FAPI_TRY(l_set_phy_params.set_RcdIBTCtrl(o_phy_params));
FAPI_TRY(l_set_phy_params.set_RcdDBDic(o_phy_params));

FAPI_TRY(l_set_phy_params.set_RcdSlewRate(o_phy_params));
FAPI_TRY(l_set_phy_params.set_EmulationSupport(o_phy_params));
}

return fapi2::FAPI2_RC_SUCCESS;

fapi_try_exit:
return fapi2::current_err;
}

namespace check
{

Expand Down

0 comments on commit bdaa5b1

Please sign in to comment.