From ae8c69b8061732b934f9bbdf43d0cc4fd87c62ff Mon Sep 17 00:00:00 2001 From: Mark Pizzutillo Date: Wed, 4 Sep 2019 00:58:09 -0400 Subject: Zero out command argument field to fix exp_draminit issues Change-Id: If861521ad997d890c82429d8ab71b6b94ce78258 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/83223 Tested-by: FSP CI Jenkins Tested-by: Jenkins Server Dev-Ready: STEPHEN GLANCY Tested-by: Hostboot CI Reviewed-by: Jennifer A Stofer Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/83227 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Nicholas E Bofferding --- .../chips/ocmb/explorer/procedures/hwp/memory/exp_draminit.C | 2 +- .../explorer/procedures/hwp/memory/lib/exp_draminit_utils.C | 12 ++++++++---- .../explorer/procedures/hwp/memory/lib/exp_draminit_utils.H | 6 +++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_draminit.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_draminit.C index 8583c96b6..1f0ae5c9e 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_draminit.C +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_draminit.C @@ -67,7 +67,7 @@ extern "C" // Issue full boot mode cmd though EXP-FW REQ buffer { host_fw_command_struct l_cmd; - mss::exp::setup_cmd_params(l_crc, l_cmd); + mss::exp::setup_cmd_params(l_crc, sizeof(l_phy_params), l_cmd); FAPI_TRY( mss::exp::ib::putCMD(i_target, l_cmd), "Failed putCMD() for %s", mss::c_str(i_target) ); } 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 c77c1c59a..e8e8ddb66 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 @@ -43,21 +43,25 @@ namespace exp /// /// @brief host_fw_command_struct structure setup /// @param[in] i_cmd_data_crc the command data CRC +/// @param[in] i_cmd_length the length of the command present in the data buffer (if any) /// @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) +void setup_cmd_params( + const uint32_t i_cmd_data_crc, + const uint8_t i_cmd_length, + host_fw_command_struct& o_cmd) { + memset(&o_cmd, 0, sizeof(host_fw_command_struct)); // Issue full boot mode cmd though EXP-FW REQ buffer + // Explicit with all of these (including 0 values) to avoid ambiguity o_cmd.cmd_id = mss::exp::omi::EXP_FW_DDR_PHY_INIT; 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_length = i_cmd_length; 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)); } /// diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_draminit_utils.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_draminit_utils.H index e310ee220..ba9602b3b 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_draminit_utils.H +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_draminit_utils.H @@ -148,9 +148,13 @@ enum odt_fields /// /// @brief host_fw_command_struct structure setup /// @param[in] i_cmd_data_crc the command data CRC +/// @param[in] i_cmd_length the length of the command present in the data buffer (if any) /// @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); +void setup_cmd_params( + const uint32_t i_cmd_data_crc, + const uint8_t i_cmd_length, + host_fw_command_struct& o_cmd); /// /// @brief user_input_msdg structure setup -- cgit v1.2.1