[rtems commit] leon, grspw_pkt: Preserve DMA address enable at start.

Daniel Hellstrom danielh at rtems.org
Mon Mar 6 06:58:44 UTC 2017


Module:    rtems
Branch:    master
Commit:    6ecad1d526512b59414cb3d541285f7ac38d6817
Changeset: http://git.rtems.org/rtems/commit/?id=6ecad1d526512b59414cb3d541285f7ac38d6817

Author:    Martin Aberg <maberg at gaisler.com>
Date:      Tue Oct 27 12:41:50 2015 +0100

leon, grspw_pkt: Preserve DMA address enable at start.

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 */
 




More information about the vc mailing list