diff options
author | Santosh Puranik <santosh.puranik@in.ibm.com> | 2016-06-09 02:59:50 -0500 |
---|---|---|
committer | Santosh S. Puranik <santosh.puranik@in.ibm.com> | 2016-06-21 01:09:01 -0400 |
commit | 2af56e4130cf02ee9c480c959ba07d4ea82d6179 (patch) | |
tree | 170b363fca04cd9f5def99b2cfd0d6ad963f3d51 /hwpf | |
parent | b6e96c3e8edb4972591c6003942d7d0d898a0bf2 (diff) | |
download | talos-sbe-2af56e4130cf02ee9c480c959ba07d4ea82d6179.tar.gz talos-sbe-2af56e4130cf02ee9c480c959ba07d4ea82d6179.zip |
Changes for handling EX/MCS scoms
Change-Id: I411440954ce98add0a70013efa1d8aadd05b60c5
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25740
Tested-by: Jenkins Server
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-by: Santosh S. Puranik <santosh.puranik@in.ibm.com>
Diffstat (limited to 'hwpf')
-rw-r--r-- | hwpf/include/plat/target.H | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/hwpf/include/plat/target.H b/hwpf/include/plat/target.H index 02939ebe..4d37d4e6 100644 --- a/hwpf/include/plat/target.H +++ b/hwpf/include/plat/target.H @@ -46,6 +46,36 @@ extern "C" static const uint8_t CORES_PER_QUAD = 4; static const uint8_t EX_PER_QUAD = 2; static const uint8_t CORES_PER_EX = 2; +static const uint8_t N3_CHIPLET = 5; +struct ScomAddr +{ + ScomAddr(uint32_t i_addr) : iv_addr(i_addr) + { + } + + operator uint32_t() + { + return iv_addr; + } + + union + { + struct + { + uint32_t iv_unused : 1; + uint32_t iv_multicast : 1; + uint32_t iv_chiplet : 6; + uint32_t iv_pibMaster : 4; + uint32_t iv_port : 4; + uint32_t iv_unused2 : 2; + uint32_t iv_ring : 4; + uint32_t iv_satId : 4; + uint32_t iv_satOffset : 6; + }; + uint32_t iv_addr; + }; +}; + namespace fapi2 { @@ -452,6 +482,53 @@ namespace fapi2 snprintf(i_buffer, i_bsize, "Target 0x%lx/0x%x", i_target.get(), T); } + template<TargetType T> + __attribute__((always_inline)) + inline uint32_t getEffectiveAddress(const Target<T> &i_target, + const uint32_t i_addr) + { + ScomAddr l_addr = i_addr; + if(0 != i_target.getAddressOverlay()) + { + l_addr.iv_chiplet = i_target.getChipletNumber(); + } + return l_addr; + } + + inline uint32_t getEffectiveAddress(const Target<TARGET_TYPE_EX> &i_target, + const uint32_t i_addr) + { + ScomAddr l_addr = i_addr; + + if((EQ_CHIPLET_OFFSET <= l_addr.iv_chiplet) && + ((EQ_CHIPLET_OFFSET + EQ_TARGET_COUNT) > l_addr.iv_chiplet)) + { + l_addr.iv_chiplet = i_target.getChipletNumber(); + l_addr.iv_ring = (l_addr.iv_ring - (l_addr.iv_ring % 2)) + + (i_target.getTargetNumber() % 2); + } + else if ((CORE_CHIPLET_OFFSET <= l_addr.iv_chiplet) && + ((CORE_CHIPLET_OFFSET + CORE_TARGET_COUNT) > l_addr.iv_chiplet)) + { + l_addr.iv_chiplet = CORE_CHIPLET_OFFSET + (l_addr.iv_chiplet % 2) + + (i_target.getTargetNumber() * 2); + } + else + { + assert(false); + } + return l_addr; + } + + inline uint32_t getEffectiveAddress(const Target<TARGET_TYPE_MCS> &i_target, + const uint32_t i_addr) + { + ScomAddr l_addr = i_addr; + l_addr.iv_chiplet = N3_CHIPLET - (2 * (i_target.getTargetNumber() / 2)); + l_addr.iv_satId = (2 * (i_target.getTargetNumber() % 2)); + return l_addr; + } + /// /// @brief Return the string interpretation of this target /// @tparam T The type of the target |