-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 84912 b: refs/heads/master c: f74c31d h: refs/heads/master v: v3
- Loading branch information
Jesper Nilsson
authored and
Jesper Nilsson
committed
Feb 8, 2008
1 parent
9bb32cd
commit a81b46c
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 58d083192825c5fbd46fa0b1ff4d1ecc9118b692 | ||
refs/heads/master: f74c31d50c3c568abf315f9b8b206a4ec7b9c9f6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include <linux/init.h> | ||
#include <linux/kernel.h> | ||
#include <linux/string.h> | ||
#include <memmap.h> | ||
#include <hwregs/reg_map.h> | ||
#include <hwregs/reg_rdwr.h> | ||
#include <hwregs/l2cache_defs.h> | ||
#include <asm/io.h> | ||
|
||
#define L2CACHE_SIZE 64 | ||
|
||
int __init l2cache_init(void) | ||
{ | ||
reg_l2cache_rw_ctrl ctrl = {0}; | ||
reg_l2cache_rw_cfg cfg = {.en = regk_l2cache_yes}; | ||
|
||
ctrl.csize = L2CACHE_SIZE; | ||
ctrl.cbase = L2CACHE_SIZE / 4 + (L2CACHE_SIZE % 4 ? 1 : 0); | ||
REG_WR(l2cache, regi_l2cache, rw_ctrl, ctrl); | ||
|
||
/* Flush the tag memory */ | ||
memset((void *)(MEM_INTMEM_START | MEM_NON_CACHEABLE), 0, 2*1024); | ||
|
||
/* Enable the cache */ | ||
REG_WR(l2cache, regi_l2cache, rw_cfg, cfg); | ||
|
||
return 0; | ||
} | ||
|