diff options
Diffstat (limited to 'arch/blackfin/include/asm/cplbinit.h')
-rw-r--r-- | arch/blackfin/include/asm/cplbinit.h | 83 |
1 files changed, 39 insertions, 44 deletions
diff --git a/arch/blackfin/include/asm/cplbinit.h b/arch/blackfin/include/asm/cplbinit.h index f845b41147ba..05b14a631d0c 100644 --- a/arch/blackfin/include/asm/cplbinit.h +++ b/arch/blackfin/include/asm/cplbinit.h | |||
@@ -32,61 +32,56 @@ | |||
32 | 32 | ||
33 | #include <asm/blackfin.h> | 33 | #include <asm/blackfin.h> |
34 | #include <asm/cplb.h> | 34 | #include <asm/cplb.h> |
35 | #include <linux/threads.h> | ||
35 | 36 | ||
36 | #ifdef CONFIG_MPU | 37 | #ifdef CONFIG_CPLB_SWITCH_TAB_L1 |
37 | 38 | # define PDT_ATTR __attribute__((l1_data)) | |
38 | #include <asm/cplb-mpu.h> | ||
39 | |||
40 | #else | 39 | #else |
40 | # define PDT_ATTR | ||
41 | #endif | ||
41 | 42 | ||
42 | #define INITIAL_T 0x1 | 43 | struct cplb_entry { |
43 | #define SWITCH_T 0x2 | 44 | unsigned long data, addr; |
44 | #define I_CPLB 0x4 | ||
45 | #define D_CPLB 0x8 | ||
46 | |||
47 | #define IN_KERNEL 1 | ||
48 | |||
49 | enum | ||
50 | {ZERO_P, L1I_MEM, L1D_MEM, SDRAM_KERN , SDRAM_RAM_MTD, SDRAM_DMAZ, RES_MEM, ASYNC_MEM, L2_MEM}; | ||
51 | |||
52 | struct cplb_desc { | ||
53 | u32 start; /* start address */ | ||
54 | u32 end; /* end address */ | ||
55 | u32 psize; /* prefered size if any otherwise 1MB or 4MB*/ | ||
56 | u16 attr;/* attributes */ | ||
57 | u16 i_conf;/* I-CPLB DATA */ | ||
58 | u16 d_conf;/* D-CPLB DATA */ | ||
59 | u16 valid;/* valid */ | ||
60 | const s8 name[30];/* name */ | ||
61 | }; | 45 | }; |
62 | 46 | ||
63 | struct cplb_tab { | 47 | struct cplb_boundary { |
64 | u_long *tab; | 48 | unsigned long eaddr; /* End of this region. */ |
65 | u16 pos; | 49 | unsigned long data; /* CPLB data value. */ |
66 | u16 size; | ||
67 | }; | 50 | }; |
68 | 51 | ||
69 | extern u_long icplb_table[]; | 52 | extern struct cplb_boundary dcplb_bounds[]; |
70 | extern u_long dcplb_table[]; | 53 | extern struct cplb_boundary icplb_bounds[]; |
54 | extern int dcplb_nr_bounds, icplb_nr_bounds; | ||
71 | 55 | ||
72 | /* Till here we are discussing about the static memory management model. | 56 | extern struct cplb_entry dcplb_tbl[NR_CPUS][MAX_CPLBS]; |
73 | * However, the operating envoronments commonly define more CPLB | 57 | extern struct cplb_entry icplb_tbl[NR_CPUS][MAX_CPLBS]; |
74 | * descriptors to cover the entire addressable memory than will fit into | 58 | extern int first_switched_icplb; |
75 | * the available on-chip 16 CPLB MMRs. When this happens, the below table | 59 | extern int first_switched_dcplb; |
76 | * will be used which will hold all the potentially required CPLB descriptors | ||
77 | * | ||
78 | * This is how Page descriptor Table is implemented in uClinux/Blackfin. | ||
79 | */ | ||
80 | 60 | ||
81 | extern u_long ipdt_table[]; | 61 | extern int nr_dcplb_miss[], nr_icplb_miss[], nr_icplb_supv_miss[]; |
82 | extern u_long dpdt_table[]; | 62 | extern int nr_dcplb_prot[], nr_cplb_flush[]; |
83 | #ifdef CONFIG_CPLB_INFO | 63 | |
84 | extern u_long ipdt_swapcount_table[]; | 64 | #ifdef CONFIG_MPU |
85 | extern u_long dpdt_swapcount_table[]; | 65 | |
86 | #endif | 66 | extern int first_mask_dcplb; |
67 | |||
68 | extern int page_mask_order; | ||
69 | extern int page_mask_nelts; | ||
70 | |||
71 | extern unsigned long *current_rwx_mask[NR_CPUS]; | ||
72 | |||
73 | extern void flush_switched_cplbs(unsigned int); | ||
74 | extern void set_mask_dcplbs(unsigned long *, unsigned int); | ||
75 | |||
76 | extern void __noreturn panic_cplb_error(int seqstat, struct pt_regs *); | ||
87 | 77 | ||
88 | #endif /* CONFIG_MPU */ | 78 | #endif /* CONFIG_MPU */ |
89 | 79 | ||
90 | extern void generate_cplb_tables(void); | 80 | extern void bfin_icache_init(struct cplb_entry *icplb_tbl); |
81 | extern void bfin_dcache_init(struct cplb_entry *icplb_tbl); | ||
91 | 82 | ||
83 | #if defined(CONFIG_BFIN_DCACHE) || defined(CONFIG_BFIN_ICACHE) | ||
84 | extern void generate_cplb_tables_all(void); | ||
85 | extern void generate_cplb_tables_cpu(unsigned int cpu); | ||
86 | #endif | ||
92 | #endif | 87 | #endif |