wcd-dsp-utils.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 and
  6. * only version 2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef __WCD_DSP_UTILS_H__
  14. #define __WCD_DSP_UTILS_H__
  15. #define WDSP_IMG_NAME_LEN_MAX 64
  16. #define WDSP_ELF_FLAG_EXECUTE (1 << 0)
  17. #define WDSP_ELF_FLAG_WRITE (1 << 1)
  18. #define WDSP_ELF_FLAG_READ (1 << 2)
  19. #define WDSP_ELF_FLAG_RE (WDSP_ELF_FLAG_READ | WDSP_ELF_FLAG_EXECUTE)
  20. struct wdsp_img_segment {
  21. /* Firmware for the slit image */
  22. const struct firmware *split_fw;
  23. /* Name of the split firmware file */
  24. char split_fname[WDSP_IMG_NAME_LEN_MAX];
  25. /* Address where the segment is to be loaded */
  26. u32 load_addr;
  27. /* Buffer to hold the data to be loaded */
  28. u8 *data;
  29. /* Size of the data to be loaded */
  30. size_t size;
  31. /* List node pointing to next segment */
  32. struct list_head list;
  33. };
  34. int wdsp_get_segment_list(struct device *dev, const char *img_fname,
  35. unsigned int segment_type, struct list_head *seg_list,
  36. u32 *entry_point);
  37. void wdsp_flush_segment_list(struct list_head *seg_list);
  38. #endif /* __WCD_DSP_UTILS_H__ */