/* * iav_fastboot.h * * History: * 2016/03/10 - [Xu Liang] Created file * * Copyright (c) 2016 Ambarella, Inc. * * This file and its contents ("Software") are protected by intellectual * property rights including, without limitation, U.S. and/or foreign * copyrights. This Software is also the confidential and proprietary * information of Ambarella, Inc. and its licensors. You may not use, reproduce, * disclose, distribute, modify, or otherwise prepare derivative works of this * Software or any portion thereof except pursuant to a signed license agreement * or nondisclosure agreement with Ambarella, Inc. or its authorized affiliates. * In the absence of such an agreement, you agree to promptly notify and return * this Software to Ambarella, Inc. * * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, * MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL AMBARELLA, INC. OR ITS AFFILIATES BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; COMPUTER FAILURE OR MALFUNCTION; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ #ifndef __IAV_FASTBOOT_H__ #define __IAV_FASTBOOT_H__ #ifdef __cplusplus extern "C" { #endif enum preload_file_id { PF_ISO_CFG = 0, PF_TONE_CURVE = 1, PF_RGB2YUV_MAT = 2, PF_LOCAL_EXPO = 3, PF_MAX_NUM, PF_FIRST = PF_ISO_CFG, PF_LAST = PF_MAX_NUM, }; #define MAX_FILE_NAME (64) #define PRELOAD_ISO_CONFIG "/tmp/idsp_iso_cfg.bin" #define PRELOAD_TONE_CURVE "/tmp/idsp_tone_curve" #define PRELOAD_RGB2YUV_MAT "/tmp/idsp_rgb2yuv" #define PRELOAD_LOCAL_EXPO "/tmp/idsp_local_expo" #define PRELOAD_AWB_FILE "/tmp/idsp_awb" #define PRELOAD_AE_FILE "/tmp/idsp_ae" enum iav_fb_bin_id { IAV_FB_VIN_VIDEO_FORMAT = 0, IAV_FB_VIN_DSP_CONFIG = 1, IAV_FB_ENC_CONFIG = 2, IAV_FB_SRCBUF_CONFIG = 3, IAV_FB_VOUT0_SETUP = 4, IAV_FB_VOUT1_SETUP = 5, IAV_FB_DATA_MAX_NUM, IAV_FB_DATA_FIRST = IAV_FB_VIN_VIDEO_FORMAT, IAV_FB_DATA_LAST = IAV_FB_DATA_MAX_NUM, }; struct iav_fb_aeb { /* AWB */ unsigned int r_gain; unsigned int b_gain; /* AE */ unsigned int d_gain; unsigned int shutter_row; unsigned int agc_index; }; struct iav_fb_node { unsigned int offset; unsigned int size; }; enum iav_fb_vout_dram_id { IAV_FB_VOUT_HEADER = 0, IAV_FB_VOUT_DISPLAY = 1, IAV_FB_VOUT_DVE = 2, IAV_FB_VOUT_OSD_CLUT = 3, IAV_FB_VOUT_OSD_BUF_INFO = 4, IAV_FB_VOUT_OSD_BUF_DRAM = 5, IAV_FB_VOUT_TIMING = 6, IAV_FB_VOUT_DATA_MAX_NUM, IAV_FB_VOUT_DATA_FIRST = IAV_FB_VOUT_HEADER, IAV_FB_VOUT_DATA_LAST = IAV_FB_VOUT_DATA_MAX_NUM, }; struct amba_fb_vout_config_data { unsigned int vout_id : 2; unsigned int enabled : 1; unsigned int reserved : 29; struct iav_fb_node vout_mem[IAV_FB_VOUT_DATA_MAX_NUM]; }; struct amba_fb_bpi_info { u32 work_mode : 4; u32 rtos_vca_enable : 1; u32 rtos_vca_classes : 3; u32 rtos_vca_result : 4; u32 reserved0 : 4; u32 record_sec : 8; u32 linux_vca_eable : 1; u32 reserved1 : 7; }; #define FB_MAX_CHAN_NUM 2 #define FB_MAX_VIN_NUM 2 #define FB_HEADER_SIZE 256 struct iav_fb_hdr { /* 4 + 8 + 8 + 8 * 2 + 4 + 20 * 2 + 8 * 6 + 128 = 256 */ unsigned int dsp_status; unsigned int header_size : 16; unsigned int fast_thaw : 1; unsigned int night_mode : 1; unsigned int prev_id : 4; unsigned int reserved : 2; unsigned int active_vin_num : 4; unsigned int rtos_log_level : 4; unsigned int light_value; unsigned int bin_offset; struct amba_fb_bpi_info info; unsigned int vinc_chan_map[FB_MAX_VIN_NUM]; unsigned int sensor_ctrl_map[FB_MAX_VIN_NUM]; unsigned char shutter_max[FB_MAX_CHAN_NUM]; /* unit: denominator seconds */ unsigned char agc_max[FB_MAX_CHAN_NUM]; /* unit: db */ struct iav_fb_aeb pre_aeb[FB_MAX_CHAN_NUM]; struct iav_fb_node bin[IAV_FB_DATA_MAX_NUM]; unsigned char reserve1[128]; }__attribute__((packed)); #ifdef __cplusplus } #endif #endif