ipc4-telemetry.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
  2. /*
  3. * This file is provided under a dual BSD/GPLv2 license. When using or
  4. * redistributing this file, you may do so under either license.
  5. *
  6. * Copyright(c) 2023 Intel Corporation
  7. */
  8. #ifndef __SOUND_SOC_SOF_IPC4_TELEMETRY_H
  9. #define __SOUND_SOC_SOF_IPC4_TELEMETRY_H
  10. /* Target code */
  11. enum sof_ipc4_coredump_tgt_code {
  12. COREDUMP_TGT_UNKNOWN = 0,
  13. COREDUMP_TGT_X86,
  14. COREDUMP_TGT_X86_64,
  15. COREDUMP_TGT_ARM_CORTEX_M,
  16. COREDUMP_TGT_RISC_V,
  17. COREDUMP_TGT_XTENSA,
  18. };
  19. #define COREDUMP_ARCH_HDR_ID 'A'
  20. #define COREDUMP_HDR_ID0 'Z'
  21. #define COREDUMP_HDR_ID1 'E'
  22. #define XTENSA_BLOCK_HDR_VER 2
  23. #define XTENSA_CORE_DUMP_SEPARATOR 0x0DEC0DEB
  24. #define XTENSA_CORE_AR_REGS_COUNT 16
  25. #define XTENSA_SOC_INTEL_ADSP 3
  26. #define XTENSA_TOOL_CHAIN_ZEPHYR 1
  27. #define XTENSA_TOOL_CHAIN_XCC 2
  28. /* Coredump header */
  29. struct sof_ipc4_coredump_hdr {
  30. /* 'Z', 'E' as identifier of file */
  31. char id[2];
  32. /* Identify the version of the header */
  33. u16 hdr_version;
  34. /* Indicate which target (e.g. architecture or SoC) */
  35. u16 tgt_code;
  36. /* Size of uintptr_t in power of 2. (e.g. 5 for 32-bit, 6 for 64-bit) */
  37. u8 ptr_size_bits;
  38. u8 flag;
  39. /* Reason for the fatal error */
  40. u32 reason;
  41. } __packed;
  42. /* Architecture-specific block header */
  43. struct sof_ipc4_coredump_arch_hdr {
  44. /* COREDUMP_ARCH_HDR_ID to indicate this is a architecture-specific block */
  45. char id;
  46. /* Identify the version of this block */
  47. u16 hdr_version;
  48. /* Number of bytes following the header */
  49. u16 num_bytes;
  50. } __packed;
  51. struct sof_ipc4_telemetry_slot_data {
  52. u32 separator;
  53. struct sof_ipc4_coredump_hdr hdr;
  54. struct sof_ipc4_coredump_arch_hdr arch_hdr;
  55. u32 arch_data[];
  56. } __packed;
  57. void sof_ipc4_create_exception_debugfs_node(struct snd_sof_dev *sdev);
  58. #endif