source: rtems/c/src/lib/libbsp/m68k/mcf5225x/startup/bspstart.c @ af03345

4.115
Last change on this file since af03345 was af03345, checked in by Joel Sherrill <joel.sherrill@…>, on 10/13/14 at 21:54:12

Move CPU cache support from mcf5225x BSP to libcpu

  • Property mode set to 100644
File size: 983 bytes
Line 
1/*
2 *  This routine does the bulk of the system initialisation.
3 */
4
5/*
6 *  Author:
7 *    David Fiddes, D.J@fiddes.surfaid.org
8 *    http://www.calm.hw.ac.uk/davidf/coldfire/
9 *
10 *  COPYRIGHT (c) 1989-1998.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#include <bsp.h>
19#include <bsp/bootcard.h>
20
21void __attribute__((weak)) bsp_start(void)
22{
23}
24
25uint32_t  __attribute__((weak)) bsp_get_CPU_clock_speed(void)
26{
27  #define DEF_CLOCK_SPEED 8000000.0F //8.0 MHz
28  #define MCF_MFD0_2_MASK 0x7000U
29  #define MCF_RFD0_2_MASK 0x0700U
30  #define MCF_MFD0_2_OFFSET 4U
31
32  #define SPEED_BIAS  ((((MCF_CLOCK_SYNCR & MCF_MFD0_2_MASK) >> 11) + MCF_MFD0_2_OFFSET) / (float)(((MCF_CLOCK_SYNCR & MCF_RFD0_2_MASK)>>7) ? : 1.0F))
33
34  return MCF_CLOCK_SYNCR & MCF_CLOCK_SYNCR_PLLEN ? SPEED_BIAS * DEF_CLOCK_SPEED : DEF_CLOCK_SPEED;
35}
Note: See TracBrowser for help on using the repository browser.