aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier.adi@gmail.com>2008-04-22 20:23:51 -0400
committerBryan Wu <cooloney@kernel.org>2008-04-22 20:23:51 -0400
commit0e184c6b4feba9640c85811a7929d18f4491ddb0 (patch)
tree076d8ef2ca5e454a2f20637ad8d528cc85938503
parent53eabf046b2837647f186f0cba085ce7a43bd7ce (diff)
[Blackfin] arch: relocate MAX_SWITCH_{D,I}_CPLBS from the header to the file where it actually gets used.
relocate MAX_SWITCH_{D,I}_CPLBS from the header to the file where it actually gets used. this way when we change CONFIG_MEM_SIZE in our kconfig, we only rebuild one or two files rather than a whole bunch that implicitly include cplb.h. this will also remove the ability to clear the swapcount on the fly, but i really dont think that functionality is important. ultimate goal is for CONFIG_MEM_SIZE to go away and calculate this value on the fly based on what u-boot programmed for us. Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cplbinfo.c11
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cplbinit.c23
-rw-r--r--include/asm-blackfin/cplb.h26
3 files changed, 23 insertions, 37 deletions
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbinfo.c b/arch/blackfin/kernel/cplb-nompu/cplbinfo.c
index a4f0b428a34d..f7f2eb0b7fea 100644
--- a/arch/blackfin/kernel/cplb-nompu/cplbinfo.c
+++ b/arch/blackfin/kernel/cplb-nompu/cplbinfo.c
@@ -174,16 +174,6 @@ static int cplbinfo_read_proc(char *page, char **start, off_t off,
174 return len; 174 return len;
175} 175}
176 176
177static int cplbinfo_write_proc(struct file *file, const char __user *buffer,
178 unsigned long count, void *data)
179{
180 printk(KERN_INFO "Reset the CPLB swap in/out counts.\n");
181 memset(ipdt_swapcount_table, 0, MAX_SWITCH_I_CPLBS * sizeof(unsigned long));
182 memset(dpdt_swapcount_table, 0, MAX_SWITCH_D_CPLBS * sizeof(unsigned long));
183
184 return count;
185}
186
187static int __init cplbinfo_init(void) 177static int __init cplbinfo_init(void)
188{ 178{
189 struct proc_dir_entry *entry; 179 struct proc_dir_entry *entry;
@@ -193,7 +183,6 @@ static int __init cplbinfo_init(void)
193 return -ENOMEM; 183 return -ENOMEM;
194 184
195 entry->read_proc = cplbinfo_read_proc; 185 entry->read_proc = cplbinfo_read_proc;
196 entry->write_proc = cplbinfo_write_proc;
197 entry->data = NULL; 186 entry->data = NULL;
198 187
199 return 0; 188 return 0;
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbinit.c b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
index 6320bc45fbba..dd46b666fd4d 100644
--- a/arch/blackfin/kernel/cplb-nompu/cplbinit.c
+++ b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
@@ -26,6 +26,29 @@
26#include <asm/cplb.h> 26#include <asm/cplb.h>
27#include <asm/cplbinit.h> 27#include <asm/cplbinit.h>
28 28
29/*
30* Number of required data CPLB switchtable entries
31* MEMSIZE / 4 (we mostly install 4M page size CPLBs
32* approx 16 for smaller 1MB page size CPLBs for allignment purposes
33* 1 for L1 Data Memory
34* possibly 1 for L2 Data Memory
35* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
36* 1 for ASYNC Memory
37*/
38#define MAX_SWITCH_D_CPLBS (((CONFIG_MEM_SIZE / 4) + 16 + 1 + 1 + 1 \
39 + ASYNC_MEMORY_CPLB_COVERAGE) * 2)
40
41/*
42* Number of required instruction CPLB switchtable entries
43* MEMSIZE / 4 (we mostly install 4M page size CPLBs
44* approx 12 for smaller 1MB page size CPLBs for allignment purposes
45* 1 for L1 Instruction Memory
46* possibly 1 for L2 Instruction Memory
47* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
48*/
49#define MAX_SWITCH_I_CPLBS (((CONFIG_MEM_SIZE / 4) + 12 + 1 + 1 + 1) * 2)
50
51
29u_long icplb_table[MAX_CPLBS + 1]; 52u_long icplb_table[MAX_CPLBS + 1];
30u_long dcplb_table[MAX_CPLBS + 1]; 53u_long dcplb_table[MAX_CPLBS + 1];
31 54
diff --git a/include/asm-blackfin/cplb.h b/include/asm-blackfin/cplb.h
index 654375c2b746..5b0da9a69b67 100644
--- a/include/asm-blackfin/cplb.h
+++ b/include/asm-blackfin/cplb.h
@@ -74,32 +74,6 @@
74#define ASYNC_MEMORY_CPLB_COVERAGE ((ASYNC_BANK0_SIZE + ASYNC_BANK1_SIZE + \ 74#define ASYNC_MEMORY_CPLB_COVERAGE ((ASYNC_BANK0_SIZE + ASYNC_BANK1_SIZE + \
75 ASYNC_BANK2_SIZE + ASYNC_BANK3_SIZE) / SIZE_4M) 75 ASYNC_BANK2_SIZE + ASYNC_BANK3_SIZE) / SIZE_4M)
76 76
77/*
78* Number of required data CPLB switchtable entries
79* MEMSIZE / 4 (we mostly install 4M page size CPLBs
80* approx 16 for smaller 1MB page size CPLBs for allignment purposes
81* 1 for L1 Data Memory
82* possibly 1 for L2 Data Memory
83* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
84* 1 for ASYNC Memory
85*/
86
87
88#define MAX_SWITCH_D_CPLBS (((CONFIG_MEM_SIZE / 4) + 16 + 1 + 1 + 1 \
89 + ASYNC_MEMORY_CPLB_COVERAGE) * 2)
90
91/*
92* Number of required instruction CPLB switchtable entries
93* MEMSIZE / 4 (we mostly install 4M page size CPLBs
94* approx 12 for smaller 1MB page size CPLBs for allignment purposes
95* 1 for L1 Instruction Memory
96* possibly 1 for L2 Instruction Memory
97* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
98*/
99
100#define MAX_SWITCH_I_CPLBS (((CONFIG_MEM_SIZE / 4) + 12 + 1 + 1 + 1) * 2)
101
102
103#define CPLB_ENABLE_ICACHE_P 0 77#define CPLB_ENABLE_ICACHE_P 0
104#define CPLB_ENABLE_DCACHE_P 1 78#define CPLB_ENABLE_DCACHE_P 1
105#define CPLB_ENABLE_DCACHE2_P 2 79#define CPLB_ENABLE_DCACHE2_P 2