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