Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:51

0001 /* irq.h
0002  *
0003  *  This include file describe the data structure and the functions implemented
0004  *  by rtems to write interrupt handlers.
0005  *
0006  *  CopyRight (C) 1999 valette@crf.canon.fr
0007  *
0008  *  This code is heavilly inspired by the public specification of STREAM V2
0009  *  that can be found at :
0010  *
0011  *      <http://www.chorus.com/Documentation/index.html> by following
0012  *  the STREAM API Specification Document link.
0013  *
0014  *  The license and distribution terms for this file may be
0015  *  found in the file LICENSE in this distribution or at
0016  *  http://www.rtems.org/license/LICENSE.
0017  *
0018  * Modified by T. Straumann for the beatnik BSP, 2005-2007
0019  * Some information may be based on mvme5500/irq/irq.h by K. Feng.
0020  */
0021 
0022 #ifndef LIBBSP_POWERPC_MOT_PPC_NEW_IRQ_IRQ_H
0023 #define LIBBSP_POWERPC_MOT_PPC_NEW_IRQ_IRQ_H
0024 
0025 #define BSP_SHARED_HANDLER_SUPPORT      1
0026 #include <rtems/irq.h>
0027 #include <bsp/vectors.h>
0028 #include <bsp/irq-default.h>
0029 
0030 /* This BSP also passes a pointer to the interrupt frame to the handler.
0031  * The PPC ABI guarantees that this will not mess up handlers written
0032  * without knowledge of this feature.
0033  */
0034 
0035 typedef void (*BSP_rtems_irq_hdl)(rtems_irq_hdl_param,BSP_Exception_frame*);
0036 
0037 
0038 /* legal priorities are 0 <= priority <= MAX_PRIO; 0 effectively disables the interrupt */
0039 #define BSP_IRQ_MAX_PRIO        4
0040 #define BSP_IRQ_MIN_PRIO        1
0041 
0042 /* Note that priorites are only honoured for 'PCI' interrupt numbers.
0043  * The discovery pic has no support for hardware priorites; hence they
0044  * are handled in software
0045  */
0046 #define BSP_IRQ_DEFAULT_PRIORITY 2
0047 
0048 
0049 #define BSP_PCI_IRQ_LOWEST_OFFSET   0   /* IMPLEMENTATION RELIES ON discovery pic INTERRUPTS HAVING NUMBERS 0..95 */
0050 #define BSP_IRQ_DEV         1   /* device interface interrupt */
0051 #define BSP_IRQ_DMA         2   /* DMA addres error interrupt (260) */
0052 #define BSP_IRQ_CPU         3   /* CPU interface interrupt */
0053 #define BSP_IRQ_IDMA0_1         4   /* IDMA ch. 0..1 complete interrupt (260) */
0054 #define BSP_IRQ_IDMA2_3         5   /* IDMA ch. 2..3 complete interrupt (260) */
0055 #define BSP_IRQ_IDMA4_5         6   /* IDMA ch. 4..5 complete interrupt (260) */
0056 #define BSP_IRQ_IDMA6_7         7   /* IDMA ch. 6..7 complete interrupt (260) */
0057 #define BSP_IRQ_TIME0_1         8   /* Timer 0..1 interrupt; Timer 0 on 64360 */
0058 #define BSP_IRQ_TIME2_3         9   /* Timer 2..3 interrupt; Timer 1 on 64360 */
0059 #define BSP_IRQ_TIME4_5         10  /* Timer 4..5 interrupt; Timer 2 on 64360 */
0060 #define BSP_IRQ_TIME6_7         11  /* Timer 6..7 interrupt; Timer 3 on 64360 */
0061 #define BSP_IRQ_PCI0_0          12  /* PCI 0 interrupt 0 summary (PCI 0 interrupt summary on 64360) */
0062 #define BSP_IRQ_PCI0_1          13  /* PCI 0 interrupt 1 summary (SRAM PAR ERROR on 64360)          */
0063 #define BSP_IRQ_PCI0_2          14  /* PCI 0 interrupt 2 summary */
0064 #define BSP_IRQ_PCI0_3          15  /* PCI 0 interrupt 3 summary */
0065 #define BSP_IRQ_PCI1_0          16  /* PCI 1 interrupt 0 summary (PCI 1 interrupt summary on 64360) */
0066 #define BSP_IRQ_ECC             17  /* ECC error interrupt */
0067 #define BSP_IRQ_PCI1_1          18  /* PCI 1 interrupt 1 summary */
0068 #define BSP_IRQ_PCI1_2          19  /* PCI 1 interrupt 2 summary */
0069 #define BSP_IRQ_PCI1_3          20  /* PCI 1 interrupt 3 summary */
0070 #define BSP_IRQ_PCI0OUT_LO      21  /* PCI 0 outbound interrupt summary */
0071 #define BSP_IRQ_PCI0OUT_HI      22  /* PCI 0 outbound interrupt summary */
0072 #define BSP_IRQ_PCI1OUT_LO      23  /* PCI 1 outbound interrupt summary */
0073 #define BSP_IRQ_PCI1OUT_HI      24  /* PCI 1 outbound interrupt summary */
0074 #define BSP_IRQ_PCI0IN_LO       26  /* PCI 0 inbound interrupt summary */
0075 #define BSP_IRQ_PCI0IN_HI       27  /* PCI 0 inbound interrupt summary */
0076 #define BSP_IRQ_PCI1IN_LO       28  /* PCI 1 inbound interrupt summary */
0077 #define BSP_IRQ_PCI1IN_HI       29  /* PCI 1 inbound interrupt summary */
0078 #define BSP_IRQ_ETH0            (32+0)  /* Ethernet controller 0 interrupt */
0079 #define BSP_IRQ_ETH1            (32+1)  /* Ethernet controller 1 interrupt */
0080 #define BSP_IRQ_ETH2            (32+2)  /* Ethernet controller 2 interrupt */
0081 #define BSP_IRQ_SDMA            (32+4)  /* SDMA interrupt */
0082 #define BSP_IRQ_I2C         (32+5)  /* I2C interrupt */
0083 #define BSP_IRQ_BRG         (32+7)  /* Baud Rate Generator interrupt */
0084 #define BSP_IRQ_MPSC0           (32+8)  /* MPSC 0 interrupt */
0085 #define BSP_IRQ_MPSC1           (32+10) /* MPSC 1 interrupt */
0086 #define BSP_IRQ_COMM            (32+11) /* Comm unit interrupt */
0087 #define BSP_IRQ_GPP7_0          (32+24) /* GPP[7..0] interrupt summary */
0088 #define BSP_IRQ_GPP15_8         (32+25) /* GPP[15..8] interrupt summary */
0089 #define BSP_IRQ_GPP23_16        (32+26) /* GPP[23..16] interrupt summary */
0090 #define BSP_IRQ_GPP31_24        (32+27) /* GPP[31..24] interrupt summary */
0091 #define BSP_IRQ_GPP_0           64
0092 
0093 #define BSP_PCI_IRQ_NUMBER      (64+32)
0094 #define BSP_PCI_IRQ_MAX_OFFSET      (BSP_PCI_IRQ_LOWEST_OFFSET + BSP_PCI_IRQ_NUMBER - 1)
0095 
0096 #define BSP_PROCESSOR_IRQ_NUMBER    1
0097 #define BSP_PROCESSOR_IRQ_LOWEST_OFFSET (BSP_PCI_IRQ_MAX_OFFSET+1)
0098 #define BSP_PROCESSOR_IRQ_MAX_OFFSET    (BSP_PROCESSOR_IRQ_LOWEST_OFFSET + BSP_PROCESSOR_IRQ_NUMBER - 1)
0099 
0100 /* summary */
0101 
0102 #define BSP_IRQ_NUMBER          (BSP_PCI_IRQ_NUMBER + BSP_PROCESSOR_IRQ_NUMBER)
0103 #define BSP_LOWEST_OFFSET       0
0104 #define BSP_MAX_OFFSET          (BSP_LOWEST_OFFSET + BSP_IRQ_NUMBER - 1)
0105 #define BSP_DECREMENTER         BSP_PROCESSOR_IRQ_LOWEST_OFFSET
0106 
0107 #define BSP_UART_COM1_IRQ       BSP_IRQ_GPP_0
0108 #define BSP_UART_COM2_IRQ       BSP_IRQ_GPP_0
0109 
0110 #ifndef ASM
0111 
0112 #ifdef __cplusplus
0113 extern "C" {
0114 #endif
0115 
0116 
0117 #include <bsp/irq_supp.h>
0118 
0119 int  BSP_irq_is_enabled_at_pic(rtems_irq_number irq);
0120 
0121 /* set priority of an interrupt; must not be called from ISR level */
0122 int  BSP_irq_set_priority(rtems_irq_number irq, rtems_irq_prio pri);
0123 
0124 /* Not for public use */
0125 void BSP_rtems_irq_mng_init(unsigned cpuId);
0126 
0127 #ifdef __cplusplus
0128 }
0129 #endif
0130 
0131 
0132 #endif
0133 
0134 #endif