source: rtems/c/src/lib/libbsp/arm/raspberrypi/startup/bspstarthooks.c @ f2e9d0d

4.115
Last change on this file since f2e9d0d was f2e9d0d, checked in by Sebastian Huber <sebastian.huber@…>, on 05/06/13 at 07:59:16

bsp/raspberrypi: Use shared start code

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup raspberrypi
5 *
6 * @brief Startup code.
7 */
8
9/*
10 * Copyright (c) 2013 by Alan Cudmore
11 * based on work by:
12 * Copyright (c) 2009
13 * embedded brains GmbH
14 * Obere Lagerstr. 30
15 * D-82178 Puchheim
16 * Germany
17 * <rtems@embedded-brains.de>
18 *
19 * The license and distribution terms for this file may be
20 * found in the file LICENSE in this distribution or at
21 * http://www.rtems.com/license/LICENSE
22 */
23
24#include <bspopts.h>
25#include <bsp/start.h>
26#include <bsp/raspberrypi.h>
27#include <bsp/mmu.h>
28
29static void BSP_START_TEXT_SECTION raspberrypi_cache_setup(void)
30{
31  uint32_t ctrl = 0;
32
33  /* Disable MMU and cache, basic settings */
34  ctrl = arm_cp15_get_control();
35  ctrl &= ~(ARM_CP15_CTRL_I | ARM_CP15_CTRL_R | ARM_CP15_CTRL_C
36    | ARM_CP15_CTRL_V | ARM_CP15_CTRL_M);
37  ctrl |= ARM_CP15_CTRL_S;
38  arm_cp15_set_control(ctrl);
39
40  arm_cp15_cache_invalidate();
41  arm_cp15_tlb_invalidate();
42
43}
44
45
46void BSP_START_TEXT_SECTION bsp_start_hook_0(void)
47{
48  raspberrypi_cache_setup();
49}
50
51
52void BSP_START_TEXT_SECTION bsp_start_hook_1(void)
53{
54  bsp_start_copy_sections();
55  bsp_start_clear_bss();
56}
Note: See TracBrowser for help on using the repository browser.