[PATCH 07/44] leon, grspw_pkt: Preserve DMA address enable at start.
Daniel Hellstrom
daniel at gaisler.com
Fri Mar 3 14:56:40 UTC 2017
From: Martin Aberg <maberg at gaisler.com>
The EN bit (enable separate node address for this channel) is preserved when
grspw_dma_start is called. This preserves any previous address configuration.
---
c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c b/c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c
index 96348ae..6d2cefb 100644
--- a/c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c
+++ b/c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c
@@ -2209,6 +2209,7 @@ int grspw_dma_start(void *c)
struct grspw_dma_priv *dma = c;
struct grspw_dma_regs *dregs = dma->regs;
unsigned int ctrl;
+ IRQFLAGS_TYPE irqflags;
if (dma->started)
return 0;
@@ -2264,7 +2265,10 @@ int grspw_dma_start(void *c)
ctrl |= GRSPW_DMACTRL_RI;
if (dma->cfg.tx_irq_en_cnt != 0)
ctrl |= GRSPW_DMACTRL_TI;
+ SPIN_LOCK_IRQ(&dma->core->devlock, irqflags);
+ ctrl |= REG_READ(&dma->regs->ctrl) & GRSPW_DMACTRL_EN;
REG_WRITE(&dregs->ctrl, ctrl);
+ SPIN_UNLOCK_IRQ(&dma->core->devlock, irqflags);
dma->started = 1; /* open up other DMA interfaces */
--
2.7.4
More information about the devel
mailing list