2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2010-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 __INPUT_FORMATTER_LOCAL_H_INCLUDED__
16 #define __INPUT_FORMATTER_LOCAL_H_INCLUDED__
18 #include "input_formatter_global.h"
20 #include "isp.h" /* ISP_VEC_ALIGN */
22 typedef struct input_formatter_switch_state_s input_formatter_switch_state_t;
23 typedef struct input_formatter_state_s input_formatter_state_t;
24 typedef struct input_formatter_bin_state_s input_formatter_bin_state_t;
26 #define HIVE_IF_FSM_SYNC_STATUS 0x100
27 #define HIVE_IF_FSM_SYNC_COUNTER 0x104
28 #define HIVE_IF_FSM_DEINTERLEAVING_IDX 0x114
29 #define HIVE_IF_FSM_DECIMATION_H_COUNTER 0x118
30 #define HIVE_IF_FSM_DECIMATION_V_COUNTER 0x11C
31 #define HIVE_IF_FSM_DECIMATION_BLOCK_V_COUNTER 0x120
32 #define HIVE_IF_FSM_PADDING_STATUS 0x124
33 #define HIVE_IF_FSM_PADDING_ELEMENT_COUNTER 0x128
34 #define HIVE_IF_FSM_VECTOR_SUPPORT_ERROR 0x12C
35 #define HIVE_IF_FSM_VECTOR_SUPPORT_BUFF_FULL 0x130
36 #define HIVE_IF_FSM_VECTOR_SUPPORT 0x134
37 #define HIVE_IF_FIFO_SENSOR_STATUS 0x138
40 * The switch LUT's coding defines a sink for each
41 * single channel ID + channel format type. Conversely
42 * the sink (i.e. an input formatter) can be reached
43 * from multiple channel & format type combinations
45 * LUT[0,1] channel=0, format type {0,1,...31}
46 * LUT[2,3] channel=1, format type {0,1,...31}
47 * LUT[4,5] channel=2, format type {0,1,...31}
48 * LUT[6,7] channel=3, format type {0,1,...31}
50 * Each register hold 16 2-bit fields encoding the sink
51 * {0,1,2,3}, "0" means unconnected.
53 * The single FSYNCH register uses four 3-bit fields of 1-hot
54 * encoded sink information, "0" means unconnected.
56 * The encoding is redundant. The FSYNCH setting will connect
57 * a channel to a sink. At that point the LUT's belonging to
58 * that channel can be directed to another sink. Thus the data
59 * goes to another place than the synch
61 struct input_formatter_switch_state_s {
62 int if_input_switch_lut_reg[8];
63 int if_input_switch_fsync_lut;
64 int if_input_switch_ch_id_fmt_type;
65 bool if_input_switch_map[HIVE_SWITCH_N_CHANNELS][HIVE_SWITCH_N_FORMATTYPES];
68 struct input_formatter_state_s {
76 int ver_deinterleaving;
77 int hor_deinterleaving;
80 int vmem_start_address;
86 int allow_fifo_overflow;
87 int block_fifo_when_no_req;
91 int fsm_crop_line_counter;
92 int fsm_crop_pixel_counter;
93 int fsm_deinterleaving_index;
94 int fsm_dec_h_counter;
95 int fsm_dec_v_counter;
96 int fsm_dec_block_v_counter;
97 int fsm_padding_status;
98 int fsm_padding_elem_counter;
99 int fsm_vector_support_error;
100 int fsm_vector_buffer_full;
102 int sensor_data_lost;
105 struct input_formatter_bin_state_s {
107 uint32_t input_endianness;
108 uint32_t output_endianness;
110 uint32_t block_synch;
111 uint32_t packet_synch;
112 uint32_t readpostwrite_synch;
114 uint32_t en_status_update;
117 static const unsigned int input_formatter_alignment[N_INPUT_FORMATTER_ID] = {
118 ISP_VEC_ALIGN, ISP_VEC_ALIGN, HIVE_ISP_CTRL_DATA_BYTES};
120 #endif /* __INPUT_FORMATTER_LOCAL_H_INCLUDED__ */