File indexing completed on 2025-05-11 08:23:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include <libcpu/io.h>
0018 #include <libcpu/spr.h>
0019 #include <bsp/irq.h>
0020 #include <bsp.h>
0021 #include <bsp/vectors.h> /* ASM_EXT_VECTOR, ASM_DEC_VECTOR ... */
0022
0023
0024
0025
0026
0027 static void nop_func(void){}
0028
0029
0030
0031 static int not_connected(void) {return 0;}
0032
0033 static rtems_irq_connect_data rtemsIrq[BSP_IRQ_NUMBER];
0034 static rtems_irq_global_settings initial_config;
0035
0036 static rtems_irq_connect_data defaultIrq = {
0037 .name = 0,
0038 .hdl = NULL,
0039 .handle = NULL,
0040 .on = (rtems_irq_enable) nop_func,
0041 .off = (rtems_irq_disable) nop_func,
0042 .isOn = (rtems_irq_is_enabled) not_connected,
0043 #ifdef BSP_SHARED_HANDLER_SUPPORT
0044 .next_handler = NULL
0045 #endif
0046 };
0047
0048 rtems_irq_prio BSPirqPrioTable[BSP_PIC_IRQ_NUMBER] = {
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0,
0068
0069 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0070
0071
0072 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0073
0074 0, 0, 0, 0, 0, 0, 0, 0,
0075 255 , 255, 255, 255, 0, 0, 0, 0,
0076
0077
0078 1,0, 0, 0, 0, 0, 0, 0,
0079
0080 47,46,45,44,30, 29,3,1,
0081
0082 37,36,35,34,23, 0,0,0,
0083
0084 7, 0,0,0,0,0,0,0
0085 };
0086
0087
0088
0089
0090
0091
0092
0093 void BSP_rtems_irq_mng_init(unsigned cpuId)
0094 {
0095 int i;
0096 rtems_interrupt_level level;
0097
0098
0099
0100
0101 #ifdef TRACE_IRQ_INIT
0102 printk("Initializing the interrupt controller of the GT64260\n");
0103 #endif
0104
0105 #ifdef TRACE_IRQ_INIT
0106 printk("Going to re-initialize the rtemsIrq table %d\n",BSP_IRQ_NUMBER);
0107 #endif
0108
0109
0110
0111
0112
0113
0114 for (i = 0; i < BSP_IRQ_NUMBER; i++) {
0115 rtemsIrq[i] = defaultIrq;
0116 rtemsIrq[i].name = i;
0117 }
0118
0119
0120
0121
0122 initial_config.irqNb = BSP_IRQ_NUMBER;
0123 initial_config.defaultEntry = defaultIrq;
0124 initial_config.irqHdlTbl = rtemsIrq;
0125 initial_config.irqBase = BSP_LOWEST_OFFSET;
0126 initial_config.irqPrioTbl = BSPirqPrioTable;
0127
0128 #ifdef TRACE_IRQ_INIT
0129 printk("Going to setup irq mngt configuration\n");
0130 #endif
0131
0132 rtems_interrupt_disable(level);
0133 (void) level;
0134
0135 if (!BSP_rtems_irq_mngt_set(&initial_config)) {
0136
0137
0138
0139 rtems_panic("Unable to initialize RTEMS interrupt Management!!! System locked\n");
0140 }
0141 #ifdef TRACE_IRQ_INIT
0142 printk("Done setup irq mngt configuration\n");
0143 #endif
0144
0145 #ifdef TRACE_IRQ_INIT
0146 printk("RTEMS IRQ management is now operationnal\n");
0147 #endif
0148 }