diff options
Diffstat (limited to 'arch/blackfin/mach-common/entry.S')
-rw-r--r-- | arch/blackfin/mach-common/entry.S | 54 |
1 files changed, 38 insertions, 16 deletions
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S index 1b13fa470977..dc9d3ee2e691 100644 --- a/arch/blackfin/mach-common/entry.S +++ b/arch/blackfin/mach-common/entry.S | |||
@@ -33,7 +33,7 @@ | |||
33 | * after a timer-interrupt and after each system call. | 33 | * after a timer-interrupt and after each system call. |
34 | */ | 34 | */ |
35 | 35 | ||
36 | 36 | #include <linux/init.h> | |
37 | #include <linux/linkage.h> | 37 | #include <linux/linkage.h> |
38 | #include <linux/unistd.h> | 38 | #include <linux/unistd.h> |
39 | #include <asm/blackfin.h> | 39 | #include <asm/blackfin.h> |
@@ -71,25 +71,44 @@ ENDPROC(_safe_speculative_execution) | |||
71 | * This one does not lower the level to IRQ5, and thus can be used to | 71 | * This one does not lower the level to IRQ5, and thus can be used to |
72 | * patch up CPLB misses on the kernel stack. | 72 | * patch up CPLB misses on the kernel stack. |
73 | */ | 73 | */ |
74 | ENTRY(_ex_dcplb) | ||
75 | #if ANOMALY_05000261 | 74 | #if ANOMALY_05000261 |
75 | #define _ex_dviol _ex_workaround_261 | ||
76 | #define _ex_dmiss _ex_workaround_261 | ||
77 | #define _ex_dmult _ex_workaround_261 | ||
78 | |||
79 | ENTRY(_ex_workaround_261) | ||
76 | /* | 80 | /* |
77 | * Work around an anomaly: if we see a new DCPLB fault, return | 81 | * Work around an anomaly: if we see a new DCPLB fault, return |
78 | * without doing anything. Then, if we get the same fault again, | 82 | * without doing anything. Then, if we get the same fault again, |
79 | * handle it. | 83 | * handle it. |
80 | */ | 84 | */ |
85 | P4 = R7; /* Store EXCAUSE */ | ||
81 | p5.l = _last_cplb_fault_retx; | 86 | p5.l = _last_cplb_fault_retx; |
82 | p5.h = _last_cplb_fault_retx; | 87 | p5.h = _last_cplb_fault_retx; |
83 | r7 = [p5]; | 88 | r7 = [p5]; |
84 | r6 = retx; | 89 | r6 = retx; |
85 | [p5] = r6; | 90 | [p5] = r6; |
86 | cc = r6 == r7; | 91 | cc = r6 == r7; |
87 | if !cc jump _return_from_exception; | 92 | if !cc jump _bfin_return_from_exception; |
88 | /* fall through */ | 93 | /* fall through */ |
94 | R7 = P4; | ||
95 | R6 = 0x26; /* Data CPLB Miss */ | ||
96 | cc = R6 == R7; | ||
97 | if cc jump _ex_dcplb_miss (BP); | ||
98 | /* Handle 0x23 Data CPLB Protection Violation | ||
99 | * and Data CPLB Multiple Hits - Linux Trap Zero | ||
100 | */ | ||
101 | jump _ex_trap_c; | ||
102 | ENDPROC(_ex_workaround_261) | ||
103 | |||
104 | #else | ||
105 | #define _ex_dviol _ex_trap_c | ||
106 | #define _ex_dmiss _ex_dcplb_miss | ||
107 | #define _ex_dmult _ex_trap_c | ||
89 | #endif | 108 | #endif |
90 | ENDPROC(_ex_dcplb) | ||
91 | 109 | ||
92 | ENTRY(_ex_icplb) | 110 | ENTRY(_ex_dcplb_miss) |
111 | ENTRY(_ex_icplb_miss) | ||
93 | (R7:6,P5:4) = [sp++]; | 112 | (R7:6,P5:4) = [sp++]; |
94 | ASTAT = [sp++]; | 113 | ASTAT = [sp++]; |
95 | SAVE_ALL_SYS | 114 | SAVE_ALL_SYS |
@@ -98,7 +117,7 @@ ENTRY(_ex_icplb) | |||
98 | RESTORE_ALL_SYS | 117 | RESTORE_ALL_SYS |
99 | SP = EX_SCRATCH_REG; | 118 | SP = EX_SCRATCH_REG; |
100 | rtx; | 119 | rtx; |
101 | ENDPROC(_ex_icplb) | 120 | ENDPROC(_ex_icplb_miss) |
102 | 121 | ||
103 | ENTRY(_ex_syscall) | 122 | ENTRY(_ex_syscall) |
104 | DEBUG_START_HWTRACE(p5, r7) | 123 | DEBUG_START_HWTRACE(p5, r7) |
@@ -120,7 +139,7 @@ ENTRY(_ex_single_step) | |||
120 | r7 = retx; | 139 | r7 = retx; |
121 | r6 = reti; | 140 | r6 = reti; |
122 | cc = r7 == r6; | 141 | cc = r7 == r6; |
123 | if cc jump _return_from_exception | 142 | if cc jump _bfin_return_from_exception |
124 | r7 = syscfg; | 143 | r7 = syscfg; |
125 | bitclr (r7, 0); | 144 | bitclr (r7, 0); |
126 | syscfg = R7; | 145 | syscfg = R7; |
@@ -137,8 +156,9 @@ ENTRY(_ex_single_step) | |||
137 | r7 = [p4]; | 156 | r7 = [p4]; |
138 | cc = r6 == r7; | 157 | cc = r6 == r7; |
139 | if !cc jump _ex_trap_c; | 158 | if !cc jump _ex_trap_c; |
159 | ENDPROC(_ex_single_step) | ||
140 | 160 | ||
141 | ENTRY(_return_from_exception) | 161 | ENTRY(_bfin_return_from_exception) |
142 | DEBUG_START_HWTRACE(p5, r7) | 162 | DEBUG_START_HWTRACE(p5, r7) |
143 | #if ANOMALY_05000257 | 163 | #if ANOMALY_05000257 |
144 | R7=LC0; | 164 | R7=LC0; |
@@ -150,7 +170,7 @@ ENTRY(_return_from_exception) | |||
150 | ASTAT = [sp++]; | 170 | ASTAT = [sp++]; |
151 | sp = EX_SCRATCH_REG; | 171 | sp = EX_SCRATCH_REG; |
152 | rtx; | 172 | rtx; |
153 | ENDPROC(_ex_soft_bp) | 173 | ENDPROC(_bfin_return_from_exception) |
154 | 174 | ||
155 | ENTRY(_handle_bad_cplb) | 175 | ENTRY(_handle_bad_cplb) |
156 | /* To get here, we just tried and failed to change a CPLB | 176 | /* To get here, we just tried and failed to change a CPLB |
@@ -843,7 +863,7 @@ ENTRY(_ex_trace_buff_full) | |||
843 | LC0 = [sp++]; | 863 | LC0 = [sp++]; |
844 | P2 = [sp++]; | 864 | P2 = [sp++]; |
845 | P3 = [sp++]; | 865 | P3 = [sp++]; |
846 | jump _return_from_exception; | 866 | jump _bfin_return_from_exception; |
847 | ENDPROC(_ex_trace_buff_full) | 867 | ENDPROC(_ex_trace_buff_full) |
848 | 868 | ||
849 | #if CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN == 4 | 869 | #if CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN == 4 |
@@ -861,7 +881,7 @@ ENTRY(_software_trace_buff) | |||
861 | #endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND */ | 881 | #endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND */ |
862 | 882 | ||
863 | #if CONFIG_EARLY_PRINTK | 883 | #if CONFIG_EARLY_PRINTK |
864 | .section .init.text | 884 | __INIT |
865 | ENTRY(_early_trap) | 885 | ENTRY(_early_trap) |
866 | SAVE_ALL_SYS | 886 | SAVE_ALL_SYS |
867 | trace_buffer_stop(p0,r0); | 887 | trace_buffer_stop(p0,r0); |
@@ -896,6 +916,7 @@ ENTRY(_early_trap) | |||
896 | call _early_trap_c; | 916 | call _early_trap_c; |
897 | SP += 12; | 917 | SP += 12; |
898 | ENDPROC(_early_trap) | 918 | ENDPROC(_early_trap) |
919 | __FINIT | ||
899 | #endif /* CONFIG_EARLY_PRINTK */ | 920 | #endif /* CONFIG_EARLY_PRINTK */ |
900 | 921 | ||
901 | /* | 922 | /* |
@@ -908,6 +929,7 @@ ENDPROC(_early_trap) | |||
908 | #else | 929 | #else |
909 | .data | 930 | .data |
910 | #endif | 931 | #endif |
932 | |||
911 | ENTRY(_ex_table) | 933 | ENTRY(_ex_table) |
912 | /* entry for each EXCAUSE[5:0] | 934 | /* entry for each EXCAUSE[5:0] |
913 | * This table must be in sync with the table in ./kernel/traps.c | 935 | * This table must be in sync with the table in ./kernel/traps.c |
@@ -952,16 +974,16 @@ ENTRY(_ex_table) | |||
952 | .long _ex_trap_c /* 0x20 - Reserved */ | 974 | .long _ex_trap_c /* 0x20 - Reserved */ |
953 | .long _ex_trap_c /* 0x21 - Undefined Instruction */ | 975 | .long _ex_trap_c /* 0x21 - Undefined Instruction */ |
954 | .long _ex_trap_c /* 0x22 - Illegal Instruction Combination */ | 976 | .long _ex_trap_c /* 0x22 - Illegal Instruction Combination */ |
955 | .long _ex_dcplb /* 0x23 - Data CPLB Protection Violation */ | 977 | .long _ex_dviol /* 0x23 - Data CPLB Protection Violation */ |
956 | .long _ex_trap_c /* 0x24 - Data access misaligned */ | 978 | .long _ex_trap_c /* 0x24 - Data access misaligned */ |
957 | .long _ex_trap_c /* 0x25 - Unrecoverable Event */ | 979 | .long _ex_trap_c /* 0x25 - Unrecoverable Event */ |
958 | .long _ex_dcplb /* 0x26 - Data CPLB Miss */ | 980 | .long _ex_dmiss /* 0x26 - Data CPLB Miss */ |
959 | .long _ex_trap_c /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */ | 981 | .long _ex_dmult /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero */ |
960 | .long _ex_trap_c /* 0x28 - Emulation Watchpoint */ | 982 | .long _ex_trap_c /* 0x28 - Emulation Watchpoint */ |
961 | .long _ex_trap_c /* 0x29 - Instruction fetch access error (535 only) */ | 983 | .long _ex_trap_c /* 0x29 - Instruction fetch access error (535 only) */ |
962 | .long _ex_trap_c /* 0x2A - Instruction fetch misaligned */ | 984 | .long _ex_trap_c /* 0x2A - Instruction fetch misaligned */ |
963 | .long _ex_icplb /* 0x2B - Instruction CPLB protection Violation */ | 985 | .long _ex_trap_c /* 0x2B - Instruction CPLB protection Violation */ |
964 | .long _ex_icplb /* 0x2C - Instruction CPLB miss */ | 986 | .long _ex_icplb_miss /* 0x2C - Instruction CPLB miss */ |
965 | .long _ex_trap_c /* 0x2D - Instruction CPLB Multiple Hits */ | 987 | .long _ex_trap_c /* 0x2D - Instruction CPLB Multiple Hits */ |
966 | .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */ | 988 | .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */ |
967 | .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */ | 989 | .long _ex_trap_c /* 0x2E - Illegal use of Supervisor Resource */ |