summaryrefslogtreecommitdiffstats
path: root/hwpf/src
diff options
context:
space:
mode:
authorSantosh Puranik <santosh.puranik@in.ibm.com>2016-02-22 00:26:55 -0600
committerSantosh S. Puranik <santosh.puranik@in.ibm.com>2016-02-29 01:11:32 -0500
commitfa96524c2c612e01ff1d19680a47f74f1605eaa8 (patch)
tree744155ffa099243b40419a553b25b3f00f611bc1 /hwpf/src
parent56e55dbf8cc7f9b47659bf15b51ea5195677c35e (diff)
downloadtalos-sbe-fa96524c2c612e01ff1d19680a47f74f1605eaa8.tar.gz
talos-sbe-fa96524c2c612e01ff1d19680a47f74f1605eaa8.zip
Plat API to get Target by chiplet number
Change-Id: I119a856d0b608c25899df4ef613715e26c6ec86a Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21022 Reviewed-by: RAJA DAS <rajadas2@in.ibm.com> Tested-by: Jenkins Server Reviewed-by: Santosh S. Puranik <santosh.puranik@in.ibm.com>
Diffstat (limited to 'hwpf/src')
-rw-r--r--hwpf/src/plat/target.C31
1 files changed, 31 insertions, 0 deletions
diff --git a/hwpf/src/plat/target.C b/hwpf/src/plat/target.C
index c04f3356..a1c6ca38 100644
--- a/hwpf/src/plat/target.C
+++ b/hwpf/src/plat/target.C
@@ -26,6 +26,7 @@
#include <fapi2.H>
#include <plat_target_pg_attributes.H>
+#include <assert.h>
// Global Vector containing ALL targets. This structure is referenced by
// fapi2::getChildren to produce the resultant returned vector from that
@@ -475,4 +476,34 @@ fapi_try_exit:
return fapi2::current_err;
}
+ /// @brief Function to return a platform target handle, given the chiplet
+ // number
+ // @param i_chipletNumber The chiplet number of the target
+ // @return Platform target handle
+ // @note The caller can use the platform target handle to construct a
+ // Target of it's choice. Ex:
+ // fapi2::Target<fapi2::TARGET_TYPE_CORE>
+ // l_core(plat_getTargetHandleByChipletNumber(0x20);
+ plat_target_handle_t plat_getTargetHandleByChipletNumber(
+ const uint8_t i_chipletNumber)
+ {
+ assert(((i_chipletNumber > 0) &&
+ (i_chipletNumber < (EQ_CHIPLET_OFFSET + EQ_TARGET_COUNT))) ||
+ ((i_chipletNumber >= CORE_CHIPLET_OFFSET) &&
+ (i_chipletNumber < (CORE_CHIPLET_OFFSET + CORE_TARGET_COUNT))));
+
+ uint32_t l_idx = 0;
+
+ if(i_chipletNumber < (EQ_CHIPLET_OFFSET + EQ_TARGET_COUNT))
+ {
+ l_idx = (i_chipletNumber - NEST_GROUP1_CHIPLET_OFFSET) +
+ NEST_GROUP1_TARGET_OFFSET;
+ }
+ else
+ {
+ l_idx = (i_chipletNumber - CORE_CHIPLET_OFFSET) +
+ CORE_TARGET_OFFSET;
+ }
+ return G_vec_targets[l_idx];
+ }
} // fapi2
OpenPOWER on IntegriCloud