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

4.115
Last change on this file since c499856 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.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 *  http://www.rtems.org/license/LICENSE.
8 */
9
10#include <bsp.h>
11
12/*
13 * Read/write copy of common cache
14 *   Split I/D cache
15 *   Allow CPUSHL to invalidate a cache line
16 *   Enable buffered writes
17 *   No burst transfers on non-cacheable accesses
18 *   Default cache mode is *disabled* (cache only ACRx areas)
19 */
20uint32_t cacr_mode = MCF5XXX_CACR_CENB | MCF5XXX_CACR_DBWE | MCF5XXX_CACR_DCM;
21
22/*
23 * Cacheable areas
24 */
25extern char RamBase[];
26extern char RamSize[];
27
28/*
29 *  bsp_start
30 *
31 *  This routine does the bulk of the system initialisation.
32 */
33void bsp_start( void )
34{
35  /*
36   * Invalidate the cache and disable it
37   */
38  m68k_set_acr0(0);
39  m68k_set_acr1(0);
40  m68k_set_cacr(MCF5XXX_CACR_CINV);
41
42  /*
43   * Cache SDRAM
44   */
45  m68k_set_acr0(MCF5XXX_ACR_AB((uintptr_t)RamBase)   |
46                MCF5XXX_ACR_AM((uintptr_t)RamSize-1) |
47                MCF5XXX_ACR_EN                       |
48                MCF5XXX_ACR_BWE                      |
49                MCF5XXX_ACR_SM_IGNORE);
50
51  /*
52   * Enable the cache
53   */
54  m68k_set_cacr(cacr_mode);
55}
Note: See TracBrowser for help on using the repository browser.