1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2015, Intel Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  */
15 
16 #ifndef _SH_CSS_FIRMWARE_H_
17 #define _SH_CSS_FIRMWARE_H_
18 
19 #include <system_local.h>
20 
21 #include <ia_css_err.h>
22 #include <ia_css_acc_types.h>
23 
24 /* This is for the firmware loaded from user space */
25 struct  sh_css_fw_bi_file_h {
26 	char version[64];		/* branch tag + week day + time */
27 	int binary_nr;			/* Number of binaries */
28 	unsigned int h_size;		/* sizeof(struct sh_css_fw_bi_file_h) */
29 };
30 
31 extern struct ia_css_fw_info     sh_css_sp_fw;
32 extern struct ia_css_blob_descr *sh_css_blob_info;
33 extern unsigned int sh_css_num_binaries;
34 
35 char
36 *sh_css_get_fw_version(void);
37 
38 struct device;
39 bool
40 sh_css_check_firmware_version(struct device *dev, const char *fw_data);
41 
42 int
43 sh_css_load_firmware(struct device *dev, const char *fw_data,
44 		     unsigned int fw_size);
45 
46 void sh_css_unload_firmware(void);
47 
48 ia_css_ptr sh_css_load_blob(const unsigned char *blob, unsigned int size);
49 
50 int
51 sh_css_load_blob_info(const char *fw, const struct ia_css_fw_info *bi,
52 		      struct ia_css_blob_descr *bd, unsigned int i);
53 
54 #endif /* _SH_CSS_FIRMWARE_H_ */
55