summaryrefslogtreecommitdiffstats
path: root/src/hwpf/include
diff options
context:
space:
mode:
authorSantosh Puranik <santosh.puranik@in.ibm.com>2017-05-29 06:15:17 -0500
committerSantosh S. Puranik <santosh.puranik@in.ibm.com>2017-05-31 23:59:53 -0400
commite97705e412957844cc516486a6686de1a8d69ecb (patch)
tree366cabe4a468c5f85917c48ad4423c8d2ed61711 /src/hwpf/include
parent5110484932840cd55a361b6bbe8bef5aa24b27e3 (diff)
downloadtalos-sbe-e97705e412957844cc516486a6686de1a8d69ecb.tar.gz
talos-sbe-e97705e412957844cc516486a6686de1a8d69ecb.zip
FAPI Plat Cleanup
-- Remove src and include subdirs Change-Id: I47d2b7d0b3667e7765692fb014932ae23a6325f7 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41085 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: Shakeeb A. Pasha B K <shakeebbk@in.ibm.com> Reviewed-by: Santosh S. Puranik <santosh.puranik@in.ibm.com>
Diffstat (limited to 'src/hwpf/include')
-rw-r--r--src/hwpf/include/plat/hw_access.H611
-rw-r--r--src/hwpf/include/plat/hwp_executor.H65
-rw-r--r--src/hwpf/include/plat/multicast.H55
-rw-r--r--src/hwpf/include/plat/plat_attributes.H36
-rw-r--r--src/hwpf/include/plat/plat_error_scope.H80
-rw-r--r--src/hwpf/include/plat/plat_hw_access.H166
-rw-r--r--src/hwpf/include/plat/plat_includes.H40
-rw-r--r--src/hwpf/include/plat/plat_ring_traverse.H117
-rw-r--r--src/hwpf/include/plat/plat_target.H292
-rw-r--r--src/hwpf/include/plat/plat_target_definitions.H112
-rw-r--r--src/hwpf/include/plat/plat_target_filter.H90
-rw-r--r--src/hwpf/include/plat/plat_target_parms.H101
-rw-r--r--src/hwpf/include/plat/plat_target_utils.H89
-rw-r--r--src/hwpf/include/plat/plat_trace.H114
-rw-r--r--src/hwpf/include/plat/plat_utils.H65
-rw-r--r--src/hwpf/include/plat/target.H410
16 files changed, 0 insertions, 2443 deletions
diff --git a/src/hwpf/include/plat/hw_access.H b/src/hwpf/include/plat/hw_access.H
deleted file mode 100644
index fdbca56a..00000000
--- a/src/hwpf/include/plat/hw_access.H
+++ /dev/null
@@ -1,611 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/include/plat/hw_access.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2017 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-/**
- * @file hw_access.H
- *
-* @brief Defines the hardware access functions that platform code must
- * implement.
- */
-
-#ifndef FAPI2_HWACCESS_H_
-#define FAPI2_HWACCESS_H_
-
-
-// variable_buffer isn't supported on PPE
-#ifndef __PPE__
-#include <variable_buffer.H>
-#endif
-
-#include <utils.H>
-#include <p9_ringId.H>
-#include <plat_hw_access.H>
-#include "plat_ring_traverse.H" // for findRS4InImageAndApply
-
-namespace fapi2
-{
-
- /// @brief Default template to disallow at compile time any operations the
- // plat does not support on Targets
- template<TargetType K, typename V>
- struct does_plat_allow {static constexpr bool value = false;};
-
- //--------------------------------------------------------------------------
- // PIB Error Functions
- //--------------------------------------------------------------------------
-
- /// @brief Sets the PIB error mask - platform dependant
- /// @param[in] i_mask The new error mask
- inline void setPIBErrorMask(uint8_t i_mask)
- {
- PLAT_SET_PIB_ERROR_MASK(i_mask);
- }
-
- /// @brief Gets the PIB error mask - platform dependant
- /// @return uint8_t The current PIB error mask
- inline uint8_t getPIBErrorMask(void)
- {
- PLAT_GET_PIB_ERROR_MASK(o_pib_mask);
- return o_pib_mask;
- }
-
- //--------------------------------------------------------------------------
- // Operational Mode Error Functions
- //--------------------------------------------------------------------------
-
- /// @brief Sets the operational mode
- /// @param[in] i_mode The new mode
- // note: this can be moved to a C file if desired
- inline void setOpMode(const OpModes i_mode)
- {
- // Keeps the compiler from complaining about the unused i_mode
- static_cast<void>(i_mode);
-
- // No-op for now. Should set thread-local operational mode
- return;
- }
-
- /// @brief Gets the operational mode
- /// @return the operational mode
- // note: this can be moved to a C file if desired
- inline OpModes getOpMode(void)
- {
- // No-op for now. Should read thread-local operational mode
- return NORMAL;
- }
-
- //--------------------------------------------------------------------------
- // HW Communication Functions
- //--------------------------------------------------------------------------
-
- /// @brief Reads a SCOM register from a chip.
- /// @tparam K template parameter, passed in target.
- /// @param[in] i_target HW target to operate on.
- /// @param[in] i_address SCOM register address to read from.
- /// @param[out] o_data Buffer that holds data read from HW target.
- /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- __attribute__((always_inline))
- inline ReturnCode getScom(const Target<K, V>& i_target, const uint64_t i_address,
- buffer<uint64_t>& o_data)
- {
- fapi2::ReturnCode l_rc;
- PLAT_GETSCOM(l_rc,
- i_target,
- i_address,
- &(o_data()));
-
- return l_rc;
- }
-
- /// @brief Writes a SCOM register on a chip.
- /// @tparam K template parameter, passed in target.
- /// @param[in] i_target HW target to operate on.
- /// @param[in] i_address SCOM register address to write to.
- /// @param[in] i_data Buffer that holds data to write into address.
- /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- __attribute__((always_inline))
- inline ReturnCode putScom(const Target<K, V>& i_target, const uint64_t i_address,
- const buffer<uint64_t> i_data)
- {
- fapi2::ReturnCode l_rc;
- PLAT_PUTSCOM(l_rc,
- i_target,
- i_address,
- i_data());
-
- return l_rc;
- }
-
- /// @brief Read-modify-write a SCOM register on a chip
- /// @tparam K template parameter, passed in target.
- /// @param[in] i_target HW target to operate on.
- /// @param[in] i_address SCOM register address to write to.
- /// @param[in] i_data Buffer that holds data to be modified.
- /// @param[in] i_modifyMode The modify mode (or/and/xor).
- /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- inline ReturnCode modifyScom(const Target<K, V>& i_target,
- const uint64_t i_address,
- const buffer<uint64_t> i_data,
- const ChipOpModifyMode i_modifyMode)
- {
- fapi2::buffer<uint64_t> l_modifyDataBuffer;
-
- fapi2::ReturnCode l_rc;
- PLAT_GETSCOM(l_rc,
- i_target,
- (uint32_t)(i_address & BITS(40,24)),
- &(l_modifyDataBuffer()));
- if (l_rc) goto __fapi2exit__;
-
- if ( i_modifyMode == CHIP_OP_MODIFY_MODE_OR)
- {
- l_modifyDataBuffer |= i_data;
- }
-
- if ( i_modifyMode == CHIP_OP_MODIFY_MODE_AND)
- {
- l_modifyDataBuffer &= i_data;
- }
-
- if ( i_modifyMode == CHIP_OP_MODIFY_MODE_XOR)
- {
- l_modifyDataBuffer ^= i_data;
- }
-
- PLAT_PUTSCOM(l_rc,
- i_target,
- (uint32_t)(i_address & BITS(40,24)),
- l_modifyDataBuffer());
- if (l_rc) goto __fapi2exit__;
-
-
-__fapi2exit__:
- return l_rc;
-
- }
-
- /// @brief Writes a SCOM register under mask on a chip
- /// @tparam K template parameter, passed in target.
- /// @param[in] i_target HW target to operate on.
- /// @param[in] i_address SCOM register address to write to.
- /// @param[in] i_data Buffer that holds data to write into address.
- /// @param[in] i_mask Buffer that holds the mask value.
- /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- inline ReturnCode putScomUnderMask( const Target<K, V>& i_target,
- const uint64_t i_address,
- buffer<uint64_t> i_data,
- buffer<uint64_t> i_mask)
- {
- // TODO: via RTC: 160143: Fix the plat implementation
- static_assert(does_plat_allow<K, V>::value, "putScomUnderMask not suppported");
- fapi2::buffer<uint64_t> l_modifyDataBuffer = i_data;
-
- l_modifyDataBuffer &= i_mask;
-
- fapi2::ReturnCode l_rc;
- PLAT_PUTSCOM(l_rc,
- i_target,
- (uint32_t)(i_address & BITS(40,24)),
- l_modifyDataBuffer());
-
- return l_rc;
-
- }
-
-
- /// @brief Reads a CFAM register from a chip.
- /// CFAM register is 32-bit wide.
- /// @tparam K template parameter, passed in target.
- /// @param[in] i_target HW target to operate on.
- /// @param[in] i_address CFAM register address to read from.
- /// @param[out] o_data Buffer that holds data read from HW target.
- /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- inline ReturnCode getCfamRegister(const Target<K, V>& i_target,
- const uint32_t i_address,
- buffer<uint32_t>& o_data)
- {
- PLAT_GETCFAM(i_target.get(),
- (uint32_t)(i_address & BITS(40,24)),
- &(o_data()));
-
- return FAPI2_RC_SUCCESS;
- }
-
- /// @brief Writes a CFAM register on a chip.
- /// CFAM register is 32-bit wide.
- /// @tparam K template parameter, passed in target.
- /// @param[in] i_target HW target to operate on.
- /// @param[in] i_address CFAM register address to write to.
- /// @param[in] i_data Buffer that holds data to write into address.
- /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- inline ReturnCode putCfamRegister(const Target<K, V>& i_target,
- const uint32_t i_address,
- buffer<uint32_t>& i_data)
- {
- PLAT_PUTCFAM(i_target.get(),
- (uint32_t)(i_address & BITS(40,24)),
- &(i_data()));
-
- return FAPI2_RC_SUCCESS;
- }
-
- /// @brief Read-modify-write a CFAM register on a chip.
- /// CFAM register is 32-bit wide.
- /// @tparam K template parameter, passed in target.
- /// @param[in] i_target HW target to operate on.
- /// @param[in] i_address CFAM register address to modify.
- /// @param[in] i_data Buffer that holds data to be modified.
- /// @param[in] i_modifyMode The modify mode (or/and/xor).
- /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- inline ReturnCode modifyCfamRegister(const Target<K, V>& i_target,
- const uint32_t i_address,
- const buffer<uint32_t>& i_data,
- const ChipOpModifyMode i_modifyMode)
- {
- PLAT_MODCFAM(i_target.get(),
- (uint32_t)(i_address & BITS(40,24)),
- &(i_data()),
- i_modifyMode);
-
- return FAPI2_RC_SUCCESS;
- }
-
- /// @brief Platform-level implementation of putRing()
- /// Hardware procedures writers will not call this function.
- /// @tparam K template parameter, passed in target.
- /// @param[in] i_target Target to operate on.
- /// @param[in] i_ringID Ring ID that will identify the Ring in the image.
- /// @param[in] i_ringMode Ring operation mode.
- /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- inline ReturnCode putRing(const Target<K, V>& i_target,
- const RingID i_ringID,
- const RingMode i_ringMode = RING_MODE_HEADER_CHECK)
- {
- ReturnCode l_rc = FAPI2_RC_SUCCESS;
-
- // Find the RS4 string in the SEEPROM
- l_rc = findRS4InImageAndApply(i_target, i_ringID, i_ringMode);
-
- return l_rc;
- }
-
- // variable_buffer isn't supported on PPE
-#ifndef __PPE__
- /// @brief Reads a ring from a chip.
- /// @tparam K template parameter, passed in target.
- /// @param[in] i_target Target to operate on.
- /// @param[in] i_address Ring address to read from.
- /// @param[out] o_data Buffer that holds data read from HW target.
- /// @param[in] i_ringMode Ring operation mode.
- /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- inline ReturnCode getRing(const Target<K, V>& i_target,
- const scanRingId_t i_address,
- variable_buffer& o_data,
- const RingMode i_ringMode = 0)
- {
- o_data.setBit(0);
- o_data.setBit(3);
-#ifndef __PPE__
- std::cout << std::hex << " getRing "
- << "target: {" << i_target.getType() << ","
- << uint64_t(i_target) << "}; "
- << "ring address: " << i_address << "; "
- << "ring mode: " << i_ringMode << "; "
- << "output data:";
- o_data.print();
-#endif
-
- return FAPI2_RC_SUCCESS;
- }
-
- /// @brief Read-modify-write a ring on a chip.
- /// @tparam K template parameter, passed in target.
- /// @param[in] i_target Target to operate on.
- /// @param[in] i_address Ring address to modify.
- /// @param[in] i_data Buffer that contains RS4 compressed ring data
- /// to be modified.
- /// @param[in] i_modifyMode The modify mode (or/and/xor)
- /// @param[in] i_ringMode Ring operation mode.
- /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- template< TargetType K, typename V >
- inline ReturnCode modifyRing(const Target<K, V>& i_target,
- const scanRingId_t i_address,
- variable_buffer& i_data,
- const ChipOpModifyMode i_modifyMode,
- const RingMode i_ringMode = 0)
- {
-
- return FAPI2_RC_SUCCESS;
- }
-#endif
-
-
-#ifdef FAPI_SUPPORT_MULTI_SCOM
- /// @brief Performs a multiple SCOM operation
- /// This interface performs multiple SCOM operations on a chip in the
- /// order specified by the input MultiScom object.
- /// See fapiMultiScom.H for details of how to populate the MultiScom
- /// object with SCOM operations.
- ///
- /// @tparam K template parameter, passed in target.
- /// @param[in] i_target Target to operate on.
- /// @param[in,out] io_multiScomObj Reference to a MultiScom object,
- /// pre-populated with SingleScomInfo entries
- /// to perform multiple SCOMs on input target
- /// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- ///
- /// @note This is a synchronous interface and would return after all the
- /// SCOM operations are completed or on the first failed operation
- ///
- /// @note SCOMs will be performed in the order they were added to the
- /// input MultiScom object
- ///
- /// @note In case of errors, the platform code is responsible to collect
- /// and add all the required error info and FFDC into the error data
- /// for debugging
- ///
- /// @note If the SCOM operations added are specific to a processor chip,
- /// then the FSI Shift Engine configured in scatter-gather DMA mode
- /// extension would be used to execute the SCOM operations in a
- /// performance optimize mode. In this mode, the special
- /// SCOM_BULK_READ_MODE and SCOM_BULK_WRITE_MODE operations are
- /// supported that allow a large bulk of SCOM access (in multiple of
- /// 64 bits) for targets that support auto-increment. The
- /// SCOM_WRITE_UNDER_MASK operation is not supported in this mode
- ///
- /// @note If the SCOM operations added are specific to a memory buffer
- /// chip, then the regular SCOM engine is used to execute the SCOM
- /// operations. SCOM_WRITE_UNDER_MASK operation is supported in
- /// this mode, but the special SCOM_BULK_READ_MODE and
- /// SCOM_BULK_WRITE_MODE operations are not supported due to
- /// hardware limitations.
- ///
- template< TargetType K, typename V >
- fapi2::ReturnCode multiScom (const Target<K, V>& i_target,
- MultiScom& io_multiScomObj)
- {
- }
-#endif
-
- // --------------------------------------------------------------------------
- // NOTE:
- // Implement platform Spy access functions if platform supports them.
- // --------------------------------------------------------------------------
-
- // variable_buffer isn't supported on PPE
-#ifndef __PPE__
- /// @brief Reads a spy from a chip.
- /// @tparam K template parameter, passed in target.
- /// @param[in] i_target Target to operate on.
- /// @param[in] i_spyId Id of the spy whose data to be read.
- /// @param[out] o_data Buffer that holds data read from HW target.
- /// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- ///
- /// @note: The string version is only supported for cronus.
- ///
- /// The fapi design to support both FSP and cronus use of get and
- /// put spy functions is dependant on the SPY names being expanded
- /// to resemble a valid C identifier. This design places some
- /// restrictions on the SPY names which can be used.
- ///
- /// 1. if the spy name contains a # procedure writers should replace
- /// it with an __P__ for example -
- ///
- /// ABUS.RX0.RXPACKS#0.RXPACK.RD.LC.LC.ACT_DIS
- /// becomes
- /// ABUS.RX0.RXPACKS__P__0.RXPACK.RD.LC.LC.ACT_DIS
- ///
- /// 2. if the spy name has a number following a "." it must have an
- /// underscore prepended to the number.
- ///
- /// EH.TPCHIP.2KX100_ARY_CLK_EDGES_DLY
- /// becomes
- /// EH.TPCHIP._2KX100_ARY_CLK_EDGES_DLY
- ///
- /// Example SPY name:
- /// The hardware procedure should call the function like:
- ///
- /// ABUS.RX0.RXPACKS#0.RXPACK.RD.LC.LC.ACT_DIS
- ///
- /// fapi2::ReturnCode rc = fapiGetSpy( targ,
- /// ABUS.RX0.RXPACKS__P__0.RXPACK.RD.LC.LC.ACT_DIS, data );
- ///
- /// @note The ID is not in quotes the fapi code will handle adding
- /// the quotes for the cronus environment
- ///
-#ifdef FAPI_SUPPORT_SPY_AS_ENUM
- template< TargetType K, typename V >
- inline ReturnCode getSpy(const Target<K, V>& i_target,
- const spyId_t i_spyId,
- variable_buffer& o_data)
- {
- static_assert(K == 0, "implement getSpy (string)");
- return ~FAPI2_RC_SUCCESS;
- }
-#endif
-#ifdef FAPI_SUPPORT_SPY_AS_STRING
- template< TargetType K, typename V >
- inline ReturnCode getSpy(const Target<K, V>& i_target,
- const char * const i_spyId,
- variable_buffer& o_data)
- {
- static_assert(K == 0, "implement getSpy (string)");
- return ~FAPI2_RC_SUCCESS;
- }
-#endif
- /// @brief Writes a spy on a chip.
- /// @tparam K template parameter, passed in target.
- /// @param[in] i_target Target to operate on.
- /// @param[in] i_spyId Id of the spy to write data to.
- /// @param[out] i_data Buffer that holds data to write into spy.
- /// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- ///
- /// @note: The string version is only supported for cronus.
- ///
- /// The fapi design to support both FSP and cronus use of get and
- /// put spy functions is dependent on the SPY names being expanded
- /// to resemble a valid C identifier. This design places some
- /// restrictions on the SPY names which can be used.
- ///
- /// 1. if the spy name contains a # procedure writers should replace
- /// is with an __P__ for example -
- ///
- /// ABUS.RX0.RXPACKS#0.RXPACK.RD.LC.LC.ACT_DIS
- /// becomes
- /// ABUS.RX0.RXPACKS__P__0.RXPACK.RD.LC.LC.ACT_DIS
- ///
- /// 2. if the spy name has a number following a "." it must have an
- /// underscore prepended to the number.
- ///
- /// EH.TPCHIP.2KX100_ARY_CLK_EDGES_DLY
- /// becomes
- /// EH.TPCHIP._2KX100_ARY_CLK_EDGES_DLY
- ///
- /// Example SPY name:
- /// The hardware procedure should call the function like:
- ///
- /// ABUS.RX0.RXPACKS#0.RXPACK.RD.LC.LC.ACT_DIS
- ///
- /// fapi2::ReturnCode rc = fapiPutSpy( targ,
- /// ABUS.RX0.RXPACKS__P__0.RXPACK.RD.LC.LC.ACT_DIS, data );
- ///
- /// @note The ID is not in quotes the fapi code will handle adding
- /// the quotes for the cronus environment
- ///
-#ifdef FAPI_SUPPORT_SPY_AS_ENUM
- template< TargetType K, typename V >
- inline ReturnCode putSpy(const Target<K, V>& i_target,
- const spyId_t i_spyId,
- variable_buffer& i_data)
- {
- static_assert(K == 0, "implement putSpy (enum)");
- return ~FAPI2_RC_SUCCESS;
- }
-#endif
-#ifdef FAPI_SUPPORT_SPY_AS_STRING
- template< TargetType K, typename V >
- inline ReturnCode putSpy(const Target<K, V>& i_target,
- const char* const i_spyId,
- variable_buffer& i_data)
- {
- static_assert(K == 0, "implement putSpy (string)");
- return ~FAPI2_RC_SUCCESS;
- }
-#endif
- /// @brief Writes spy data into a buffer holding ring data image
- /// This API is used by L2/L3 repair to put column repair data
- /// into a ring buffer image.
- /// @tparam K template parameter, passed in target.
- /// @param[in] i_target Target to operate on.
- /// @param[in] i_spyId Id of the spy.
- /// @param[in] i_data Buffer that holds spy data to write into ring
- /// image.
- /// @param[out] o_data Buffer that holds updated ring image.
- /// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- ///
- /// @note: The string version is only supported for cronus.
- ///
- /// The fapi design to support both FSP and cronus use of get and
- /// put spy functions is dependent on the SPY names being expanded
- /// to resemble a valid C identifier. This design places some
- /// restrictions on the SPY names which can be used.
- ///
- /// See fapiPutSpy for details on spy id specifics.
- ///
-#ifdef FAPI_SUPPORT_SPY_AS_ENUM
- template< TargetType K, typename V >
- inline ReturnCode putSpyImage(const Target<K, V>& i_target,
- const spyId_t i_spyId,
- const variable_buffer& i_data,
- variable_buffer& o_imageData)
- {
- static_assert(K == 0, "implement putSpyImage (enum)");
- return ~FAPI2_RC_SUCCESS;
- }
-#endif
-#ifdef FAPI_SUPPORT_SPY_AS_STRING
- template< TargetType K, typename V >
- inline ReturnCode putSpyImage(const Target<K, V>& i_target,
- const char* const i_spyId,
- const variable_buffer& i_data,
- variable_buffer& o_imageData)
- {
- static_assert(K == 0, "implement putSpyImage (string)");
- return ~FAPI2_RC_SUCCESS;
- }
-#endif
- /// @brief Reads spy data from a ring image buffer
- /// @param[in] i_target Target to operate on
- /// @param[in] i_spyId The spy's id
- /// @param[out] o_data Buffer that holds data read from ring image.
- /// @param[in] i_imageData Buffer that holds ring image to read data
- /// from.
- /// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- ///
- /// @note: The string version is only supported for cronus.
- ///
- /// The fapi design to support both FSP and cronus use of get and
- /// put spy functions is dependent on the SPY names being expanded
- /// to resemble a valid C identifier. This design places some
- /// restrictions on the SPY names which can be used.
- ///
- /// See fapiPutSpy for details on spy id specifics.
- ///
-#ifdef FAPI_SUPPORT_SPY_AS_ENUM
- template< TargetType K, typename V >
- inline ReturnCode getSpyImage(const Target<K, V>& i_target,
- const spyId_t i_spyId,
- variable_buffer& o_data,
- const variable_buffer& i_imageData)
- {
- static_assert(K == 0, "implement getSpyImage (enum)");
- return ~FAPI2_RC_SUCCESS;
- }
-#endif
-#ifdef FAPI_SUPPORT_SPY_AS_STRING
- template< TargetType K, typename V >
- inline ReturnCode getSpyImage(const Target<K, V>& i_target,
- const char * const i_spyId,
- variable_buffer& o_data,
- const variable_buffer& i_imageData)
- {
- static_assert(K == 0, "implement getSpyImage (string)");
- return ~FAPI2_RC_SUCCESS;
- }
-#endif
-
-#endif // PPE
-
-};
-
-#endif // _FAPI2_HWACCESS_H_
diff --git a/src/hwpf/include/plat/hwp_executor.H b/src/hwpf/include/plat/hwp_executor.H
deleted file mode 100644
index c77b163a..00000000
--- a/src/hwpf/include/plat/hwp_executor.H
+++ /dev/null
@@ -1,65 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/include/plat/hwp_executor.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-/**
- * @file fapi2PlatHwpExecutor.H
- *
- * @brief Defines the FAPI HWP Executor Macro.
- *
- * The HWP Executor macro is called when a PLAT invoker function or a HWP wants
- * to execute a HWP. Each platform can modify the macro to do any platform
- * specific work to execute the HWP (e.g. dlopening a shared library)
- */
-
-#ifndef FAPI2PLATHWPEXECUTOR_H_
-#define FAPI2PLATHWPEXECUTOR_H_
-
-/**
- * @brief HWP Executor macro
- *
- * By default, this macro just calls the HWP directly. If this cannot be done
- * then the platform needs to modify
- */
-
-#include <return_code.H>
-#include <target.H>
-
-
-
-// Macro to execute an arbitrary function with an arbitray number of arguments. The
-// function is in a shared lib that must be dlopened. All that is required is that
-// there is a typedef for the function pointer available that is called <FUNC>_FP_t
-// i.e. if the function is called foo, then the typedef is called foo_FP_t
-#define FAPI_PLAT_EXEC_HWP(RC, FUNC, _args_...) \
-{\
- RC = FUNC(_args_); \
-}
-
-#define FAPI_PLAT_EXEC_HWP_LAMBDA(FUNC, _args_...) \
-[&]()->fapi2::ReturnCode \
-{\
- FUNC(_args_); \
-}()
-
-#endif // FAPI2PLATHWPEXECUTOR_H_
diff --git a/src/hwpf/include/plat/multicast.H b/src/hwpf/include/plat/multicast.H
deleted file mode 100644
index 5bf1c549..00000000
--- a/src/hwpf/include/plat/multicast.H
+++ /dev/null
@@ -1,55 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/include/plat/multicast.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-#ifndef __FAPI2_MULTICAST__
-#define __FAPI2_MULTICAST__
-
-#include <fapi2_multicast.H>
-
-namespace fapi2
-{
-
-template<MulticastType M, MulticastGroup G, typename V>
-template<MulticastType O, MulticastGroup N>
-inline void Multicast<M, G, V>::updateHandle(V& i_value)
-{
- // Update handle only if multicast bit is set in handle, else we leave the
- // handle unchanged. This enables the same procedure to work with both
- // multicast and unicast targets
- if(i_value.fields.is_multicast)
- {
- // Update the handle to reflect the new multicast type and group
- i_value.fields.chiplet_num = (0x40) | (O << 3) | N;
- }
-}
-
-template<MulticastType M, MulticastGroup G, typename V>
-inline bool Multicast<M, G, V>::isMulticast() const
-{
- return iv_handle.fields.is_multicast;
-}
-
-}
-
-#endif
diff --git a/src/hwpf/include/plat/plat_attributes.H b/src/hwpf/include/plat/plat_attributes.H
deleted file mode 100644
index 781cbd56..00000000
--- a/src/hwpf/include/plat/plat_attributes.H
+++ /dev/null
@@ -1,36 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/include/plat/plat_attributes.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2016 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-/**
- * @file plat_attributes.H
- * @brief Platform specific attribute headers
- */
-
-#ifndef __PLAT_ATTTRIBUTE_H__
-#define __PLAT_ATTTRIBUTE_H__
-
-#include <fapi2_attribute_service.H>
-#include <attribute_ids.H> // Generated file
-
-#endif // __PLAT_ATTTRIBUTE_H__
diff --git a/src/hwpf/include/plat/plat_error_scope.H b/src/hwpf/include/plat/plat_error_scope.H
deleted file mode 100644
index 153de5e2..00000000
--- a/src/hwpf/include/plat/plat_error_scope.H
+++ /dev/null
@@ -1,80 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/include/plat/plat_error_scope.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2017 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-/**
- * @file plat_error_scope.H
- * @brief platform definitions which create a scope for automatic error handling
- */
-
-#ifndef __FAPI2_PLAT_ERROR_SCOPE__
-#define __FAPI2_PLAT_ERROR_SCOPE__
-
-/// @cond
-#define PLAT_FAPI_TRY_NO_TRACE( __operation__ ) \
- if(std::is_same<decltype((__operation__)), fapi2::AttributeRC>::value) \
- { \
- (void)((__operation__)); \
- } \
- else \
- { \
- if ((fapi2::current_err = (__operation__)) != fapi2::FAPI2_RC_SUCCESS) \
- { \
- goto fapi_try_exit; \
- } \
- }
-
-
-#define PLAT_FAPI_TRY_TRACE( __operation__, ... ) \
- if ((fapi2::current_err = (__operation__)) != fapi2::FAPI2_RC_SUCCESS) \
- { /* TODO via RTC 172311 */ \
- /* Enable these traces back again */ \
- /* FAPI_ERR(__VA_ARGS__); */ \
- goto fapi_try_exit; \
- }
-
-///
-/// @brief Assert a conditional is true.
-/// If it is not, the FFDC gathering function is called and the
-/// trace is output as a FAPI error trace.
-/// @param[in] __conditional__ the condition to assert
-/// @param[in] __ffdc__ the FFDC gathering function
-/// @param[in] ... varargs, as input to FAPI_ERR
-///
-#define PLAT_FAPI_ASSERT( __conditional__, __ffdc__, ... ) \
- if (! (__conditional__)) \
- { \
- (__ffdc__).execute(); \
- FAPI_ERR(__VA_ARGS__); \
- goto fapi_try_exit; \
- }
-
-
-///
-/// @brief Temporary macro for error label until all are removed.
-/// @todo REMOVE this in time.
-#define FAPI_CLEANUP() \
-fapi_try_exit:
-/// @endcond
-
-#endif
diff --git a/src/hwpf/include/plat/plat_hw_access.H b/src/hwpf/include/plat/plat_hw_access.H
deleted file mode 100644
index 55c84f98..00000000
--- a/src/hwpf/include/plat/plat_hw_access.H
+++ /dev/null
@@ -1,166 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/include/plat/plat_hw_access.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-/**
- * @file plat_hw_access.H
- *
- * @brief Define platform specific calls for hardware accesses.
- */
-
-#ifndef PLATHWACCESS_H_
-#define PLATHWACCESS_H_
-
-#include <plat_includes.H>
-#include "hw_access_def.H"
-#include <return_code.H>
-#include <fapi2_target.H>
-
-// PIB errors
-enum PCB_ERRORS
-{
- PIB_NO_ERROR = 0x0,
- PIB_XSCOM_ERROR = 0x1,
- PIB_OFFLINE_ERROR = 0x2,
- PIB_PARTIAL_ERROR = 0x3,
- PIB_ADDRESS_ERROR = 0x4,
- PIB_CLOCK_ERROR = 0x5,
- PIB_PARITY_ERROR = 0x6,
- PIB_TIMEOUT_ERROR = 0x7
-};
-
-/// PIB Error Mask
-
-#define PLAT_SET_PIB_ERROR_MASK(_m_mask) \
- { /* Read MSR */ \
- uint32_t msr_data = mfmsr(); \
- /* Set SEM field */ \
- msr_data &= ~(BITS(0,8)); \
- msr_data |= (uint32_t)(i_mask << 24); \
- /* Write MSR */ \
- mtmsr(msr_data); \
- };
-
-#define PLAT_GET_PIB_ERROR_MASK(_m_mask) \
- uint8_t _m_mask; \
- uint32_t _sem = mfmsr(); \
- _m_mask = (uint8_t)((_sem & MSR_SEM) >> (32-(MSR_SEM_START_BIT + MSR_SEM_LEN)));
-
-// Building block PPE instructions
-#define PPE_MFMSR(_m_data) \
-asm volatile \
- ( \
- "mfmsr %[data] \n" \
- : [data]"=&r"(*_m_data) \
- : "[data]"(*_m_data) \
- );
-
-#define PPE_MTMSR(_m_data) \
-asm volatile \
- ( \
- "mtmsr %[data] \n" \
- : [data]"=&r"(*_m_data) \
- : "[data]"(*_m_data) \
- );
-
-/// GetScom
-#define PLAT_GETSCOM(_m_rc, _m_base, _m_offset, _m_data) \
- _m_rc = fapi2::getscom_abs_wrap(&(_m_base), _m_offset, _m_data)
-
-/// PutScom
-#define PLAT_PUTSCOM(_m_rc, _m_base, _m_offset, _m_data) \
- _m_rc = fapi2::putscom_abs_wrap(&(_m_base), _m_offset, _m_data)
-
-/// GetCFAM
-#define PLAT_GETCFAM(_m_base, _m_offset, _m_data) \
- static_assert( K == TARGET_TYPE_NONE, \
- "getCfamRegister is not supported by PPE platforms")
-
-/// PutCFAM
-#define PLAT_PUTCFAM(_m_base, _m_offset, _m_data) \
- static_assert( K == TARGET_TYPE_NONE, \
- "putCfamRegister is not supported by PPE platforms")
-
-/// ModifyCFAM
-#define PLAT_MODCFAM(_m_base, _m_offset, _m_data, _m_mode) \
- static_assert( K == TARGET_TYPE_NONE, \
- "modifyCfamRegister is not supported by PPE platforms")
-
-namespace fapi2
-{
- // This function loads the scan region data for the given ring address and
- // updates the check word data
- // @param[in] : ring addtress
- // @param[in]: ring mode
- // @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- fapi2::ReturnCode getRing_setup(const uint32_t i_ringAddress,
- const fapi2::RingMode i_ringMode);
-
- // This function verify the check word data is matching or not and will
- // clean up the scan region data
- // @param[in] i_ringAddress - absolute ring address
- // @param[in] i_ringMode - Ring mode value
- // @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- fapi2::ReturnCode getRing_verifyAndcleanup(const uint32_t i_ringAddress,
- const fapi2::RingMode i_ringMode);
-
- typedef union plat_target_handle plat_target_handle_t;
- ///
- /// @brief Platform wrapper over PK getscom_abs
- ///
- /// @param [in] i_addr The SCOM address
- /// @param [out] o_data The data read
- ///
- /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- ///
- fapi2::ReturnCode getscom_abs_wrap(const void *i_target,
- const uint32_t i_addr, uint64_t *o_data);
-
- ///
- /// @brief Platform wrapper over PK putscom_abs
- ///
- /// @param [in] i_addr The SCOM address
- /// @param [in] i_data The data to write
- ///
- /// @return fapi::ReturnCode. FAPI2_RC_SUCCESS if success, else error code.
- ///
- fapi2::ReturnCode putscom_abs_wrap(const void *i_target,
- const uint32_t i_addr, uint64_t i_data);
-
- ///
- /// @brief Platform wrapper to retry scom for parity/timeout errors
- ///
- /// @param [in] i_addr The SCOM address
- /// @param [io] io_data The data pointer
- /// @param [in] i_pibErr PIB error code
- /// @param [in] i_isRead True if read operation, false otherwise
- ///
- /// @return PCB-PIB return code
- ///
- uint32_t p9_pibErrRetry( const uint32_t i_addr, uint64_t *io_data,
- const uint8_t i_pibErr, const bool i_isRead);
-}
-
-
-#endif // PLATHWACCESS_H_
-
diff --git a/src/hwpf/include/plat/plat_includes.H b/src/hwpf/include/plat/plat_includes.H
deleted file mode 100644
index bc706f28..00000000
--- a/src/hwpf/include/plat/plat_includes.H
+++ /dev/null
@@ -1,40 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/include/plat/plat_includes.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2016 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-/**
- * @file plat_includes.H
- * @brief Platform specific include to implement FAPI2 APIs
- */
-
-#ifndef __PLAT_INCLUDES_H__
-#define __PLAT_INCLUDES_H__
-
-#include <plat_hw_access.H>
-
-#include <ppe42_scom.h>
-#include <ppe42_msr.h>
-//#include <pk.h>
-
-
-#endif // __PLAT_INCLUDES_H__
diff --git a/src/hwpf/include/plat/plat_ring_traverse.H b/src/hwpf/include/plat/plat_ring_traverse.H
deleted file mode 100644
index 54723051..00000000
--- a/src/hwpf/include/plat/plat_ring_traverse.H
+++ /dev/null
@@ -1,117 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/include/plat/plat_ring_traverse.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-
-#ifndef _PLAT_RING_TRAVERSE_H_
-#define _PLAT_RING_TRAVERSE_H_
-
-#include <p9_putRingUtils.H> // for RS4 decompression utilities
-
-using namespace RING_TYPES;
-
-/// @brief This structure represents the layout of the Section-TOR
-/// Section-TOR has the offsets to the different chiplet's
-/// Common Ring section and Instance Ring section
-struct SectionTOR
-{
- uint32_t TOC_PERV_COMMON_RING; // Offset of Perv Common Ring section
- uint32_t TOC_PERV_INSTANCE_RING; // Offset of Perv Instance Ring section
-
- uint32_t TOC_N0_COMMON_RING; // Offset of N0 Common Ring section
- uint32_t TOC_N0_INSTANCE_RING; // Offset of N0 Instance Ring section
-
- uint32_t TOC_N1_COMMON_RING; // Offset of N1 Common Ring section
- uint32_t TOC_N1_INSTANCE_RING; // Offset of N1 Instance Ring section
-
- uint32_t TOC_N2_COMMON_RING; // Offset of N2 Common Ring section
- uint32_t TOC_N2_INSTANCE_RING; // Offset of N2 Instance Ring section
-
- uint32_t TOC_N3_COMMON_RING; // Offset of N3 Common Ring section
- uint32_t TOC_N3_INSTANCE_RING; // Offset of N3 Instance Ring section
-
- uint32_t TOC_XB_COMMON_RING; // Offset of XB Common Ring section
- uint32_t TOC_XB_INSTANCE_RING; // Offset of XB Instance Ring section
-
- uint32_t TOC_MC_COMMON_RING; // Offset of MC Common Ring section
- uint32_t TOC_MC_INSTANCE_RING; // Offset of MC Instance Ring section
-
- uint32_t TOC_OB0_COMMON_RING; // Offset of OB0 Common Ring section
- uint32_t TOC_OB0_INSTANCE_RING; // Offset of OB0 Instance Ring section
-
- uint32_t TOC_OB1_COMMON_RING; // Offset of OB1 Common Ring section
- uint32_t TOC_OB1_INSTANCE_RING; // Offset of OB1 Instance Ring section
-
- uint32_t TOC_OB2_COMMON_RING; // Offset of OB2 Common Ring section
- uint32_t TOC_OB2_INSTANCE_RING; // Offset of OB2 Instance Ring section
-
- uint32_t TOC_OB3_COMMON_RING; // Offset of OB3 Common Ring section
- uint32_t TOC_OB3_INSTANCE_RING; // Offset of OB3 Instance Ring section
-
- uint32_t TOC_PCI0_COMMON_RING; // Offset of PCI0 Common Ring section
- uint32_t TOC_PCI0_INSTANCE_RING; // Offset of PCI0 Instance Ring section
-
- uint32_t TOC_PCI1_COMMON_RING; // Offset of PCI1 Common Ring section
- uint32_t TOC_PCI1_INSTANCE_RING; // Offset of PCI1 Instance Ring section
-
- uint32_t TOC_PCI2_COMMON_RING; // Offset of PCI2 Common Ring section
- uint32_t TOC_PCI2_INSTANCE_RING; // Offset of PCI2 Instance Ring section
-
- uint32_t TOC_EQ_COMMON_RING; // Offset of Quad Common Ring section
- uint32_t TOC_EQ_INSTANCE_RING; // Offset of Quad Instance Ring section
-
- uint32_t TOC_EC_COMMON_RING; // Offset of Core Common Ring section
- uint32_t TOC_EC_INSTANCE_RING; // Offset of Core Instance Ring section
-};
-
-
-///
-/// @brief This is a plat pecific (SBE Plat) function that locates the
-/// Ring Container in the image and calls the functin to decompress the
-/// RS4 string and apply it to the hardware.
-/// @param i_target The target of Ring apply.
-/// @param i_ringID The Ring ID that identifies the ring to be applied.
-/// @return FAPI2_RC_SUCCESS on success, else error code.
-///
-fapi2::ReturnCode findRS4InImageAndApply(
- const fapi2::Target<fapi2::TARGET_TYPE_ALL>& i_target,
- const RingID i_ringID,
- const fapi2::RingMode i_ringMode);
-///
-/// @brief This is a plat pecific (SBE Plat) function that locates the
-/// Ring Container in the image and calls the functin to decompress the
-/// RS4 string and apply it to the hardware.
-/// @param i_target The target of Ring apply.
-/// @param i_ringID The Ring ID that identifies the ring to be applied.
-/// @param i_sectionTOR TOR section address
-/// @param i_applyOverride override is enabled or not
-/// @return FAPI2_RC_SUCCESS on success, else error code.
-///
-fapi2::ReturnCode getRS4ImageFromTor(
- const fapi2::Target<fapi2::TARGET_TYPE_ALL>& i_target,
- const RingID i_ringID,
- SectionTOR *i_sectionTOR,
- bool i_applyOverride,
- const uint32_t i_sectionOffset,
- const fapi2::RingMode i_ringMode);
-#endif
diff --git a/src/hwpf/include/plat/plat_target.H b/src/hwpf/include/plat/plat_target.H
deleted file mode 100644
index 88d7e231..00000000
--- a/src/hwpf/include/plat/plat_target.H
+++ /dev/null
@@ -1,292 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/include/plat/plat_target.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-/**
- * @file plat_target.H
- * @brief platform definitions for fapi2 targets
- */
-
-#ifndef __FAPI2_PLAT_TARGET__
-#define __FAPI2_PLAT_TARGET__
-
-#include <stdint.h>
-#include <target_types.H>
-#include <target_states.H>
-#include <assert.h>
-#include <plat_target_parms.H>
-#include <vector>
-
-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 N2_CHIPLET = 4;
-static const uint8_t N3_CHIPLET = 5;
-static const uint8_t MCS_PER_MCBIST = 2;
-static const uint8_t PCI0_CHIPLET = 0x0D;
-
-//
-// Define what a platform handle looks like. For Hostboot,
-// for example, this might be a void*. For the SBE, this
-// will be a uint32_t ...
-//
-namespace fapi2
-{
- typedef enum plat_target_type
- {
- PPE_TARGET_TYPE_NONE = 0x00,
- PPE_TARGET_TYPE_PROC_CHIP = 0x01,
- PPE_TARGET_TYPE_MCS = 0x02,
- PPE_TARGET_TYPE_CORE = 0x04,
- PPE_TARGET_TYPE_EQ = 0x08,
- PPE_TARGET_TYPE_EX = 0x10,
- PPE_TARGET_TYPE_PERV = 0x20,
- PPE_TARGET_TYPE_MCBIST = 0x40,
- PPE_TARGET_TYPE_SYSTEM = 0x80,
- PPE_TARGET_TYPE_PHB = 0x100,
- PPE_TARGET_TYPE_ALL = 0xFFF,
- } plat_target_type_t;
-
- typedef union plat_target_handle {
- uint32_t value;
- struct {
-#ifdef _BIG_ENDIAN
- uint32_t chiplet_num : 8;
- uint32_t type_target_num : 8;
- uint32_t present : 1;
- uint32_t functional : 1;
- uint32_t is_multicast : 1;
- uint32_t valid : 1;
- uint32_t type : 12;
-#else
- uint32_t type : 12;
- uint32_t valid : 1;
- uint32_t is_multicast : 1;
- uint32_t functional : 1;
- uint32_t present : 1;
- uint32_t type_target_num : 8;
- uint32_t chiplet_num : 8;
-#endif
- } fields;
- ///
- /// @brief Plat target handle constructor
- ///
- /// @param i_value Value to instantiate handle with
- ///
- explicit plat_target_handle(uint32_t i_value = 0):value(i_value) {}
-
- ///
- /// @brief Get the fapi2::TargetType for this target
- ///
- /// @par Converts the internal PPE type for this target to fapi2 enum
- ///
- /// @return The fapi2::TargetType for this target
- ///
- TargetType getFapiTargetType() const;
-
- ///
- /// @brief Get the scom address overlay for this target
- ///
- /// @return Address overlay
- ///
- uint32_t getAddressOverlay() const
- {
- return (value & 0xFF000000);
- }
-
- ///
- /// @brief Get the plat target type
- ///
- /// @return The plat target type as a fapi2::TargetType
- ///
- TargetType getTargetType() const
- {
- return static_cast<TargetType>(fields.type);
- }
-
- ///
- /// @brief Get the instance number for this target
- ///
- /// @return The instance number for this target
- ///
- uint32_t getTargetInstance() const
- {
- return fields.type_target_num;
- }
-
- ///
- /// @brief Returns whether this target is functional
- ///
- /// @return true if Target is functional
- ///
- bool getFunctional() const
- {
- return fields.functional;
- }
-
- ///
- /// @brief Set functional state of the Target
- ///
- /// @param [in] i_state Functional state to set
- ///
- void setFunctional(const bool &i_state)
- {
- fields.functional = i_state;
- }
-
- ///
- /// @brief Returns whether this target is present
- ///
- /// @return true if Target is present
- ///
- bool getPresent() const
- {
- return fields.present;
- }
-
- ///
- /// @brief Set Target as present
- ///
- void setPresent()
- {
- fields.present = true;
- }
-
- ///
- /// @brief Get this target's parent
- ///
- /// @param [in] The fapi2 type of the requested parent
- /// @return Plat target handle to the parent target
- ///
- plat_target_handle getParent(const TargetType i_parentType) const;
-
- ///
- /// @brief Get this target's children
- ///
- /// @param [in] i_parentType fapi2 type of the parent
- /// @param [in] i_childType fapi2 type of the child
- /// @param [in] i_platType Plat type of the parent
- /// @param [in] i_state Required state of the children
- /// @param [out] o_children A vector of child target handles
- ///
- void getChildren(const TargetType i_parentType,
- const TargetType i_childType,
- const plat_target_type_t i_platType,
- const TargetState i_state,
- std::vector<plat_target_handle> &o_children) const;
-
- ///
- /// @brief Get proc chip target's children - filtered
- ///
- /// @param [in] i_filter Target filter
- /// @param [in] i_state Required state of the children
- /// @param [out] o_children A vector of child target handles
- ///
- void getChildren(const TargetFilter i_filter,
- const TargetState i_state,
- std::vector<plat_target_handle>& o_children) const;
-
- ///
- /// @brief Gets the plat target handle as a uint32
- ///
- /// @return Plat target handle as a uint32_t
- ///
- operator uint32_t() const {return value;}
- } plat_target_handle_t;
-
- typedef plat_target_handle_t plat_target_argument_t;
-
- template<TargetType K, bool MULTICAST = false>
- plat_target_handle_t createPlatTargetHandle(const uint32_t i_plat_argument)
- {
- static_assert((MULTICAST != true) || (K == TARGET_TYPE_PROC_CHIP),
- "Only PROC_CHIP types can be multicast");
- plat_target_handle_t l_handle;
-
- if(MULTICAST == true)
- {
- // Simply set the is multicast flag
- l_handle.fields.is_multicast = 1;
- }
- else if(K & TARGET_TYPE_PROC_CHIP)
- {
- l_handle.fields.chiplet_num = 0;
- l_handle.fields.type = PPE_TARGET_TYPE_PROC_CHIP;
- l_handle.fields.type_target_num = 0;
- }
- else if(K & TARGET_TYPE_PERV)
- {
- l_handle.fields.chiplet_num = i_plat_argument + NEST_GROUP1_CHIPLET_OFFSET;
- l_handle.fields.type = PPE_TARGET_TYPE_PERV;
- l_handle.fields.type_target_num = i_plat_argument;
- }
- else if(K & TARGET_TYPE_CORE)
- {
- l_handle.fields.chiplet_num = i_plat_argument + CORE_CHIPLET_OFFSET;
- l_handle.fields.type = PPE_TARGET_TYPE_CORE | PPE_TARGET_TYPE_PERV;
- l_handle.fields.type_target_num = i_plat_argument;
- }
- else if(K & TARGET_TYPE_EQ)
- {
- l_handle.fields.chiplet_num = i_plat_argument + EQ_CHIPLET_OFFSET;
- l_handle.fields.type = PPE_TARGET_TYPE_EQ | PPE_TARGET_TYPE_PERV;
- l_handle.fields.type_target_num = i_plat_argument;
- }
- else if(K & TARGET_TYPE_EX)
- {
- l_handle.fields.chiplet_num = (i_plat_argument / 2) + EX_CHIPLET_OFFSET;
- l_handle.fields.type = PPE_TARGET_TYPE_EX;
- l_handle.fields.type_target_num = i_plat_argument;
- }
- else if(K & TARGET_TYPE_MCBIST)
- {
- l_handle.fields.chiplet_num = i_plat_argument + MCBIST_CHIPLET_OFFSET;
- l_handle.fields.type = PPE_TARGET_TYPE_MCBIST | PPE_TARGET_TYPE_PERV;
- l_handle.fields.type_target_num = i_plat_argument;
- }
- else if(K & TARGET_TYPE_MCS)
- {
- l_handle.fields.chiplet_num = N3_CHIPLET - (MCS_PER_MCBIST * (i_plat_argument / MCS_PER_MCBIST));
- l_handle.fields.type = PPE_TARGET_TYPE_MCS;
- l_handle.fields.type_target_num = i_plat_argument;
- }
- else if(K & TARGET_TYPE_PHB)
- {
- l_handle.fields.chiplet_num = (0 == i_plat_argument) ? PCI0_CHIPLET :
- (((i_plat_argument / 3) + 1) + PCI0_CHIPLET);
- l_handle.fields.type = PPE_TARGET_TYPE_PHB;
- l_handle.fields.type_target_num = i_plat_argument;
- }
- else if(K == TARGET_TYPE_ALL)
- {
- l_handle.fields.chiplet_num = i_plat_argument;
- l_handle.fields.type = PPE_TARGET_TYPE_ALL;
- }
-
- l_handle.fields.valid = 1;
- return l_handle;
- }
-
-};
-
-#endif
diff --git a/src/hwpf/include/plat/plat_target_definitions.H b/src/hwpf/include/plat/plat_target_definitions.H
deleted file mode 100644
index 24991ebb..00000000
--- a/src/hwpf/include/plat/plat_target_definitions.H
+++ /dev/null
@@ -1,112 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/include/plat/plat_target_definitions.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2016 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-/**
- * @file plat_ppe_target.H
- * @brief Definitions for fapi2 PPE targets
- */
-
-#ifndef __FAPI2_PPE_TARGET__
-#define __FAPI2_PPE_TARGET__
-
-#define TARGET_CHIP(_name, _index) \
- fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP > _name((uint64_t)_index);
-
-#define TARGET_CHIP_PERV(_name, _index) \
- fapi2::Target<fapi2::TARGET_TYPE_PERV> _name((uint64_t)_index);
-
-#define TARGET_EQ(_name, _index) \
- fapi2::Target<fapi2::TARGET_TYPE_EQ> _name((uint64_t)_index);
-
-#define TARGET_CORE(_name, _index) \
- fapi2::Target<fapi2::TARGET_TYPE_CORE> _name((uint64_t)_index);
-
-#define TARGET_EX(_name, _index) \
- fapi2::Target<fapi2::TARGET_TYPE_EX> _name((uint64_t)_index);
-
-namespace fapi2
-{
-
- TARGET_CHIP (chip_target, 0);
- TARGET_CHIP_PERV (perv_target, 1);
- TARGET_CHIP_PERV (n0_target, 2);
- TARGET_CHIP_PERV (n1_target, 3);
- TARGET_CHIP_PERV (n2_target, 4);
- TARGET_CHIP_PERV (n3_target, 5);
- TARGET_CHIP_PERV (xb_target, 6);
- TARGET_CHIP_PERV (mc0_target, 7);
- TARGET_CHIP_PERV (mc1_target, 8);
- TARGET_CHIP_PERV (ob0_target, 9);
- TARGET_CHIP_PERV (ob1_target, 10);
- TARGET_CHIP_PERV (ob2_target, 11);
- TARGET_CHIP_PERV (ob3_target, 12);
- TARGET_CHIP_PERV (pci0_target, 13);
- TARGET_CHIP_PERV (pci1_target, 14);
- TARGET_CHIP_PERV (pci2_target, 15);
- TARGET_EQ (eq0_target, 0);
- TARGET_EQ (eq1_target, 1);
- TARGET_EQ (eq2_target, 2);
- TARGET_EQ (eq3_target, 3);
- TARGET_EQ (eq4_target, 4);
- TARGET_EQ (eq5_target, 5);
- TARGET_EX (ex0_target, 0);
- TARGET_EX (ex1_target, 1);
- TARGET_EX (ex2_target, 2);
- TARGET_EX (ex3_target, 3);
- TARGET_EX (ex4_target, 4);
- TARGET_EX (ex5_target, 5);
- TARGET_EX (ex6_target, 6);
- TARGET_EX (ex7_target, 7);
- TARGET_EX (ex8_target, 8);
- TARGET_EX (ex9_target, 9);
- TARGET_EX (ex10_target, 10);
- TARGET_EX (ex11_target, 11);
- TARGET_CORE (core0_target, 0);
- TARGET_CORE (core1_target, 1);
- TARGET_CORE (core2_target, 2);
- TARGET_CORE (core3_target, 3);
- TARGET_CORE (core4_target, 4);
- TARGET_CORE (core5_target, 5);
- TARGET_CORE (core6_target, 6);
- TARGET_CORE (core7_target, 7);
- TARGET_CORE (core8_target, 8);
- TARGET_CORE (core9_target, 9);
- TARGET_CORE (core10_target,10);
- TARGET_CORE (core11_target,11);
- TARGET_CORE (core12_target,12);
- TARGET_CORE (core13_target,13);
- TARGET_CORE (core14_target,14);
- TARGET_CORE (core15_target,15);
- TARGET_CORE (core16_target,16);
- TARGET_CORE (core17_target,17);
- TARGET_CORE (core18_target,18);
- TARGET_CORE (core19_target,19);
- TARGET_CORE (core20_target,20);
- TARGET_CORE (core21_target,21);
- TARGET_CORE (core22_target,22);
- TARGET_CORE (core23_target,23);
-
-}; // fapi2 namespace
-
-#endif // __FAPI2_PPE_TARGET__
diff --git a/src/hwpf/include/plat/plat_target_filter.H b/src/hwpf/include/plat/plat_target_filter.H
deleted file mode 100644
index 0e19fa71..00000000
--- a/src/hwpf/include/plat/plat_target_filter.H
+++ /dev/null
@@ -1,90 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/include/plat/plat_target_filter.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-#ifndef __FAPI2_PLAT_TARGET_FILTER__
-#define __FAPI2_PLAT_TARGET_FILTER__
-
-#include <stdint.h>
-
-//
-// Define TargetFilter enum values for the platform
-//
-namespace fapi2
-{
-namespace PlatTargetFilter
-{
-// These values must contain only 1 bit 'on' so that they can be ORed
-// together as composite filters
-
-constexpr uint64_t PLAT_TARGET_FILTER_TP = 0x8000000000000000; // Pervasive 1
-constexpr uint64_t PLAT_TARGET_FILTER_NEST_NORTH = 0x4000000000000000; // Pervasive 2
-constexpr uint64_t PLAT_TARGET_FILTER_NEST_EAST = 0x2000000000000000; // Pervasive 3
-constexpr uint64_t PLAT_TARGET_FILTER_NEST_SOUTH = 0x1000000000000000; // Pervasive 4
-constexpr uint64_t PLAT_TARGET_FILTER_NEST_WEST = 0x0800000000000000; // Pervasive 5
-constexpr uint64_t PLAT_TARGET_FILTER_XBUS = 0x0400000000000000; // Pervasive 6
-constexpr uint64_t PLAT_TARGET_FILTER_MC_WEST = 0x0200000000000000; // Pervasive 7
-constexpr uint64_t PLAT_TARGET_FILTER_MC_EAST = 0x0100000000000000; // Pervasive 8
-constexpr uint64_t PLAT_TARGET_FILTER_OBUS0 = 0x0080000000000000; // Pervasive 9
-constexpr uint64_t PLAT_TARGET_FILTER_OBUS1 = 0x0040000000000000; // Pervasive 10
-constexpr uint64_t PLAT_TARGET_FILTER_OBUS2 = 0x0020000000000000; // Pervasive 11
-constexpr uint64_t PLAT_TARGET_FILTER_OBUS3 = 0x0010000000000000; // Pervasive 12
-constexpr uint64_t PLAT_TARGET_FILTER_PCI0 = 0x0008000000000000; // Pervasive 13
-constexpr uint64_t PLAT_TARGET_FILTER_PCI1 = 0x0004000000000000; // Pervasive 14
-constexpr uint64_t PLAT_TARGET_FILTER_PCI2 = 0x0002000000000000; // Pervasive 15
-constexpr uint64_t PLAT_TARGET_FILTER_CACHE0 = 0x0001000000000000; // Pervasive 16
-constexpr uint64_t PLAT_TARGET_FILTER_CACHE1 = 0x0000800000000000; // Pervasive 17
-constexpr uint64_t PLAT_TARGET_FILTER_CACHE2 = 0x0000400000000000; // Pervasive 18
-constexpr uint64_t PLAT_TARGET_FILTER_CACHE3 = 0x0000200000000000; // Pervasive 19
-constexpr uint64_t PLAT_TARGET_FILTER_CACHE4 = 0x0000100000000000; // Pervasive 20
-constexpr uint64_t PLAT_TARGET_FILTER_CACHE5 = 0x0000080000000000; // Pervasive 21
-constexpr uint64_t PLAT_TARGET_FILTER_CORE0 = 0x0000040000000000; // Pervasive 32
-constexpr uint64_t PLAT_TARGET_FILTER_CORE1 = 0x0000020000000000; // Pervasive 33
-constexpr uint64_t PLAT_TARGET_FILTER_CORE2 = 0x0000010000000000; // Pervasive 34
-constexpr uint64_t PLAT_TARGET_FILTER_CORE3 = 0x0000008000000000; // Pervasive 35
-constexpr uint64_t PLAT_TARGET_FILTER_CORE4 = 0x0000004000000000; // Pervasive 36
-constexpr uint64_t PLAT_TARGET_FILTER_CORE5 = 0x0000002000000000; // Pervasive 37
-constexpr uint64_t PLAT_TARGET_FILTER_CORE6 = 0x0000001000000000; // Pervasive 38
-constexpr uint64_t PLAT_TARGET_FILTER_CORE7 = 0x0000000800000000; // Pervasive 39
-constexpr uint64_t PLAT_TARGET_FILTER_CORE8 = 0x0000000400000000; // Pervasive 40
-constexpr uint64_t PLAT_TARGET_FILTER_CORE9 = 0x0000000200000000; // Pervasive 41
-constexpr uint64_t PLAT_TARGET_FILTER_CORE10 = 0x0000000100000000; // Pervasive 42
-constexpr uint64_t PLAT_TARGET_FILTER_CORE11 = 0x0000000080000000; // Pervasive 43
-constexpr uint64_t PLAT_TARGET_FILTER_CORE12 = 0x0000000040000000; // Pervasive 44
-constexpr uint64_t PLAT_TARGET_FILTER_CORE13 = 0x0000000020000000; // Pervasive 45
-constexpr uint64_t PLAT_TARGET_FILTER_CORE14 = 0x0000000010000000; // Pervasive 46
-constexpr uint64_t PLAT_TARGET_FILTER_CORE15 = 0x0000000008000000; // Pervasive 47
-constexpr uint64_t PLAT_TARGET_FILTER_CORE16 = 0x0000000004000000; // Pervasive 48
-constexpr uint64_t PLAT_TARGET_FILTER_CORE17 = 0x0000000002000000; // Pervasive 49
-constexpr uint64_t PLAT_TARGET_FILTER_CORE18 = 0x0000000001000000; // Pervasive 50
-constexpr uint64_t PLAT_TARGET_FILTER_CORE19 = 0x0000000000800000; // Pervasive 51
-constexpr uint64_t PLAT_TARGET_FILTER_CORE20 = 0x0000000000400000; // Pervasive 52
-constexpr uint64_t PLAT_TARGET_FILTER_CORE21 = 0x0000000000200000; // Pervasive 53
-constexpr uint64_t PLAT_TARGET_FILTER_CORE22 = 0x0000000000100000; // Pervasive 54
-constexpr uint64_t PLAT_TARGET_FILTER_CORE23 = 0x0000000000080000; // Pervasive 55
-
-} // namespace PlatTargetFilter
-
-} // namespace fapi2
-
-#endif
diff --git a/src/hwpf/include/plat/plat_target_parms.H b/src/hwpf/include/plat/plat_target_parms.H
deleted file mode 100644
index 79d9edf0..00000000
--- a/src/hwpf/include/plat/plat_target_parms.H
+++ /dev/null
@@ -1,101 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/include/plat/plat_target_parms.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2017 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-/**
- * @file plat_ppe_target.H
- * @brief Definitions for fapi2 PPE targets
- */
-
-#ifndef __FAPI2_PPE_TARGET_PARMS__
-#define __FAPI2_PPE_TARGET_PARMS__
-
-#include "fapi_sbe_common.H"
-
-
-CONST_UINT32_T(CHIP_TARGET_OFFSET, 0);
-CONST_UINT32_T(CHIP_TARGET_COUNT , 1);
-
-// Nest targets - Group 1
-CONST_UINT32_T(NEST_GROUP1_TARGET_OFFSET, CHIP_TARGET_OFFSET + CHIP_TARGET_COUNT);
-CONST_UINT32_T(NEST_GROUP1_CHIPLET_OFFSET, 0x1);
-CONST_UINT32_T(NEST_GROUP1_TARGET_COUNT, 6);
-
-// MCBIST targets
-CONST_UINT32_T(MCBIST_TARGET_OFFSET, NEST_GROUP1_TARGET_OFFSET + NEST_GROUP1_TARGET_COUNT);
-CONST_UINT32_T(MCBIST_CHIPLET_OFFSET, 0x7);
-CONST_UINT32_T(MCBIST_TARGET_COUNT, 2);
-
-// Nest targets - Group 2
-CONST_UINT32_T(NEST_GROUP2_TARGET_OFFSET, MCBIST_TARGET_OFFSET + MCBIST_TARGET_COUNT);
-CONST_UINT32_T(NEST_GROUP2_TARGET_COUNT, 7);
-CONST_UINT32_T(NEST_GROUP2_CHIPLET_OFFSET, 0x9);
-
-// Cache Targets
-CONST_UINT32_T(EQ_TARGET_OFFSET, NEST_GROUP2_TARGET_OFFSET + NEST_GROUP2_TARGET_COUNT);
-CONST_UINT32_T(EQ_CHIPLET_OFFSET, 0x10);
-CONST_UINT32_T(EQ_TARGET_COUNT, 6);
-
-// Core Targets
-CONST_UINT32_T(CORE_TARGET_OFFSET, EQ_TARGET_OFFSET + EQ_TARGET_COUNT);
-CONST_UINT32_T(CORE_CHIPLET_OFFSET, 0x20);
-CONST_UINT32_T(CORE_TARGET_COUNT, 24);
-
-// Ex Targets
-CONST_UINT32_T(EX_TARGET_OFFSET, CORE_TARGET_OFFSET + CORE_TARGET_COUNT);
-CONST_UINT32_T(EX_CHIPLET_OFFSET, 0x10);
-CONST_UINT32_T(EX_TARGET_COUNT, 12);
-
-// MCS Targets
-CONST_UINT32_T(MCS_TARGET_OFFSET, EX_TARGET_OFFSET + EX_TARGET_COUNT);
-CONST_UINT32_T(MCS_TARGET_COUNT, 4);
-
-// PHB Targets
-CONST_UINT32_T(PHB_TARGET_OFFSET, MCS_TARGET_OFFSET + MCS_TARGET_COUNT);
-CONST_UINT32_T(PHB_TARGET_COUNT, 6);
-
-// System Target
-CONST_UINT32_T(SYSTEM_TARGET_OFFSET, PHB_TARGET_OFFSET + PHB_TARGET_COUNT);
-CONST_UINT32_T(SYSTEM_TARGET_COUNT, 1);
-
-CONST_UINT32_T(MCAST_TARGET_OFFSET, SYSTEM_TARGET_OFFSET + SYSTEM_TARGET_COUNT);
-CONST_UINT32_T(MCAST_CHIPLET_OFFSET, 4);
-CONST_UINT32_T(MCAST_TARGET_COUNT, 3); // PPE only needs multicast groups 4-6
-
-// Total number of pervasive targets (Both NEST groups + EQs + COREs +MCBISTs)
-CONST_UINT32_T(PERV_TARGET_COUNT, NEST_GROUP1_TARGET_COUNT + NEST_GROUP2_TARGET_COUNT +
- MCBIST_TARGET_COUNT + EQ_TARGET_COUNT + CORE_TARGET_COUNT);
-
-// Total Target Count
-CONST_UINT32_T(TARGET_COUNT, CHIP_TARGET_COUNT +
- PERV_TARGET_COUNT +
- EX_TARGET_COUNT +
- MCS_TARGET_COUNT +
- PHB_TARGET_COUNT +
- SYSTEM_TARGET_COUNT +
- MCAST_TARGET_COUNT);
-
-// Maximum possible Pervasive chiplets
-CONST_UINT32_T(MAX_PERV_CHIPLETS, 64);
-
-#endif // __FAPI2_PPE_TARGET_PARMS__
diff --git a/src/hwpf/include/plat/plat_target_utils.H b/src/hwpf/include/plat/plat_target_utils.H
deleted file mode 100644
index 9d3e520f..00000000
--- a/src/hwpf/include/plat/plat_target_utils.H
+++ /dev/null
@@ -1,89 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/include/plat/plat_target_utils.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2017 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-/**
- * @file plat_target_util.H
- * @brief platform utility definitions for fapi2 targets
- */
-
-#ifndef __FAPI2_PLAT_TARGET_UTIL__
-#define __FAPI2_PLAT_TARGET_UTIL__
-
-#include <proc_sbe_fixed.H>
-
-#pragma pack(8) //Start of packing to 8byte boundary
- typedef struct {
- fapi2attr::SystemAttributes_t G_system_attrs;
- fapi2attr::ProcChipAttributes_t G_proc_chip_attrs;
- fapi2attr::PervAttributes_t G_perv_attrs;
- fapi2attr::CoreAttributes_t G_core_attrs;
- fapi2attr::EXAttributes_t G_ex_attrs;
- fapi2attr::EQAttributes_t G_eq_attrs;
- } G_sbe_attrs_t;
-#pragma pack()//End of packing to 8byte boundary
-
-//
-// Platform Utility functions..
-//
-namespace fapi2
-{
- /// @brief Function to initialize the G_targets vector based on partial good
- /// attributes
- ReturnCode plat_TargetsInit();
-
- /// @brief Function to apply any gard records set (via
- // ATTR_EQ_GARD/ATTR_EC_GARD) to mark corresponding targets non functional
- ReturnCode plat_ApplyGards();
-
- /// @brief Function to initialize the G_targets vector based on partial good
- /// attributes
- Target<TARGET_TYPE_PROC_CHIP> plat_getChipTarget();
-
- /// @brief Function to return a platform target handle, given the chiplet
- // number and the fapi2 Target type
- // @tparam K The fapi2 TargetType
- // @param i_chipletNumber The chiplet number of the target
- // @return Platform handle
- // @note The caller can use the platform handle to construct a Target of
- // it's choice. Ex:
- // fapi2::Target<fapi2::TARGET_TYPE_CORE>
- // l_core(plat_getTargetHandleByChipletNumber<fapi2::TARGET_TYPE_CORE>(0x20);
- template <TargetType K>
- plat_target_handle_t plat_getTargetHandleByChipletNumber(
- const uint8_t i_chipletNumber);
-
- /// @brief Function to return a platform target handle, given the target
- /// instance number and the fapi2 Target type
- // @tparam K The fapi2 TargetType
- // @param i_targetNum The instance number for the target
- // @return Platform handle
- // @note The caller can use the platform handle to construct a Target of
- // it's choice. Ex:
- // fapi2::Target<fapi2::TARGET_TYPE_EX>
- // l_ex(plat_getTargetHandleByInstance<fapi2::TARGET_TYPE_EX>(0);
- template <TargetType K>
- plat_target_handle_t plat_getTargetHandleByInstance(
- const uint8_t i_targetNum);
-}
-#endif
diff --git a/src/hwpf/include/plat/plat_trace.H b/src/hwpf/include/plat/plat_trace.H
deleted file mode 100644
index fcc87899..00000000
--- a/src/hwpf/include/plat/plat_trace.H
+++ /dev/null
@@ -1,114 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/include/plat/plat_trace.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2016 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-/**
- * @file plat_trace.H
- * @brief Defines the FAPI2 trace macros.
- *
- * Note that platform code must provide the implementation.
- *
- * FAPI has provided a default implementation. Platform code must
- * provide an alternate implementation if needed.
- */
-
-#ifndef FAPI2_PLATTRACE_H_
-#define FAPI2_PLATTRACE_H_
-
-#include <stdint.h>
-
-// @todo update these headers with extern "C" in a future commit
-// or not and leave this just as it is.
-extern "C"
-{
-#include "pk.h"
-#include <pk_trace.h>
-#include "trac_interface.h"
-}
-
-// Why not a #define, why is this in the fapi2 namespace?
-// To prevent problems with Cronus and the fapi1 definitions.
-namespace fapi2
-{
- static const uint32_t MAX_ECMD_STRING_LEN = 64;
-};
-
-// Information traces (go into fast trace buffer that can wrap often)
-#define FAPI_TRACE(_id_, _fmt_, _args_...) \
- PK_TRACE(_fmt_, ##_args_);
-
-
-/* The following is a desirous trace entry but the second line has a
- compilation issue that is unresolved
-
-#define FAPI_TRACE(_id_, _fmt_, _args_...) \
- PK_TRACE("%s: %s:%d ", _id_, __FUNCTION__, __LINE__); \
- PK_TRACE(_fmt_, ##_args_);
-*/
-// FAPI_TRACE_LEVEL controls what traces are included in the code build
-// 0 == No tracing
-// 1 == ERR traces only
-// 2 == ERR and IMP only
-// 3 == ERR, IMP and INF only. This is the default in Makefile
-// > 4 == All traces (ERR, IMP, INF, DBG, SCAN, MFG)
-#if (FAPI_TRACE_LEVEL >= 3)
-#define FAPI_INF(_fmt_, _args_...) FAPI_TRACE("inf", _fmt_, ##_args_)
-#else
-#define FAPI_INF(_fmt_, _args_...)
-#endif
-
-// Important traces (go into slow trace buffer that should not wrap often)
-#if (FAPI_TRACE_LEVEL >= 2)
-#define FAPI_IMP(_fmt_, _args_...) FAPI_TRACE("imp", _fmt_, ##_args_)
-#else
-#define FAPI_IMP(_fmt_, _args_...)
-#endif
-
-// Error traces (go into slow trace buffer that should not wrap often)
-#if (FAPI_TRACE_LEVEL >= 1)
-#define FAPI_ERR(_fmt_, _args_...) FAPI_TRACE("err", _fmt_, ##_args_)
-#else
-#define FAPI_ERR(_fmt_, _args_...)
-#endif
-
-// Debug traces (go into fast trace buffer that can wrap often)
-#if (FAPI_TRACE_LEVEL >= 4)
-#define FAPI_DBG(_fmt_, _args_...) FAPI_TRACE("dbg", _fmt_, ##_args_)
-#else
-#define FAPI_DBG(_fmt_, _args_...)
-#endif
-
-// Scan traces
-#if (FAPI_TRACE_LEVEL >= 4)
-#define FAPI_SCAN(_fmt_, _args_...) FAPI_TRACE("scan", _fmt_, ##_args_)
-#else
-#define FAPI_SCAN(_fmt_, _args_...)
-#endif
-
-#if (FAPI_TRACE_LEVEL >= 4)
-#define FAPI_MFG(_fmt_, _args_...) FAPI_TRACE("mfg", _fmt_, ##_args_)
-#else
-#define FAPI_MFG(_fmt_, _args_...)
-#endif
-
-#endif // FAPI2_PLATTRACE_H_
diff --git a/src/hwpf/include/plat/plat_utils.H b/src/hwpf/include/plat/plat_utils.H
deleted file mode 100644
index eadee6aa..00000000
--- a/src/hwpf/include/plat/plat_utils.H
+++ /dev/null
@@ -1,65 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/include/plat/plat_utils.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-#ifndef _PLAT_UTILS_H_
-#define _PLAT_UTILS_H_
-
-#ifdef __ASSEMBLER__
-
-#ifndef ULL
-#define ULL(x) x
-#endif
-
-#else
-
-#ifndef ULL
-#define ULL(x) x##ull
-
-#endif
-
-#endif // __ASSEMBLER
-
-/// Create a multi-bit mask of \a n bits starting at bit \a b
-#ifndef BITS
- #define BITS(b, n) ((ULL(0xffffffffffffffff) << (64 - (n))) >> (b))
-#endif
-
-/// Create a single bit mask at bit \a b
-#ifndef BIT
- #define BIT(b) BITS((b), 1)
-#endif
-
-#ifdef _BIG_ENDIAN
-
-#define revle16(x) x
-#define revle32(x) x
-#define revle64(x) x
-
-#else
-
-uint16_t revle16(uint16_t i_x);
-uint32_t revle32(uint32_t i_x);
-uint64_t revle64(uint64_t i_x);
-
-#endif
-#endif //_PLAT_UTILS_H_
diff --git a/src/hwpf/include/plat/target.H b/src/hwpf/include/plat/target.H
deleted file mode 100644
index 3bdfc4dc..00000000
--- a/src/hwpf/include/plat/target.H
+++ /dev/null
@@ -1,410 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/hwpf/include/plat/target.H $ */
-/* */
-/* OpenPOWER sbe Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2017 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-/**
- * @file target.H
- * @brief platform specializations for fapi2 targets
- */
-
-#ifndef __FAPI2_TARGET__
-#define __FAPI2_TARGET__
-
-#include <plat_target.H>
-#include <plat_target_parms.H>
-#include <fapi2_target.H>
-#include <multicast.H>
-#include <plat_trace.H>
-#include <utils.H>
-#include <stdint.h>
-#include <vector>
-#include <plat_target_utils.H>
-
-extern "C"
-{
- extern std::vector<fapi2::plat_target_handle_t> G_vec_targets;
-}
-
-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
-{
-
- template<TargetType T>
- constexpr plat_target_type_t fapiTargetTypeToPlatTargetType()
- {
- return PPE_TARGET_TYPE_NONE;
- }
-
- template<>
- constexpr plat_target_type_t fapiTargetTypeToPlatTargetType<TARGET_TYPE_PROC_CHIP>()
- {
- return PPE_TARGET_TYPE_PROC_CHIP;
- }
-
- template<>
- constexpr plat_target_type_t fapiTargetTypeToPlatTargetType<TARGET_TYPE_EQ>()
- {
- return PPE_TARGET_TYPE_EQ;
- }
-
- template<>
- constexpr plat_target_type_t fapiTargetTypeToPlatTargetType<TARGET_TYPE_CORE>()
- {
- return PPE_TARGET_TYPE_CORE;
- }
-
- template<>
- constexpr plat_target_type_t fapiTargetTypeToPlatTargetType<TARGET_TYPE_EX>()
- {
- return PPE_TARGET_TYPE_EX;
- }
-
- template<>
- constexpr plat_target_type_t fapiTargetTypeToPlatTargetType<TARGET_TYPE_MCS>()
- {
- return PPE_TARGET_TYPE_MCS;
- }
-
- template<>
- constexpr plat_target_type_t fapiTargetTypeToPlatTargetType<TARGET_TYPE_PHB>()
- {
- return PPE_TARGET_TYPE_PHB;
- }
-
- template<>
- constexpr plat_target_type_t fapiTargetTypeToPlatTargetType<TARGET_TYPE_MCBIST>()
- {
- return PPE_TARGET_TYPE_MCBIST;
- }
-
- template<>
- constexpr plat_target_type_t fapiTargetTypeToPlatTargetType<TARGET_TYPE_PERV>()
- {
- return PPE_TARGET_TYPE_PERV;
- }
-
- ///
- /// @brief Assignment Operator.
- /// @param[in] i_right Reference to Target to assign from.
- /// @return Reference to 'this' Target
- ///
- template<TargetType K, typename V>
- Target<K, V>& Target<K, V>::operator=(const Target& i_right)
- {
- this->iv_handle.value = i_right.iv_handle.value;
- return *this;
- }
- ///
- /// @brief Equality Comparison Operator
- /// @param[in] i_right Reference to Target to compare.
- /// @return bool. True if equal.
- /// @note Platforms need to define this so that the physical
- /// targets are determined to be equivilent rather than just the handles
- ///
- template<TargetType K, typename V>
- bool Target<K, V>::operator==(const Target& i_right) const
- {
- if (this->iv_handle.value == i_right.iv_handle.value)
- return true;
- else
- return false;
- }
-
- ///
- /// @brief Inquality Comparison Operator
- /// @param[in] i_right Reference to Target to compare.
- /// @return bool. True if not equal.
- /// @note Platforms need to define this so that the physical
- /// targets are determined to be equivilent rather than just the handles
- ///
- template<TargetType K, typename V>
- bool Target<K, V>::operator!=(const Target& i_right) const
- {
- if (this->iv_handle.value != i_right.iv_handle.value)
- return true;
- else
- return false;
- }
-
- ///
- /// @brief Get this target's immediate parent
- /// @tparam T The type of the parent
- /// @return Target<T, V> a target representing the parent
- ///
- template<TargetType K, typename V>
- template<TargetType T>
- inline Target<T, V> Target<K, V>::getParent(void) const
- {
- constexpr TargetType TARGET_TYPE_PROC_CHILDREN =
- TARGET_TYPE_EQ | TARGET_TYPE_PERV | TARGET_TYPE_EX |
- TARGET_TYPE_MCBIST | TARGET_TYPE_CORE |
- TARGET_TYPE_MCS | TARGET_TYPE_PROC_CHIP | TARGET_TYPE_PHB;
-
- static_assert(((
- ((K & TARGET_TYPE_PROC_CHILDREN) != TARGET_TYPE_NONE) ||
- (K == TARGET_TYPE_ALL)) &&
- ((T == TARGET_TYPE_EQ) ||
- (T == TARGET_TYPE_EX) ||
- (T == TARGET_TYPE_PROC_CHIP) ||
- (T == TARGET_TYPE_PERV))),
- "Invalid parent/child target type passed");
-
- static_assert(!((K == TARGET_TYPE_EQ) &&
- (T != TARGET_TYPE_PERV) &&
- (T != TARGET_TYPE_PROC_CHIP)),
- "Invalid parent for EQ target, must be PERV or "
- "PROC_CHIP");
-
- static_assert(!((T == TARGET_TYPE_PROC_CHIP) &&
- ((K & TARGET_TYPE_PROC_CHILDREN) == TARGET_TYPE_NONE)),
- "Parent proc chip invalid for this target type");
-
- static_assert(!((K == TARGET_TYPE_MCBIST) &&
- (T != TARGET_TYPE_PERV) &&
- (T != TARGET_TYPE_PROC_CHIP)),
- "Invalid parent for MCBIST target, must be PERV or "
- "PROC_CHIP");
-
- static_assert(!((K == TARGET_TYPE_CORE) &&
- (T != TARGET_TYPE_PERV) &&
- (T != TARGET_TYPE_PROC_CHIP) &&
- (T != TARGET_TYPE_EQ) &&
- (T != TARGET_TYPE_EX)),
- "Invalid parent for CORE target, must be PERV or "
- "PROC_CHIP or EQ or EX");
-
- static_assert(!((K == TARGET_TYPE_PERV) &&
- (T != TARGET_TYPE_PERV) &&
- (T != TARGET_TYPE_PROC_CHIP)),
- "Invalid parent for PERV target, must be PERV or "
- "PROC_CHIP");
-
- static_assert(!((K == TARGET_TYPE_EX) &&
- (T != TARGET_TYPE_PROC_CHIP) &&
- (T != TARGET_TYPE_EQ)),
- "Invalid parent for EX target, must be PERV or "
- "PROC_CHIP or EQ");
-
- if(TARGET_TYPE_PERV == T) // EQ/EC/MCBIST/PERV ===> PERV
- {
- return static_cast<V>(this->iv_handle);
- }
- if(TARGET_TYPE_PROC_CHIP == T) // EQ/EC/EX/MCBIST/PERV ===> PROC
- {
- return static_cast<V>(G_vec_targets[CHIP_TARGET_OFFSET]);
- }
- if((TARGET_TYPE_EQ == T) && (TARGET_TYPE_CORE == K)) // EC ===> EQ
- {
- return static_cast<V>(G_vec_targets[(static_cast<plat_target_handle_t>(get()).getTargetInstance() / CORES_PER_QUAD) + EQ_TARGET_OFFSET]);
- }
- if((TARGET_TYPE_EQ == T) && (TARGET_TYPE_EX == K)) // EX ===> EQ
- {
- return static_cast<V>(G_vec_targets[(static_cast<plat_target_handle_t>(get()).getTargetInstance() / EX_PER_QUAD) + EQ_TARGET_OFFSET]);
- }
- if(TARGET_TYPE_EX == T) // EC ===> EX
- {
- return static_cast<V>(G_vec_targets[(static_cast<plat_target_handle_t>(get()).getTargetInstance() / CORES_PER_EX) + EX_TARGET_OFFSET]);
- }
- }
-
- ///
- /// @brief Get this target's immediate parent - specialization for compound
- // target (PROC_CHIP | CORE | EX)
- /// @tparam T The type of the parent
- /// @return Target<T, plat_target_handle_t> a target representing the parent
- ///
- template<>
- template<TargetType T>
- Target<T, plat_target_handle_t>
- Target<TARGET_TYPE_PROC_CHIP | TARGET_TYPE_CORE | TARGET_TYPE_EX | TARGET_TYPE_PERV,
- plat_target_handle_t>::getParent(void) const
- {
- static_assert(((T == TARGET_TYPE_PROC_CHIP) || (T == TARGET_TYPE_EQ)),
- "Wrong parent target type");
- return static_cast<plat_target_handle_t>(get()).getParent(T);
- }
-
- /// @brief Get this target's children - handles EQ/EX/EC conversions
- /// @tparam K The type of parent
- /// @tparam V The plat target handle type
- /// @tparam T The type of child
- /// @param[in] i_state The desired TargetState of the children
- /// @return std::vector<Target<T, V> > a vector of present/functional
- /// children
- /// @warning The children are returned in order, ex child[0] is
- /// std::vector[0]
- template<TargetType K, typename V>
- template<TargetType T>
- std::vector<Target<T, V>>
- Target<K, V>::getChildren(const TargetState i_state) const
- {
- constexpr TargetType L = static_cast<TargetType>(K & ~(TARGET_TYPE_PROC_CHIP));
- constexpr plat_target_type_t P = fapiTargetTypeToPlatTargetType<T>();
-
- static_assert(sizeof(Target<T, V>) == sizeof(plat_target_handle_t),
- "Sizes of plat target and FAPI target must match");
-
- static_assert(((L == TARGET_TYPE_EQ) || (L == TARGET_TYPE_EX) || (K == TARGET_TYPE_PROC_CHIP)),
- "Invalid parent passed to getChildren");
- // valid children for EQ
- // EQ -> CORE
- // EQ -> EX
- static_assert(!((L == fapi2::TARGET_TYPE_EQ) &&
- (T != fapi2::TARGET_TYPE_CORE) &&
- (T != fapi2::TARGET_TYPE_EX)),
- "improper child of fapi2::TARGET_TYPE_EQ");
-
- // valid children for EX
- // EX -> CORE
- static_assert(!((L == fapi2::TARGET_TYPE_EX) &&
- (T != fapi2::TARGET_TYPE_CORE)),
- "improper child of fapi2::TARGET_TYPE_EX");
-
-
- std::vector<Target<T, V> > l_children;
- static_cast<plat_target_handle_t>(get()).getChildren(K, T, P, i_state, reinterpret_cast<std::vector<plat_target_handle>&>(l_children));
- return l_children;
- }
-
- // Specialization of getChildren, filtered for the chip target
- template<TargetType K, typename V>
- template<TargetType T>
- std::vector<Target<T, V> >
- Target<K, V>::getChildren(const TargetFilter i_filter,
- const TargetState i_state) const
- {
- static_assert(sizeof(Target<T, V>) == sizeof(plat_target_handle_t),
- "Sizes of plat target and FAPI target must match");
-
- static_assert((K == TARGET_TYPE_PROC_CHIP), "Parent target must be the proc chip");
- static_assert((T == TARGET_TYPE_EQ) || (T == TARGET_TYPE_CORE)
- || (T == TARGET_TYPE_PERV) || (T == TARGET_TYPE_MCBIST),
- "Child target type must be a pervasive chiplet");
-
- std::vector<Target<T> > l_children;
-
- (static_cast<plat_target_handle_t>(get())).getChildren(i_filter, i_state, reinterpret_cast<std::vector<plat_target_handle_t>&>(l_children));
-
- return l_children;
- }
-
- ///
- /// @brief Is the target functional?
- /// @return true if target is functional, false if non-functional
- ///
- template<TargetType K, typename V>
- inline bool
- Target<K, V>::isFunctional(void) const
- {
- return static_cast<plat_target_handle_t>(get()).getFunctional();
- }
-
- ///
- /// @brief Returns the chiplet number for this Target
- /// @return The chiplet number
- ///
- template<TargetType K, typename V>
- inline uint8_t
- Target<K, V>::getChipletNumber(void) const
- {
- return static_cast<plat_target_handle_t>(iv_handle).fields.chiplet_num;
- }
-
- ///
- /// @brief Return the string interpretation of this target
- /// @tparam T The type of the target
- /// @param[in] i_target Target<T>
- /// @param[in] i_buffer buffer to write in to
- /// @param[in] i_bsize size of the buffer
- /// @return void
- /// @post The contents of the buffer is replaced with the string
- /// representation of the target
- ///
- template< TargetType T, typename V >
- inline void toString(const Target<T, V>& i_target, char* i_buffer, size_t i_bsize)
- {
- snprintf(i_buffer, i_bsize, "Target 0x%lx/0x%x", i_target.get(), T);
- }
-
- ///
- /// @brief Return the string interpretation of this target
- /// @tparam T The type of the target
- /// @tparam B The type of the buffer
- /// @param[in] A pointer to the Target<T, V>
- /// @param[in] i_buffer buffer to write in to
- /// @param[in] i_bsize size of the buffer
- /// @return void
- /// @post The contents of the buffer is replaced with the string
- /// representation of the target
- ///
- template< TargetType T, typename V >
- inline void toString(const Target<T, V>* i_target, char* i_buffer, size_t i_bsize)
- {
- snprintf(i_buffer, i_bsize, "Target 0x%lx/0x%x", i_target->get(), T);
- }
-
- ///
- /// @brief Get an enumerated target of a specific type
- /// @tparam T The type of the target
- /// @param[in] Ordinal representing the ordinal number of
- /// the desired target
- /// @return Target<T, V> the target requested
- ///
- template<TargetType T, typename V>
- inline Target<T, V> getTarget(uint64_t Ordinal)
- {
- // For testing
- return Target<T, V>(Ordinal);
- }
-}
-
-#endif
OpenPOWER on IntegriCloud