diff options
Diffstat (limited to 'src/hwpf/src/plat/target.C')
-rw-r--r-- | src/hwpf/src/plat/target.C | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/hwpf/src/plat/target.C b/src/hwpf/src/plat/target.C index dbf8413b..3532f521 100644 --- a/src/hwpf/src/plat/target.C +++ b/src/hwpf/src/plat/target.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2016 */ +/* Contributors Listed Below - COPYRIGHT 2012,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -135,6 +135,9 @@ namespace fapi2 case PPE_TARGET_TYPE_MCS: l_targetType = TARGET_TYPE_MCS; break; + case PPE_TARGET_TYPE_PHB: + l_targetType = TARGET_TYPE_PHB; + break; case PPE_TARGET_TYPE_CORE | PPE_TARGET_TYPE_PERV: l_targetType = TARGET_TYPE_CORE; break; @@ -589,6 +592,31 @@ fapi_try_exit: G_vec_targets.at(l_beginning_offset+i) = revle32((fapi2::plat_target_handle_t)(target_name.get())); } + /* + * PHB Targets + */ + l_beginning_offset = PHB_TARGET_OFFSET; + for (uint32_t i = 0; i < PHB_TARGET_COUNT; ++i) + { + fapi2::Target<fapi2::TARGET_TYPE_PHB> target_name(createPlatTargetHandle<fapi2::TARGET_TYPE_PHB>(i)); + + fapi2::Target<fapi2::TARGET_TYPE_PERV> + l_pciTarget((plat_getTargetHandleByChipletNumber<TARGET_TYPE_PERV>(target_name.getChipletNumber()))); + + constexpr uint16_t l_pciPgArray[] = {0xE1FD, 0xE0FD, 0xE07D}; + uint16_t l_attrPg = 0; + + FAPI_ATTR_GET(fapi2::ATTR_PG, l_pciTarget, l_attrPg); + + if(l_pciPgArray[target_name.getChipletNumber() - PCI0_CHIPLET] == l_attrPg) + { + static_cast<plat_target_handle_t&>(target_name.operator ()()).setPresent(); + static_cast<plat_target_handle_t&>(target_name.operator ()()).setFunctional(true); + } + + G_vec_targets.at(l_beginning_offset+i) = revle32((fapi2::plat_target_handle_t)(target_name.get())); + } + fapi_try_exit: return fapi2::current_err; |