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