diff options
Diffstat (limited to 'import/chips/p9')
5 files changed, 63 insertions, 39 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 94e0c40c..698ccfce 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 40a49397..5c0ec63b 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) { diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_exit.c b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_exit.c index 26d6647d..273c5ed4 100644 --- a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_exit.c +++ b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_exit.c @@ -403,39 +403,62 @@ p9_sgpe_stop_exit() // PGPE, as part of its processing this IPC, // will write the QPPM_DPLL_FREQ register before responding. - if((G_sgpe_stop_record.wof.update_pgpe & SGPE_IPC_UPDATE_QUAD_ENABLED) && - (in32(OCB_OCCS2) & BIT32(PGPE_PSTATE_PROTOCOL_ACTIVE)) && - G_sgpe_stop_record.group.quad[VECTOR_EXIT]) // exit from STOP11 + + if ((in32(OCB_OCCS2) & BIT32(PGPE_ACTIVE)) && + G_sgpe_stop_record.group.quad[VECTOR_EXIT]) // exit from STOP11 { - PK_TRACE_INF("SXIPC: Update PGPE with Active Quads(stop11 and pstate enabled)"); - G_sgpe_ipcmsg_update_quads.fields.update_type = SGPE_IPC_UPDATE_TYPE_EXIT; - G_sgpe_ipcmsg_update_quads.fields.return_code = SGPE_IPC_RETURN_CODE_NULL; - G_sgpe_ipcmsg_update_quads.fields.requested_quads = - (G_sgpe_stop_record.group.quad[VECTOR_EXIT] >> SHIFT32(5)); + G_sgpe_ipcmsg_update_quads.fields.requested_quads = 0; - 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); + for(cexit = G_sgpe_stop_record.group.core[VECTOR_EXIT], + qspwu = G_sgpe_stop_record.group.qswu[VECTOR_EXIT], + qloop = 0; + (cexit > 0 || qspwu > 0) && (qloop < MAX_QUADS); + cexit = cexit << 4, qspwu = qspwu << 1, qloop++) + { - rc = ipc_send_cmd(&G_sgpe_ipccmd_to_pgpe.cmd); + if (!((cexit & BITS32(0, 4)) || (qspwu & BIT32(0)))) + { + continue; + } - if(rc) - { - PK_TRACE_ERR("ERROR: Exit Updates PGPE with Active Quads Failed. HALT SGPE!"); - PK_PANIC(SGPE_STOP_EXIT_IPC_QUAD_FAILED); + + if(G_sgpe_stop_record.state[qloop].act_state_q >= STOP_LEVEL_11) + { + G_sgpe_ipcmsg_update_quads.fields.requested_quads |= (0x20 >> qloop); + } } - /// @todo RTC166577 - /// move the poll below to before dpll setup when sgpe supports multicast - PK_TRACE_INF("SXIPC: Poll PGPE Update Active Quads Ack"); + if (G_sgpe_ipcmsg_update_quads.fields.requested_quads) + { + PK_TRACE_INF("SXIPC: Update PGPE with Active Quads(stop11 and pstate enabled)"); + G_sgpe_ipcmsg_update_quads.fields.update_type = SGPE_IPC_UPDATE_TYPE_EXIT; + G_sgpe_ipcmsg_update_quads.fields.return_code = SGPE_IPC_RETURN_CODE_NULL; + G_sgpe_ipcmsg_update_quads.fields.requested_quads = + (G_sgpe_stop_record.group.quad[VECTOR_EXIT] >> SHIFT32(5)); - while (G_sgpe_ipcmsg_update_quads.fields.return_code == SGPE_IPC_RETURN_CODE_NULL); + 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, + p9_sgpe_ipc_pgpe_rsp_callback, (void*)&G_sgpe_stop_record.sem[3]); - if (G_sgpe_ipcmsg_update_quads.fields.return_code != SGPE_IPC_RETURN_CODE_ACK) - { - PK_TRACE_ERR("ERROR: Exit Updates PGPE with Active Quads Bad RC. HALT SGPE!"); - PK_PANIC(SGPE_STOP_EXIT_IPC_QUAD_BAD_RC); + rc = ipc_send_cmd(&G_sgpe_ipccmd_to_pgpe.cmd); + + if(rc) + { + PK_TRACE_ERR("ERROR: Exit Updates PGPE with Active Quads Failed. HALT SGPE!"); + PK_PANIC(SGPE_STOP_EXIT_IPC_QUAD_FAILED); + } + + /// @todo RTC166577 + /// move the poll below to before dpll setup when sgpe supports multicast + PK_TRACE_INF("SXIPC: Pend PGPE Update Active Quads Ack"); + pk_semaphore_pend(&(G_sgpe_stop_record.sem[3]), PK_WAIT_FOREVER); + + if (G_sgpe_ipcmsg_update_quads.fields.return_code != SGPE_IPC_RETURN_CODE_ACK) + { + PK_TRACE_ERR("ERROR: Exit Updates PGPE with Active Quads Bad RC. HALT SGPE!"); + PK_PANIC(SGPE_STOP_EXIT_IPC_QUAD_BAD_RC); + } } } @@ -1133,6 +1156,7 @@ p9_sgpe_stop_exit() G_sgpe_stop_record.group.quad[VECTOR_ACTIVE] |= G_sgpe_stop_record.group.quad[VECTOR_EXIT]; + //=========================== MARK_TRAP(ENDSCOPE_STOP_EXIT) //=========================== diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_irq_handlers.c b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_irq_handlers.c index 961c163a..24976afe 100644 --- a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_irq_handlers.c +++ b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_irq_handlers.c @@ -56,7 +56,7 @@ SgpeStopRecord G_sgpe_stop_record __attribute__((section (".dump_ptrs"))) = // wof status {0, 0, 0, 0}, // semaphores - {{0, 0}} + {{0, 0, 0}} }; // PCB Interrupt Type2 diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe.mk b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe.mk index 3ef5ab9f..2bdb1f64 100644 --- a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe.mk +++ b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/stop_gpe.mk @@ -128,7 +128,7 @@ $(IMAGE)_COMMONFLAGS+= -DUSE_SIMICS_IO=0 $(IMAGE)_COMMONFLAGS+= -DSTOP_PRIME=0 $(IMAGE)_COMMONFLAGS+= -DSKIP_HOMER_ACCESS=0 -$(IMAGE)_COMMONFLAGS+= -DSKIP_IPC=1 +$(IMAGE)_COMMONFLAGS+= -DSKIP_IPC=0 $(IMAGE)_COMMONFLAGS+= -DSKIP_L3_PURGE=0 $(IMAGE)_COMMONFLAGS+= -DSKIP_L3_PURGE_ABORT=0 |