static void qoriq_clock_handler_install(rtems_isr_entry *old_isr) { rtems_status_code sc = RTEMS_SUCCESSFUL; *old_isr = NULL; sc = qoriq_pic_set_affinity( CLOCK_INTERRUPT, ppc_processor_id() ); if (sc != RTEMS_SUCCESSFUL) { rtems_fatal_error_occurred(0xdeadbeef); } sc = qoriq_pic_set_priority( CLOCK_INTERRUPT, QORIQ_PIC_PRIORITY_LOWEST, NULL ); if (sc != RTEMS_SUCCESSFUL) { rtems_fatal_error_occurred(0xdeadbeef); } sc = rtems_interrupt_handler_install( CLOCK_INTERRUPT, "Clock", RTEMS_INTERRUPT_UNIQUE, (rtems_interrupt_handler) Clock_isr, NULL ); if (sc != RTEMS_SUCCESSFUL) { rtems_fatal_error_occurred(0xdeadbeef); } }
static void qoriq_clock_handler_install(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; #if defined(RTEMS_MULTIPROCESSING) && !defined(RTEMS_SMP) { Processor_mask affinity; _Processor_mask_From_index(&affinity, ppc_processor_id()); bsp_interrupt_set_affinity(CLOCK_INTERRUPT, &affinity); } #endif sc = qoriq_pic_set_priority( CLOCK_INTERRUPT, QORIQ_PIC_PRIORITY_LOWEST, NULL ); if (sc != RTEMS_SUCCESSFUL) { rtems_fatal_error_occurred(0xdeadbeef); } sc = rtems_interrupt_handler_install( CLOCK_INTERRUPT, "Clock", RTEMS_INTERRUPT_UNIQUE, Clock_isr, NULL ); if (sc != RTEMS_SUCCESSFUL) { rtems_fatal_error_occurred(0xdeadbeef); } }
static void mpci_send_packet(uint32_t destination_node, rtems_packet_prefix *prefix) { intercom_packet *packet = packet_of_prefix(prefix); if (destination_node != MPCI_ALL_NODES) { qoriq_intercom_send_packet((int) destination_node - 1, packet); } else { uint32_t self = ppc_processor_id(); int other = self == 0 ? 1 : 0; qoriq_intercom_send_packet(other, packet); } }
rtems_status_code bsp_interrupt_facility_initialize(void) { rtems_vector_number i = 0; uint32_t processor_id = ppc_processor_id(); if (ppc_exc_set_handler(ASM_EXT_VECTOR, qoriq_external_exception_handler)) { return RTEMS_IO_ERROR; } if (processor_id == 0) { /* Core 0 must do the basic initialization */ pic_reset(); for (i = BSP_INTERRUPT_VECTOR_MIN; i <= BSP_INTERRUPT_VECTOR_MAX; ++i) { volatile uint32_t *base = (volatile uint32_t *) &qoriq.pic; int offs = vpr_and_dr_offsets [i] << 2; volatile uint32_t *vpr = base + offs; *vpr = VPR_MSK | VPR_P | VPR_PRIORITY(1) | VPR_VECTOR(i); if (!pic_is_ipi(i)) { volatile uint32_t *dr = base + offs + 4; *dr = 0x1; } } qoriq.pic.mer03 = 0xf; qoriq.pic.mer47 = 0xf; qoriq.pic.svr = SPURIOUS; qoriq.pic.gcr = GCR_M; pic_global_timer_init(); } qoriq.pic.ctpr = 0; for (i = BSP_INTERRUPT_VECTOR_MIN; i <= BSP_INTERRUPT_VECTOR_MAX; ++i) { qoriq.pic.iack; qoriq.pic.eoi = 0; qoriq.pic.whoami; } return RTEMS_SUCCESSFUL; }
rtems_status_code bsp_interrupt_facility_initialize(void) { rtems_vector_number i = 0; uint32_t processor_id = ppc_processor_id(); #ifndef PPC_EXC_CONFIG_USE_FIXED_HANDLER if (ppc_exc_set_handler(ASM_EXT_VECTOR, qoriq_external_exception_handler)) { return RTEMS_IO_ERROR; } #endif if (processor_id == 0) { /* Core 0 must do the basic initialization */ pic_reset(); for (i = BSP_INTERRUPT_VECTOR_MIN; i <= BSP_INTERRUPT_VECTOR_MAX; ++i) { volatile qoriq_pic_src_cfg *src_cfg = get_src_cfg(i); src_cfg->vpr = VPR_MSK | VPR_P | VPR_PRIORITY(1) | VPR_VECTOR(i); if (!pic_is_ipi(i)) { src_cfg->dr = 0x1; } } qoriq.pic.mer03 = 0xf; qoriq.pic.mer47 = 0xf; qoriq.pic.svr = SPURIOUS; qoriq.pic.gcr = GCR_M; pic_global_timer_init(); } qoriq.pic.ctpr = 0; for (i = BSP_INTERRUPT_VECTOR_MIN; i <= BSP_INTERRUPT_VECTOR_MAX; ++i) { qoriq.pic.iack; qoriq.pic.eoi = 0; qoriq.pic.whoami; } return RTEMS_SUCCESSFUL; }