diff options
| author | Yue Du <daviddu@us.ibm.com> | 2017-04-19 14:16:24 -0500 |
|---|---|---|
| committer | hostboot <hostboot@us.ibm.com> | 2018-08-22 17:54:48 -0500 |
| commit | 42ddb69355b92c2608f2789c7eafb327ec68bc5d (patch) | |
| tree | c24e18d93b8b8edef816582a5aa22758e4a04edb | |
| parent | d1883eb35452af28cc8bfcd94cdb087033da26fc (diff) | |
| download | talos-hcode-42ddb69355b92c2608f2789c7eafb327ec68bc5d.tar.gz talos-hcode-42ddb69355b92c2608f2789c7eafb327ec68bc5d.zip | |
STOP: SGPE fixes for PGPE Interaction
- SGPE checks PGPE_ACTIVE bit on OCC Scratch2
- SGPE uses semaphore for waiting on PGPE ACKs
- SGPE checks STOP_LVL before sending Update Quad Active Exit
- Sets IPC build flag to enable
Change-Id: I6c2accdc144c2d21d1eafb1171002a397740ebdb
Original-Change-Id: I8d99bf94e50d296e46c685ebf16f5e5cd155520d
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/39449
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Michael S. Floyd <mfloyd@us.ibm.com>
Reviewed-by: Juan R. Medina <jrmedina@us.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
| -rw-r--r-- | import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop.h | 4 | ||||
| -rw-r--r-- | import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_entry.c | 20 |
2 files changed, 12 insertions, 12 deletions
diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop.h b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop.h index 7a13e774..f974fc60 100644 --- a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop.h +++ b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop.h @@ -300,7 +300,7 @@ typedef struct // group of ex and quad entering or exiting the stop sgpe_group_t group; sgpe_wof_t wof; - PkSemaphore sem[2]; + PkSemaphore sem[3]; } SgpeStopRecord; typedef struct @@ -324,6 +324,8 @@ void p9_sgpe_clear_slvcfg_pm_disable(uint32_t); /// SGPE to PGPE IPC handlers void p9_sgpe_ipc_pgpe_ctrl_stop_updates(ipc_msg_t* cmd, void* arg); void p9_sgpe_ipc_pgpe_suspend_stop(ipc_msg_t* cmd, void* arg); +void p9_sgpe_ipc_pgpe_rsp_callback(ipc_msg_t* cmd, void* arg); + /// SGPE STOP Entry and Exit Prototypes void p9_sgpe_stop_pig_handler(void*, PkIrqId); diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_entry.c b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_entry.c index 0a9fdfd8..0b388077 100644 --- a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_entry.c +++ b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_entry.c @@ -230,7 +230,7 @@ p9_sgpe_stop_entry() // will resume Pstate protocol operations. // 4. optionally finishes the entry (if not done above) - if ((in32(OCB_OCCS2) & BIT32(PGPE_PSTATE_PROTOCOL_ACTIVE)) && + if ((in32(OCB_OCCS2) & BIT32(PGPE_ACTIVE)) && G_sgpe_stop_record.group.quad[VECTOR_ENTRY]) // entry into STOP11 { //=============================== @@ -246,7 +246,7 @@ p9_sgpe_stop_entry() G_sgpe_ipccmd_to_pgpe.cmd_data = &G_sgpe_ipcmsg_suspend_pstate; ipc_init_msg(&G_sgpe_ipccmd_to_pgpe.cmd, IPC_MSGID_SGPE_PGPE_SUSPEND_PSTATE, - 0, 0); + p9_sgpe_ipc_pgpe_rsp_callback, (void*)&G_sgpe_stop_record.sem[2]); rc = ipc_send_cmd(&G_sgpe_ipccmd_to_pgpe.cmd); @@ -258,9 +258,8 @@ p9_sgpe_stop_entry() /// @todo RTC166577 /// move poll below to before stop cache clocks when sgpe supports multicast - PK_TRACE_INF("SEIPC: Poll PGPE Suspend Pstate Ack"); - - while (G_sgpe_ipcmsg_suspend_pstate.fields.return_code == SGPE_IPC_RETURN_CODE_NULL); + PK_TRACE_INF("SEIPC: Pend PGPE Suspend Pstate Ack"); + pk_semaphore_pend(&(G_sgpe_stop_record.sem[2]), PK_WAIT_FOREVER); if (G_sgpe_ipcmsg_suspend_pstate.fields.return_code != SGPE_IPC_RETURN_CODE_ACK) { @@ -1135,8 +1134,8 @@ p9_sgpe_stop_entry() /// @todo RTC166577 /// this block can be done as early as after stop cache clocks /// when sgpe supports multicast - if((G_sgpe_stop_record.wof.update_pgpe & SGPE_IPC_UPDATE_QUAD_ENABLED) && - G_sgpe_stop_record.group.quad[VECTOR_ENTRY]) + if ((in32(OCB_OCCS2) & BIT32(PGPE_ACTIVE)) && + G_sgpe_stop_record.group.quad[VECTOR_ENTRY]) { PK_TRACE_INF("SEIPC: Send PGPE Resume with Active Quads Updated(0 if aborted)"); // Note: if all quads aborted on l3 purge, the list will be 0s; @@ -1149,7 +1148,7 @@ p9_sgpe_stop_entry() G_sgpe_ipccmd_to_pgpe.cmd_data = &G_sgpe_ipcmsg_update_quads; ipc_init_msg(&G_sgpe_ipccmd_to_pgpe.cmd, IPC_MSGID_SGPE_PGPE_UPDATE_ACTIVE_QUADS, - 0, 0); + p9_sgpe_ipc_pgpe_rsp_callback, (void*)&G_sgpe_stop_record.sem[2]); rc = ipc_send_cmd(&G_sgpe_ipccmd_to_pgpe.cmd); @@ -1159,9 +1158,8 @@ p9_sgpe_stop_entry() PK_PANIC(SGPE_STOP_ENTRY_IPC_QUAD_FAILED); } - PK_TRACE_INF("SEIPC: Poll PGPE Update Active Quads Ack"); - - while (G_sgpe_ipcmsg_update_quads.fields.return_code == SGPE_IPC_RETURN_CODE_NULL); + PK_TRACE_INF("SEIPC: Pend PGPE Update Active Quads Ack"); + pk_semaphore_pend(&(G_sgpe_stop_record.sem[2]), PK_WAIT_FOREVER); if (G_sgpe_ipcmsg_update_quads.fields.return_code != SGPE_IPC_RETURN_CODE_ACK) { |

