diff options
author | Matt Derksen <v2cibmd@us.ibm.com> | 2016-04-07 14:51:26 -0500 |
---|---|---|
committer | Stephen Cprek <smcprek@us.ibm.com> | 2016-04-21 13:51:57 -0500 |
commit | 6d2b7d0c32bf12e354be90f0d2cd58572c88d67f (patch) | |
tree | a1e990a98ff64a8deacb8a8149aaa49262a371ed /src/include | |
parent | 1709ac31da9777ddff1c1b08b44d6482dba376d0 (diff) | |
download | talos-hostboot-6d2b7d0c32bf12e354be90f0d2cd58572c88d67f.tar.gz talos-hostboot-6d2b7d0c32bf12e354be90f0d2cd58572c88d67f.zip |
Added platform implementations of fapi2 ring access functions.
fapi2::getRing(), fapi2::modifyRing() and fapi2::putRing().
Change-Id: I50fee8d2b04496e7ae7f0966dabdc53b5524a454
RTC:126630
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/23207
Tested-by: Jenkins Server
Tested-by: FSP CI Jenkins
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/usr/fapi2/plat_hw_access.H | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/src/include/usr/fapi2/plat_hw_access.H b/src/include/usr/fapi2/plat_hw_access.H index d5e76e55c..f4c669fa8 100644 --- a/src/include/usr/fapi2/plat_hw_access.H +++ b/src/include/usr/fapi2/plat_hw_access.H @@ -41,6 +41,7 @@ #include <target.H> #include <target_types.H> #include <hw_access_def.H> +#include <p9_ringId.H> namespace fapi2 { @@ -103,7 +104,6 @@ ReturnCode platGetCfamRegister(const Target<TARGET_TYPE_ALL>& i_target, /// /// @brief Platform-level implementation called by putCfamRegister() /// Hardware procedures writers will not call this function. -/// @Tparam K template parameter, passed in target. /// @param[in] i_target HW target to operate on. /// @param[in] i_address CFAM address to write to. /// @param[out] i_data 32-bit buffer that holds data to write into address. @@ -117,7 +117,6 @@ ReturnCode platPutCfamRegister(const Target<TARGET_TYPE_ALL>& i_target, /// /// @brief Platform-level implementation of modifyCfamRegister() /// Hardware procedures writers will not call this function. -/// @Tparam K template parameter, passed in target. /// @param[in] i_target HW target to operate on. /// @param[in] i_address CFAM register address to modify. /// @param[out] i_data 32-bit buffer that holds data to modify. @@ -129,25 +128,20 @@ ReturnCode platModifyCfamRegister(const Target<TARGET_TYPE_ALL>& i_target, const buffer<uint32_t> i_data, const fapi2::ChipOpModifyMode i_modifyMode); -//@TODO RTC:126630 getRing is not yet supported -#if 0 /// @brief Reads a ring from a chip. -/// @tparam K template parameter, passed in target. /// @param[in] i_target Target to operate on. /// @param[in] i_address Ring address to read from. /// @param[out] o_data Buffer that holds data read from HW target. /// @param[in] i_ringMode Ring operation mode. /// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. -template< TargetType K > -inline ReturnCode getRing(const Target<K>& i_target, - const scanRingId_t i_address, - variable_buffer& o_data, - const RingMode i_ringMode = 0); +ReturnCode platGetRing(const Target<TARGET_TYPE_ALL>& i_target, + const scanRingId_t i_address, + variable_buffer& o_data, + const RingMode i_ringMode); /// @brief Read-modify-write a ring on a chip. -/// @tparam K template parameter, passed in target. /// @param[in] i_target Target to operate on. /// @param[in] i_address Ring address to modify. /// @param[in] i_data Buffer that contains RS4 compressed ring data @@ -155,14 +149,34 @@ inline ReturnCode getRing(const Target<K>& i_target, /// @param[in] i_modifyMode The modify mode (or/and/xor) /// @param[in] i_ringMode Ring operation mode. /// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. -template< TargetType K > -inline ReturnCode modifyRing(const Target<K>& i_target, +ReturnCode platModifyRing(const Target<TARGET_TYPE_ALL>& i_target, const scanRingId_t i_address, const variable_buffer& i_data, const ChipOpModifyMode i_modifyMode, - const RingMode i_ringMode = 0); + const RingMode i_ringMode); + -#endif // End if 0 +// This will be used in future Cumulus code +/// @brief Write a ring on a chip. +/// @param[in] i_target Target to operate on. +/// @param[in] i_address Ring address to modify. +/// @param[in] i_data Buffer that contains RS4 compressed ring data +/// to be written +/// @param[in] i_ringMode Ring operation mode. +/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. +ReturnCode platPutRing(const Target<TARGET_TYPE_ALL>& i_target, + const scanRingId_t i_address, + variable_buffer& i_data, + const RingMode i_ringMode); + +/// @brief Writes a ring to a chip. +/// @param[in] i_target Target to operate on. +/// @param[in] i_ringID Ring ID that will identify the Ring in the image. +/// @param[in] i_ringMode Ring operation mode. +/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. +ReturnCode platPutRing(const Target<TARGET_TYPE_ALL>& i_target, + const RingID i_ringID, + const RingMode i_ringMode); // -------------------------------------------------------------------------- // NOTE: |