diff options
Diffstat (limited to 'arch/blackfin/kernel/cplb-mpu/cplbinit.c')
-rw-r--r-- | arch/blackfin/kernel/cplb-mpu/cplbinit.c | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/arch/blackfin/kernel/cplb-mpu/cplbinit.c b/arch/blackfin/kernel/cplb-mpu/cplbinit.c index 55af729f8495..bdb958486e76 100644 --- a/arch/blackfin/kernel/cplb-mpu/cplbinit.c +++ b/arch/blackfin/kernel/cplb-mpu/cplbinit.c | |||
@@ -25,18 +25,19 @@ | |||
25 | #include <asm/blackfin.h> | 25 | #include <asm/blackfin.h> |
26 | #include <asm/cplb.h> | 26 | #include <asm/cplb.h> |
27 | #include <asm/cplbinit.h> | 27 | #include <asm/cplbinit.h> |
28 | #include <asm/mem_map.h> | ||
28 | 29 | ||
29 | #if ANOMALY_05000263 | 30 | #if ANOMALY_05000263 |
30 | # error the MPU will not function safely while Anomaly 05000263 applies | 31 | # error the MPU will not function safely while Anomaly 05000263 applies |
31 | #endif | 32 | #endif |
32 | 33 | ||
33 | struct cplb_entry icplb_tbl[MAX_CPLBS]; | 34 | struct cplb_entry icplb_tbl[NR_CPUS][MAX_CPLBS]; |
34 | struct cplb_entry dcplb_tbl[MAX_CPLBS]; | 35 | struct cplb_entry dcplb_tbl[NR_CPUS][MAX_CPLBS]; |
35 | 36 | ||
36 | int first_switched_icplb, first_switched_dcplb; | 37 | int first_switched_icplb, first_switched_dcplb; |
37 | int first_mask_dcplb; | 38 | int first_mask_dcplb; |
38 | 39 | ||
39 | void __init generate_cplb_tables(void) | 40 | void __init generate_cplb_tables_cpu(unsigned int cpu) |
40 | { | 41 | { |
41 | int i_d, i_i; | 42 | int i_d, i_i; |
42 | unsigned long addr; | 43 | unsigned long addr; |
@@ -55,15 +56,16 @@ void __init generate_cplb_tables(void) | |||
55 | d_cache |= CPLB_L1_AOW | CPLB_WT; | 56 | d_cache |= CPLB_L1_AOW | CPLB_WT; |
56 | #endif | 57 | #endif |
57 | #endif | 58 | #endif |
59 | |||
58 | i_d = i_i = 0; | 60 | i_d = i_i = 0; |
59 | 61 | ||
60 | /* Set up the zero page. */ | 62 | /* Set up the zero page. */ |
61 | dcplb_tbl[i_d].addr = 0; | 63 | dcplb_tbl[cpu][i_d].addr = 0; |
62 | dcplb_tbl[i_d++].data = SDRAM_OOPS | PAGE_SIZE_1KB; | 64 | dcplb_tbl[cpu][i_d++].data = SDRAM_OOPS | PAGE_SIZE_1KB; |
63 | 65 | ||
64 | #if 0 | 66 | #if 0 |
65 | icplb_tbl[i_i].addr = 0; | 67 | icplb_tbl[cpu][i_i].addr = 0; |
66 | icplb_tbl[i_i++].data = i_cache | CPLB_USER_RD | PAGE_SIZE_4KB; | 68 | icplb_tbl[cpu][i_i++].data = i_cache | CPLB_USER_RD | PAGE_SIZE_4KB; |
67 | #endif | 69 | #endif |
68 | 70 | ||
69 | /* Cover kernel memory with 4M pages. */ | 71 | /* Cover kernel memory with 4M pages. */ |
@@ -72,28 +74,28 @@ void __init generate_cplb_tables(void) | |||
72 | i_data = i_cache | CPLB_VALID | CPLB_PORTPRIO | PAGE_SIZE_4MB; | 74 | i_data = i_cache | CPLB_VALID | CPLB_PORTPRIO | PAGE_SIZE_4MB; |
73 | 75 | ||
74 | for (; addr < memory_start; addr += 4 * 1024 * 1024) { | 76 | for (; addr < memory_start; addr += 4 * 1024 * 1024) { |
75 | dcplb_tbl[i_d].addr = addr; | 77 | dcplb_tbl[cpu][i_d].addr = addr; |
76 | dcplb_tbl[i_d++].data = d_data; | 78 | dcplb_tbl[cpu][i_d++].data = d_data; |
77 | icplb_tbl[i_i].addr = addr; | 79 | icplb_tbl[cpu][i_i].addr = addr; |
78 | icplb_tbl[i_i++].data = i_data | (addr == 0 ? CPLB_USER_RD : 0); | 80 | icplb_tbl[cpu][i_i++].data = i_data | (addr == 0 ? CPLB_USER_RD : 0); |
79 | } | 81 | } |
80 | 82 | ||
81 | /* Cover L1 memory. One 4M area for code and data each is enough. */ | 83 | /* Cover L1 memory. One 4M area for code and data each is enough. */ |
82 | #if L1_DATA_A_LENGTH > 0 || L1_DATA_B_LENGTH > 0 | 84 | #if L1_DATA_A_LENGTH > 0 || L1_DATA_B_LENGTH > 0 |
83 | dcplb_tbl[i_d].addr = L1_DATA_A_START; | 85 | dcplb_tbl[cpu][i_d].addr = get_l1_data_a_start_cpu(cpu); |
84 | dcplb_tbl[i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB; | 86 | dcplb_tbl[cpu][i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB; |
85 | #endif | 87 | #endif |
86 | #if L1_CODE_LENGTH > 0 | 88 | #if L1_CODE_LENGTH > 0 |
87 | icplb_tbl[i_i].addr = L1_CODE_START; | 89 | icplb_tbl[cpu][i_i].addr = get_l1_code_start_cpu(cpu); |
88 | icplb_tbl[i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB; | 90 | icplb_tbl[cpu][i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB; |
89 | #endif | 91 | #endif |
90 | 92 | ||
91 | /* Cover L2 memory */ | 93 | /* Cover L2 memory */ |
92 | #if L2_LENGTH > 0 | 94 | #if L2_LENGTH > 0 |
93 | dcplb_tbl[i_d].addr = L2_START; | 95 | dcplb_tbl[cpu][i_d].addr = L2_START; |
94 | dcplb_tbl[i_d++].data = L2_DMEMORY | PAGE_SIZE_1MB; | 96 | dcplb_tbl[cpu][i_d++].data = L2_DMEMORY | PAGE_SIZE_1MB; |
95 | icplb_tbl[i_i].addr = L2_START; | 97 | icplb_tbl[cpu][i_i].addr = L2_START; |
96 | icplb_tbl[i_i++].data = L2_IMEMORY | PAGE_SIZE_1MB; | 98 | icplb_tbl[cpu][i_i++].data = L2_IMEMORY | PAGE_SIZE_1MB; |
97 | #endif | 99 | #endif |
98 | 100 | ||
99 | first_mask_dcplb = i_d; | 101 | first_mask_dcplb = i_d; |
@@ -101,7 +103,11 @@ void __init generate_cplb_tables(void) | |||
101 | first_switched_icplb = i_i; | 103 | first_switched_icplb = i_i; |
102 | 104 | ||
103 | while (i_d < MAX_CPLBS) | 105 | while (i_d < MAX_CPLBS) |
104 | dcplb_tbl[i_d++].data = 0; | 106 | dcplb_tbl[cpu][i_d++].data = 0; |
105 | while (i_i < MAX_CPLBS) | 107 | while (i_i < MAX_CPLBS) |
106 | icplb_tbl[i_i++].data = 0; | 108 | icplb_tbl[cpu][i_i++].data = 0; |
109 | } | ||
110 | |||
111 | void generate_cplb_tables_all(void) | ||
112 | { | ||
107 | } | 113 | } |