1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2015, Intel Corporation.
5  */
6 
7 #ifndef _SH_CSS_FIRMWARE_H_
8 #define _SH_CSS_FIRMWARE_H_
9 
10 #include <system_local.h>
11 
12 #include <ia_css_err.h>
13 #include <ia_css_acc_types.h>
14 
15 /* This is for the firmware loaded from user space */
16 struct  sh_css_fw_bi_file_h {
17 	char version[64];		/* branch tag + week day + time */
18 	int binary_nr;			/* Number of binaries */
19 	unsigned int h_size;		/* sizeof(struct sh_css_fw_bi_file_h) */
20 };
21 
22 extern struct ia_css_fw_info     sh_css_sp_fw;
23 extern struct ia_css_blob_descr *sh_css_blob_info;
24 extern unsigned int sh_css_num_binaries;
25 
26 char
27 *sh_css_get_fw_version(void);
28 
29 struct device;
30 bool
31 sh_css_check_firmware_version(struct device *dev, const char *fw_data);
32 
33 int
34 sh_css_load_firmware(struct device *dev, const char *fw_data,
35 		     unsigned int fw_size);
36 
37 void sh_css_unload_firmware(void);
38 
39 ia_css_ptr sh_css_load_blob(const unsigned char *blob, unsigned int size);
40 
41 int
42 sh_css_load_blob_info(const char *fw, const struct ia_css_fw_info *bi,
43 		      struct ia_css_blob_descr *bd, unsigned int i);
44 
45 #endif /* _SH_CSS_FIRMWARE_H_ */
46