aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/include/asm/cplbinit.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/include/asm/cplbinit.h')
-rw-r--r--arch/blackfin/include/asm/cplbinit.h57
1 files changed, 47 insertions, 10 deletions
diff --git a/arch/blackfin/include/asm/cplbinit.h b/arch/blackfin/include/asm/cplbinit.h
index f845b41147ba..6bfc25788161 100644
--- a/arch/blackfin/include/asm/cplbinit.h
+++ b/arch/blackfin/include/asm/cplbinit.h
@@ -36,6 +36,8 @@
36#ifdef CONFIG_MPU 36#ifdef CONFIG_MPU
37 37
38#include <asm/cplb-mpu.h> 38#include <asm/cplb-mpu.h>
39extern void bfin_icache_init(struct cplb_entry *icplb_tbl);
40extern void bfin_dcache_init(struct cplb_entry *icplb_tbl);
39 41
40#else 42#else
41 43
@@ -46,8 +48,40 @@
46 48
47#define IN_KERNEL 1 49#define IN_KERNEL 1
48 50
49enum 51#define ASYNC_MEMORY_CPLB_COVERAGE ((ASYNC_BANK0_SIZE + ASYNC_BANK1_SIZE + \
50{ZERO_P, L1I_MEM, L1D_MEM, SDRAM_KERN , SDRAM_RAM_MTD, SDRAM_DMAZ, RES_MEM, ASYNC_MEM, L2_MEM}; 52 ASYNC_BANK2_SIZE + ASYNC_BANK3_SIZE) / SIZE_4M)
53
54#define CPLB_MEM CONFIG_MAX_MEM_SIZE
55
56/*
57* Number of required data CPLB switchtable entries
58* MEMSIZE / 4 (we mostly install 4M page size CPLBs
59* approx 16 for smaller 1MB page size CPLBs for allignment purposes
60* 1 for L1 Data Memory
61* possibly 1 for L2 Data Memory
62* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
63* 1 for ASYNC Memory
64*/
65#define MAX_SWITCH_D_CPLBS (((CPLB_MEM / 4) + 16 + 1 + 1 + 1 \
66 + ASYNC_MEMORY_CPLB_COVERAGE) * 2)
67
68/*
69* Number of required instruction CPLB switchtable entries
70* MEMSIZE / 4 (we mostly install 4M page size CPLBs
71* approx 12 for smaller 1MB page size CPLBs for allignment purposes
72* 1 for L1 Instruction Memory
73* possibly 1 for L2 Instruction Memory
74* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
75*/
76#define MAX_SWITCH_I_CPLBS (((CPLB_MEM / 4) + 12 + 1 + 1 + 1) * 2)
77
78/* Number of CPLB table entries, used for cplb-nompu. */
79#define CPLB_TBL_ENTRIES (16 * 4)
80
81enum {
82 ZERO_P, L1I_MEM, L1D_MEM, L2_MEM, SDRAM_KERN, SDRAM_RAM_MTD, SDRAM_DMAZ,
83 RES_MEM, ASYNC_MEM, OCB_ROM
84};
51 85
52struct cplb_desc { 86struct cplb_desc {
53 u32 start; /* start address */ 87 u32 start; /* start address */
@@ -66,8 +100,8 @@ struct cplb_tab {
66 u16 size; 100 u16 size;
67}; 101};
68 102
69extern u_long icplb_table[]; 103extern u_long icplb_tables[NR_CPUS][CPLB_TBL_ENTRIES+1];
70extern u_long dcplb_table[]; 104extern u_long dcplb_tables[NR_CPUS][CPLB_TBL_ENTRIES+1];
71 105
72/* Till here we are discussing about the static memory management model. 106/* Till here we are discussing about the static memory management model.
73 * However, the operating envoronments commonly define more CPLB 107 * However, the operating envoronments commonly define more CPLB
@@ -78,15 +112,18 @@ extern u_long dcplb_table[];
78 * This is how Page descriptor Table is implemented in uClinux/Blackfin. 112 * This is how Page descriptor Table is implemented in uClinux/Blackfin.
79 */ 113 */
80 114
81extern u_long ipdt_table[]; 115extern u_long ipdt_tables[NR_CPUS][MAX_SWITCH_I_CPLBS+1];
82extern u_long dpdt_table[]; 116extern u_long dpdt_tables[NR_CPUS][MAX_SWITCH_D_CPLBS+1];
83#ifdef CONFIG_CPLB_INFO 117#ifdef CONFIG_CPLB_INFO
84extern u_long ipdt_swapcount_table[]; 118extern u_long ipdt_swapcount_tables[NR_CPUS][MAX_SWITCH_I_CPLBS];
85extern u_long dpdt_swapcount_table[]; 119extern u_long dpdt_swapcount_tables[NR_CPUS][MAX_SWITCH_D_CPLBS];
86#endif 120#endif
121extern void bfin_icache_init(u_long icplbs[]);
122extern void bfin_dcache_init(u_long dcplbs[]);
87 123
88#endif /* CONFIG_MPU */ 124#endif /* CONFIG_MPU */
89 125
90extern void generate_cplb_tables(void); 126#if defined(CONFIG_BFIN_DCACHE) || defined(CONFIG_BFIN_ICACHE)
91 127extern void generate_cplb_tables_cpu(unsigned int cpu);
128#endif
92#endif 129#endif