rtkit: Always wake up/boot IOP unconditionally

Get rid of asc_cpu_stop() which was never a thing. The CPU start bit
should always be off in the steady state, it is only used momentarily to
start the CPU.

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2022-06-01 00:52:13 +09:00
parent 7023e247bb
commit abd48b0b5c
4 changed files with 5 additions and 7 deletions

View file

@ -51,6 +51,8 @@ asc_dev_t *asc_init(const char *path)
asc->iop_node = adt_first_child_offset(adt, node);
asc->cpu_base = base;
asc->base = base + 0x8000;
clear32(base + ASC_CPU_CONTROL, ASC_CPU_CONTROL_START);
return asc;
}
@ -67,10 +69,7 @@ int asc_get_iop_node(asc_dev_t *asc)
void asc_cpu_start(asc_dev_t *asc)
{
set32(asc->cpu_base + ASC_CPU_CONTROL, ASC_CPU_CONTROL_START);
}
void asc_cpu_stop(asc_dev_t *asc)
{
udelay(10);
clear32(asc->cpu_base + ASC_CPU_CONTROL, ASC_CPU_CONTROL_START);
}

View file

@ -18,7 +18,6 @@ void asc_free(asc_dev_t *asc);
int asc_get_iop_node(asc_dev_t *asc);
void asc_cpu_start(asc_dev_t *asc);
void asc_cpu_stop(asc_dev_t *asc);
bool asc_can_recv(asc_dev_t *asc);
bool asc_can_send(asc_dev_t *asc);

View file

@ -329,7 +329,6 @@ bool nvme_init(void)
nvme_asc = asc_init("/arm-io/ans");
if (!nvme_asc)
goto out_ioq;
asc_cpu_start(nvme_asc);
nvme_sart = sart_init("/arm-io/sart-ans");
if (!nvme_sart)
@ -451,7 +450,6 @@ void nvme_shutdown(void)
printf("nvme: timeout while waiting for CSTS.RDY to clear\n");
rtkit_sleep(nvme_rtkit);
asc_cpu_stop(nvme_asc);
pmgr_reset(nvme_die, "ANS2");
rtkit_free(nvme_rtkit);
sart_free(nvme_sart);

View file

@ -481,6 +481,8 @@ bool rtkit_boot(rtkit_dev_t *rtk)
{
struct asc_message msg;
/* boot the IOP if it isn't already */
asc_cpu_start(rtk->asc);
/* can be sent unconditionally to wake up a possibly sleeping IOP */
msg.msg0 = FIELD_PREP(MGMT_TYPE, MGMT_MSG_IOP_PWR_STATE) |
FIELD_PREP(MGMT_PWR_STATE, RTKIT_POWER_INIT);