source: rtems/c/src/lib/libbsp/m68k/mcf5235/startup/bspstart.c @ 2fbe159e

4.104.115
Last change on this file since 2fbe159e was 2fbe159e, checked in by Joel Sherrill <joel.sherrill@…>, on 09/19/08 at 15:49:28

2008-09-19 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, startup/bspstart.c: Split out bspstart contents. Move cache code to libcpu.
  • startup/bspgetcpuclockspeed.c: New file.
  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2008.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *
8 *  http://www.rtems.com/license/LICENSE.
9 *
10 *  $Id$
11 */
12
13#include <bsp.h>
14 
15/*
16 * Read/write copy of common cache
17 *   Split I/D cache
18 *   Allow CPUSHL to invalidate a cache line
19 *   Enable buffered writes
20 *   No burst transfers on non-cacheable accesses
21 *   Default cache mode is *disabled* (cache only ACRx areas)
22 */
23uint32_t cacr_mode = MCF5XXX_CACR_CENB | MCF5XXX_CACR_DBWE | MCF5XXX_CACR_DCM;
24
25/*
26 * Cacheable areas
27 */
28extern char RamBase[];
29extern char RamSize[];
30
31/*
32 *  bsp_start
33 *
34 *  This routine does the bulk of the system initialisation.
35 */
36void bsp_start( void )
37{
38  /*
39   * Invalidate the cache and disable it
40   */
41  m68k_set_acr0(0);
42  m68k_set_acr1(0);
43  m68k_set_cacr(MCF5XXX_CACR_CINV);
44
45  /*
46   * Cache SDRAM
47   */
48  m68k_set_acr0(MCF5XXX_ACR_AB((uintptr_t)RamBase)   |
49                MCF5XXX_ACR_AM((uintptr_t)RamSize-1) |
50                MCF5XXX_ACR_EN                       |
51                MCF5XXX_ACR_BWE                      |
52                MCF5XXX_ACR_SM_IGNORE);
53
54  /*
55   * Enable the cache
56   */
57  m68k_set_cacr(cacr_mode);
58}
Note: See TracBrowser for help on using the repository browser.