1# Copyright (c) 2020 Intel Corporation.
2# SPDX-License-Identifier: Apache-2.0
3
4menuconfig DEBUG_COREDUMP
5	bool "Core Dump"
6	depends on ARCH_SUPPORTS_COREDUMP
7	help
8	  Enable core dump so it can be used for offline debugging.
9
10if DEBUG_COREDUMP
11
12choice
13	prompt "Coredump backend"
14	default DEBUG_COREDUMP_BACKEND_LOGGING if LOG
15
16config DEBUG_COREDUMP_BACKEND_LOGGING
17	bool "Use Logging subsystem for coredump"
18	depends on LOG
19	help
20	  Core dump is done via logging subsystem.
21
22config DEBUG_COREDUMP_BACKEND_FLASH_PARTITION
23	bool "Use flash partition for coredump"
24	depends on FLASH
25	select FLASH_MAP
26	select STREAM_FLASH
27	help
28	  Core dump is saved to a flash partition with DTS alias
29	  "coredump-partition".
30
31config DEBUG_COREDUMP_BACKEND_INTEL_ADSP_MEM_WINDOW
32	bool "Use memory window for coredump on Intel ADSP"
33	help
34	  Core dump is done via memory window slot[1].
35	  It is Intel ADSP memory region shared with xtensa DSP.
36	  Window 2 slot [1] is reserved for debuging information.
37
38config DEBUG_COREDUMP_BACKEND_OTHER
39	bool "Backend subsystem for coredump defined out of tree"
40	help
41	  Core dump is done via custom mechanism defined out of tree
42
43endchoice
44
45choice
46	prompt "Memory dump"
47	default DEBUG_COREDUMP_MEMORY_DUMP_LINKER_RAM
48
49config DEBUG_COREDUMP_MEMORY_DUMP_MIN
50	bool "Minimal"
51	select THREAD_STACK_INFO
52	help
53	  Only dumps the bare minimum memory content.
54	  For example, the thread struct and stack of
55	  the exception thread will be dumped.
56
57	  Don't use this unless you want absolutely
58	  minimum core dump.
59
60config DEBUG_COREDUMP_MEMORY_DUMP_LINKER_RAM
61	bool "RAM defined by linker section"
62	help
63	  Dumps the memory region between _image_ram_start[]
64	  and _image_ram_end[]. This includes at least data,
65	  noinit, and BSS sections.
66
67	  This is the default.
68
69endchoice
70
71config DEBUG_COREDUMP_SHELL
72	bool "Coredump shell"
73	default y
74	depends on SHELL
75	help
76	  This shell provides access to coredump and its backends.
77
78endif # DEBUG_COREDUMP
79