wcd-dsp-utils.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __WCD_DSP_UTILS_H__
  6. #define __WCD_DSP_UTILS_H__
  7. #define WDSP_IMG_NAME_LEN_MAX 64
  8. #define WDSP_ELF_FLAG_EXECUTE (1 << 0)
  9. #define WDSP_ELF_FLAG_WRITE (1 << 1)
  10. #define WDSP_ELF_FLAG_READ (1 << 2)
  11. #define WDSP_ELF_FLAG_RE (WDSP_ELF_FLAG_READ | WDSP_ELF_FLAG_EXECUTE)
  12. struct wdsp_img_segment {
  13. /* Firmware for the slit image */
  14. const struct firmware *split_fw;
  15. /* Name of the split firmware file */
  16. char split_fname[WDSP_IMG_NAME_LEN_MAX];
  17. /* Address where the segment is to be loaded */
  18. u32 load_addr;
  19. /* Buffer to hold the data to be loaded */
  20. u8 *data;
  21. /* Size of the data to be loaded */
  22. size_t size;
  23. /* List node pointing to next segment */
  24. struct list_head list;
  25. };
  26. int wdsp_get_segment_list(struct device *dev, const char *img_fname,
  27. unsigned int segment_type, struct list_head *seg_list,
  28. u32 *entry_point);
  29. void wdsp_flush_segment_list(struct list_head *seg_list);
  30. #endif /* __WCD_DSP_UTILS_H__ */