summaryrefslogtreecommitdiffstats
path: root/src/import/hwpf
diff options
context:
space:
mode:
authorJoachim Fenkes <fenkes@de.ibm.com>2018-12-05 16:47:55 +0100
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-02-14 16:26:31 -0600
commit5e4b564b9cc39812e3be3f022175edc8a0404ee6 (patch)
treed8b0d443749237fd1448022bc03a9bd79dfd666a /src/import/hwpf
parenta57d9746ec970e5d74269718da7c7e7d012e00ed (diff)
downloadtalos-hostboot-5e4b564b9cc39812e3be3f022175edc8a0404ee6.tar.gz
talos-hostboot-5e4b564b9cc39812e3be3f022175edc8a0404ee6.zip
FAPI2: Multicast API 1/2: Platform-breaking changes
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/70867 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/import/hwpf')
-rw-r--r--src/import/hwpf/fapi2/include/error_info_defs.H6
-rw-r--r--src/import/hwpf/fapi2/include/fapi2_hw_access.H78
-rw-r--r--src/import/hwpf/fapi2/include/fapi2_i2c_access.H8
-rw-r--r--src/import/hwpf/fapi2/include/fapi2_mmio_access.H8
-rw-r--r--src/import/hwpf/fapi2/include/fapi2_target.H78
-rw-r--r--src/import/hwpf/fapi2/include/fapi2_vpd_access.H4
-rw-r--r--src/import/hwpf/fapi2/include/multicast_defs.H42
-rw-r--r--src/import/hwpf/fapi2/include/utils.H6
8 files changed, 136 insertions, 94 deletions
diff --git a/src/import/hwpf/fapi2/include/error_info_defs.H b/src/import/hwpf/fapi2/include/error_info_defs.H
index 79a11b69c..623d83d66 100644
--- a/src/import/hwpf/fapi2/include/error_info_defs.H
+++ b/src/import/hwpf/fapi2/include/error_info_defs.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -393,8 +393,8 @@ inline uint16_t getErrorInfoFfdcSize(const T*)
///
/// @brief Get FFDC Size specialization for fapi2::Target
///
-template<fapi2::TargetType T, typename V>
-inline uint16_t getErrorInfoFfdcSize(const fapi2::Target<T, V>&)
+template<fapi2::TargetType T, MulticastType M, typename V>
+inline uint16_t getErrorInfoFfdcSize(const fapi2::Target<T, M, V>&)
{
return EI_FFDC_SIZE_TARGET;
}
diff --git a/src/import/hwpf/fapi2/include/fapi2_hw_access.H b/src/import/hwpf/fapi2/include/fapi2_hw_access.H
index 1e8c012d9..d2a4d0191 100644
--- a/src/import/hwpf/fapi2/include/fapi2_hw_access.H
+++ b/src/import/hwpf/fapi2/include/fapi2_hw_access.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -85,8 +85,8 @@ inline OpModes getOpMode(void);
/// @param[in] i_address SCOM register address to read from.
/// @param[out] o_data Buffer that holds data read from HW target.
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode getScom(const Target<K, V>& i_target, const uint64_t i_address,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getScom(const Target<K, M, V>& i_target, const uint64_t i_address,
buffer<uint64_t>& o_data);
/// @brief Writes a SCOM register on a chip.
@@ -95,8 +95,8 @@ inline ReturnCode getScom(const Target<K, V>& i_target, const uint64_t i_address
/// @param[in] i_address SCOM register address to write to.
/// @param[in] i_data Buffer that holds data to write into address.
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode putScom(const Target<K, V>& i_target, const uint64_t i_address,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putScom(const Target<K, M, V>& i_target, const uint64_t i_address,
const buffer<uint64_t> i_data);
/// @brief Writes a SCOM register under mask on a chip
@@ -106,8 +106,8 @@ inline ReturnCode putScom(const Target<K, V>& i_target, const uint64_t i_address
/// @param[in] i_data Buffer that holds data to write into address.
/// @param[in] i_mask Buffer that holds the mask value.
/// @return fapi2::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);
@@ -119,8 +119,8 @@ inline ReturnCode putScomUnderMask(const Target<K, V>& i_target,
/// @param[in] i_address CFAM register address to read from.
/// @param[out] o_data Buffer that holds data read from HW target.
/// @return fapi2::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);
@@ -131,8 +131,8 @@ inline ReturnCode getCfamRegister(const Target<K, V>& i_target,
/// @param[in] i_address CFAM register address to write to.
/// @param[in] i_data Buffer that holds data to write into address.
/// @return fapi2::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,
const buffer<uint32_t> i_data);
@@ -144,8 +144,8 @@ inline ReturnCode putCfamRegister(const Target<K, V>& i_target,
/// @param[in] i_data Buffer that holds data to be modified.
/// @param[in] i_modifyMode The modify mode (or/and/xor).
/// @return fapi2::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);
@@ -156,8 +156,8 @@ inline ReturnCode modifyCfamRegister(const Target<K, V>& i_target,
/// @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.
-template< TargetType K, typename V >
-ReturnCode putRing(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+ReturnCode putRing(const Target<K, M, V>& i_target,
const RingId_t i_ringID,
const RingMode i_ringMode = RING_MODE_HEADER_CHECK);
@@ -170,8 +170,8 @@ ReturnCode putRing(const Target<K, V>& i_target,
/// @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, 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 = RING_MODE_HEADER_CHECK);
@@ -185,8 +185,8 @@ inline ReturnCode getRing(const Target<K, V>& 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, 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,
const variable_buffer& i_data,
const ChipOpModifyMode i_modifyMode,
@@ -242,8 +242,8 @@ inline ReturnCode modifyRing(const Target<K, V>& i_target,
#define FAPI_GET_SPY(TARGET, ID, DATA) fapi2::getSpy(TARGET, FAPI_SPY_NAMES::ID.value, DATA)
-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);
@@ -258,8 +258,8 @@ inline ReturnCode getSpy(const Target<K>& i_target,
#define FAPI_GET_SPY(TARGET, ID, DATA) fapi2::getSpy(TARGET, #ID, DATA)
-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);
@@ -313,8 +313,8 @@ inline ReturnCode getSpy(const Target<K>& i_target,
#define FAPI_PUT_SPY(TARGET, ID, DATA) fapi2::putSpy(TARGET, FAPI_SPY_NAMES::ID.value, DATA)
-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,
const variable_buffer& i_data);
#endif
@@ -323,19 +323,19 @@ inline ReturnCode putSpy(const Target<K, V>& i_target,
#define FAPI_PUT_SPY(TARGET, ID, DATA) fapi2::putSpy(TARGET, #ID, DATA)
-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,
const variable_buffer& i_data);
-template<TargetType K, typename V >
-inline ReturnCode putSpyWithCare(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putSpyWithCare(const Target<K, M, V>& i_target,
const char* const i_spyId,
const variable_buffer& i_data,
const variable_buffer& i_care);
-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,
const char* i_enum);
#endif
@@ -366,8 +366,8 @@ inline ReturnCode putSpy(const Target<K, V>& i_target,
fapi2::putSpyImage(TARGET, FAPI_SPY_NAMES::ID.value, \
DATA1, DATA2)
-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);
@@ -378,8 +378,8 @@ inline ReturnCode putSpyImage(const Target<K, V>& i_target,
#define FAPI_PUT_SPY_IMAGE(TARGET, ID, DATA1, DATA2) \
fapi2::putSpyImage(TARGET, #ID, DATA1,DATA2)
-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);
@@ -408,8 +408,8 @@ inline ReturnCode putSpyImage(const Target<K, V>& i_target,
fapi2:getSpyImage(TARGET, FAPI_SPY_NAMES::ID.value, \
DATA1, DATA2)
-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);
@@ -420,8 +420,8 @@ inline ReturnCode getSpyImage(const Target<K, V>& i_target,
#define FAPI_GET_SPY_IMAGE(TARGET, ID, DATA1, DATA2) \
fapi2::getSpyImage(TARGET, #ID, DATA1,DATA2)
-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);
diff --git a/src/import/hwpf/fapi2/include/fapi2_i2c_access.H b/src/import/hwpf/fapi2/include/fapi2_i2c_access.H
index d6736cf01..4212f0b33 100644
--- a/src/import/hwpf/fapi2/include/fapi2_i2c_access.H
+++ b/src/import/hwpf/fapi2/include/fapi2_i2c_access.H
@@ -66,8 +66,8 @@ namespace fapi2
/// before the read.
/// @param[out] o_data Buffer that holds data read from HW target.
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode getI2c(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getI2c(const Target<K, M, V>& i_target,
const size_t i_get_size,
const std::vector<uint8_t>& i_data,
std::vector<uint8_t>& o_data);
@@ -87,8 +87,8 @@ inline ReturnCode getI2c(const Target<K, V>& i_target,
/// @param[in] i_target HW target to operate on.
/// @param[in] i_data Buffer that holds data to write to the HW target.
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode putI2c(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putI2c(const Target<K, M, V>& i_target,
const std::vector<uint8_t>& i_data);
};
diff --git a/src/import/hwpf/fapi2/include/fapi2_mmio_access.H b/src/import/hwpf/fapi2/include/fapi2_mmio_access.H
index d41e59912..2718b15f0 100644
--- a/src/import/hwpf/fapi2/include/fapi2_mmio_access.H
+++ b/src/import/hwpf/fapi2/include/fapi2_mmio_access.H
@@ -50,8 +50,8 @@ namespace fapi2
/// The size of the buffer determines the number of
/// amount of bytes that are read.
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode getMMIO(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode getMMIO(const Target<K, M, V>& i_target,
const uint64_t i_mmioAddr,
const size_t i_transSize,
std::vector<uint8_t>& o_data);
@@ -68,8 +68,8 @@ inline ReturnCode getMMIO(const Target<K, V>& i_target,
/// The size of the buffer determines the number of
/// amount of bytes that are written.
/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
-template< TargetType K, typename V >
-inline ReturnCode putMMIO(const Target<K, V>& i_target,
+template< TargetType K, MulticastType M, typename V >
+inline ReturnCode putMMIO(const Target<K, M, V>& i_target,
const uint64_t i_mmioAddr,
const size_t i_transSize,
const std::vector<uint8_t>& i_data);
diff --git a/src/import/hwpf/fapi2/include/fapi2_target.H b/src/import/hwpf/fapi2/include/fapi2_target.H
index 5c7067c4f..fcfb8d12c 100644
--- a/src/import/hwpf/fapi2/include/fapi2_target.H
+++ b/src/import/hwpf/fapi2/include/fapi2_target.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -37,6 +37,7 @@
#include <vector>
#include <target_types.H>
#include <target_states.H>
+#include <multicast_defs.H>
#include <plat_target.H>
#include <return_code_defs.H>
@@ -44,8 +45,18 @@ namespace fapi2
{
///
+/// @brief Apply any platform specific static assertions to target construction
+/// @tparam K the type of target to be constructed
+/// @tparam M the multicast type of the target to be constructed
+/// @tparam V the value type of the target to be constructed
+///
+template<TargetType K, MulticastType M, typename V>
+static constexpr void plat_apply_target_limits(void);
+
+///
/// @brief Class representing a FAPI2 Target
/// @tparam K the type (Kind) of target
+/// @tparam M the type of multicast operation if it's a multicast target
/// @tparam V the type of the target's Value
/// @remark TargetLite targets are uint64_t, Targets
/// are uintptr_t (void*).
@@ -102,7 +113,7 @@ namespace fapi2
/// fapi2::Target<fapi2::TARGET_TYPE_ABUS_ENDPOINT> E;
/// takesProcOrMembuf( E );
/// @endcode
-template<TargetType K, typename V = plat_target_handle_t>
+template<TargetType K, MulticastType M = MULTICAST_OR, typename V = plat_target_handle_t>
class Target
{
public:
@@ -112,7 +123,9 @@ class Target
/// that takes in a value as a param
///
Target(): Target(V())
- {};
+ {
+ plat_apply_target_limits<K, M, V>();
+ };
///
/// @brief Create a Target, with a value
@@ -124,7 +137,9 @@ class Target
///
Target(const V& Value):
iv_handle(Value)
- {};
+ {
+ plat_apply_target_limits<K, M, V>();
+ };
///
@@ -203,7 +218,7 @@ class Target
/// @return Target<T> a target representing the parent
///
template< TargetType T >
- inline Target<T, V> getParent(void) const;
+ inline Target<T, M, V> getParent(void) const;
///
/// @brief Is this target a chip?
@@ -277,7 +292,7 @@ class Target
/// in order. That is, core 0 is std::vector[0].
///
template< TargetType T>
- inline std::vector<Target<T, V> >
+ inline std::vector<Target<T, M, V> >
getChildren(const TargetState i_state = TARGET_STATE_FUNCTIONAL) const;
///
@@ -289,7 +304,7 @@ class Target
/// children
///
template< TargetType T>
- inline std::vector<Target<T, V> >
+ inline std::vector<Target<T, M, V> >
getChildren(const TargetFilter i_filter,
const TargetState i_state = TARGET_STATE_FUNCTIONAL) const;
@@ -305,7 +320,7 @@ class Target
template<TargetType T>
inline fapi2::ReturnCodes
- getOtherEnd(Target<T, V>& o_target, const TargetState i_state = TARGET_STATE_FUNCTIONAL) const;
+ getOtherEnd(Target<T, M, V>& o_target, const TargetState i_state = TARGET_STATE_FUNCTIONAL) const;
///
/// @brief Is the target functional?
@@ -329,10 +344,12 @@ class Target
/// @brief Copy from a Target<O> to a Target<K>
/// @tparam O the target type of the other
///
- template<TargetType O, typename VO>
- inline Target( const Target<O, VO>& Other ):
- Target<K, V>(Other.get())
+ template<TargetType O, MulticastType MO, typename VO>
+ inline Target( const Target<O, MO, VO>& Other ):
+ Target<K, M, V>(Other.get())
{
+ plat_apply_target_limits<K, M, V>();
+
// In case of recursion depth failure, use -ftemplate-depth=
static_assert( (K & O) != 0,
"unable to cast Target, no shared types");
@@ -347,6 +364,8 @@ class Target
static const TargetType iv_type = K;
V iv_handle;
+ /// @brief if iv_handle is a multicast target, update its multicast type to M
+ inline void mcUpdateHandle();
};
// EX threads map to CORE threads:
@@ -475,8 +494,8 @@ inline uint8_t thread_bitset_f2n(const uint8_t i_ordinal, const uint8_t i_thread
/// @post The contents of the buffer is replaced with the string
/// representation of the target
///
-template< TargetType T, typename V >
-inline void toString(const Target<T, V>& i_target, char* i_buffer, size_t i_bsize);
+template< TargetType T, MulticastType M, typename V >
+inline void toString(const Target<T, M, V>& i_target, char* i_buffer, size_t i_bsize);
///
/// @brief Return the string interpretation of this target
@@ -489,8 +508,8 @@ inline void toString(const Target<T, V>& i_target, char* i_buffer, size_t i_bsiz
/// @post The contents of the buffer is replaced with the string
/// representation of the target
///
-template< TargetType T, typename V >
-inline void toString(const Target<T, V>* i_target, char* i_buffer, size_t i_bsize);
+template< TargetType T, MulticastType M, typename V >
+inline void toString(const Target<T, M, V>* i_target, char* i_buffer, size_t i_bsize);
///
/// @brief Get an enumerated target of a specific type
@@ -499,28 +518,8 @@ inline void toString(const Target<T, V>* i_target, char* i_buffer, size_t i_bsiz
/// the desired target
/// @return Target<T> the target requested
///
-template<TargetType T, typename V = plat_target_handle_t>
-inline Target<T, V> getTarget(uint64_t Ordinal);
-
-// Why has the been removed? For starters, the API name
-// is probably wrong as it's already been confused with
-// Target::getChildren(). And if I'm going to change it
-// I really want to see if we need it. I'm still not
-// clear on whether we're alloing this traversal or not.
-#if 0
-///
-/// @brief Get the base target's children
-/// @tparam T The type of the target
-/// @return std::vector<Target<T,V>> a vector of present/functional
-/// children
-///
-template<TargetType T, typename V>
-inline std::vector<Target<T, V>> getChildren()
-{
- // For testing
- return {Target<T, V>(), Target<T, V>()};
-}
-#endif
+template<TargetType T, MulticastType M = MULTICAST_OR, typename V = plat_target_handle_t>
+inline Target<T, M, V> getTarget(uint64_t Ordinal);
///
/// @brief Return the string interpretation of this target
@@ -532,8 +531,8 @@ inline std::vector<Target<T, V>> getChildren()
/// @post The contents of the buffer is replaced with the string
/// representation of the target
///
-template<TargetType T, typename V, typename B>
-inline void toString(const Target<T, V>& i_target, B& i_buffer);
+template<TargetType T, MulticastType M, typename V, typename B>
+inline void toString(const Target<T, M, V>& i_target, B& i_buffer);
///
/// @brief Check if the target is of a type, or in a type subset.
@@ -546,6 +545,7 @@ inline constexpr bool is_same(void)
{
return (K & T) != 0;
}
+
}
#endif
diff --git a/src/import/hwpf/fapi2/include/fapi2_vpd_access.H b/src/import/hwpf/fapi2/include/fapi2_vpd_access.H
index ee1532202..0a9ffe5de 100644
--- a/src/import/hwpf/fapi2/include/fapi2_vpd_access.H
+++ b/src/import/hwpf/fapi2/include/fapi2_vpd_access.H
@@ -145,8 +145,8 @@ class VPDInfo<TARGET_TYPE_OCMB_CHIP>
/// FAPI_TRY(getVPD( mcs, vpdInfo, blob ));
/// blob now contains the VPD data for the MCS.
///
-template<TargetType T, typename V>
-ReturnCode getVPD(const Target<T, V>& i_target,
+template<TargetType T, MulticastType M, typename V>
+ReturnCode getVPD(const Target<T, M, V>& i_target,
VPDInfo<T>& io_vpd_info,
uint8_t* o_blob);
diff --git a/src/import/hwpf/fapi2/include/multicast_defs.H b/src/import/hwpf/fapi2/include/multicast_defs.H
new file mode 100644
index 000000000..5ed6a1bbe
--- /dev/null
+++ b/src/import/hwpf/fapi2/include/multicast_defs.H
@@ -0,0 +1,42 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/hwpf/fapi2/include/multicast_defs.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2018,2019 */
+/* [+] 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 */
+#ifndef __FAPI2_COMMON_MULTICAST_DEFS__
+#define __FAPI2_COMMON_MULTICAST_DEFS__
+
+namespace fapi2
+{
+enum MulticastType
+{
+ // Code points picked according to PCB spec
+ MULTICAST_OR = 0,
+ MULTICAST_AND = 1,
+ MULTICAST_BITX = 2,
+ MULTICAST_COMPARE = 4,
+};
+
+typedef uint32_t MulticastGroup;
+}
+
+#endif
diff --git a/src/import/hwpf/fapi2/include/utils.H b/src/import/hwpf/fapi2/include/utils.H
index 174d9e2dd..fe32f9be5 100644
--- a/src/import/hwpf/fapi2/include/utils.H
+++ b/src/import/hwpf/fapi2/include/utils.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -102,8 +102,8 @@ void endian_swap(T& io_input)
/// @return ReturnCode. FAPI2_RC_SUCCESS on success, else platform specified error.
///
///
-template<TargetType T, typename V>
-inline ReturnCode specialWakeup(const Target<T, V>& i_target,
+template<TargetType T, MulticastType M, typename V>
+inline ReturnCode specialWakeup(const Target<T, M, V>& i_target,
const bool i_enable)
{
// enforce the allowed target types
OpenPOWER on IntegriCloud