linux/drivers/staging/media/atomisp/pci/css_receiver_2400_common_defs.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Support for Intel Camera Imaging ISP subsystem.
 * Copyright (c) 2015, Intel Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 */

#ifndef _css_receiver_2400_common_defs_h_
#define _css_receiver_2400_common_defs_h_
#ifndef _mipi_backend_common_defs_h_
#define _mipi_backend_common_defs_h_

#define _HRT_CSS_RECEIVER_2400_GEN_SHORT_DATA_WIDTH
#define _HRT_CSS_RECEIVER_2400_GEN_SHORT_CH_ID_WIDTH
#define _HRT_CSS_RECEIVER_2400_GEN_SHORT_FMT_TYPE_WIDTH
#define _HRT_CSS_RECEIVER_2400_GEN_SHORT_STR_REAL_WIDTH
#define _HRT_CSS_RECEIVER_2400_GEN_SHORT_STR_WIDTH

/* Definition of data format ID at the interface CSS_receiver capture/acquisition units */
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_YUV420_8
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_YUV420_10
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_YUV420_8L
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_YUV422_8
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_YUV422_10
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RGB444
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RGB555
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RGB565
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RGB666
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RGB888
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW6
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW7
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW8
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW10
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW12
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW14
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_USR_DEF_1
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_USR_DEF_2
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_USR_DEF_3
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_USR_DEF_4
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_USR_DEF_5
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_USR_DEF_6
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_USR_DEF_7
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_USR_DEF_8
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_Emb
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_SOF
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_EOF
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_SOL
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_EOL
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_GEN_SH1
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_GEN_SH2
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_GEN_SH3
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_GEN_SH4
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_GEN_SH5
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_GEN_SH6
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_GEN_SH7
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_GEN_SH8
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_YUV420_8_CSPS
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_YUV420_10_CSPS
/* used reserved mipi positions for these */
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW16
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW18
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW18_2
#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW18_3

#define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_WIDTH

/* Definition of format_types at the interface CSS --> input_selector*/
/* !! Changes here should be copied to systems/isp/isp_css/bin/conv_transmitter_cmd.tcl !! */
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RGB888
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RGB555
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RGB444
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RGB565
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RGB666
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW8
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW10
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW6
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW7
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW12
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW14
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_YUV420_8
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_YUV420_10
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_YUV422_8
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_YUV422_10
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_USR_DEF_1
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_YUV420_8L
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_Emb
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_USR_DEF_2
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_USR_DEF_3
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_USR_DEF_4
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_USR_DEF_5
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_USR_DEF_6
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_USR_DEF_7
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_USR_DEF_8
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_YUV420_8_CSPS
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_YUV420_10_CSPS
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW16
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW18
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW18_2
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW18_3
#define _HRT_CSS_RECEIVER_2400_FMT_TYPE_CUSTOM

/* definition for state machine of data FIFO for decode different type of data */
#define _HRT_CSS_RECEIVER_2400_YUV420_8_REPEAT_PTN
#define _HRT_CSS_RECEIVER_2400_YUV420_10_REPEAT_PTN
#define _HRT_CSS_RECEIVER_2400_YUV420_8L_REPEAT_PTN
#define _HRT_CSS_RECEIVER_2400_YUV422_8_REPEAT_PTN
#define _HRT_CSS_RECEIVER_2400_YUV422_10_REPEAT_PTN
#define _HRT_CSS_RECEIVER_2400_RGB444_REPEAT_PTN
#define _HRT_CSS_RECEIVER_2400_RGB555_REPEAT_PTN
#define _HRT_CSS_RECEIVER_2400_RGB565_REPEAT_PTN
#define _HRT_CSS_RECEIVER_2400_RGB666_REPEAT_PTN
#define _HRT_CSS_RECEIVER_2400_RGB888_REPEAT_PTN
#define _HRT_CSS_RECEIVER_2400_RAW6_REPEAT_PTN
#define _HRT_CSS_RECEIVER_2400_RAW7_REPEAT_PTN
#define _HRT_CSS_RECEIVER_2400_RAW8_REPEAT_PTN
#define _HRT_CSS_RECEIVER_2400_RAW10_REPEAT_PTN
#define _HRT_CSS_RECEIVER_2400_RAW12_REPEAT_PTN
#define _HRT_CSS_RECEIVER_2400_RAW14_REPEAT_PTN

#define _HRT_CSS_RECEIVER_2400_MAX_REPEAT_PTN

