#ifndef itc2_h #define itc2_h /* Cesar project {{{ * * Copyright (C) 2008 Spidcom * * <<>> * * }}} */ /** * \file hal/leon/itc2.h * \brief Secondary interrupt controller support. * \ingroup hal_leon * * Can be included from assembly files. */ /** 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 for low priority, 1 for pending. */ #define LEON_ITC2_PENDING_LOW (* (volatile u32 *) (LEON_ITC2_BASE + 0x04)) /** Interrupt status for low priority. */ #define LEON_ITC2_STATUS_LOW (* (volatile u32 *) (LEON_ITC2_BASE + 0x08)) /** Interrupt request level. */ #define LEON_ITC2_STATUS_LOW__IRL 4, 0 /** Interrupt pending. */ #define LEON_ITC2_STATUS_LOW__IP 5, 5 /** Interrupt clear, write 1 to clear. */ #define LEON_ITC2_CLEAR (* (volatile u32 *) (LEON_ITC2_BASE + 0x0c)) /** Interrupt priority configuration, 1 for high. */ #define LEON_ITC2_LEVEL (* (volatile u32 *) (LEON_ITC2_BASE + 0x30)) /** Interrupt pending for high priority, 1 for pending. */ #define LEON_ITC2_PENDING_HIGH (* (volatile u32 *) (LEON_ITC2_BASE + 0x34)) /** Interrupt status for high priority, register address. */ #define LEON_ITC2_STATUS_HIGH_ADDR (LEON_ITC2_BASE + 0x38) /** Interrupt status for high priority. */ #define LEON_ITC2_STATUS_HIGH (* (volatile u32 *) (LEON_ITC2_STATUS_HIGH_ADDR)) /** Interrupt request level. */ #define LEON_ITC2_STATUS_HIGH__IRL 4, 0 /** Interrupt pending. */ #define LEON_ITC2_STATUS_HIGH__IP 5, 5 /** First interrupt controller clear register, needed to acknowledge high * level ITC2 interrupts. */ #define LEON_ITC1_CLEAR (* (volatile u32 *) (0x8000009c)) /* Interrupt assignment: */ #define LEON_ITC2_IT__CONGESTION_TX_ERROR 25 #define LEON_ITC2_IT__PREAMBLE_EARLY_FOUND 24 #define LEON_ITC2_IT__PREAMBLE_FOUND 23 #define LEON_ITC2_IT__RES_FFT_ERROR 22 #define LEON_ITC2_IT__FC_RECEIVED 21 #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__PRATIC_CAPTURE 16 #define LEON_ITC2_IT__ME10DOI_END 15 #define LEON_ITC2_IT__MAILBOXES_A2L 14 #define LEON_ITC2_IT__MAILBOXES_A2L_ACK 13 #define LEON_ITC2_IT__BRIDGE_DMA_END 12 #define LEON_ITC2_IT__PB_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_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 #ifndef __ASSEMBLER__ /** * Initialise the secondary interrupt controller. */ extern inline void leon_itc2_init (void) { LEON_ITC2_MASK = 0; LEON_ITC2_CLEAR = 0xffffffff; LEON_ITC2_LEVEL = 0; } /** * Mask all interrupts and uninitialise the secondary interrupt controller. */ extern inline void leon_itc2_uninit (void) { LEON_ITC2_MASK = 0; } #endif /* __ASSEMBLER__ */ #endif /* itc2_h */