diff options
-rw-r--r-- | src/common/global_app_cfg.h | 3 | ||||
-rwxr-xr-x | src/common/gpe_export.h | 12 | ||||
-rw-r--r-- | src/occ_gpe0/core_data.c | 2 | ||||
-rw-r--r-- | src/occ_gpe0/gpe0_main.c | 7 | ||||
-rw-r--r-- | src/occ_gpe0/gpe_core_data.c | 12 | ||||
-rw-r--r-- | src/occ_gpe1/gpe1_main.c | 7 |
6 files changed, 36 insertions, 7 deletions
diff --git a/src/common/global_app_cfg.h b/src/common/global_app_cfg.h index 81cf4db..0962d19 100644 --- a/src/common/global_app_cfg.h +++ b/src/common/global_app_cfg.h @@ -34,6 +34,9 @@ // Turn off periodic GPE traces #define PK_TRACE_TIMER_OUTPUT 0 +// Increase size of GPE trace buffers +#define PK_TRACE_SZ 1024 + // Redefine the default MSR to mask off SIB errors and avoid data machine checks // These SIB errors probably occur due to contention on the PIB #define PK_THREAD_MACHINE_CONTEXT_DEFAULT (MSR_SEM | MSR_UIE | MSR_EE | MSR_ME) diff --git a/src/common/gpe_export.h b/src/common/gpe_export.h index 9b6adfd..2cc9191 100755 --- a/src/common/gpe_export.h +++ b/src/common/gpe_export.h @@ -60,9 +60,17 @@ typedef struct gpe_shared_data { uint32_t nest_freq_div; // Nest freq / 4 uint32_t spipss_spec_p9; // Which APSS spec to use - uint32_t fir_heap_buffer_ptr; + uint32_t fir_heap_buffer_ptr; uint32_t fir_params_buffer_ptr; - uint32_t reserved[60]; + uint32_t gpe0_tb_ptr; + uint32_t gpe0_tb_sz; + uint32_t gpe1_tb_ptr; + uint32_t gpe1_tb_sz; + uint32_t pgpe_tb_ptr; + uint32_t pgpe_tb_sz; + uint32_t sgpe_tb_ptr; + uint32_t sgpe_tb_sz; + uint32_t reserved[52]; } gpe_shared_data_t; diff --git a/src/occ_gpe0/core_data.c b/src/occ_gpe0/core_data.c index 0ac8376..7dcb613 100644 --- a/src/occ_gpe0/core_data.c +++ b/src/occ_gpe0/core_data.c @@ -54,7 +54,7 @@ uint32_t get_core_data(uint32_t i_core, // rc == 1 resource occupied (see ppe42_scom.h) Action: return with rc // rc == 2 Core is fenced, offline Action: return with rc // rc == 3 partial good - // rc == 4 address error + // rc == 4 address error (Can be caused by other device using bus) // rc == 5 clock error // rc == 6 packet error // rc == 7 timeout diff --git a/src/occ_gpe0/gpe0_main.c b/src/occ_gpe0/gpe0_main.c index 1eb227a..2962d60 100644 --- a/src/occ_gpe0/gpe0_main.c +++ b/src/occ_gpe0/gpe0_main.c @@ -30,6 +30,7 @@ /// an example of how to add traces to the code. #include "pk.h" +#include "pk_trace.h" #include "ipc_api.h" #include "ipc_ping.h" #include "gpe_export.h" @@ -47,6 +48,8 @@ PkThread G_main_thread; gpe_shared_data_t * G_gpe_shared_data = (gpe_shared_data_t*) GPE_SHARED_DATA_ADDR; +extern PkTraceBuffer* g_pk_trace_buf_ptr; + //statically initialize a ping command message IPC_PING_CMD_CREATE(G_ping_cmd); @@ -83,6 +86,10 @@ int main(int argc, char **argv) l_timebase = PPE_TIMEBASE_HZ; } + // Mark the location of the trace buffer in shared data + G_gpe_shared_data->gpe0_tb_ptr = (uint32_t) g_pk_trace_buf_ptr; + G_gpe_shared_data->gpe0_tb_sz = sizeof(PkTraceBuffer); + // initializes kernel data (stack, threads, timebase, timers, etc.) pk_initialize((PkAddress)G_kernel_stack, KERNEL_STACK_SIZE, diff --git a/src/occ_gpe0/gpe_core_data.c b/src/occ_gpe0/gpe_core_data.c index d8f6983..0911a49 100644 --- a/src/occ_gpe0/gpe_core_data.c +++ b/src/occ_gpe0/gpe_core_data.c @@ -5,7 +5,7 @@ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* Contributors Listed Below - COPYRIGHT 2015,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -50,15 +50,19 @@ void gpe_get_core_data(ipc_msg_t* cmd, void* arg) uint32_t rc; // return code ipc_async_cmd_t *async_cmd = (ipc_async_cmd_t*)cmd; ipc_core_data_parms_t *args = (ipc_core_data_parms_t*) async_cmd->cmd_data; - + static uint32_t L_trace = 0; rc = get_core_data(args->core_num, // core ID args->data); // CoreData* if(rc) { - PK_TRACE("gpe_get_core_data: get_core_data failed, rc = 0x%08x, core = 0x%08x", - rc, args->core_num); + if( !(L_trace & (1 << args->core_num)) ) + { + PK_TRACE("gpe_get_core_data: get_core_data failed, rc = 0x%08x, core = 0x%08x", + rc, args->core_num); + L_trace |= (1 << args->core_num); + } gpe_set_ffdc(&(args->error), args->core_num, GPE_RC_GET_CORE_DATA_FAILED, rc); } diff --git a/src/occ_gpe1/gpe1_main.c b/src/occ_gpe1/gpe1_main.c index 670dff0..6272621 100644 --- a/src/occ_gpe1/gpe1_main.c +++ b/src/occ_gpe1/gpe1_main.c @@ -30,6 +30,7 @@ /// an example of how to add traces to the code. #include "pk.h" +#include "pk_trace.h" #include "ipc_api.h" #include "gpe_export.h" @@ -43,6 +44,8 @@ uint8_t G_kernel_stack[KERNEL_STACK_SIZE]; gpe_shared_data_t * G_gpe_shared_data = (gpe_shared_data_t*) GPE_SHARED_DATA_ADDR; +extern PkTraceBuffer* g_pk_trace_buf_ptr; + // The main function is called by the boot code (after initializing some // registers) int main(int argc, char **argv) @@ -56,6 +59,10 @@ int main(int argc, char **argv) l_timebase = PPE_TIMEBASE_HZ; } + // Mark the location of the trace buffer in shared data + G_gpe_shared_data->gpe1_tb_ptr = (uint32_t) g_pk_trace_buf_ptr; + G_gpe_shared_data->gpe1_tb_sz = sizeof(PkTraceBuffer); + // initializes kernel data (stack, threads, timebase, timers, etc.) pk_initialize((PkAddress)G_kernel_stack, KERNEL_STACK_SIZE, |