source: rtems/bsps/arm/imx/start/bspsmp.c @ e0dd8a5a

5
Last change on this file since e0dd8a5a was 9964895, checked in by Sebastian Huber <sebastian.huber@…>, on 04/20/18 at 08:35:35

bsps: Move startup files to bsps

Adjust build support files to new directory layout.

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 * Copyright (c) 2017 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <info@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#include <rtems/score/smpimpl.h>
16
17#include <arm/freescale/imx/imx_srcreg.h>
18#include <arm/freescale/imx/imx_gpcreg.h>
19
20#include <bsp/start.h>
21
22bool _CPU_SMP_Start_processor(uint32_t cpu_index)
23{
24  bool started;
25
26  if (cpu_index == 1) {
27    volatile imx_src *src = (volatile imx_src *) 0x30390000;
28    volatile imx_gpc *gpc = (volatile imx_gpc *) 0x303a0000;
29
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;
47}
Note: See TracBrowser for help on using the repository browser.