diff options
author | Andre Marin <aamarin@us.ibm.com> | 2018-11-02 08:33:30 -0500 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2018-11-27 10:14:19 -0600 |
commit | bafdb81a24b53c7c21e66d017face19c1aafdb0d (patch) | |
tree | 9e09a157f6701475ae4770a62fa8b72f3ce07141 /src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_draminit_utils.C | |
parent | 29cd96eae92f2de321a7b9b0cc1fc72625b160fe (diff) | |
download | talos-hostboot-bafdb81a24b53c7c21e66d017face19c1aafdb0d.tar.gz talos-hostboot-bafdb81a24b53c7c21e66d017face19c1aafdb0d.zip |
Add exp_draminit and fix data_structs constants
Change-Id: Ia5391859ff05d1ab777201153a413630516de589
Original-Change-Id: Ic8011ed9b6261ce2849b2c51f79c9533261222bf
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/67837
Reviewed-by: STEPHEN GLANCY <sglancy@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: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69089
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_draminit_utils.C')
-rw-r--r-- | src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_draminit_utils.C | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_draminit_utils.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_draminit_utils.C index e6d39d8a5..3e97ba3b4 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_draminit_utils.C +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_draminit_utils.C @@ -22,3 +22,71 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ +/// +/// @file exp_draminit_utils.C +/// @brief Procedure definition to initialize DRAM +/// +// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com> +// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com> +// *HWP Team: Memory +// *HWP Level: 2 +// *HWP Consumed by: FSP:HB + +#include <generic/memory/lib/utils/c_str.H> +#include <lib/exp_draminit_utils.H> + +namespace mss +{ +namespace exp +{ + +/// +/// @brief host_fw_command_struct structure setup +/// @param[in] i_cmd_data_crc the command data CRC +/// @param[out] o_cmd the command parameters to set +/// +void setup_cmd_params(const uint32_t i_cmd_data_crc, host_fw_command_struct& o_cmd) +{ + // Issue full boot mode cmd though EXP-FW REQ buffer + o_cmd.cmd_id = mss::exp::omi::FW_SPD_DATA_SET; + o_cmd.cmd_flags = 0; + + // TK - Fabricated value need to figure out if we'll be creating req_id tables + o_cmd.request_identifier = 0xBB; + o_cmd.cmd_length = 0; + o_cmd.cmd_crc = i_cmd_data_crc; + o_cmd.host_work_area = 0; + o_cmd.cmd_work_area = 0; + memset(o_cmd.padding, 0, sizeof(o_cmd.padding)); +} + +namespace check +{ + +/// +/// @brief Checks explorer response argument for a successful command +/// @param[in] i_target OCMB target +/// @param[in] i_rsp response command +/// @return FAPI2_RC_SUCCESS iff okay +/// +fapi2::ReturnCode response(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, + const host_fw_response_struct& i_rsp) +{ + // Check if cmd was successful + FAPI_ASSERT(i_rsp.response_argument[0] == omi::response_arg::SUCCESS, + fapi2::MSS_EXP_RSP_ARG_FAILED(). + set_TARGET(i_target). + set_RSP_ID(i_rsp.response_id). + set_ERROR_CODE(i_rsp.response_argument[1]), + "Failed to initialize the PHY for %s", mss::c_str(i_target)); + + return fapi2::FAPI2_RC_SUCCESS; + +fapi_try_exit: + return fapi2::current_err; +} + +}//check + +}// exp +}// mss |