summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuslaimi, Alif Zakuan <alif.zakuan.yuslaimi@intel.com>2022-07-13 14:47:02 +0800
committerLokanathan, Raaj <raaj.lokanathan@intel.com>2022-10-11 14:41:49 +0800
commit8da34aa7651cd8f69abd0cbdd5b127796e945e98 (patch)
treed4ee212b16af33c53f570bab177170afa2edf316
parenta58aac9cf49037951b9d99e0b16f32bfedd13bf3 (diff)
downloadu-boot-socfpga-8da34aa7651cd8f69abd0cbdd5b127796e945e98.tar.gz
HSD #18019005734: arch: arm: mach-socfpga: SDM Doorbell Issue Fix
This patch clears the buffer overflow check during command buffer write, removes command buffer overflow checking and set to always trigger SDM doorbell at the end of command buffer to ensure SDM can read all of the remaining data. Signed-off-by: Yuslaimi, Alif Zakuan <alif.zakuan.yuslaimi@intel.com>
-rw-r--r--arch/arm/mach-socfpga/mailbox_s10.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/arch/arm/mach-socfpga/mailbox_s10.c b/arch/arm/mach-socfpga/mailbox_s10.c
index eb972edb2f..ca4b95dbf8 100644
--- a/arch/arm/mach-socfpga/mailbox_s10.c
+++ b/arch/arm/mach-socfpga/mailbox_s10.c
@@ -93,6 +93,8 @@ static __always_inline int mbox_write_cmd_buffer(u32 *cin, u32 data,
MBOX_WRITE_CMD_BUF(data, (*cin)++);
*cin %= MBOX_CMD_BUFFER_SIZE;
MBOX_WRITEL(*cin, MBOX_CIN);
+ if (is_cmdbuf_overflow)
+ *is_cmdbuf_overflow = 0;
break;
}
timeout--;
@@ -101,10 +103,6 @@ static __always_inline int mbox_write_cmd_buffer(u32 *cin, u32 data,
if (!timeout)
return -ETIMEDOUT;
- /* Wait for the SDM to drain the FIFO command buffer */
- if (is_cmdbuf_overflow && *is_cmdbuf_overflow)
- return mbox_wait_for_cmdbuf_empty(*cin);
-
return 0;
}
@@ -130,13 +128,10 @@ static __always_inline int mbox_fill_cmd_circular_buff(u32 header, u32 len,
return ret;
}
- /* If SDM doorbell is not triggered after the last data is
- * written into mailbox FIFO command buffer, trigger the
- * SDM doorbell again to ensure SDM able to read the remaining
- * data.
+ /* Always trigger the SDM doorbell at the end to ensure SDM able to read
+ * the remaining data.
*/
- if (!is_cmdbuf_overflow)
- MBOX_WRITEL(1, MBOX_DOORBELL_TO_SDM);
+ MBOX_WRITEL(1, MBOX_DOORBELL_TO_SDM);
return 0;
}