Skip to content

Commit

Permalink
FAPI2: Multicast API 1/2: Platform-breaking changes
Browse files Browse the repository at this point in the history
The Target gains a new template parameter, M, that specifies
the multicast type. This is propagated through all affected
header files.

A new target type is introduced, TARGET_TYPE_MULTICAST, and
platform specific assertions put in place to prevent users
from creating such targets before the platform supports it.

Target also grows a new inline function for updating MC targets.
Platforms not supporting MC can provide a dummy implementation.

The example platform code in fapi2/include/plat/plat_target.H
is updated with minimal example code for platform implementers.

Change-Id: Ia0990f26890dc5c719caca608cd134a4964a3acf
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69456
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matt K. Light <mklight@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/70866
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
  • Loading branch information
fenkes-ibm authored and sgupta2m committed Feb 14, 2019
1 parent 6eb2a4c commit b9b668e
Show file tree
Hide file tree
Showing 14 changed files with 268 additions and 485 deletions.
78 changes: 39 additions & 39 deletions src/hwpf/hw_access.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -105,9 +105,9 @@ namespace fapi2
/// @param[in] i_address SCOM register address to read from.
/// @param[out] o_data Buffer that holds data read from HW target.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
template< TargetType K, typename V >
template< TargetType K, MulticastType M, typename V >
__attribute__((always_inline))
inline ReturnCode getScom(const Target<K, V>& i_target, const uint64_t i_address,
inline ReturnCode getScom(const Target<K, M, V>& i_target, const uint64_t i_address,
buffer<uint64_t>& o_data)
{
fapi2::ReturnCode l_rc;
Expand All @@ -125,9 +125,9 @@ namespace fapi2
/// @param[in] i_address SCOM register address to write to.
/// @param[in] i_data Buffer that holds data to write into address.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
template< TargetType K, typename V >
template< TargetType K, MulticastType M, typename V >
__attribute__((always_inline))
inline ReturnCode putScom(const Target<K, V>& i_target, const uint64_t i_address,
inline ReturnCode putScom(const Target<K, M, V>& i_target, const uint64_t i_address,
const buffer<uint64_t> i_data)
{
fapi2::ReturnCode l_rc;
Expand All @@ -146,8 +146,8 @@ namespace fapi2
/// @param[in] i_data Buffer that holds data to be modified.
/// @param[in] i_modifyMode The modify mode (or/and/xor).
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
template< TargetType K, typename V >
inline ReturnCode modifyScom(const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
inline ReturnCode modifyScom(const Target<K, M, V>& i_target,
const uint64_t i_address,
const buffer<uint64_t> i_data,
const ChipOpModifyMode i_modifyMode)
Expand Down Expand Up @@ -196,8 +196,8 @@ __fapi2exit__:
/// @param[in] i_data Buffer that holds data to write into address.
/// @param[in] i_mask Buffer that holds the mask value.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
template< TargetType K, typename V >
inline ReturnCode putScomUnderMask( const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
inline ReturnCode putScomUnderMask( const Target<K, M, V>& i_target,
const uint64_t i_address,
const buffer<uint64_t> i_data,
const buffer<uint64_t> i_mask)
Expand All @@ -214,8 +214,8 @@ __fapi2exit__:
/// @param[in] i_address CFAM register address to read from.
/// @param[out] o_data Buffer that holds data read from HW target.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
template< TargetType K, typename V >
inline ReturnCode getCfamRegister(const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
inline ReturnCode getCfamRegister(const Target<K, M, V>& i_target,
const uint32_t i_address,
buffer<uint32_t>& o_data)
{
Expand All @@ -234,8 +234,8 @@ __fapi2exit__:
/// @param[in] i_address CFAM register address to write to.
/// @param[in] i_data Buffer that holds data to write into address.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
template< TargetType K, typename V >
inline ReturnCode putCfamRegister(const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
inline ReturnCode putCfamRegister(const Target<K, M, V>& i_target,
const uint32_t i_address,
buffer<uint32_t>& i_data)
{
Expand All @@ -255,8 +255,8 @@ __fapi2exit__:
/// @param[in] i_data Buffer that holds data to be modified.
/// @param[in] i_modifyMode The modify mode (or/and/xor).
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
template< TargetType K, typename V >
inline ReturnCode modifyCfamRegister(const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
inline ReturnCode modifyCfamRegister(const Target<K, M, V>& i_target,
const uint32_t i_address,
const buffer<uint32_t>& i_data,
const ChipOpModifyMode i_modifyMode)
Expand All @@ -277,8 +277,8 @@ __fapi2exit__:
/// @param[in] i_ringID Ring ID that will identify the Ring in the image.
/// @param[in] i_ringMode Ring operation mode.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
template< TargetType K, typename V >
inline ReturnCode putRing(const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
inline ReturnCode putRing(const Target<K, M, V>& i_target,
const RingId_t i_ringID,
const RingMode i_ringMode = RING_MODE_HEADER_CHECK)
{
Expand All @@ -299,8 +299,8 @@ __fapi2exit__:
/// @param[out] o_data Buffer that holds data read from HW target.
/// @param[in] i_ringMode Ring operation mode.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
template< TargetType K, typename V >
inline ReturnCode getRing(const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
inline ReturnCode getRing(const Target<K, M, V>& i_target,
const scanRingId_t i_address,
variable_buffer& o_data,
const RingMode i_ringMode = 0)
Expand Down Expand Up @@ -329,8 +329,8 @@ __fapi2exit__:
/// @param[in] i_modifyMode The modify mode (or/and/xor)
/// @param[in] i_ringMode Ring operation mode.
/// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
template< TargetType K, typename V >
inline ReturnCode modifyRing(const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
inline ReturnCode modifyRing(const Target<K, M, V>& i_target,
const scanRingId_t i_address,
variable_buffer& i_data,
const ChipOpModifyMode i_modifyMode,
Expand Down Expand Up @@ -382,8 +382,8 @@ __fapi2exit__:
/// SCOM_BULK_WRITE_MODE operations are not supported due to
/// hardware limitations.
///
template< TargetType K, typename V >
fapi2::ReturnCode multiScom (const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
fapi2::ReturnCode multiScom (const Target<K, M, V>& i_target,
MultiScom& io_multiScomObj)
{
}
Expand Down Expand Up @@ -436,8 +436,8 @@ __fapi2exit__:
/// the quotes for the cronus environment
///
#ifdef FAPI_SUPPORT_SPY_AS_ENUM
template< TargetType K, typename V >
inline ReturnCode getSpy(const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
inline ReturnCode getSpy(const Target<K, M, V>& i_target,
const spyId_t i_spyId,
variable_buffer& o_data)
{
Expand All @@ -446,8 +446,8 @@ __fapi2exit__:
}
#endif
#ifdef FAPI_SUPPORT_SPY_AS_STRING
template< TargetType K, typename V >
inline ReturnCode getSpy(const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
inline ReturnCode getSpy(const Target<K, M, V>& i_target,
const char * const i_spyId,
variable_buffer& o_data)
{
Expand Down Expand Up @@ -495,8 +495,8 @@ __fapi2exit__:
/// the quotes for the cronus environment
///
#ifdef FAPI_SUPPORT_SPY_AS_ENUM
template< TargetType K, typename V >
inline ReturnCode putSpy(const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
inline ReturnCode putSpy(const Target<K, M, V>& i_target,
const spyId_t i_spyId,
variable_buffer& i_data)
{
Expand All @@ -505,8 +505,8 @@ __fapi2exit__:
}
#endif
#ifdef FAPI_SUPPORT_SPY_AS_STRING
template< TargetType K, typename V >
inline ReturnCode putSpy(const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
inline ReturnCode putSpy(const Target<K, M, V>& i_target,
const char* const i_spyId,
variable_buffer& i_data)
{
Expand Down Expand Up @@ -535,8 +535,8 @@ __fapi2exit__:
/// See fapiPutSpy for details on spy id specifics.
///
#ifdef FAPI_SUPPORT_SPY_AS_ENUM
template< TargetType K, typename V >
inline ReturnCode putSpyImage(const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
inline ReturnCode putSpyImage(const Target<K, M, V>& i_target,
const spyId_t i_spyId,
const variable_buffer& i_data,
variable_buffer& o_imageData)
Expand All @@ -546,8 +546,8 @@ __fapi2exit__:
}
#endif
#ifdef FAPI_SUPPORT_SPY_AS_STRING
template< TargetType K, typename V >
inline ReturnCode putSpyImage(const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
inline ReturnCode putSpyImage(const Target<K, M, V>& i_target,
const char* const i_spyId,
const variable_buffer& i_data,
variable_buffer& o_imageData)
Expand All @@ -574,8 +574,8 @@ __fapi2exit__:
/// See fapiPutSpy for details on spy id specifics.
///
#ifdef FAPI_SUPPORT_SPY_AS_ENUM
template< TargetType K, typename V >
inline ReturnCode getSpyImage(const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
inline ReturnCode getSpyImage(const Target<K, M, V>& i_target,
const spyId_t i_spyId,
variable_buffer& o_data,
const variable_buffer& i_imageData)
Expand All @@ -585,8 +585,8 @@ __fapi2exit__:
}
#endif
#ifdef FAPI_SUPPORT_SPY_AS_STRING
template< TargetType K, typename V >
inline ReturnCode getSpyImage(const Target<K, V>& i_target,
template< TargetType K, MulticastType M, typename V >
inline ReturnCode getSpyImage(const Target<K, M, V>& i_target,
const char * const i_spyId,
variable_buffer& o_data,
const variable_buffer& i_imageData)
Expand Down
54 changes: 0 additions & 54 deletions src/hwpf/multicast.H

This file was deleted.

10 changes: 9 additions & 1 deletion src/hwpf/plat_target.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -33,6 +33,7 @@
#include <stdint.h>
#include <target_types.H>
#include <target_states.H>
#include <multicast_defs.H>
#include <assert.h>
#include <plat_target_parms.H>
#include <vector>
Expand All @@ -53,6 +54,13 @@ static const uint8_t PCI0_CHIPLET = 0x0D;
//
namespace fapi2
{
template<TargetType K, MulticastType M, typename V>
static constexpr void plat_apply_target_limits(void)
{
static_assert(!(K & TARGET_TYPE_MULTICAST),
"Multicast targets are not supported on this platform");
}

typedef enum plat_target_type
{
PPE_TARGET_TYPE_NONE = 0x00,
Expand Down

0 comments on commit b9b668e

Please sign in to comment.