From 7738208e04ad42fd8f9e5d4e3e51d8f27eb4c95f Mon Sep 17 00:00:00 2001 From: spashabk-in Date: Fri, 23 Dec 2016 01:28:27 -0600 Subject: Tracearray HWP L2 Change-Id: I2fbb02f8dc372f37aa725e26fb5ee2dd307ac275 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34191 Tested-by: Jenkins Server Reviewed-by: Joachim Fenkes Reviewed-by: Sachin Gupta Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40875 Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- .../p9/procedures/hwp/perv/p9_sbe_tracearray.H | 49 +++++++++++++++------- 1 file changed, 34 insertions(+), 15 deletions(-) (limited to 'src/import/chips/p9/procedures/hwp/perv/p9_sbe_tracearray.H') diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_tracearray.H b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_tracearray.H index fbb1e4709..0143ef64a 100644 --- a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_tracearray.H +++ b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_tracearray.H @@ -43,8 +43,8 @@ // *HWP HW Backup Owner : Joe McGill // *HWP FW Owner : Shakeeb Pasha // *HWP Team : Perv -// *HWP Level : 1 -// *HWP Consumed by : SBE +// *HWP Level : 2 +// *HWP Consumed by : Conus, SBE //------------------------------------------------------------------------------ #ifndef _P9_SBE_TRACEARRAY_H @@ -56,8 +56,22 @@ #include #include "p9_tracearray_defs.H" +constexpr uint32_t P9_TRACEARRAY_FIRST_ROW = 0; +constexpr uint32_t MCBIST_CHIPLET_ID_START = 0x07; +constexpr uint32_t MCBIST_CHIPLET_ID_END = 0x08; +constexpr uint32_t OBUS_CHIPLET_ID_START = 0x09; +constexpr uint32_t OBUS_CHIPLET_ID_END = 0x0C; + +#define IS_MCBIST(chipletId) \ + ((chipletId >= MCBIST_CHIPLET_ID_START) && \ + (chipletId <= MCBIST_CHIPLET_ID_END)) + +#define IS_OBUS(chipletId) \ + ((chipletId >= OBUS_CHIPLET_ID_START) && \ + (chipletId <= OBUS_CHIPLET_ID_END)) + // structure to represent HWP arguments -struct p9_sbe_tracearray_args +struct proc_gettracearray_args { p9_tracearray_bus_id trace_bus; ///< The trace bus whose associated trace array should be dumped bool stop_pre_dump; ///< Stop the trace array before starting the dump @@ -69,14 +83,16 @@ struct p9_sbe_tracearray_args static const fapi2::TargetType P9_SBE_TRACEARRAY_TARGET_TYPES = fapi2::TARGET_TYPE_PROC_CHIP | + fapi2::TARGET_TYPE_PERV | fapi2::TARGET_TYPE_EX | fapi2::TARGET_TYPE_CORE; //function pointer typedef definition for HWP call support typedef fapi2::ReturnCode (*p9_sbe_tracearray_FP_t) ( const fapi2::Target& i_target, - const p9_sbe_tracearray_args& i_args, - uint8_t* o_ta_data, + const proc_gettracearray_args& i_args, + uint64_t* o_ta_data, + const uint32_t i_cur_row, const uint32_t i_num_rows ); @@ -89,16 +105,17 @@ extern "C" { * @return The type of target to hand to p9_sbe_tracearray to clearly * identify the array instance. */ - static inline fapi2::TargetType p9_sbe_tracearray_target_type(p9_tracearray_bus_id i_trace_bus) + static inline fapi2::TargetType p9_sbe_tracearray_target_type( + p9_tracearray_bus_id i_trace_bus) { - /* On SBE there is no support for MCBIST and OBUS fapi targets. - * But since the usage related to these targets in p9_sbe_tracearray - * is only for SCOMs with fully qualified adresses, PROC - * target is used for MCBIST and OBUS as well */ - if (i_trace_bus <= _PROC_TB_LAST_MC_TARGET) + if (i_trace_bus <= _PROC_TB_LAST_PROC_TARGET) { return fapi2::TARGET_TYPE_PROC_CHIP; } + else if (i_trace_bus <= _PROC_TB_LAST_MC_TARGET) + { + return fapi2::TARGET_TYPE_PERV; + } else if (i_trace_bus <= _PROC_TB_LAST_EX_TARGET) { return fapi2::TARGET_TYPE_EX; @@ -109,8 +126,6 @@ extern "C" { } } - - /* TODO via RTC:164528 - Look at optimization to improve performance * @brief Retrieve trace array data, based on the number of * rows requested, from selected trace array via SCOM. @@ -137,18 +152,22 @@ extern "C" { * if trace array dump sequence completes successfully, * RC_PROC_GETTRACEARRAY_INVALID_BUS * if an invalid trace bus ID has been requested + * RC_PROC_GETTRACEARRAY_INVALID_TARGET + * if the supplied target type does not match the requested trace bus * RC_PROC_GETTRACEARRAY_CORE_NOT_DUMPABLE * if a core trace array has been requested but the chip's core * is not dumpable via SCOM -> use fastarray instead + * RC_PROC_GETTRACEARRAY_TRACE_RUNNING + * if trace array is running when dump collection is attempted, * RC_PROC_GETTRACEARRAY_TRACE_MUX_INCORRECT * if the primary trace mux is not set up to trace the requested bus, * else FAPI getscom/putscom return code for failing operation */ fapi2::ReturnCode p9_sbe_tracearray( const fapi2::Target& i_target, - const p9_sbe_tracearray_args& i_args, + const proc_gettracearray_args& i_args, uint64_t* o_ta_data, - const uint32_t i_cur_row = 0, + const uint32_t i_cur_row = P9_TRACEARRAY_FIRST_ROW, const uint32_t i_num_rows = P9_TRACEARRAY_NUM_ROWS ); } // extern "C" -- cgit v1.2.1