aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-socfpga
diff options
context:
space:
mode:
authorLey Foon Tan <ley.foon.tan@intel.com>2018-08-17 16:22:03 +0800
committerMarek Vasut <marex@denx.de>2018-08-24 12:05:20 +0200
commit8497cb9b25302e75a4422502c9d13d310ffbcfd2 (patch)
treeb080b431d7a55682b1bbb07b20f46815efe825f4 /arch/arm/mach-socfpga
parentdb3b5e9898f5420a7dbf7c38d80ea3f0d972de36 (diff)
downloadu-boot-8497cb9b25302e75a4422502c9d13d310ffbcfd2.zip
u-boot-8497cb9b25302e75a4422502c9d13d310ffbcfd2.tar.gz
u-boot-8497cb9b25302e75a4422502c9d13d310ffbcfd2.tar.bz2
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>
Diffstat (limited to 'arch/arm/mach-socfpga')
-rw-r--r--arch/arm/mach-socfpga/mailbox_s10.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga/mailbox_s10.c
index cccd1a4..0d906c3 100644
--- a/arch/arm/mach-socfpga/mailbox_s10.c
+++ b/arch/arm/mach-socfpga/mailbox_s10.c
@@ -160,15 +160,15 @@ static __always_inline int mbox_send_cmd_common(u8 id, u32 cmd, u8 is_indirect,
u32 buf_len;
int ret;
- ret = mbox_prepare_cmd_only(id, cmd, is_indirect, len, arg);
- if (ret)
- return ret;
-
if (urgent) {
/* Read status because it is toggled */
status = MBOX_READL(MBOX_STATUS) & MBOX_STATUS_UA_MSK;
- /* Send command as urgent command */
- MBOX_WRITEL(1, MBOX_URG);
+ /* Write urgent command to urgent register */
+ MBOX_WRITEL(cmd, MBOX_URG);
+ } else {
+ ret = mbox_prepare_cmd_only(id, cmd, is_indirect, len, arg);
+ if (ret)
+ return ret;
}
/* write doorbell */
@@ -188,8 +188,7 @@ static __always_inline int mbox_send_cmd_common(u8 id, u32 cmd, u8 is_indirect,
if (urgent) {
u32 new_status = MBOX_READL(MBOX_STATUS);
- /* urgent command doesn't have response */
- MBOX_WRITEL(0, MBOX_URG);
+
/* Urgent ACK is toggled */
if ((new_status & MBOX_STATUS_UA_MSK) ^ status)
return 0;