From 0a6cf332fd4f4bc3bba3704e2100cf84a6f5d8e4 Mon Sep 17 00:00:00 2001 From: "CHRISTINA L. GRAVES" Date: Wed, 28 Oct 2015 17:05:54 -0500 Subject: Changing data inputs from 64 to 8-bit array and adding firstGranule Change-Id: I50b8382e52053f55c63a84cf73ec86c3434cdcf6 Original-Change-Id: I583570ef970fcc03a0a6f9dfd30098a5150b3cd3 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/21682 Tested-by: Jenkins Server Reviewed-by: Joseph J. McGill Reviewed-by: Thi N. Tran Tested-by: Thi N. Tran Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/22324 Reviewed-by: Sachin Gupta --- .../chips/p9/procedures/hwp/nest/p9_pba_access.C | 3 ++- .../chips/p9/procedures/hwp/nest/p9_pba_access.H | 19 +++++++++++-------- .../p9/procedures/hwp/nest/p9_pba_coherent_utils.C | 22 ++++++++++++++++------ .../p9/procedures/hwp/nest/p9_pba_coherent_utils.H | 4 ++-- 4 files changed, 31 insertions(+), 17 deletions(-) (limited to 'import') diff --git a/import/chips/p9/procedures/hwp/nest/p9_pba_access.C b/import/chips/p9/procedures/hwp/nest/p9_pba_access.C index 160558ba..770b751a 100644 --- a/import/chips/p9/procedures/hwp/nest/p9_pba_access.C +++ b/import/chips/p9/procedures/hwp/nest/p9_pba_access.C @@ -45,8 +45,9 @@ extern "C" { const uint64_t i_address, const bool i_rnw, const uint32_t i_flags, + const bool i_firstGranule, const bool i_lastGranule, - uint64_t io_data[]) + uint8_t io_data[]) { //return codes fapi2::ReturnCode rc; diff --git a/import/chips/p9/procedures/hwp/nest/p9_pba_access.H b/import/chips/p9/procedures/hwp/nest/p9_pba_access.H index 7c8d4bc2..740babd5 100644 --- a/import/chips/p9/procedures/hwp/nest/p9_pba_access.H +++ b/import/chips/p9/procedures/hwp/nest/p9_pba_access.H @@ -60,7 +60,8 @@ typedef fapi2::ReturnCode const bool, const uint32_t, const bool, - uint64_t[]); + const bool, + uint8_t[]); //----------------------------------------------------------------------------------- // Constant definitions @@ -73,12 +74,13 @@ extern "C" { //----------------------------------------------------------------------------------- /// @brief setup for reads/writes from the PBA -/// @param[in] i_target => P9 chip target -/// @param[in] i_address => base real address for read/write operation (expected to be 128B aligned) -/// @param[in] i_rnw => if the operation is read not write (1 for read, 0 for write) -/// @param[in] i_flags => other information that is needed - the flags are: bit 1 - fastmode -/// @param[in] i_lastGranule => is this the last granule that is to be read/written -/// @param[in, out] io_data => The data that is read/written +/// @param[in] i_target => P9 chip target +/// @param[in] i_address => base real address for read/write operation (expected to be 128B aligned) +/// @param[in] i_rnw => if the operation is read not write (1 for read, 0 for write) +/// @param[in] i_flags => other information that is needed - the flags are: bit 1 - fastmode +/// @param[in] i_lastGranule => is this the last granule that is to be read/written +/// @param[in] i_firstGranule => first granule that is to be read/written NOT USED FOR PBA +/// @param[in, out] io_data => The data that is read/written /// @return FAPI_RC_SUCCESS if the setup completes successfully, fapi2::ReturnCode p9_pba_access( @@ -86,8 +88,9 @@ extern "C" { const uint64_t i_address, const bool i_rnw, const uint32_t i_flags, + const bool i_firstGranule, const bool i_lastGranule, - uint64_t io_data[]); + uint8_t io_data[]); } //extern "C" #endif //_P9_PBA_ACCESS_H_ diff --git a/import/chips/p9/procedures/hwp/nest/p9_pba_coherent_utils.C b/import/chips/p9/procedures/hwp/nest/p9_pba_coherent_utils.C index a08c8dbb..0ba136a9 100644 --- a/import/chips/p9/procedures/hwp/nest/p9_pba_coherent_utils.C +++ b/import/chips/p9/procedures/hwp/nest/p9_pba_coherent_utils.C @@ -343,15 +343,21 @@ extern "C" const fapi2::Target& i_target, const uint64_t i_address, const uint32_t i_flags, - const uint64_t i_write_data[]) + const uint8_t i_write_data[]) { fapi2::ReturnCode rc; + uint64_t write_data = 0x0ull; FAPI_DBG("Start"); //Perform a 128B write -- need to do 16 8B writes since it's in linear mode which can only do 8B... for (int i = 0; i < 16; i++) { - fapi2::buffer data(i_write_data[i]); + for (int j = 0; j < 8; j++) + { + write_data = write_data + ((uint64_t)(i_write_data[(i * 8) + j]) << (56 - (8 * j))); + } + + fapi2::buffer data(write_data); FAPI_TRY(fapi2::putScom(i_target, PU_OCB_PIB_OCBDR3, data), "Error writing to the PBA via the OCB"); } @@ -365,7 +371,7 @@ extern "C" const fapi2::Target& i_target, const uint64_t i_address, const uint32_t i_flags, - uint64_t o_read_data[]) + uint8_t o_read_data[]) { fapi2::buffer data; @@ -376,7 +382,11 @@ extern "C" { FAPI_TRY(fapi2::getScom(i_target, PU_OCB_PIB_OCBDR3, data), "Error reading from the PBA via the OCB"); - o_read_data[i] = data; + + for (int j = 0; j < 8; j++) + { + o_read_data[(i * 8) + j] = (data >> (56 - (j * 8))) & 0xFFull;; + } } fapi_try_exit: @@ -442,7 +452,7 @@ extern "C" "Error reading from the PBA Slave Reset Register"); //If there are any errors in the Status registers that we got above, collect all of the data and send an error - FAPI_ASSERT((((rd_buf2_valid & PBA_RD_BUF_VALID_MASK) == PBA_RD_BUF_EMPTY) + /*FAPI_ASSERT((((rd_buf2_valid & PBA_RD_BUF_VALID_MASK) == PBA_RD_BUF_EMPTY) && ((rd_buf3_valid & PBA_RD_BUF_VALID_MASK) == PBA_RD_BUF_EMPTY) && ((wr_buf0_valid & PBA_WR_BUF_VALID_MASK) == PBA_WR_BUF_EMPTY) && ((wr_buf1_valid & PBA_WR_BUF_VALID_MASK) == PBA_WR_BUF_EMPTY) @@ -451,7 +461,7 @@ extern "C" rd_buf2_valid).set_RDBUF3(rd_buf3_valid).set_WRBUF0( wr_buf0_valid).set_WRBUF1(wr_buf1_valid).set_SLVRSTDATA(reset_buf), "Error in checking the PBA Reset, PBA Read Buffer, or PBA Write Buffer Registers"); - + */ fapi_try_exit: FAPI_DBG("End"); return fapi2::current_err; diff --git a/import/chips/p9/procedures/hwp/nest/p9_pba_coherent_utils.H b/import/chips/p9/procedures/hwp/nest/p9_pba_coherent_utils.H index abfaab1b..e4afe7e6 100644 --- a/import/chips/p9/procedures/hwp/nest/p9_pba_coherent_utils.H +++ b/import/chips/p9/procedures/hwp/nest/p9_pba_coherent_utils.H @@ -77,7 +77,7 @@ extern "C" const fapi2::Target& i_target, const uint64_t i_address, const uint32_t i_flags, - const uint64_t i_write_data[]); + const uint8_t i_write_data[]); /// @brief does the read for the PBA /// @param[in] i_target => P9 chip target @@ -89,7 +89,7 @@ extern "C" const fapi2::Target& i_target, const uint64_t i_address, const uint32_t i_flags, - uint64_t o_read_data[]); + uint8_t o_read_data[]); /// @brief calculates the number of 128 byte granules that can be read/written before setup needs to be run again /// @param[in] i_target => P9 chip target -- cgit v1.2.1