diff options
author | Graf Yang <graf.yang@analog.com> | 2008-11-18 04:48:22 -0500 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-11-18 04:48:22 -0500 |
commit | b8a989893cbdeb6c97a7b5af5f38fb0e480235f9 (patch) | |
tree | 658cf6df93dac687f0d6b94111d0f53b3dd0177c /arch/blackfin/kernel/cplb-mpu/cplbinit.c | |
parent | 6b3087c64a92a36ae20d33479b4df6d7afc910d4 (diff) |
Blackfin arch: SMP supporting patchset: Blackfin CPLB related code
Blackfin dual core BF561 processor can support SMP like features.
https://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:smp-like
In this patch, we provide SMP extend to Blackfin CPLB related code
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel/cplb-mpu/cplbinit.c')
-rw-r--r-- | arch/blackfin/kernel/cplb-mpu/cplbinit.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/arch/blackfin/kernel/cplb-mpu/cplbinit.c b/arch/blackfin/kernel/cplb-mpu/cplbinit.c index 55af729f8495..269d2a3530a6 100644 --- a/arch/blackfin/kernel/cplb-mpu/cplbinit.c +++ b/arch/blackfin/kernel/cplb-mpu/cplbinit.c | |||
@@ -30,13 +30,13 @@ | |||
30 | # error the MPU will not function safely while Anomaly 05000263 applies | 30 | # error the MPU will not function safely while Anomaly 05000263 applies |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | struct cplb_entry icplb_tbl[MAX_CPLBS]; | 33 | struct cplb_entry icplb_tbl[NR_CPUS][MAX_CPLBS]; |
34 | struct cplb_entry dcplb_tbl[MAX_CPLBS]; | 34 | struct cplb_entry dcplb_tbl[NR_CPUS][MAX_CPLBS]; |
35 | 35 | ||
36 | int first_switched_icplb, first_switched_dcplb; | 36 | int first_switched_icplb, first_switched_dcplb; |
37 | int first_mask_dcplb; | 37 | int first_mask_dcplb; |
38 | 38 | ||
39 | void __init generate_cplb_tables(void) | 39 | void __init generate_cplb_tables_cpu(unsigned int cpu) |
40 | { | 40 | { |
41 | int i_d, i_i; | 41 | int i_d, i_i; |
42 | unsigned long addr; | 42 | unsigned long addr; |
@@ -55,15 +55,16 @@ void __init generate_cplb_tables(void) | |||
55 | d_cache |= CPLB_L1_AOW | CPLB_WT; | 55 | d_cache |= CPLB_L1_AOW | CPLB_WT; |
56 | #endif | 56 | #endif |
57 | #endif | 57 | #endif |
58 | |||
58 | i_d = i_i = 0; | 59 | i_d = i_i = 0; |
59 | 60 | ||
60 | /* Set up the zero page. */ | 61 | /* Set up the zero page. */ |
61 | dcplb_tbl[i_d].addr = 0; | 62 | dcplb_tbl[cpu][i_d].addr = 0; |
62 | dcplb_tbl[i_d++].data = SDRAM_OOPS | PAGE_SIZE_1KB; | 63 | dcplb_tbl[cpu][i_d++].data = SDRAM_OOPS | PAGE_SIZE_1KB; |
63 | 64 | ||
64 | #if 0 | 65 | #if 0 |
65 | icplb_tbl[i_i].addr = 0; | 66 | icplb_tbl[cpu][i_i].addr = 0; |
66 | icplb_tbl[i_i++].data = i_cache | CPLB_USER_RD | PAGE_SIZE_4KB; | 67 | icplb_tbl[cpu][i_i++].data = i_cache | CPLB_USER_RD | PAGE_SIZE_4KB; |
67 | #endif | 68 | #endif |
68 | 69 | ||
69 | /* Cover kernel memory with 4M pages. */ | 70 | /* Cover kernel memory with 4M pages. */ |
@@ -72,28 +73,28 @@ void __init generate_cplb_tables(void) | |||
72 | i_data = i_cache | CPLB_VALID | CPLB_PORTPRIO | PAGE_SIZE_4MB; | 73 | i_data = i_cache | CPLB_VALID | CPLB_PORTPRIO | PAGE_SIZE_4MB; |
73 | 74 | ||
74 | for (; addr < memory_start; addr += 4 * 1024 * 1024) { | 75 | for (; addr < memory_start; addr += 4 * 1024 * 1024) { |
75 | dcplb_tbl[i_d].addr = addr; | 76 | dcplb_tbl[cpu][i_d].addr = addr; |
76 | dcplb_tbl[i_d++].data = d_data; | 77 | dcplb_tbl[cpu][i_d++].data = d_data; |
77 | icplb_tbl[i_i].addr = addr; | 78 | icplb_tbl[cpu][i_i].addr = addr; |
78 | icplb_tbl[i_i++].data = i_data | (addr == 0 ? CPLB_USER_RD : 0); | 79 | icplb_tbl[cpu][i_i++].data = i_data | (addr == 0 ? CPLB_USER_RD : 0); |
79 | } | 80 | } |
80 | 81 | ||
81 | /* Cover L1 memory. One 4M area for code and data each is enough. */ | 82 | /* 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 | 83 | #if L1_DATA_A_LENGTH > 0 || L1_DATA_B_LENGTH > 0 |
83 | dcplb_tbl[i_d].addr = L1_DATA_A_START; | 84 | dcplb_tbl[cpu][i_d].addr = get_l1_data_a_start_cpu(cpu); |
84 | dcplb_tbl[i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB; | 85 | dcplb_tbl[cpu][i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB; |
85 | #endif | 86 | #endif |
86 | #if L1_CODE_LENGTH > 0 | 87 | #if L1_CODE_LENGTH > 0 |
87 | icplb_tbl[i_i].addr = L1_CODE_START; | 88 | icplb_tbl[cpu][i_i].addr = get_l1_code_start_cpu(cpu); |
88 | icplb_tbl[i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB; | 89 | icplb_tbl[cpu][i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB; |
89 | #endif | 90 | #endif |
90 | 91 | ||
91 | /* Cover L2 memory */ | 92 | /* Cover L2 memory */ |
92 | #if L2_LENGTH > 0 | 93 | #if L2_LENGTH > 0 |
93 | dcplb_tbl[i_d].addr = L2_START; | 94 | dcplb_tbl[cpu][i_d].addr = L2_START; |
94 | dcplb_tbl[i_d++].data = L2_DMEMORY | PAGE_SIZE_1MB; | 95 | dcplb_tbl[cpu][i_d++].data = L2_DMEMORY | PAGE_SIZE_1MB; |
95 | icplb_tbl[i_i].addr = L2_START; | 96 | icplb_tbl[cpu][i_i].addr = L2_START; |
96 | icplb_tbl[i_i++].data = L2_IMEMORY | PAGE_SIZE_1MB; | 97 | icplb_tbl[cpu][i_i++].data = L2_IMEMORY | PAGE_SIZE_1MB; |
97 | #endif | 98 | #endif |
98 | 99 | ||
99 | first_mask_dcplb = i_d; | 100 | first_mask_dcplb = i_d; |
@@ -101,7 +102,7 @@ void __init generate_cplb_tables(void) | |||
101 | first_switched_icplb = i_i; | 102 | first_switched_icplb = i_i; |
102 | 103 | ||
103 | while (i_d < MAX_CPLBS) | 104 | while (i_d < MAX_CPLBS) |
104 | dcplb_tbl[i_d++].data = 0; | 105 | dcplb_tbl[cpu][i_d++].data = 0; |
105 | while (i_i < MAX_CPLBS) | 106 | while (i_i < MAX_CPLBS) |
106 | icplb_tbl[i_i++].data = 0; | 107 | icplb_tbl[cpu][i_i++].data = 0; |
107 | } | 108 | } |