summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/shared/include/grspw_pkt.h
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2017-01-22 15:58:18 +0100
committerDaniel Hellstrom <daniel@gaisler.com>2017-03-06 07:54:55 +0100
commit94fb377bd92c7c0fbbfe76e60c513959e6e32f2d (patch)
tree3b6f18fe1b52459a820650cadbee7c55c69d3ee3 /c/src/lib/libbsp/sparc/shared/include/grspw_pkt.h
parentleon, grpsw_pkt: set unique work-task name (diff)
downloadrtems-94fb377bd92c7c0fbbfe76e60c513959e6e32f2d.tar.bz2
leon, grspw_pkt: ISR RX/TX DMA interrupt source disable configurable
This patch introduces some new options to let the user control when the ISR shall disable DMA RX/TX interrupt. The ISR can be set in three modes when a RX/TX DMA interrupt is asserted: 1) ISR will always clear both RX/TX DMA interrupt enable. (DEFAULT). 2) ISR will never never RX or TX DMA interrupt enable, ISR will leave RX/TX DMA interrupt enable untouched. 3) ISR will clear the interrupt enable(s) causing the interrupt, this allows separate RX and TX IRQ handling. This patch is backwards compatible since default mode 1) is activated when the grspw_dma_config.flags DMAFLAGS2_IRQD field is 0.
Diffstat (limited to 'c/src/lib/libbsp/sparc/shared/include/grspw_pkt.h')
-rw-r--r--c/src/lib/libbsp/sparc/shared/include/grspw_pkt.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/include/grspw_pkt.h b/c/src/lib/libbsp/sparc/shared/include/grspw_pkt.h
index 71f45d5283..d14d434217 100644
--- a/c/src/lib/libbsp/sparc/shared/include/grspw_pkt.h
+++ b/c/src/lib/libbsp/sparc/shared/include/grspw_pkt.h
@@ -270,7 +270,20 @@ struct grspw_core_stats {
* Used to enable RX DMA interrupt
* when rx_irq_en_cnt=0.
*/
-#define DMAFLAG2_MASK (DMAFLAG2_TXIE | DMAFLAG2_RXIE)
+/* Defines how the ISR will disable RX/TX DMA interrupt source when a DMA RX/TX
+ * interrupt has happended. DMA Error Interrupt always disables both RX/TX DMA
+ * interrupt. By default both RX/TX IRQs are disabled when either a RX, TX or
+ * both RX/TX DMA interrupt has been requested. The work-task, custom
+ * application handler or custom ISR handler is responsible to re-enable
+ * DMA interrupts.
+ */
+#define DMAFLAG2_IRQD_SRC 0x01000000 /* Disable triggering RX/TX source */
+#define DMAFLAG2_IRQD_NONE 0x00c00000 /* Never disable RX/TX IRQ in ISR */
+#define DMAFLAG2_IRQD_BOTH 0x00000000 /* Always disable both RX/TX sources */
+#define DMAFLAG2_IRQD_MASK 0x01c00000 /* Mask of options */
+#define DMAFLAG2_IRQD_BIT 22
+
+#define DMAFLAG2_MASK (DMAFLAG2_TXIE | DMAFLAG2_RXIE | DMAFLAG2_IRQD_MASK)
struct grspw_dma_config {
int flags; /* DMA config flags, see DMAFLAG1&2_* options */