summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Aberg <maberg@gaisler.com>2015-10-27 12:41:50 +0100
committerDaniel Hellstrom <daniel@gaisler.com>2017-03-06 07:54:55 +0100
commit6ecad1d526512b59414cb3d541285f7ac38d6817 (patch)
tree10c400cb0b66ca4031de72de99171d9bb9cdc0fe
parenta48bfc0ffa8924ddce55a567795a5352a98fb322 (diff)
downloadrtems-6ecad1d526512b59414cb3d541285f7ac38d6817.tar.bz2
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.
-rw-r--r--c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c4
1 files changed, 4 insertions, 0 deletions
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 96348ae758..6d2cefb2b6 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 */