Exemplo n.º 1
0
void rpi_start_rtems_on_secondary_processor(void)
{
  uint32_t ctrl;

  ctrl = arm_cp15_start_setup_mmu_and_cache(
    0,
    ARM_CP15_CTRL_AFE | ARM_CP15_CTRL_Z
  );

  rpi_ipi_initialize();

  arm_cp15_set_domain_access_control(
    ARM_CP15_DAC_DOMAIN(ARM_MMU_DEFAULT_CLIENT_DOMAIN, ARM_CP15_DAC_CLIENT)
  );

  /* FIXME: Sharing the translation table between processors is brittle */
  arm_cp15_set_translation_table_base(
    (uint32_t *) bsp_translation_table_base
  );

  arm_cp15_tlb_invalidate();

  ctrl |= ARM_CP15_CTRL_I | ARM_CP15_CTRL_C | ARM_CP15_CTRL_M;
  ctrl &= ~ARM_CP15_CTRL_V;
  arm_cp15_set_control(ctrl);

  _SMP_Start_multitasking_on_secondary_processor();
}
Exemplo n.º 2
0
void leon3_secondary_cpu_initialize(uint32_t cpu)
{
  leon3_set_cache_control_register(0x80000F);
  LEON_Unmask_interrupt(LEON3_MP_IRQ);
  LEON3_IrqCtrl_Regs->mask[cpu] |= 1 << LEON3_MP_IRQ;

  _SMP_Start_multitasking_on_secondary_processor();
}
Exemplo n.º 3
0
void qoriq_start_thread(void)
{
  const Per_CPU_Control *cpu_self = _Per_CPU_Get();

  ppc_exc_initialize_interrupt_stack(
    (uintptr_t) cpu_self->interrupt_stack_low,
    rtems_configuration_get_interrupt_stack_size()
  );

  bsp_interrupt_facility_initialize();

  _SMP_Start_multitasking_on_secondary_processor();
}
Exemplo n.º 4
0
Arquivo: bspsmp.c Projeto: AoLaD/rtems
void bsp_start_on_secondary_processor()
{
  uint32_t cpu_index_self = _CPU_SMP_Get_current_processor();

  /*
   * If data cache snooping is not enabled we terminate using BSP_fatal_exit()
   * instead of bsp_fatal().  This is done since the latter function tries to
   * acquire a ticket lock, an operation which requires data cache snooping to
   * be enabled.
   */
  if ( !leon3_data_cache_snooping_enabled() )
    BSP_fatal_exit( LEON3_FATAL_INVALID_CACHE_CONFIG_SECONDARY_PROCESSOR );

  /* Unmask IPI interrupts at Interrupt controller for this CPU */
  LEON3_IrqCtrl_Regs->mask[cpu_index_self] |= 1U << LEON3_mp_irq;

  _SMP_Start_multitasking_on_secondary_processor();
}
Exemplo n.º 5
0
void bsp_start_on_secondary_processor(void)
{
  uint32_t cpu_index_self = _SMP_Get_current_processor();
  const Per_CPU_Control *cpu_self = _Per_CPU_Get_by_index(cpu_index_self);

  ppc_exc_initialize_with_vector_base(
    (uintptr_t) cpu_self->interrupt_stack_low,
    rtems_configuration_get_interrupt_stack_size(),
    bsp_exc_vector_base
  );

  /* Now it is possible to make the code execute only */
  qoriq_mmu_change_perm(
    FSL_EIS_MAS3_SR | FSL_EIS_MAS3_SX,
    FSL_EIS_MAS3_SX,
    FSL_EIS_MAS3_SR
  );

  bsp_interrupt_facility_initialize();

  start_thread_if_necessary(cpu_index_self);

  _SMP_Start_multitasking_on_secondary_processor();
}