Skip to content

Commit 33d4049

Browse files
nklaymanlyakh
authored andcommitted
ASoC: SOF: sof-client: expose Zephyr GDB stub
Adds a DebugFS file to communicate with Zephyr's GDB stub. Communication is via ringbuffers in shared SRAM. Both IPC3 and IPC4 are supported. Signed-off-by: Noah Klayman <noah.klayman@intel.com> Co-developed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent dde614e commit 33d4049

File tree

4 files changed

+521
-0
lines changed

4 files changed

+521
-0
lines changed

sound/soc/sof/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,18 @@ config SND_SOC_SOF_DEBUG_IPC_KERNEL_INJECTOR
258258
Say Y if you want to enable the IPC kernel injector.
259259
If unsure, select "N".
260260

261+
config SND_SOC_SOF_DEBUG_FW_GDB
262+
tristate "SOF enable Firmware GDB debugging"
263+
select SND_SOC_SOF_CLIENT
264+
help
265+
This enables GDB debugging of the SOF firmware. If selected, this
266+
will make the kernel create a debugfs file, that can be used to
267+
communicate with the firmware GDB stub. When the file is opened, the
268+
kernel sends a command to the firmware to switch to the GDB mode and
269+
to wait for GDB commands. socat can be used to connect that file to a
270+
socket, to which GDB can then connect.
271+
If unsure, select "N".
272+
261273
config SND_SOC_SOF_DEBUG_RETAIN_DSP_CONTEXT
262274
bool "SOF retain DSP context on any FW exceptions"
263275
help

sound/soc/sof/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ endif
3535
ifneq ($(CONFIG_SND_SOC_SOF_IPC4),)
3636
snd-sof-probes-y += sof-client-probes-ipc4.o
3737
endif
38+
snd-sof-fw-gdb-objs := sof-client-fw-gdb.o
3839

3940
snd-sof-nocodec-y := nocodec.o
4041

@@ -53,6 +54,7 @@ obj-$(CONFIG_SND_SOC_SOF_DEBUG_IPC_FLOOD_TEST) += snd-sof-ipc-flood-test.o
5354
obj-$(CONFIG_SND_SOC_SOF_DEBUG_IPC_MSG_INJECTOR) += snd-sof-ipc-msg-injector.o
5455
obj-$(CONFIG_SND_SOC_SOF_DEBUG_IPC_KERNEL_INJECTOR) += snd-sof-ipc-kernel-injector.o
5556
obj-$(CONFIG_SND_SOC_SOF_DEBUG_PROBES) += snd-sof-probes.o
57+
obj-$(CONFIG_SND_SOC_SOF_DEBUG_FW_GDB) += snd-sof-fw-gdb.o
5658

5759
obj-$(CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL) += intel/
5860
obj-$(CONFIG_SND_SOC_SOF_IMX_TOPLEVEL) += imx/

0 commit comments

Comments
 (0)