Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
arch
cris
arch-v32
mm
l2cache.c
Go to the documentation of this file.
1
#include <
linux/init.h
>
2
#include <linux/kernel.h>
3
#include <linux/string.h>
4
#include <memmap.h>
5
#include <hwregs/reg_map.h>
6
#include <
hwregs/reg_rdwr.h
>
7
#include <
hwregs/l2cache_defs.h
>
8
#include <asm/io.h>
9
10
#define L2CACHE_SIZE 64
11
12
int
__init
l2cache_init
(
void
)
13
{
14
reg_l2cache_rw_ctrl
ctrl
= {0};
15
reg_l2cache_rw_cfg
cfg
= {.en =
regk_l2cache_yes
};
16
17
ctrl.
csize
=
L2CACHE_SIZE
;
18
ctrl.
cbase
=
L2CACHE_SIZE
/ 4 + (
L2CACHE_SIZE
% 4 ? 1 : 0);
19
REG_WR
(l2cache,
regi_l2cache
, rw_ctrl, ctrl);
20
21
/* Flush the tag memory */
22
memset
((
void
*)(
MEM_INTMEM_START
|
MEM_NON_CACHEABLE
), 0, 2*1024);
23
24
/* Enable the cache */
25
REG_WR
(l2cache,
regi_l2cache
, rw_cfg, cfg);
26
27
return
0;
28
}
29
Generated on Thu Jan 10 2013 13:05:18 for Linux Kernel by
1.8.2