qcom_ramdump.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef _QCOM_RAMDUMP_HEADER
  7. #define _QCOM_RAMDUMP_HEADER
  8. #include <linux/kernel.h>
  9. #include <linux/firmware.h>
  10. struct device;
  11. struct qcom_dump_segment {
  12. struct list_head node;
  13. dma_addr_t da;
  14. void *va;
  15. size_t size;
  16. };
  17. #if IS_ENABLED(CONFIG_QCOM_RAMDUMP)
  18. extern void *qcom_create_ramdump_device(const char *dev_name, struct device *parent);
  19. extern void qcom_destroy_ramdump_device(void *dev);
  20. extern int qcom_elf_dump(struct list_head *segs, struct device *dev, unsigned char class);
  21. extern int qcom_dump(struct list_head *head, struct device *dev);
  22. extern int qcom_fw_elf_dump(struct firmware *fw, struct device *dev);
  23. extern bool dump_enabled(void);
  24. #else
  25. static inline void *qcom_create_ramdump_device(const char *dev_name,
  26. struct device *parent)
  27. {
  28. return NULL;
  29. }
  30. static inline void qcom_destroy_ramdump_device(void *dev)
  31. {
  32. }
  33. static inline int qcom_elf_dump(struct list_head *segs, struct device *dev, unsigned char class)
  34. {
  35. return -ENODEV;
  36. }
  37. static inline int qcom_dump(struct list_head *head, struct device *dev)
  38. {
  39. return -ENODEV;
  40. }
  41. static inline int qcom_fw_elf_dump(struct firmware *fw, struct device *dev)
  42. {
  43. return -ENODEV;
  44. }
  45. static inline bool dump_enabled(void)
  46. {
  47. return false;
  48. }
  49. #endif /* CONFIG_QCOM_RAMDUMP */
  50. #endif