Changeset 29919242 in rtems


Ignore:
Timestamp:
Sep 22, 2017, 11:48:40 AM (19 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
05f9858f
Parents:
3ad3849a
git-author:
Sebastian Huber <sebastian.huber@…> (09/22/17 11:48:40)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/22/17 12:15:51)
Message:

bsp/imx: Add SMP support

Update #3090.

Location:
c/src/lib/libbsp/arm/imx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/imx/Makefile.am

    r3ad3849a r29919242  
    8989libbsp_a_SOURCES += startup/ccm.c
    9090if HAS_SMP
     91libbsp_a_SOURCES += ../shared/arm-a9mpcore-smp.c
    9192libbsp_a_SOURCES += startup/bspsmp.c
    9293endif
  • c/src/lib/libbsp/arm/imx/startup/bspsmp.c

    r3ad3849a r29919242  
    1515#include <rtems/score/smpimpl.h>
    1616
    17 uint32_t _CPU_SMP_Initialize(void)
    18 {
    19   return 1;
    20 }
     17#include <arm/freescale/imx/imx_srcreg.h>
     18#include <arm/freescale/imx/imx_gpcreg.h>
     19
     20#include <bsp/start.h>
    2121
    2222bool _CPU_SMP_Start_processor(uint32_t cpu_index)
    2323{
    24   (void) cpu_index;
     24  bool started;
    2525
    26   /* Nothing to do */
     26  if (cpu_index == 1) {
     27    volatile imx_src *src = (volatile imx_src *) 0x30390000;
     28    volatile imx_gpc *gpc = (volatile imx_gpc *) 0x303a0000;
    2729
    28   return true;
     30    src->gpr3 = (uint32_t) _start;
     31    gpc->pgc_a7core0_ctrl |= IMX_GPC_PGC_CTRL_PCR;
     32    gpc->cpu_pgc_sw_pup_req |= IMX_GPC_CPU_PGC_CORE1_A7;
     33
     34    while ((gpc->cpu_pgc_pup_status1 & IMX_GPC_CPU_PGC_CORE1_A7) != 0) {
     35      /* Wait */
     36    }
     37
     38    gpc->pgc_a7core0_ctrl &= ~IMX_GPC_PGC_CTRL_PCR;
     39    src->a7rcr1 |= IMX_SRC_A7RCR1_A7_CORE1_ENABLE;
     40
     41    started = true;
     42  } else {
     43    started = false;
     44  }
     45
     46  return started;
    2947}
    30 
    31 void _CPU_SMP_Finalize_initialization(uint32_t cpu_count)
    32 {
    33 }
    34 
    35 void _CPU_SMP_Prepare_start_multitasking(void)
    36 {
    37 }
    38 
    39 void _CPU_SMP_Send_interrupt(uint32_t target_processor_index)
    40 {
    41 }
  • c/src/lib/libbsp/arm/imx/startup/bspstarthooks.c

    r3ad3849a r29919242  
    4848BSP_START_TEXT_SECTION void bsp_start_hook_0(void)
    4949{
     50#ifdef RTEMS_SMP
     51  uint32_t cpu_id = arm_cortex_a9_get_multiprocessor_cpu_id();
     52
     53  arm_a9mpcore_start_enable_smp_in_auxiliary_control();
     54
     55  if (cpu_id != 0) {
     56    arm_a9mpcore_start_on_secondary_processor();
     57  }
     58#endif
    5059}
    5160
Note: See TracChangeset for help on using the changeset viewer.