summaryrefslogtreecommitdiff
path: root/cesar/hal/leon/itc2.h
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/hal/leon/itc2.h')
-rw-r--r--cesar/hal/leon/itc2.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/cesar/hal/leon/itc2.h b/cesar/hal/leon/itc2.h
new file mode 100644
index 0000000000..39d60a09a5
--- /dev/null
+++ b/cesar/hal/leon/itc2.h
@@ -0,0 +1,89 @@
+#ifndef itc2_h
+#define itc2_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file hal/leon/itc2.h
+ * \brief Secondary interrupt controller support.
+ * \ingroup hal_leon
+ */
+
+/** Secondary interrupt controller base address. */
+#define LEON_ITC2_BASE 0x800000b0
+
+/** Interrupt mask, 0 for masked, 1 for enabled. */
+#define LEON_ITC2_MASK (* (volatile u32 *) (LEON_ITC2_BASE + 0x00))
+
+/** Interrupt pending, 1 for pending. */
+#define LEON_ITC2_PENDING (* (volatile u32 *) (LEON_ITC2_BASE + 0x04))
+
+/** Interrupt status. */
+#define LEON_ITC2_STATUS (* (volatile u32 *) (LEON_ITC2_BASE + 0x08))
+/** Interrupt request level. */
+#define LEON_ITC2_STATUS__IRL 4, 0
+/** Interrupt pending. */
+#define LEON_ITC2_STATUS__IP 5, 5
+
+/** Interrupt clear, write 1 to clear. */
+#define LEON_ITC2_CLEAR (* (volatile u32 *) (LEON_ITC2_BASE + 0x0c))
+
+/* Interrupt assignment: */
+#define LEON_ITC2_IT__RESYS 20
+#define LEON_ITC2_IT__PRATIC_ACCESS_CONF 19
+#define LEON_ITC2_IT__PRATIC_ACCESS 18
+#define LEON_ITC2_IT__PRATIC_INTERRUPT 17
+#define LEON_ITC2_IT__PB_DMA_END 16
+#define LEON_ITC2_IT__PRATIC_CAPTURE 15
+#define LEON_ITC2_IT__ME10DOI_END 14
+#define LEON_ITC2_IT__MAILBOXES_A2L 13
+#define LEON_ITC2_IT__MAILBOXES_A2L_ACK 12
+#define LEON_ITC2_IT__BRIDGE_DMA_END 11
+#define LEON_ITC2_IT__TM_DMA_END 10
+#define LEON_ITC2_IT__MAPPOWSE_END_TX_FRAME 9
+#define LEON_ITC2_IT__MACRASS_OUT_LAST_PB_SENT 8
+#define LEON_ITC2_IT__MACRASS_OUT_FCTX_SENT 7
+#define LEON_ITC2_IT__OSYSEQ_OSYSEQ_END 6
+#define LEON_ITC2_IT__OSYSEQ_OUT_EARLY_END_FC10 5
+#define LEON_ITC2_IT__RESYS_PRE_NOT_EXPECTED 4
+#define LEON_ITC2_IT__START_TX_ERROR 3
+#define LEON_ITC2_IT__BRIDGE_DMA_ERROR 2
+#define LEON_ITC2_IT__PB_DMA_ERROR 1
+#define LEON_ITC2_IT__TM_DMA_ERROR 0
+
+/** High priority interrupt number on primary interrupt controller. */
+#define LEON_ITC2_HIGH_PRIORITY_ITC1_IT 13
+
+/** High priority interrupt priority on primary interrupt controller. */
+#define LEON_ITC2_HIGH_PRIORITY_ITC1_IT_PRIORITY 1
+
+/** Low priority interrupt number on primary interrupt controller. */
+#define LEON_ITC2_LOW_PRIORITY_ITC1_IT 10
+
+/** Low priority interrupt priority on primary interrupt controller. */
+#define LEON_ITC2_LOW_PRIORITY_ITC1_IT_PRIORITY 0
+
+/**
+ * Initialise the secondary interrupt controller.
+ */
+inline void
+leon_itc2_init (void)
+{
+ LEON_ITC2_MASK = 0;
+ LEON_ITC2_CLEAR = 0xffffffff;
+}
+
+/**
+ * Mask all interrupts and uninitialise the secondary interrupt controller.
+ */
+inline void
+leon_itc2_uninit (void)
+{
+ LEON_ITC2_MASK = 0;
+}
+
+#endif /* itc2_h */