mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-18 06:58:54 +00:00
arm: socfpga: stratix10: Fix mailbox urgent command with urgent register
According to mailbox spec, software should send urgent command with urgent register instead of COUT location. This patch write urgent command index to urgent register. Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
This commit is contained in:
parent
db3b5e9898
commit
8497cb9b25
1 changed files with 7 additions and 8 deletions
|
@ -160,15 +160,15 @@ static __always_inline int mbox_send_cmd_common(u8 id, u32 cmd, u8 is_indirect,
|
||||||
u32 buf_len;
|
u32 buf_len;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = mbox_prepare_cmd_only(id, cmd, is_indirect, len, arg);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
if (urgent) {
|
if (urgent) {
|
||||||
/* Read status because it is toggled */
|
/* Read status because it is toggled */
|
||||||
status = MBOX_READL(MBOX_STATUS) & MBOX_STATUS_UA_MSK;
|
status = MBOX_READL(MBOX_STATUS) & MBOX_STATUS_UA_MSK;
|
||||||
/* Send command as urgent command */
|
/* Write urgent command to urgent register */
|
||||||
MBOX_WRITEL(1, MBOX_URG);
|
MBOX_WRITEL(cmd, MBOX_URG);
|
||||||
|
} else {
|
||||||
|
ret = mbox_prepare_cmd_only(id, cmd, is_indirect, len, arg);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* write doorbell */
|
/* write doorbell */
|
||||||
|
@ -188,8 +188,7 @@ static __always_inline int mbox_send_cmd_common(u8 id, u32 cmd, u8 is_indirect,
|
||||||
|
|
||||||
if (urgent) {
|
if (urgent) {
|
||||||
u32 new_status = MBOX_READL(MBOX_STATUS);
|
u32 new_status = MBOX_READL(MBOX_STATUS);
|
||||||
/* urgent command doesn't have response */
|
|
||||||
MBOX_WRITEL(0, MBOX_URG);
|
|
||||||
/* Urgent ACK is toggled */
|
/* Urgent ACK is toggled */
|
||||||
if ((new_status & MBOX_STATUS_UA_MSK) ^ status)
|
if ((new_status & MBOX_STATUS_UA_MSK) ^ status)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue