source: rtems/bsps/powerpc/gen83xx/start/bsprestart.c @ 8f8ccee

5
Last change on this file since 8f8ccee 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) 2008-2013 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Obere Lagerstr. 30
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/u-boot.h>
17
18#include <libcpu/powerpc-utility.h>
19
20void bsp_restart(void *addr)
21{
22  rtems_interrupt_level level;
23  void (*start)(void) = addr;
24  #ifdef HAS_UBOOT
25    const void *mem_begin = (const void *) bsp_uboot_board_info.bi_memstart;
26    size_t mem_size = bsp_uboot_board_info.bi_memsize;
27  #else /* HAS_UBOOT */
28    const void *mem_begin = bsp_ram_start;
29    size_t mem_size = (size_t) bsp_ram_size;
30  #endif /* HAS_UBOOT */
31  uint32_t hid0;
32
33  rtems_interrupt_disable(level);
34  (void) level; /* avoid set but not used warning */
35
36  hid0 = PPC_SPECIAL_PURPOSE_REGISTER(HID0);
37
38  if ((hid0 & HID0_DCE) != 0) {
39    rtems_cache_flush_multiple_data_lines(mem_begin, mem_size);
40  }
41
42  hid0 &= ~(HID0_DCE | HID0_ICE);
43
44  PPC_SET_SPECIAL_PURPOSE_REGISTER(HID0, hid0);
45
46  (*start)();
47}
Note: See TracBrowser for help on using the repository browser.