File indexing completed on 2025-05-11 08:23:54
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #ifndef BSP_POWERPC_IRQ_H
0020 #define BSP_POWERPC_IRQ_H
0021
0022 #ifndef BSP_SHARED_HANDLER_SUPPORT
0023 #define BSP_SHARED_HANDLER_SUPPORT 1
0024 #endif
0025
0026 #include <rtems/irq.h>
0027
0028
0029
0030
0031
0032 #define BSP_POWERPC_IRQ_GENERIC_SUPPORT 1
0033
0034
0035
0036
0037 #define ISA8259_M_ELCR 0x4d0
0038 #define ISA8259_S_ELCR 0x4d1
0039
0040 #define ELCRS_INT15_LVL 0x80
0041 #define ELCRS_INT14_LVL 0x40
0042 #define ELCRS_INT13_LVL 0x20
0043 #define ELCRS_INT12_LVL 0x10
0044 #define ELCRS_INT11_LVL 0x08
0045 #define ELCRS_INT10_LVL 0x04
0046 #define ELCRS_INT9_LVL 0x02
0047 #define ELCRS_INT8_LVL 0x01
0048 #define ELCRM_INT7_LVL 0x80
0049 #define ELCRM_INT6_LVL 0x40
0050 #define ELCRM_INT5_LVL 0x20
0051 #define ELCRM_INT4_LVL 0x10
0052 #define ELCRM_INT3_LVL 0x8
0053 #define ELCRM_INT2_LVL 0x4
0054 #define ELCRM_INT1_LVL 0x2
0055 #define ELCRM_INT0_LVL 0x1
0056
0057
0058 #define PIC_MASTER_COMMAND_IO_PORT 0x20
0059 #define PIC_SLAVE_COMMAND_IO_PORT 0xa0
0060 #define PIC_MASTER_IMR_IO_PORT 0x21
0061 #define PIC_SLAVE_IMR_IO_PORT 0xa1
0062
0063
0064 #define PIC_EOSI 0x60
0065 #define SLAVE_PIC_EOSI 0x62
0066 #define PIC_EOI 0x20
0067
0068 #ifndef ASM
0069
0070 #ifdef __cplusplus
0071 extern "C" {
0072 #endif
0073
0074
0075
0076
0077
0078
0079
0080
0081 #define BSP_ISA_IRQ_NUMBER (16)
0082 #define BSP_ISA_IRQ_LOWEST_OFFSET (0)
0083 #define BSP_ISA_IRQ_MAX_OFFSET (BSP_ISA_IRQ_LOWEST_OFFSET + BSP_ISA_IRQ_NUMBER - 1)
0084
0085
0086
0087
0088 #ifndef qemu
0089 #define BSP_PCI_IRQ_NUMBER (16)
0090 #else
0091 #define BSP_PCI_IRQ_NUMBER (0)
0092 #endif
0093 #define BSP_PCI_IRQ_LOWEST_OFFSET (BSP_ISA_IRQ_NUMBER)
0094 #define BSP_PCI_IRQ_MAX_OFFSET (BSP_PCI_IRQ_LOWEST_OFFSET + BSP_PCI_IRQ_NUMBER - 1)
0095
0096
0097
0098
0099 #define BSP_PROCESSOR_IRQ_NUMBER (1)
0100 #define BSP_PROCESSOR_IRQ_LOWEST_OFFSET (BSP_PCI_IRQ_MAX_OFFSET + 1)
0101 #define BSP_PROCESSOR_IRQ_MAX_OFFSET (BSP_PROCESSOR_IRQ_LOWEST_OFFSET + BSP_PROCESSOR_IRQ_NUMBER - 1)
0102
0103
0104 #ifndef qemu
0105 #define BSP_MISC_IRQ_NUMBER (8)
0106 #else
0107 #define BSP_MISC_IRQ_NUMBER (0)
0108 #endif
0109
0110 #define BSP_MISC_IRQ_LOWEST_OFFSET (BSP_PROCESSOR_IRQ_MAX_OFFSET + 1)
0111 #define BSP_MISC_IRQ_MAX_OFFSET (BSP_MISC_IRQ_LOWEST_OFFSET + BSP_MISC_IRQ_NUMBER - 1)
0112
0113
0114
0115 #define BSP_IRQ_NUMBER (BSP_MISC_IRQ_MAX_OFFSET + 1)
0116 #define BSP_LOWEST_OFFSET (BSP_ISA_IRQ_LOWEST_OFFSET)
0117 #define BSP_MAX_OFFSET (BSP_MISC_IRQ_MAX_OFFSET)
0118 #define BSP_INTERRUPT_VECTOR_COUNT (BSP_MAX_OFFSET + 1)
0119
0120
0121
0122 #define BSP_ISA_PERIODIC_TIMER (0)
0123 #define BSP_ISA_KEYBOARD (1)
0124 #define BSP_ISA_UART_COM2_IRQ (3)
0125 #define BSP_ISA_UART_COM1_IRQ (4)
0126 #define BSP_ISA_RT_TIMER1 (8)
0127 #define BSP_ISA_RT_TIMER3 (10)
0128
0129
0130
0131 #define BSP_PCI_IRQ0 (BSP_PCI_IRQ_LOWEST_OFFSET)
0132 #if BSP_PCI_IRQ_NUMBER > 0
0133 #define BSP_PCI_ISA_BRIDGE_IRQ (BSP_PCI_IRQ0)
0134 #endif
0135
0136 #if defined(mot_ppc_mvme2100)
0137 #define BSP_DEC21143_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 1)
0138 #define BSP_PMC_PCMIP_TYPE1_SLOT0_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 2)
0139 #define BSP_PCMIP_TYPE1_SLOT1_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 3)
0140 #define BSP_PCMIP_TYPE2_SLOT0_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 4)
0141 #define BSP_PCMIP_TYPE2_SLOT1_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 5)
0142 #define BSP_PCI_INTA_UNIVERSE_LINT0_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 7)
0143 #define BSP_PCI_INTB_UNIVERSE_LINT1_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 8)
0144 #define BSP_PCI_INTC_UNIVERSE_LINT2_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 9)
0145 #define BSP_PCI_INTD_UNIVERSE_LINT3_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 10)
0146 #define BSP_UART_COM1_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 13)
0147 #define BSP_FRONT_PANEL_ABORT_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 14)
0148 #define BSP_RTC_IRQ (BSP_PCI_IRQ_LOWEST_OFFSET + 15)
0149 #else
0150 #define BSP_UART_COM1_IRQ BSP_ISA_UART_COM1_IRQ
0151 #define BSP_UART_COM2_IRQ BSP_ISA_UART_COM2_IRQ
0152 #endif
0153
0154
0155
0156
0157 #define BSP_DECREMENTER (BSP_PROCESSOR_IRQ_LOWEST_OFFSET)
0158
0159
0160
0161
0162
0163 typedef unsigned short rtems_i8259_masks;
0164
0165 extern volatile rtems_i8259_masks i8259s_cache;
0166
0167
0168
0169
0170
0171
0172
0173 void BSP_i8259s_init(void);
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183 int BSP_irq_disable_at_i8259s (const rtems_irq_number irqLine);
0184
0185
0186
0187
0188
0189 int BSP_irq_enable_at_i8259s (const rtems_irq_number irqLine);
0190
0191
0192
0193
0194
0195
0196
0197 int BSP_irq_ack_at_i8259s (const rtems_irq_number irqLine);
0198
0199
0200
0201 int BSP_irq_enabled_at_i8259s (const rtems_irq_number irqLine);
0202
0203 unsigned short BSP_irq_suspend_i8259s(unsigned short mask);
0204 void BSP_irq_resume_i8259s(unsigned short in_progress_save);
0205
0206 extern void BSP_rtems_irq_mng_init(unsigned cpuId);
0207 extern void BSP_i8259s_init(void);
0208
0209
0210 #include <bsp/irq_supp.h>
0211
0212 #ifdef __cplusplus
0213 };
0214 #endif
0215
0216 #endif
0217 #endif