* This function will initialize hardware interrupt */
| 53 | * This function will initialize hardware interrupt |
| 54 | */ |
| 55 | void rt_hw_interrupt_init(void) |
| 56 | { |
| 57 | #ifdef SOC_BCM283x |
| 58 | rt_uint32_t index; |
| 59 | /* initialize vector table */ |
| 60 | rt_hw_vector_init(); |
| 61 | |
| 62 | /* initialize exceptions table */ |
| 63 | rt_memset(isr_table, 0x00, sizeof(isr_table)); |
| 64 | |
| 65 | /* mask all of interrupts */ |
| 66 | IRQ_DISABLE_BASIC = 0x000000ff; |
| 67 | IRQ_DISABLE1 = 0xffffffff; |
| 68 | IRQ_DISABLE2 = 0xffffffff; |
| 69 | for (index = 0; index < MAX_HANDLERS; index ++) |
| 70 | { |
| 71 | isr_table[index].handler = default_isr_handler; |
| 72 | isr_table[index].param = RT_NULL; |
| 73 | #ifdef RT_USING_INTERRUPT_INFO |
| 74 | rt_strncpy(isr_table[index].name, "unknown", RT_NAME_MAX); |
| 75 | isr_table[index].counter = 0; |
| 76 | #endif |
| 77 | } |
| 78 | |
| 79 | /* init interrupt nest, and context in thread sp */ |
| 80 | rt_atomic_store(&rt_interrupt_nest, 0); |
| 81 | #else |
| 82 | rt_uint64_t gic_cpu_base; |
| 83 | rt_uint64_t gic_dist_base; |
| 84 | #ifdef BSP_USING_GICV3 |
| 85 | rt_uint64_t gic_rdist_base; |
| 86 | #endif |
| 87 | rt_uint64_t gic_irq_start; |
| 88 | |
| 89 | /* initialize vector table */ |
| 90 | rt_hw_vector_init(); |
| 91 | |
| 92 | /* initialize exceptions table */ |
| 93 | rt_memset(isr_table, 0x00, sizeof(isr_table)); |
| 94 | |
| 95 | /* initialize ARM GIC */ |
| 96 | #if defined(RT_USING_SMART) || defined(RT_USING_OFW) |
| 97 | gic_dist_base = (rt_uint64_t)rt_ioremap((void*)platform_get_gic_dist_base(), 0x40000); |
| 98 | gic_cpu_base = (rt_uint64_t)rt_ioremap((void*)platform_get_gic_cpu_base(), 0x1000); |
| 99 | #ifdef BSP_USING_GICV3 |
| 100 | gic_rdist_base = (rt_uint64_t)rt_ioremap((void*)platform_get_gic_redist_base(), |
| 101 | ARM_GIC_CPU_NUM * (2 << 16)); |
| 102 | #endif |
| 103 | #else |
| 104 | gic_dist_base = platform_get_gic_dist_base(); |
| 105 | gic_cpu_base = platform_get_gic_cpu_base(); |
| 106 | #ifdef BSP_USING_GICV3 |
| 107 | gic_rdist_base = platform_get_gic_redist_base(); |
| 108 | #endif |
| 109 | #endif |
| 110 | |
| 111 | gic_irq_start = GIC_IRQ_START; |
| 112 |
no test coverage detected