diff options
author | Greg Still <stillgs@us.ibm.com> | 2015-10-13 20:54:36 -0500 |
---|---|---|
committer | Martin Peschke <mpeschke@de.ibm.com> | 2015-10-21 07:20:47 -0500 |
commit | 82fc55596dd107514bc3dea1b8be3c23b653c76a (patch) | |
tree | 7375f72411c9ff16775d145ce7ea727fbde46806 /sbe/hwpf/include/plat | |
parent | 43aaa85b59ba06dce6e0f7063234235384e31135 (diff) | |
download | talos-sbe-82fc55596dd107514bc3dea1b8be3c23b653c76a.tar.gz talos-sbe-82fc55596dd107514bc3dea1b8be3c23b653c76a.zip |
Rearrange PPE FAPI2 directory structure to be more in-line with HWPF
- Move files into new structure
- Delete old, obsolete files and directories
- Pre-import mirror of HWPF into importtemp
- No additional function
Change-Id: Iadad6eb05349f807acea362ec77d7f58273878b5
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/21150
Tested-by: Jenkins Server
Reviewed-by: Santosh S. Puranik <santosh.puranik@in.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: Martin Peschke <mpeschke@de.ibm.com>
Diffstat (limited to 'sbe/hwpf/include/plat')
-rw-r--r-- | sbe/hwpf/include/plat/plat_error_scope.H | 71 | ||||
-rw-r--r-- | sbe/hwpf/include/plat/plat_hw_access.H | 70 |
2 files changed, 141 insertions, 0 deletions
diff --git a/sbe/hwpf/include/plat/plat_error_scope.H b/sbe/hwpf/include/plat/plat_error_scope.H new file mode 100644 index 00000000..b6ac62e4 --- /dev/null +++ b/sbe/hwpf/include/plat/plat_error_scope.H @@ -0,0 +1,71 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +/** + * @file plat_error_scope.H + * @brief platform definitions which create a scope for automatic error handling + */ + +#ifndef __FAPI2_PLAT_ERROR_SCOPE__ +#define __FAPI2_PLAT_ERROR_SCOPE__ + +/// @cond +#define PLAT_FAPI_TRY_NO_TRACE( __operation__ ) \ + if ((fapi2::current_err = (__operation__)) != fapi2::FAPI2_RC_SUCCESS) \ + { \ + goto fapi_try_exit; \ + } + +#define PLAT_FAPI_TRY_TRACE( __operation__, ... ) \ + if ((fapi2::current_err = (__operation__)) != fapi2::FAPI2_RC_SUCCESS) \ + { \ + FAPI_ERR(__VA_ARGS__); \ + goto fapi_try_exit; \ + } + +/// +/// @brief Assert a conditional is true. +/// If it is not, the FFDC gathering function is called and the +/// trace is output as a FAPI error trace. +/// @param[in] __conditional__ the condition to assert +/// @param[in] __ffdc__ the FFDC gathering function +/// @param[in] ... varargs, as input to FAPI_ERR +/// +#define PLAT_FAPI_ASSERT( __conditional__, __ffdc__, ... ) \ + if (! (__conditional__)) \ + { \ + (__ffdc__).execute(); \ + FAPI_ERR(__VA_ARGS__); \ + goto fapi_try_exit; \ + } + + +/// +/// @brief Temporary macro for error label until all are removed. +/// @todo REMOVE this in time. +#define FAPI_CLEANUP() \ +fapi_try_exit: +/// @endcond + +#endif diff --git a/sbe/hwpf/include/plat/plat_hw_access.H b/sbe/hwpf/include/plat/plat_hw_access.H new file mode 100644 index 00000000..765837fd --- /dev/null +++ b/sbe/hwpf/include/plat/plat_hw_access.H @@ -0,0 +1,70 @@ +/** + * @file plat_hw_access.H + * + * @brief Define platform specific calls for hardware accesses. + */ + +#ifndef PLATHWACCESS_H_ +#define PLATHWACCESS_H_ + +#include <plat_includes.H> + +/// PIB Error Mask + +#define PLAT_SET_PIB_ERROR_MASK(_m_mask) \ + { /* Read MSR */ \ + uint32_t msr_data = mfmsr(); \ + /* Set SEM field */ \ + msr_data &= ~(BITS(0,8)); \ + msr_data |= (uint32_t)(i_mask << 24); \ + /* Write MSR */ \ + mtmsr(msr_data); \ + }; + +#define PLAT_GET_PIB_ERROR_MASK(_m_mask) \ + uint8_t _m_mask; \ + uint32_t _sem = mfmsr(); \ + _m_mask = (uint8_t)((_sem & MSR_SEM) >> (32-(MSR_SEM_START_BIT + MSR_SEM_LEN))); + +// Building block PPE instructions +#define PPE_MFMSR(_m_data) \ +asm volatile \ + ( \ + "mfmsr %[data] \n" \ + : [data]"=&r"(*_m_data) \ + : "[data]"(*_m_data) \ + ); + +#define PPE_MTMSR(_m_data) \ +asm volatile \ + ( \ + "mtmsr %[data] \n" \ + : [data]"=&r"(*_m_data) \ + : "[data]"(*_m_data) \ + ); + +/// GetScom +#define PLAT_GETSCOM(_m_rc, _m_base, _m_offset, _m_data) \ + _m_rc = getscom(_m_base.getAddressOverlay(), (0 == _m_base.getAddressOverlay())?_m_offset:(uint32_t)(_m_offset & BITS(40,24)), _m_data); + +/// PutScom +#define PLAT_PUTSCOM(_m_rc, _m_base, _m_offset, _m_data) \ + _m_rc = putscom(_m_base.getAddressOverlay(), (0 == _m_base.getAddressOverlay())?_m_offset:(uint32_t)(_m_offset & BITS(40,24)), _m_data); + +/// GetCFAM +#define PLAT_GETCFAM(_m_base, _m_offset, _m_data) \ + static_assert( K == TARGET_TYPE_NONE, \ + "getCfamRegister is not supported by PPE platforms") + +/// PutCFAM +#define PLAT_PUTCFAM(_m_base, _m_offset, _m_data) \ + static_assert( K == TARGET_TYPE_NONE, \ + "putCfamRegister is not supported by PPE platforms") + +/// ModifyCFAM +#define PLAT_MODCFAM(_m_base, _m_offset, _m_data, _m_mode) \ + static_assert( K == TARGET_TYPE_NONE, \ + "modifyCfamRegister is not supported by PPE platforms") + +#endif // PLATHWACCESS_H_ + |