diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-08 13:01:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-08 13:01:28 -0500 |
commit | 0cf975e16927fd70f34cee20d3856246c13bb4c8 (patch) | |
tree | bb955d50f28e5d98c198701798c8341d9763299a /arch/cris/arch-v32/mm/l2cache.c | |
parent | 03054de1e0b90b33e9974107d84dabd2509f5898 (diff) | |
parent | bc10ac3f2fe44e65f787d6197fd5d17304bf7d83 (diff) |
Merge branch 'cris' of git://www.jni.nu/cris
* 'cris' of git://www.jni.nu/cris: (158 commits)
CRIS v32: Remove hwregs/timer_defs.h, it is now architecture specific.
CRIS v32: Change drivers/i2c.c locking.
CRIS v32: Rewrite ARTPEC-3 gpio driver to avoid volatiles and general cleanup.
CRIS: Add new timerfd syscall entries.
MAINTAINERS: Add my information for the CRIS port.
CRIS v32: Correct spelling of bandwidth in function name.
CRIS v32: Clean up nandflash.c for ARTPEC-3 and ETRAX FS.
CRIS v10: Cleanup of drivers/gpio.c
CRIS v10: drivers/net/cris/eth_v10.c rename LED defines to CRIS_LED to avoid name clash.
CRIS: Make io_pwm_set_period members unsigned in etraxgpio.h
CRIS: Move ETRAX_AXISFLASHMAP to common Kconfig file.
CRIS: Drop regs parameter from call to profile_tick in kernel/time.c
CRIS v32: Fix minor formatting issue in mach-a3/io.c
CRIS v32: Initialize GIO even if we're rambooting in kernel/head.S
CRIS v32: Remove kernel/arbiter.c, it now exists in machine dependent directory.
CRIS v32: Minor changes to avoid errors in asm-cris/arch-v32/hwregs/reg_rdwr.h
CRIS v32: arch-v32/hwregs/intr_vect_defs.h moved to machine dependent directory.
CRIS v32: Correct offset for TASK_pid in asm-cris/arch-v32/offset.h
CRIS v32: Move register map header to machine dependent directory.
CRIS v32: Let compiler know that memory is clobbered after a break op.
...
Diffstat (limited to 'arch/cris/arch-v32/mm/l2cache.c')
-rw-r--r-- | arch/cris/arch-v32/mm/l2cache.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/cris/arch-v32/mm/l2cache.c b/arch/cris/arch-v32/mm/l2cache.c new file mode 100644 index 000000000000..332ff10dcc6b --- /dev/null +++ b/arch/cris/arch-v32/mm/l2cache.c | |||
@@ -0,0 +1,29 @@ | |||
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 | |||