Skip to content

Commit

Permalink
Merge pull request #423 from kahnevan/iohs_sublink
Browse files Browse the repository at this point in the history
Add new target relationship
  • Loading branch information
kahnevan authored Dec 15, 2020
2 parents 2f7ec49 + 729e22f commit ebc8ab3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
22 changes: 22 additions & 0 deletions ecmd-core/ext/fapi2/capi/plat_target_rules.H
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,16 @@ constexpr void _check_valid_parent_of_iohs()
"improper parent of fapi2::TARGET_TYPE_IOHS");
}

template< fapi2::TargetType K, fapi2::TargetType T >
constexpr void _check_valid_parent_of_iolink()
{
// valid parents for IOLINK
// IOLINK -> IOHS
static_assert(!((K == fapi2::TARGET_TYPE_IOLINK) &&
(T != fapi2::TARGET_TYPE_IOHS)),
"improper parent of fapi2::TARGET_TYPE_IOLINK");
}

template< fapi2::TargetType K, fapi2::TargetType T >
constexpr void _check_valid_parent_of_pau()
{
Expand Down Expand Up @@ -905,6 +915,7 @@ constexpr void _check_valid_unicast_parent()
fapi2plat::_check_valid_parent_of_capp<K, T>();
fapi2plat::_check_valid_parent_of_nmmu<K, T>();
fapi2plat::_check_valid_parent_of_iohs<K, T>();
fapi2plat::_check_valid_parent_of_iolink<K, T>();
fapi2plat::_check_valid_parent_of_pau<K, T>();
}

Expand Down Expand Up @@ -1203,6 +1214,16 @@ constexpr void _check_pauc_valid_children()
"improper child of fapi2::TARGET_TYPE_PAUC");
}

template< fapi2::TargetType K, fapi2::TargetType T >
constexpr void _check_iohs_valid_children()
{
// valid children for IOHS
// IOHS -> IOLINK
static_assert(!((K == fapi2::TARGET_TYPE_IOHS) &&
(T != fapi2::TARGET_TYPE_IOLINK)),
"improper child of fapi2::TARGET_TYPE_IOHS");
}


template< fapi2::TargetType K, fapi2::TargetType T >
constexpr void _check_valid_unicast_children()
Expand All @@ -1227,6 +1248,7 @@ constexpr void _check_valid_unicast_children()
fapi2plat::_check_mc_valid_children<K, T>();
fapi2plat::_check_obus_valid_children<K, T>();
fapi2plat::_check_pauc_valid_children<K, T>();
fapi2plat::_check_iohs_valid_children<K, T>();
}

#endif
Expand Down
1 change: 1 addition & 0 deletions ecmd-core/ext/fapi2/capi/target.H
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ Target<K, M, V>::getChildren(const TargetFilter i_filter,
fapi2::TARGET_TYPE_NMMU |
fapi2::TARGET_TYPE_PAU |
fapi2::TARGET_TYPE_IOHS |
fapi2::TARGET_TYPE_IOLINK |
fapi2::TARGET_TYPE_PAUC;

static_assert( !((T & TARGET_TYPE_FILTER_CHIPLETS) == fapi2::TARGET_TYPE_NONE),
Expand Down
4 changes: 3 additions & 1 deletion ecmd-core/ext/fapi2/capi/target_types.H
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ enum TargetType : uint64_t
TARGET_TYPE_PMIC = 0x0000000800000000, ///< PMIC type
TARGET_TYPE_PAUC = 0x0000001000000000, ///< PAUC type
TARGET_TYPE_GENERICI2CSLAVE = 0x0000002000000000, ///< GENERICI2CSLAVE type
TARGET_TYPE_IOLINK = 0x0000004000000000, ///< IOLINK type
TARGET_TYPE_MULTICAST = 0x8000000000000000, ///< MULTICAST type
TARGET_TYPE_ALL = 0x7FFFFFFFFFFFFFFF, ///< Any/All types
TARGET_TYPE_ALL_MC = 0xFFFFFFFFFFFFFFFF, ///< Any/All types + Multicast
Expand Down Expand Up @@ -122,7 +123,8 @@ enum TargetType : uint64_t
TARGET_TYPE_PAU |
TARGET_TYPE_IOHS |
TARGET_TYPE_FC |
TARGET_TYPE_PAUC,
TARGET_TYPE_PAUC |
TARGET_TYPE_IOLINK,

TARGET_TYPE_MULTICASTABLE = TARGET_TYPE_CORE |
TARGET_TYPE_EQ |
Expand Down

0 comments on commit ebc8ab3

Please sign in to comment.