2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2015, Intel Corporation.
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.
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
15 #ifndef __IA_CSS_FIRMWARE_H
16 #define __IA_CSS_FIRMWARE_H
19 * This file contains firmware loading/unloading support functionality
22 #include "ia_css_err.h"
23 #include "ia_css_env.h"
25 /** CSS firmware package structure.
28 void *data; /**< pointer to the firmware data */
29 unsigned int bytes; /**< length in bytes of firmware data */
32 /** @brief Loads the firmware
33 * @param[in] env Environment, provides functions to access the
34 * environment in which the CSS code runs. This is
35 * used for host side memory access and message
37 * @param[in] fw Firmware package containing the firmware for all
38 * predefined ISP binaries.
39 * @return Returns IA_CSS_ERR_INTERNAL_ERROR in case of any
40 * errors and IA_CSS_SUCCESS otherwise.
42 * This function interprets the firmware package. All
43 * contents of this firmware package are copied into local data structures, so
44 * the fw pointer could be freed after this function completes.
46 * Rationale for this function is that it can be called before ia_css_init, and thus
47 * speeds up ia_css_init (ia_css_init is called each time a stream is created but the
48 * firmware only needs to be loaded once).
51 ia_css_load_firmware(const struct ia_css_env *env,
52 const struct ia_css_fw *fw);
54 /** @brief Unloads the firmware
57 * This function unloads the firmware loaded by ia_css_load_firmware.
58 * It is pointless to call this function if no firmware is loaded,
59 * but it won't harm. Use this to deallocate all memory associated with the firmware.
62 ia_css_unload_firmware(void);
64 /** @brief Checks firmware version
65 * @param[in] fw Firmware package containing the firmware for all
66 * predefined ISP binaries.
67 * @return Returns true when the firmware version matches with the CSS
68 * host code version and returns false otherwise.
69 * This function checks if the firmware package version matches with the CSS host code version.
72 ia_css_check_firmware_version(const struct ia_css_fw *fw);
74 #endif /* __IA_CSS_FIRMWARE_H */