1 ;/*******************************************************************************
\r
3 ;* This software is supplied by Renesas Electronics Corporation and is only
\r
4 ;* intended for use with Renesas products. No other uses are authorized. This
\r
5 ;* software is owned by Renesas Electronics Corporation and is protected under
\r
6 ;* all applicable laws, including copyright laws.
\r
7 ;* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
\r
8 ;* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
\r
9 ;* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
\r
10 ;* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
\r
11 ;* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
\r
12 ;* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
\r
13 ;* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
\r
14 ;* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
\r
15 ;* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
\r
16 ;* Renesas reserves the right, without notice, to make changes to this software
\r
17 ;* and to discontinue the availability of this software. By using this software,
\r
18 ;* you agree to the additional terms and conditions found by accessing the
\r
20 ;* http://www.renesas.com/disclaimer
\r
22 ;* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved.
\r
23 ;*******************************************************************************/
\r
24 ;/*******************************************************************************
\r
25 ;* File Name : l1_cache_init.s
\r
27 ;* Device(s) : Aragon
\r
28 ;* Tool-Chain : DS-5 Ver 5.8
\r
31 ;* H/W Platform : Aragon CPU Board
\r
32 ;* Description : Aragon Sample Program vecotr.s
\r
33 ;*******************************************************************************/
\r
34 ;/*******************************************************************************
\r
35 ;* History : DD.MM.YYYY Version Description
\r
36 ;* : 23.05.2012 0.01
\r
37 ;*******************************************************************************/
\r
39 ;==================================================================
\r
40 ; This code provides basic global enable for Cortex-A9 cache.
\r
41 ; It also enables branch prediction
\r
42 ; This code must be run from a privileged mode
\r
43 ;==================================================================
\r
44 AREA INITCA9CACHE, CODE, READONLY
\r
47 L1CacheInit FUNCTION
\r
49 ;==================================================================
\r
51 ; Caches are controlled by the System Control Register:
\r
52 ;==================================================================
\r
53 ;;; I-cache is controlled by bit 12
\r
54 ;;; D-cache is controlled by bit 2
\r
56 MRC p15, 0, r0, c1, c0, 0 ;;; Read CP15 register 1
\r
57 ORR r0, r0, #(0x1 << 12) ;;; Enable I Cache
\r
58 ORR r0, r0, #(0x1 << 2) ;;; Enable D Cache
\r
59 MCR p15, 0, r0, c1, c0, 0 ;;; Write CP15 register 1
\r
61 ;==================================================================
\r
62 ; Enable Program Flow Prediction
\r
64 ; Branch prediction is controlled by the System Control Register:
\r
65 ; Set Bit 11 to enable branch prediction and return
\r
66 ;==================================================================
\r
67 ;;; Turning on branch prediction requires a general enable
\r
68 ;;; CP15, c1. Control Register
\r
70 ;;; Bit 11 [Z] bit Program flow prediction:
\r
71 ;;; 0 = Program flow prediction disabled
\r
72 ;;; 1 = Program flow prediction enabled.
\r
74 MRC p15, 0, r0, c1, c0, 0 ;;; Read System Control Register
\r
75 ORR r0, r0, #(0x1 << 11)
\r
76 MCR p15, 0, r0, c1, c0, 0 ;;; Write System Control Register
\r
78 ;==================================================================
\r
79 ; Enable D-side prefetch
\r
80 ;==================================================================
\r
81 ;;; Bit 2 [DP] Dside prefetch:
\r
82 ;;; 0 = Dside prefetch disabled
\r
83 ;;; 1 = Dside prefetch enabled.
\r
85 MRC p15, 0, r0, c1, c0, 1 ;;; Read Auxiliary Control Register
\r
86 ORR r0, r0, #(0x1 << 2) ;;; Enable Dside prefetch
\r
87 MCR p15, 0, r0, c1, c0, 1 ;;; Write Auxiliary Control Register
\r