source: rtems/c/src/lib/libbsp/arm/atsam/startup/bspstarthooks.c @ 8467c31

5
Last change on this file since 8467c31 was f2e0f8e, checked in by Sebastian Huber <sebastian.huber@…>, on Jan 14, 2016 at 3:03:51 PM

bsp/atsam: New

Close #2529.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 * Copyright (c) 2016 embedded brains GmbH Huber.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@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 <bsp.h>
16#include <bsp/start.h>
17#include <bsp/pin-config.h>
18
19#include <chip.h>
20#include <include/board_lowlevel.h>
21#include <include/board_memories.h>
22
23void BSP_START_TEXT_SECTION bsp_start_hook_0(void)
24{
25  system_init_flash(BOARD_MCK);
26  SystemInit();
27
28  PIO_Configure(&atsam_pin_config[0], atsam_pin_config_count);
29  MATRIX->CCFG_SYSIO = atsam_matrix_ccfg_sysio;
30
31  if (!PMC_IsPeriphEnabled(ID_SDRAMC)) {
32    BOARD_ConfigureSdram();
33  }
34
35  if ((SCB->CCR & SCB_CCR_IC_Msk) == 0) {
36    SCB_EnableICache();
37  }
38
39  if ((SCB->CCR & SCB_CCR_DC_Msk) == 0) {
40    SCB_EnableDCache();
41  }
42
43  _SetupMemoryRegion();
44}
45
46void BSP_START_TEXT_SECTION bsp_start_hook_1(void)
47{
48  bsp_start_copy_sections_compact();
49  SCB_CleanDCache();
50  SCB_InvalidateICache();
51  bsp_start_clear_bss();
52  WDT_Disable(WDT);
53}
Note: See TracBrowser for help on using the repository browser.