diff options
author | Tom Warren <twarren@nvidia.com> | 2015-07-17 08:19:18 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-07-21 21:45:59 +0200 |
commit | d9c7a7b4dadc088c49a5668b13bb74fc6eea8079 (patch) | |
tree | 6580a4d40ce173d56309d7c1e9f3aad38c3aff0b /src/soc | |
parent | 2b7693d63a4e9c160a611f4e2cf5df29bc81d2b5 (diff) | |
download | coreboot-d9c7a7b4dadc088c49a5668b13bb74fc6eea8079.tar.xz |
t132: 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.
This change was propogated from T210, commit ID fe48f094
BUG=None
BRANCH=None
TEST=Ryu/Rush build OK.
Change-Id: I13073cc12ed0a6390d55b00c725d1cc7d0797e23
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: aab62d5148b57fd1e05c1e838eafe8fdee431ef8
Original-Change-Id: I7388e9fd73d591de50962aaefc5ab902f560fc6f
Original-Signed-off-by: Tom Warren <twarren@nvidia.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/286468
Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: http://review.coreboot.org/11017
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/soc')
-rw-r--r-- | src/soc/nvidia/tegra132/dma.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/soc/nvidia/tegra132/dma.c b/src/soc/nvidia/tegra132/dma.c index 9f04e9777f..fb986923f9 100644 --- a/src/soc/nvidia/tegra132/dma.c +++ b/src/soc/nvidia/tegra132/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) |