mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 01:54:22 +00:00
Merge "fix(plat/mediatek/pmic_wrap): update idle flow" into integration
This commit is contained in:
commit
0f7d2e8911
1 changed files with 19 additions and 1 deletions
|
@ -26,12 +26,30 @@ static uint32_t pwrap_check_idle(void *wacs_register, uint32_t timeout_us)
|
|||
while (retry != 0) {
|
||||
udelay(WAIT_IDLE_POLLING_DELAY_US);
|
||||
reg_rdata = mmio_read_32((uintptr_t)wacs_register);
|
||||
if (GET_WACS_FSM(reg_rdata) == SWINF_FSM_IDLE) {
|
||||
/* if last read command timeout,clear vldclr bit
|
||||
* read command state machine:FSM_REQ-->wfdle-->WFVLDCLR;
|
||||
* write:FSM_REQ-->idle
|
||||
*/
|
||||
switch (GET_WACS_FSM(reg_rdata)) {
|
||||
case SWINF_FSM_WFVLDCLR:
|
||||
mmio_write_32((uintptr_t)&mtk_pwrap->wacs2_vldclr, 0x1);
|
||||
INFO("WACS_FSM = SWINF_FSM_WFVLDCLR\n");
|
||||
break;
|
||||
case SWINF_FSM_WFDLE:
|
||||
INFO("WACS_FSM = SWINF_FSM_WFDLE\n");
|
||||
break;
|
||||
case SWINF_FSM_REQ:
|
||||
INFO("WACS_FSM = SWINF_FSM_REQ\n");
|
||||
break;
|
||||
case SWINF_FSM_IDLE:
|
||||
goto done;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
retry--;
|
||||
};
|
||||
|
||||
done:
|
||||
if (retry == 0) {
|
||||
/* timeout */
|
||||
return E_PWR_WAIT_IDLE_TIMEOUT;
|
||||
|
|
Loading…
Add table
Reference in a new issue