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 */
25struct  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
31extern struct ia_css_fw_info     sh_css_sp_fw;
32extern struct ia_css_blob_descr *sh_css_blob_info;
33extern unsigned int sh_css_num_binaries;
34
35char
36*sh_css_get_fw_version(void);
37
38struct device;
39bool
40sh_css_check_firmware_version(struct device *dev, const char *fw_data);
41
42int
43sh_css_load_firmware(struct device *dev, const char *fw_data,
44		     unsigned int fw_size);
45
46void sh_css_unload_firmware(void);
47
48ia_css_ptr sh_css_load_blob(const unsigned char *blob, unsigned int size);
49
50int
51sh_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