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