summaryrefslogtreecommitdiffstats
path: root/hwpf
diff options
context:
space:
mode:
authorSantosh Puranik <santosh.puranik@in.ibm.com>2016-03-22 06:02:56 -0500
committerGregory S. Still <stillgs@us.ibm.com>2016-04-11 12:53:32 -0400
commit1309527caad59265c2b74d55bc2ebe0f3b620845 (patch)
treed4ab82a449ab71a243b86f3c3162122058b078e3 /hwpf
parent9aada3cdbbfd3a95d0d9bcfae421202bec7cafb3 (diff)
downloadtalos-sbe-1309527caad59265c2b74d55bc2ebe0f3b620845.tar.gz
talos-sbe-1309527caad59265c2b74d55bc2ebe0f3b620845.zip
Update to getParent()
Support returning PROC_CHIP as a parent. Support CORE->EQ relation. Change-Id: I09f422833a9a933c1d41ad3f138fa8640b131e40 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22331 Tested-by: Jenkins Server Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Diffstat (limited to 'hwpf')
-rw-r--r--hwpf/include/plat/target.H22
1 files changed, 19 insertions, 3 deletions
diff --git a/hwpf/include/plat/target.H b/hwpf/include/plat/target.H
index 23f01401..b44b2832 100644
--- a/hwpf/include/plat/target.H
+++ b/hwpf/include/plat/target.H
@@ -43,6 +43,7 @@ extern "C"
extern std::vector<fapi2::plat_target_handle_t> G_vec_targets;
}
+static const uint8_t CORES_PER_QUAD = 4;
namespace fapi2
{
/// @brief Create a Target, with a value
@@ -163,9 +164,24 @@ namespace fapi2
template<TargetType T>
inline Target<T> Target<K, V>::getParent(void) const
{
- static_assert(((K == TARGET_TYPE_EQ) || (K == TARGET_TYPE_CORE))
- && (T == TARGET_TYPE_PERV), "Input target type must be either EQ/CORE, and parent type must be PERV");
- return this->iv_handle.value;
+ static_assert((((K == TARGET_TYPE_EQ) || (K == TARGET_TYPE_CORE)) &&
+ (T == TARGET_TYPE_PERV)) || (T == TARGET_TYPE_PROC_CHIP)
+ || ((K == TARGET_TYPE_CORE) && (T == TARGET_TYPE_EQ)),
+ "Input target type must be either EQ/CORE, and parent type "
+ "must be PERV. Or the parent type must be a PROC_CHIP. Or "
+ "parent type must be an EQ and input target must be a CORE");
+ if(TARGET_TYPE_PERV == T)
+ {
+ return this->iv_handle.value;
+ }
+ if(TARGET_TYPE_PROC_CHIP == T)
+ {
+ return G_vec_targets[CHIP_TARGET_OFFSET];
+ }
+ if(TARGET_TYPE_EQ == T)
+ {
+ return G_vec_targets[((getChipletNumber() - CORE_CHIPLET_OFFSET) / CORES_PER_QUAD) + EQ_TARGET_OFFSET];
+ }
}
///
OpenPOWER on IntegriCloud