mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-16 08:16:42 +07:00
memory: brcmstb: dpfe: wait for DCPU to be ready
We wait for the DCPU to be ready before sending a command. Signed-off-by: Markus Mayer <mmayer@broadcom.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
This commit is contained in:
parent
6ca5d2ba9e
commit
a7c25759d8
@ -304,6 +304,18 @@ static int __send_command(struct private_data *priv, unsigned int cmd,
|
||||
|
||||
mutex_lock(&priv->lock);
|
||||
|
||||
/* Wait for DCPU to become ready */
|
||||
for (i = 0; i < DELAY_LOOP_MAX; i++) {
|
||||
resp = readl_relaxed(regs + REG_TO_HOST_MBOX);
|
||||
if (resp == 0)
|
||||
break;
|
||||
msleep(1);
|
||||
}
|
||||
if (resp != 0) {
|
||||
mutex_unlock(&priv->lock);
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
/* Write command and arguments to message area */
|
||||
for (i = 0; i < MSG_FIELD_MAX; i++)
|
||||
writel_relaxed(msg[i], regs + DCPU_MSG_RAM(i));
|
||||
|
Loading…
Reference in New Issue
Block a user