summaryrefslogtreecommitdiffstats
path: root/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C
diff options
context:
space:
mode:
authorLouis Stermole <stermole@us.ibm.com>2019-04-30 17:11:53 -0400
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-05-07 14:55:15 -0500
commite28412847eab880521683afc182e3eaceb18a723 (patch)
tree01e4b0b738ce3dd72521aa531d2402800bd0d249 /src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C
parentd0523b75c3908b8f7347b449aff3405225e0a731 (diff)
downloadtalos-hostboot-e28412847eab880521683afc182e3eaceb18a723.tar.gz
talos-hostboot-e28412847eab880521683afc182e3eaceb18a723.zip
Add 32-bit word swap on Explorer inband structures
Due to how the OpenCapi interface breaks up transactions into 32-bit words, we need to swap the first and second 32 bits in a 64-bit transfer Change-Id: Ib32e6006fe607c05423fe18972a424b03f7a07d4 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/76771 Reviewed-by: Mark Pizzutillo <mark.pizzutillo@ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@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/76882 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C')
-rw-r--r--src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C12
1 files changed, 12 insertions, 0 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 4db9ebc12..46a0c04b5 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
@@ -674,6 +674,18 @@ fapi2::ReturnCode correctMMIOEndianForStruct(std::vector<uint8_t>& io_data)
io_data.erase(io_data.begin(), io_data.begin() + BUFFER_TRANSACTION_SIZE);
}
+ // Because of how the OpenCapi interface breaks up the transaction, we also need to swap 32-bit word order
+ for (size_t l_idx = 0; l_idx < io_data.size(); l_idx += BUFFER_TRANSACTION_SIZE)
+ {
+ for (size_t l_bidx = l_idx; l_bidx < l_idx + BUFFER_TRANSACTION_SIZE / 2; l_bidx++)
+ {
+ uint8_t l_temp_first_word = io_data.at(l_bidx);
+ uint8_t l_temp_second_word = io_data.at(l_bidx + BUFFER_TRANSACTION_SIZE / 2);
+ io_data[l_bidx] = l_temp_second_word;
+ io_data[l_bidx + BUFFER_TRANSACTION_SIZE / 2] = l_temp_first_word;
+ }
+ }
+
fapi_try_exit:
FAPI_DBG("Exiting with return code : 0x%08X...", (uint64_t) fapi2::current_err);
return fapi2::current_err;
OpenPOWER on IntegriCloud