#define _HRT_CSS_RECEIVER_2400_BE_COMP_FMT_IDX
#define _HRT_CSS_RECEIVER_2400_BE_COMP_FMT_WIDTH
#define _HRT_CSS_RECEIVER_2400_BE_COMP_PRED_IDX
#define _HRT_CSS_RECEIVER_2400_BE_COMP_PRED_WIDTH
#define _HRT_CSS_RECEIVER_2400_BE_COMP_USD_BITS

#define _HRT_CSS_RECEIVER_2400_BE_RAW16_DATAID_IDX
#define _HRT_CSS_RECEIVER_2400_BE_RAW16_EN_IDX
#define _HRT_CSS_RECEIVER_2400_BE_RAW18_DATAID_IDX
#define _HRT_CSS_RECEIVER_2400_BE_RAW18_OPTION_IDX
#define _HRT_CSS_RECEIVER_2400_BE_RAW18_EN_IDX

#define _HRT_CSS_RECEIVER_2400_BE_COMP_NO_COMP
#define _HRT_CSS_RECEIVER_2400_BE_COMP_10_6_10
#define _HRT_CSS_RECEIVER_2400_BE_COMP_10_7_10
#define _HRT_CSS_RECEIVER_2400_BE_COMP_10_8_10
#define _HRT_CSS_RECEIVER_2400_BE_COMP_12_6_12
#define _HRT_CSS_RECEIVER_2400_BE_COMP_12_7_12
#define _HRT_CSS_RECEIVER_2400_BE_COMP_12_8_12

/* packet bit definition */
#define _HRT_CSS_RECEIVER_2400_PKT_SOP_IDX
#define _HRT_CSS_RECEIVER_2400_PKT_SOP_BITS
#define _HRT_CSS_RECEIVER_2400_PKT_CH_ID_IDX
#define _HRT_CSS_RECEIVER_2400_PKT_CH_ID_BITS
#define _HRT_CSS_RECEIVER_2400_PKT_FMT_ID_IDX
#define _HRT_CSS_RECEIVER_2400_PKT_FMT_ID_BITS
#define _HRT_CSS_RECEIVER_2400_PH_DATA_FIELD_IDX
#define _HRT_CSS_RECEIVER_2400_PH_DATA_FIELD_BITS
#define _HRT_CSS_RECEIVER_2400_PKT_PAYLOAD_IDX
#define _HRT_CSS_RECEIVER_2400_PKT_PAYLOAD_BITS

/*************************************************************************************************/
/* Custom Decoding                                                                               */
/* These Custom Defs are defined based on design-time config in "csi_be_pixel_formatter.chdl" !! */
/*************************************************************************************************/
#define BE_CUST_EN_IDX
#define BE_CUST_EN_DATAID_IDX
#define BE_CUST_EN_WIDTH
#define BE_CUST_MODE_ALL
#define BE_CUST_MODE_ONE

/* Data State config = {get_bits(6bits), valid(1bit)}  */
#define BE_CUST_DATA_STATE_S0_IDX
#define BE_CUST_DATA_STATE_S1_IDX
#define BE_CUST_DATA_STATE_S2_IDX
#define BE_CUST_DATA_STATE_WIDTH
#define BE_CUST_DATA_STATE_VALID_IDX
#define BE_CUST_DATA_STATE_GETBITS_IDX

/* Pixel Extractor config */
#define BE_CUST_PIX_EXT_DATA_ALIGN_IDX
#define BE_CUST_PIX_EXT_PIX_ALIGN_IDX
#define BE_CUST_PIX_EXT_PIX_MASK_IDX
#define BE_CUST_PIX_EXT_PIX_EN_IDX
#define BE_CUST_PIX_EXT_WIDTH

/* Pixel Valid & EoP config = {[eop,valid](especial), [eop,valid](normal)} */
#define BE_CUST_PIX_VALID_EOP_P0_IDX
#define BE_CUST_PIX_VALID_EOP_P1_IDX
#define BE_CUST_PIX_VALID_EOP_P2_IDX
#define BE_CUST_PIX_VALID_EOP_P3_IDX
#define BE_CUST_PIX_VALID_EOP_WIDTH
#define BE_CUST_PIX_VALID_EOP_NOR_VALID_IDX
#define BE_CUST_PIX_VALID_EOP_NOR_EOP_IDX
#define BE_CUST_PIX_VALID_EOP_ESP_VALID_IDX
#define BE_CUST_PIX_VALID_EOP_ESP_EOP_IDX

#endif /* _mipi_backend_common_defs_h_ */
#endif /* _css_receiver_2400_common_defs_h_ */