source: rtems/c/src/lib/libbsp/powerpc/t32mppc/startup/bspstart.c @ aa97f99

4.115
Last change on this file since aa97f99 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 * Copyright (c) 2012 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 <rtems/config.h>
16#include <rtems/counter.h>
17
18#include <bsp.h>
19#include <bsp/vectors.h>
20#include <bsp/bootcard.h>
21#include <bsp/irq-generic.h>
22#include <bsp/linker-symbols.h>
23
24LINKER_SYMBOL(bsp_exc_vector_base);
25
26/*
27 * Configuration parameter for clock driver.  The Trace32 PowerPC simulator has
28 * an odd decrementer frequency.  The time base frequency is one tick per
29 * instruction.  The decrementer frequency is one tick per ten instructions.
30 * The clock driver assumes that the time base and decrementer frequencies are
31 * equal.  For now we simulate processor that issues 10000000 instructions per
32 * second.
33 */
34uint32_t bsp_time_base_frequency = 10000000 / 10;
35
36void BSP_panic(char *s)
37{
38  rtems_interrupt_level level;
39
40  rtems_interrupt_disable(level);
41
42  printk("%s PANIC %s\n", rtems_get_version_string(), s);
43
44  while (1) {
45    /* Do nothing */
46  }
47}
48
49void _BSP_Fatal_error(unsigned n)
50{
51  rtems_interrupt_level level;
52
53  rtems_interrupt_disable(level);
54
55  printk("%s PANIC ERROR %u\n", rtems_get_version_string(), n);
56
57  while (1) {
58    /* Do nothing */
59  }
60}
61
62void bsp_start(void)
63{
64  get_ppc_cpu_type();
65  get_ppc_cpu_revision();
66
67  rtems_counter_initialize_converter(bsp_time_base_frequency);
68
69  /* Initialize exception handler */
70  ppc_exc_initialize_with_vector_base(
71    (uintptr_t) bsp_section_work_begin,
72    rtems_configuration_get_interrupt_stack_size(),
73    bsp_exc_vector_base
74  );
75
76  /* Initalize interrupt support */
77  bsp_interrupt_initialize();
78}
Note: See TracBrowser for help on using the repository browser.