Commit | Line | Data |
---|---|---|
74ce8322 MF |
1 | menu "Kernel hacking" |
2 | ||
3 | source "lib/Kconfig.debug" | |
4 | ||
a5ac0129 SZ |
5 | config HAVE_ARCH_KGDB |
6 | def_bool y | |
7 | ||
74ce8322 MF |
8 | config DEBUG_MMRS |
9 | bool "Generate Blackfin MMR tree" | |
10 | select DEBUG_FS | |
11 | help | |
12 | Create a tree of Blackfin MMRs via the debugfs tree. If | |
13 | you enable this, you will find all MMRs laid out in the | |
14 | /sys/kernel/debug/blackfin/ directory where you can read/write | |
15 | MMRs directly from userspace. This is obviously just a debug | |
16 | feature. | |
17 | ||
18 | config DEBUG_HWERR | |
19 | bool "Hardware error interrupt debugging" | |
20 | depends on DEBUG_KERNEL | |
21 | help | |
22 | When enabled, the hardware error interrupt is never disabled, and | |
23 | will happen immediately when an error condition occurs. This comes | |
24 | at a slight cost in code size, but is necessary if you are getting | |
25 | hardware error interrupts and need to know where they are coming | |
26 | from. | |
27 | ||
0c7a6b21 RG |
28 | config DEBUG_DOUBLEFAULT |
29 | bool "Debug Double Faults" | |
30 | default n | |
31 | help | |
32 | If an exception is caused while executing code within the exception | |
33 | handler, the NMI handler, the reset vector, or in emulator mode, | |
34 | a double fault occurs. On the Blackfin, this is a unrecoverable | |
35 | event. You have two options: | |
36 | - RESET exactly when double fault occurs. The excepting | |
37 | instruction address is stored in RETX, where the next kernel | |
38 | boot will print it out. | |
39 | - Print debug message. This is much more error prone, although | |
40 | easier to handle. It is error prone since: | |
41 | - The excepting instruction is not committed. | |
42 | - All writebacks from the instruction are prevented. | |
43 | - The generated exception is not taken. | |
44 | - The EXCAUSE field is updated with an unrecoverable event | |
45 | The only way to check this is to see if EXCAUSE contains the | |
46 | unrecoverable event value at every exception return. By selecting | |
47 | this option, you are skipping over the faulting instruction, and | |
48 | hoping things stay together enough to print out a debug message. | |
49 | ||
50 | This does add a little kernel code, but is the only method to debug | |
51 | double faults - if unsure say "Y" | |
52 | ||
53 | choice | |
54 | prompt "Double Fault Failure Method" | |
55 | default DEBUG_DOUBLEFAULT_PRINT | |
56 | depends on DEBUG_DOUBLEFAULT | |
57 | ||
58 | config DEBUG_DOUBLEFAULT_PRINT | |
59 | bool "Print" | |
60 | ||
61 | config DEBUG_DOUBLEFAULT_RESET | |
62 | bool "Reset" | |
63 | ||
64 | endchoice | |
65 | ||
74ce8322 MF |
66 | config DEBUG_ICACHE_CHECK |
67 | bool "Check Instruction cache coherency" | |
68 | depends on DEBUG_KERNEL | |
69 | depends on DEBUG_HWERR | |
70 | help | |
71 | Say Y here if you are getting weird unexplained errors. This will | |
72 | ensure that icache is what SDRAM says it should be by doing a | |
73 | byte wise comparison between SDRAM and instruction cache. This | |
74 | also relocates the irq_panic() function to L1 memory, (which is | |
75 | un-cached). | |
76 | ||
77 | config DEBUG_HUNT_FOR_ZERO | |
78 | bool "Catch NULL pointer reads/writes" | |
79 | default y | |
80 | help | |
81 | Say Y here to catch reads/writes to anywhere in the memory range | |
82 | from 0x0000 - 0x0FFF (the first 4k) of memory. This is useful in | |
83 | catching common programming errors such as NULL pointer dereferences. | |
84 | ||
85 | Misbehaving applications will be killed (generate a SEGV) while the | |
86 | kernel will trigger a panic. | |
87 | ||
88 | Enabling this option will take up an extra entry in CPLB table. | |
89 | Otherwise, there is no extra overhead. | |
90 | ||
91 | config DEBUG_BFIN_HWTRACE_ON | |
92 | bool "Turn on Blackfin's Hardware Trace" | |
93 | default y | |
94 | help | |
95 | All Blackfins include a Trace Unit which stores a history of the last | |
96 | 16 changes in program flow taken by the program sequencer. The history | |
97 | allows the user to recreate the program sequencer’s recent path. This | |
98 | can be handy when an application dies - we print out the execution | |
99 | path of how it got to the offending instruction. | |
100 | ||
101 | By turning this off, you may save a tiny amount of power. | |
102 | ||
103 | choice | |
104 | prompt "Omit loop Tracing" | |
105 | default DEBUG_BFIN_HWTRACE_COMPRESSION_OFF | |
106 | depends on DEBUG_BFIN_HWTRACE_ON | |
107 | help | |
108 | The trace buffer can be configured to omit recording of changes in | |
109 | program flow that match either the last entry or one of the last | |
110 | two entries. Omitting one of these entries from the record prevents | |
111 | the trace buffer from overflowing because of any sort of loop (for, do | |
112 | while, etc) in the program. | |
113 | ||
114 | Because zero-overhead Hardware loops are not recorded in the trace buffer, | |
115 | this feature can be used to prevent trace overflow from loops that | |
116 | are nested four deep. | |
117 | ||
118 | config DEBUG_BFIN_HWTRACE_COMPRESSION_OFF | |
119 | bool "Trace all Loops" | |
120 | help | |
121 | The trace buffer records all changes of flow | |
122 | ||
123 | config DEBUG_BFIN_HWTRACE_COMPRESSION_ONE | |
124 | bool "Compress single-level loops" | |
125 | help | |
126 | The trace buffer does not record single loops - helpful if trace | |
127 | is spinning on a while or do loop. | |
128 | ||
129 | config DEBUG_BFIN_HWTRACE_COMPRESSION_TWO | |
130 | bool "Compress two-level loops" | |
131 | help | |
132 | The trace buffer does not record loops two levels deep. Helpful if | |
133 | the trace is spinning in a nested loop | |
134 | ||
135 | endchoice | |
136 | ||
137 | config DEBUG_BFIN_HWTRACE_COMPRESSION | |
138 | int | |
139 | depends on DEBUG_BFIN_HWTRACE_ON | |
140 | default 0 if DEBUG_BFIN_HWTRACE_COMPRESSION_OFF | |
141 | default 1 if DEBUG_BFIN_HWTRACE_COMPRESSION_ONE | |
142 | default 2 if DEBUG_BFIN_HWTRACE_COMPRESSION_TWO | |
143 | ||
144 | ||
145 | config DEBUG_BFIN_HWTRACE_EXPAND | |
146 | bool "Expand Trace Buffer greater than 16 entries" | |
147 | depends on DEBUG_BFIN_HWTRACE_ON | |
148 | default n | |
149 | help | |
150 | By selecting this option, every time the 16 hardware entries in | |
151 | the Blackfin's HW Trace buffer are full, the kernel will move them | |
152 | into a software buffer, for dumping when there is an issue. This | |
153 | has a great impact on performance, (an interrupt every 16 change of | |
154 | flows) and should normally be turned off, except in those nasty | |
155 | debugging sessions | |
156 | ||
157 | config DEBUG_BFIN_HWTRACE_EXPAND_LEN | |
158 | int "Size of Trace buffer (in power of 2k)" | |
159 | range 0 4 | |
160 | depends on DEBUG_BFIN_HWTRACE_EXPAND | |
161 | default 1 | |
162 | help | |
163 | This sets the size of the software buffer that the trace information | |
164 | is kept in. | |
165 | 0 for (2^0) 1k, or 256 entries, | |
166 | 1 for (2^1) 2k, or 512 entries, | |
167 | 2 for (2^2) 4k, or 1024 entries, | |
168 | 3 for (2^3) 8k, or 2048 entries, | |
169 | 4 for (2^4) 16k, or 4096 entries | |
170 | ||
171 | config DEBUG_BFIN_NO_KERN_HWTRACE | |
172 | bool "Trace user apps (turn off hwtrace in kernel)" | |
173 | depends on DEBUG_BFIN_HWTRACE_ON | |
174 | default n | |
175 | help | |
176 | Some pieces of the kernel contain a lot of flow changes which can | |
177 | quickly fill up the hardware trace buffer. When debugging crashes, | |
178 | the hardware trace may indicate that the problem lies in kernel | |
179 | space when in reality an application is buggy. | |
180 | ||
181 | Say Y here to disable hardware tracing in some known "jumpy" pieces | |
182 | of code so that the trace buffer will extend further back. | |
183 | ||
184 | config EARLY_PRINTK | |
185 | bool "Early printk" | |
186 | default n | |
187 | help | |
188 | This option enables special console drivers which allow the kernel | |
189 | to print messages very early in the bootup process. | |
190 | ||
191 | This is useful for kernel debugging when your machine crashes very | |
192 | early before the console code is initialized. After enabling this | |
193 | feature, you must add "earlyprintk=serial,uart0,57600" to the | |
194 | command line (bootargs). It is safe to say Y here in all cases, as | |
195 | all of this lives in the init section and is thrown away after the | |
196 | kernel boots completely. | |
197 | ||
74ce8322 MF |
198 | config CPLB_INFO |
199 | bool "Display the CPLB information" | |
200 | help | |
cf93425d | 201 | Display the CPLB information via /proc/cplbinfo. |
74ce8322 MF |
202 | |
203 | config ACCESS_CHECK | |
204 | bool "Check the user pointer address" | |
205 | default y | |
206 | help | |
207 | Usually the pointer transfer from user space is checked to see if its | |
208 | address is in the kernel space. | |
209 | ||
210 | Say N here to disable that check to improve the performance. | |
211 | ||
212 | endmenu |