summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Geddes <crgeddes@us.ibm.com>2019-04-22 14:47:37 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2019-04-25 10:11:37 -0500
commitb07aab28c595a738e81c39016246d839e6567c5e (patch)
tree225ae8cfb4b6085966444f68ab04763325f3554e /src
parent3cf1a8dc6cd876d2db861317b62760992594c6d2 (diff)
downloadtalos-hostboot-b07aab28c595a738e81c39016246d839e6567c5e.tar.gz
talos-hostboot-b07aab28c595a738e81c39016246d839e6567c5e.zip
Separate communication data padding from endianess correcting code
In the OCBM inband communication code the func correctMMIOEndianForStruct will flip around some of the struct's bytes to satisfy the endianess changes needed between the OCMB and the P9A processor. This code was also padding out the communication data so it was always an even multiple of 8 bytes. This padding was getting skipped if the attribute was set to skip the endianess correction. To fix this I decided to remove the padding code from the endianess correction code and make a new function that is being called before the correctMMIOEndianForStruct function. Change-Id: I75007697e69d7923ea5f8378524e30f4dc589108 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/76350 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Louis Stermole <stermole@us.ibm.com> Reviewed-by: ANDRE A. MARIN <aamarin@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/76362 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C9
-rw-r--r--src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.H17
2 files changed, 18 insertions, 8 deletions
diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C
index 3c092f84c..9c90bb53f 100644
--- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C
+++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C
@@ -198,6 +198,7 @@ fapi2::ReturnCode user_input_msdg_to_little_endian(const user_input_msdg& i_inpu
o_crc = crc32_gen(o_data);
+ padCommData(o_data);
FAPI_TRY(correctMMIOEndianForStruct(o_data));
fapi_try_exit:
@@ -248,6 +249,7 @@ fapi2::ReturnCode host_fw_command_struct_to_little_endian(const host_fw_command_
l_cmd_header_crc = crc32_gen(o_data);
FAPI_DBG("Command header crc: %xl", l_cmd_header_crc);
FAPI_TRY(forceCrctEndian(l_cmd_header_crc, o_data));
+ padCommData(o_data);
FAPI_TRY(correctMMIOEndianForStruct(o_data));
fapi_try_exit:
@@ -604,11 +606,6 @@ fapi2::ReturnCode correctMMIOEndianForStruct(std::vector<uint8_t>& io_data)
goto fapi_try_exit;
}
- while ((io_data.size() % BUFFER_TRANSACTION_SIZE) != 0)
- {
- io_data.push_back(0);
- }
-
l_loops = io_data.size() / BUFFER_TRANSACTION_SIZE;
for (size_t l_idx = 0; l_idx < l_loops; l_idx++)
@@ -626,8 +623,6 @@ fapi_try_exit:
return fapi2::current_err;
}
-
-
///
/// @brief Forces native data into the correct endianness necessary for Explorer
/// buffer data structures.
diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.H
index 7c88ff45b..1dc6699ad 100644
--- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.H
+++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2018 */
+/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -394,6 +394,21 @@ fapi2::ReturnCode getSensorCache(
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
fapi2::ReturnCode correctMMIOEndianForStruct(std::vector<uint8_t>& io_data);
+/// @brief Ensure data is an even multiple of 8 (BUFFER_TRANSACTION_SIZE).
+/// If (sizeof(buffer) % BUFFER_TRANSACTION_SIZE != 0) ; then pad
+/// buffer with zeros until statement is true.
+///
+/// @param[in,out] io_data Communication data , either CMD or RSP buffer
+///
+/// @return void
+inline void padCommData(std::vector<uint8_t>& io_data)
+{
+ while ((io_data.size() % BUFFER_TRANSACTION_SIZE) != 0)
+ {
+ io_data.push_back(0);
+ }
+}
+
///
/// @brief Forces native data into the correct endianness necessary for Explorer
/// buffer data structures.
OpenPOWER on IntegriCloud