Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10946
-gerrit
commit 22f574f24111ff42e20d863313e6fe4bc193464d Author: Furquan Shaikh furquan@google.com Date: Mon Jul 13 09:48:52 2015 -0700
t210: Correct dma_busy function
In case of continuous mode, use STA_ACTIVITY bit to determine if DMA operation is complete. However, in case of ONCE mode, use STA_BSY bit to determine if DMA operation on the channel is complete.
BUG=chrome-os-partner:41877 BRANCH=None TEST=Compiles successfully and reboot test runs fine for 10K+ iterations
Change-Id: If98f195481b18c402bd9cac353080c317e0e1168 Signed-off-by: Patrick Georgi pgeorgi@chromium.org Original-Commit-Id: 927026db6fd910dac32dc218f28efcbc7b788b4e Original-Change-Id: Ib66bedfb413f948728a4f9cffce9d9c3feb0bfda Original-Signed-off-by: Furquan Shaikh furquan@google.com Original-Reviewed-on: https://chromium-review.googlesource.com/285140 Original-Tested-by: Furquan Shaikh furquan@chromium.org Original-Reviewed-by: Aaron Durbin adurbin@chromium.org Original-Commit-Queue: Furquan Shaikh furquan@chromium.org Original-Trybot-Ready: Furquan Shaikh furquan@chromium.org --- src/soc/nvidia/tegra210/dma.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/soc/nvidia/tegra210/dma.c b/src/soc/nvidia/tegra210/dma.c index 9f04e97..fb98692 100644 --- a/src/soc/nvidia/tegra210/dma.c +++ b/src/soc/nvidia/tegra210/dma.c @@ -69,9 +69,21 @@ int dma_busy(struct apb_dma_channel * const channel) * In continuous mode, the BSY_n bit in APB_DMA_STATUS and * BSY in APBDMACHAN_CHANNEL_n_STA_0 will remain set as '1' so long * as the channel is enabled. So for this function we'll use the - * DMA_ACTIVITY bit. + * DMA_ACTIVITY bit in case of continuous mode. + * + * However, for ONCE mode, the BSY_n bit in APB_DMA_STATUS will be used + * to determine end of dma operation. */ - return read32(&channel->regs->sta) & APB_STA_DMA_ACTIVITY ? 1 : 0; + uint32_t bit; + + if (read32(&channel->regs->csr) & APB_CSR_ONCE) + /* Once mode */ + bit = APB_STA_BSY; + else + /* Continuous mode */ + bit = APB_STA_DMA_ACTIVITY; + + return read32(&channel->regs->sta) & bit ? 1 : 0; } /* claim a DMA channel */ struct apb_dma_channel * const dma_claim(void)