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 _css_receiver_2400_common_defs_h_ 17 #define _css_receiver_2400_common_defs_h_ 18 #ifndef _mipi_backend_common_defs_h_ 19 #define _mipi_backend_common_defs_h_ 20 21 #define _HRT_CSS_RECEIVER_2400_GEN_SHORT_DATA_WIDTH 16 22 #define _HRT_CSS_RECEIVER_2400_GEN_SHORT_CH_ID_WIDTH 2 23 #define _HRT_CSS_RECEIVER_2400_GEN_SHORT_FMT_TYPE_WIDTH 3 24 #define _HRT_CSS_RECEIVER_2400_GEN_SHORT_STR_REAL_WIDTH (_HRT_CSS_RECEIVER_2400_GEN_SHORT_DATA_WIDTH + _HRT_CSS_RECEIVER_2400_GEN_SHORT_CH_ID_WIDTH + _HRT_CSS_RECEIVER_2400_GEN_SHORT_FMT_TYPE_WIDTH) 25 #define _HRT_CSS_RECEIVER_2400_GEN_SHORT_STR_WIDTH 32 /* use 32 to be compatibel with streaming monitor !, MSB's of interface are tied to '0' */ 26 27 /* Definition of data format ID at the interface CSS_receiver capture/acquisition units */ 28 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_YUV420_8 24 /* 01 1000 YUV420 8-bit */ 29 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_YUV420_10 25 /* 01 1001 YUV420 10-bit */ 30 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_YUV420_8L 26 /* 01 1010 YUV420 8-bit legacy */ 31 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_YUV422_8 30 /* 01 1110 YUV422 8-bit */ 32 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_YUV422_10 31 /* 01 1111 YUV422 10-bit */ 33 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RGB444 32 /* 10 0000 RGB444 */ 34 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RGB555 33 /* 10 0001 RGB555 */ 35 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RGB565 34 /* 10 0010 RGB565 */ 36 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RGB666 35 /* 10 0011 RGB666 */ 37 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RGB888 36 /* 10 0100 RGB888 */ 38 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW6 40 /* 10 1000 RAW6 */ 39 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW7 41 /* 10 1001 RAW7 */ 40 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW8 42 /* 10 1010 RAW8 */ 41 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW10 43 /* 10 1011 RAW10 */ 42 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW12 44 /* 10 1100 RAW12 */ 43 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW14 45 /* 10 1101 RAW14 */ 44 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_USR_DEF_1 48 /* 11 0000 JPEG [User Defined 8-bit Data Type 1] */ 45 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_USR_DEF_2 49 /* 11 0001 User Defined 8-bit Data Type 2 */ 46 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_USR_DEF_3 50 /* 11 0010 User Defined 8-bit Data Type 3 */ 47 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_USR_DEF_4 51 /* 11 0011 User Defined 8-bit Data Type 4 */ 48 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_USR_DEF_5 52 /* 11 0100 User Defined 8-bit Data Type 5 */ 49 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_USR_DEF_6 53 /* 11 0101 User Defined 8-bit Data Type 6 */ 50 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_USR_DEF_7 54 /* 11 0110 User Defined 8-bit Data Type 7 */ 51 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_USR_DEF_8 55 /* 11 0111 User Defined 8-bit Data Type 8 */ 52 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_Emb 18 /* 01 0010 embedded eight bit non image data */ 53 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_SOF 0 /* 00 0000 frame start */ 54 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_EOF 1 /* 00 0001 frame end */ 55 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_SOL 2 /* 00 0010 line start */ 56 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_EOL 3 /* 00 0011 line end */ 57 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_GEN_SH1 8 /* 00 1000 Generic Short Packet Code 1 */ 58 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_GEN_SH2 9 /* 00 1001 Generic Short Packet Code 2 */ 59 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_GEN_SH3 10 /* 00 1010 Generic Short Packet Code 3 */ 60 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_GEN_SH4 11 /* 00 1011 Generic Short Packet Code 4 */ 61 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_GEN_SH5 12 /* 00 1100 Generic Short Packet Code 5 */ 62 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_GEN_SH6 13 /* 00 1101 Generic Short Packet Code 6 */ 63 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_GEN_SH7 14 /* 00 1110 Generic Short Packet Code 7 */ 64 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_GEN_SH8 15 /* 00 1111 Generic Short Packet Code 8 */ 65 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_YUV420_8_CSPS 28 /* 01 1100 YUV420 8-bit (Chroma Shifted Pixel Sampling) */ 66 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_YUV420_10_CSPS 29 /* 01 1101 YUV420 10-bit (Chroma Shifted Pixel Sampling) */ 67 /* used reserved mipi positions for these */ 68 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW16 46 69 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW18 47 70 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW18_2 37 71 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_RAW18_3 38 72 73 //_HRT_CSS_RECEIVER_2400_FMT_TYPE_CUSTOM 63 74 #define _HRT_MIPI_BACKEND_FMT_TYPE_CUSTOM 63 75 76 #define _HRT_CSS_RECEIVER_2400_DATA_FORMAT_ID_WIDTH 6 77 78 /* Definition of format_types at the interface CSS --> input_selector*/ 79 /* !! Changes here should be copied to systems/isp/isp_css/bin/conv_transmitter_cmd.tcl !! */ 80 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RGB888 0 // 36 'h24 81 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RGB555 1 // 33 'h 82 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RGB444 2 // 32 83 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RGB565 3 // 34 84 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RGB666 4 // 35 85 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW8 5 // 42 86 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW10 6 // 43 87 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW6 7 // 40 88 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW7 8 // 41 89 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW12 9 // 43 90 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW14 10 // 45 91 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_YUV420_8 11 // 30 92 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_YUV420_10 12 // 25 93 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_YUV422_8 13 // 30 94 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_YUV422_10 14 // 31 95 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_USR_DEF_1 15 // 48 96 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_YUV420_8L 16 // 26 97 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_Emb 17 // 18 98 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_USR_DEF_2 18 // 49 99 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_USR_DEF_3 19 // 50 100 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_USR_DEF_4 20 // 51 101 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_USR_DEF_5 21 // 52 102 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_USR_DEF_6 22 // 53 103 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_USR_DEF_7 23 // 54 104 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_USR_DEF_8 24 // 55 105 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_YUV420_8_CSPS 25 // 28 106 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_YUV420_10_CSPS 26 // 29 107 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW16 27 // ? 108 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW18 28 // ? 109 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW18_2 29 // ? Option 2 for depacketiser 110 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_RAW18_3 30 // ? Option 3 for depacketiser 111 #define _HRT_CSS_RECEIVER_2400_FMT_TYPE_CUSTOM 31 // to signal custom decoding 112 113 /* definition for state machine of data FIFO for decode different type of data */ 114 #define _HRT_CSS_RECEIVER_2400_YUV420_8_REPEAT_PTN 1 115 #define _HRT_CSS_RECEIVER_2400_YUV420_10_REPEAT_PTN 5 116 #define _HRT_CSS_RECEIVER_2400_YUV420_8L_REPEAT_PTN 1 117 #define _HRT_CSS_RECEIVER_2400_YUV422_8_REPEAT_PTN 1 118 #define _HRT_CSS_RECEIVER_2400_YUV422_10_REPEAT_PTN 5 119 #define _HRT_CSS_RECEIVER_2400_RGB444_REPEAT_PTN 2 120 #define _HRT_CSS_RECEIVER_2400_RGB555_REPEAT_PTN 2 121 #define _HRT_CSS_RECEIVER_2400_RGB565_REPEAT_PTN 2 122 #define _HRT_CSS_RECEIVER_2400_RGB666_REPEAT_PTN 9 123 #define _HRT_CSS_RECEIVER_2400_RGB888_REPEAT_PTN 3 124 #define _HRT_CSS_RECEIVER_2400_RAW6_REPEAT_PTN 3 125 #define _HRT_CSS_RECEIVER_2400_RAW7_REPEAT_PTN 7 126 #define _HRT_CSS_RECEIVER_2400_RAW8_REPEAT_PTN 1 127 #define _HRT_CSS_RECEIVER_2400_RAW10_REPEAT_PTN 5 128 #define _HRT_CSS_RECEIVER_2400_RAW12_REPEAT_PTN 3 129 #define _HRT_CSS_RECEIVER_2400_RAW14_REPEAT_PTN 7 130 131 #define _HRT_CSS_RECEIVER_2400_MAX_REPEAT_PTN _HRT_CSS_RECEIVER_2400_RGB666_REPEAT_PTN 132 133 #define _HRT_CSS_RECEIVER_2400_BE_COMP_FMT_IDX 0 134 #define _HRT_CSS_RECEIVER_2400_BE_COMP_FMT_WIDTH 3 135 #define _HRT_CSS_RECEIVER_2400_BE_COMP_PRED_IDX 3 136 #define _HRT_CSS_RECEIVER_2400_BE_COMP_PRED_WIDTH 1 137 #define _HRT_CSS_RECEIVER_2400_BE_COMP_USD_BITS 4 /* bits per USD type */ 138 139 #define _HRT_CSS_RECEIVER_2400_BE_RAW16_DATAID_IDX 0 140 #define _HRT_CSS_RECEIVER_2400_BE_RAW16_EN_IDX 6 141 #define _HRT_CSS_RECEIVER_2400_BE_RAW18_DATAID_IDX 0 142 #define _HRT_CSS_RECEIVER_2400_BE_RAW18_OPTION_IDX 6 143 #define _HRT_CSS_RECEIVER_2400_BE_RAW18_EN_IDX 8 144 145 #define _HRT_CSS_RECEIVER_2400_BE_COMP_NO_COMP 0 146 #define _HRT_CSS_RECEIVER_2400_BE_COMP_10_6_10 1 147 #define _HRT_CSS_RECEIVER_2400_BE_COMP_10_7_10 2 148 #define _HRT_CSS_RECEIVER_2400_BE_COMP_10_8_10 3 149 #define _HRT_CSS_RECEIVER_2400_BE_COMP_12_6_12 4 150 #define _HRT_CSS_RECEIVER_2400_BE_COMP_12_7_12 5 151 #define _HRT_CSS_RECEIVER_2400_BE_COMP_12_8_12 6 152 153 /* packet bit definition */ 154 #define _HRT_CSS_RECEIVER_2400_PKT_SOP_IDX 32 155 #define _HRT_CSS_RECEIVER_2400_PKT_SOP_BITS 1 156 #define _HRT_CSS_RECEIVER_2400_PKT_CH_ID_IDX 22 157 #define _HRT_CSS_RECEIVER_2400_PKT_CH_ID_BITS 2 158 #define _HRT_CSS_RECEIVER_2400_PKT_FMT_ID_IDX 16 159 #define _HRT_CSS_RECEIVER_2400_PKT_FMT_ID_BITS 6 160 #define _HRT_CSS_RECEIVER_2400_PH_DATA_FIELD_IDX 0 161 #define _HRT_CSS_RECEIVER_2400_PH_DATA_FIELD_BITS 16 162 #define _HRT_CSS_RECEIVER_2400_PKT_PAYLOAD_IDX 0 163 #define _HRT_CSS_RECEIVER_2400_PKT_PAYLOAD_BITS 32 164 165 /*************************************************************************************************/ 166 /* Custom Decoding */ 167 /* These Custom Defs are defined based on design-time config in "mipi_backend_pixel_formatter.chdl" !! */ 168 /*************************************************************************************************/ 169 /* 170 #define BE_CUST_EN_IDX 0 // 2bits 171 #define BE_CUST_EN_DATAID_IDX 2 // 6bits MIPI DATA ID 172 #define BE_CUST_EN_WIDTH 8 173 #define BE_CUST_MODE_ALL 1 // Enable Custom Decoding for all DATA IDs 174 #define BE_CUST_MODE_ONE 3 // Enable Custom Decoding for ONE DATA ID, programmed in CUST_EN_DATA_ID 175 176 // Data State config = {get_bits(6bits), valid(1bit)} // 177 #define BE_CUST_DATA_STATE_S0_IDX 0 // 7bits 178 #define BE_CUST_DATA_STATE_S1_IDX 8 //7 // 7bits 179 #define BE_CUST_DATA_STATE_S2_IDX 16//14 // 7bits / 180 #define BE_CUST_DATA_STATE_WIDTH 24//21 181 #define BE_CUST_DATA_STATE_VALID_IDX 0 // 1bits 182 #define BE_CUST_DATA_STATE_GETBITS_IDX 1 // 6bits 183 184 // Pixel Extractor config 185 #define BE_CUST_PIX_EXT_DATA_ALIGN_IDX 0 // 6bits 186 #define BE_CUST_PIX_EXT_PIX_ALIGN_IDX 6//5 // 5bits 187 #define BE_CUST_PIX_EXT_PIX_MASK_IDX 11//10 // 18bits 188 #define BE_CUST_PIX_EXT_PIX_EN_IDX 29 //28 // 1bits 189 190 #define BE_CUST_PIX_EXT_WIDTH 30//29 191 192 // Pixel Valid & EoP config = {[eop,valid](especial), [eop,valid](normal)} 193 #define BE_CUST_PIX_VALID_EOP_P0_IDX 0 // 4bits 194 #define BE_CUST_PIX_VALID_EOP_P1_IDX 4 // 4bits 195 #define BE_CUST_PIX_VALID_EOP_P2_IDX 8 // 4bits 196 #define BE_CUST_PIX_VALID_EOP_P3_IDX 12 // 4bits 197 #define BE_CUST_PIX_VALID_EOP_WIDTH 16 198 #define BE_CUST_PIX_VALID_EOP_NOR_VALID_IDX 0 // Normal (NO less get_bits case) Valid - 1bits 199 #define BE_CUST_PIX_VALID_EOP_NOR_EOP_IDX 1 // Normal (NO less get_bits case) EoP - 1bits 200 #define BE_CUST_PIX_VALID_EOP_ESP_VALID_IDX 2 // Especial (less get_bits case) Valid - 1bits 201 #define BE_CUST_PIX_VALID_EOP_ESP_EOP_IDX 3 // Especial (less get_bits case) EoP - 1bits 202 203 */ 204 205 #endif /* _mipi_backend_common_defs_h_ */ 206 #endif /* _css_receiver_2400_common_defs_h_ */ 207