Professional Documents
Culture Documents
Mipi CSI 2 Specification v4 0 1
Mipi CSI 2 Specification v4 0 1
Version 4.0.1
23 May 2022
This document is a MIPI Specification. MIPI member companies’ rights and obligations apply to this MIPI
Specification as defined in the MIPI Membership Agreement and MIPI Bylaws.
Further technical changes to this document are expected as work continues in the Camera Working
Group.
NOTICE OF DISCLAIMER
The material contained herein is provided on an “AS IS” basis. To the maximum extent permitted by
applicable law, this material is provided AS IS AND WITH ALL FAULTS, and the authors and developers
of this material and MIPI Alliance Inc. (“MIPI”) hereby disclaim all other warranties and conditions, either
express, implied or statutory, including, but not limited to, any (if any) implied warranties, duties or
conditions of merchantability, of fitness for a particular purpose, of accuracy or completeness of responses,
of results, of workmanlike effort, of lack of viruses, and of lack of negligence. ALSO, THERE IS NO
WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION,
CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT WITH REGARD TO THIS
MATERIAL.
IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR MIPI BE LIABLE TO
ANY OTHER PARTY FOR THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST
PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT,
INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY, OR
OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO
THIS MATERIAL, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF THE
POSSIBILITY OF SUCH DAMAGES.
The material contained herein is not a license, either expressly or impliedly, to any IPR owned or controlled
by any of the authors or developers of this material or MIPI. Any license to use this material is granted
separately from this document. This material is protected by copyright laws, and may not be reproduced,
republished, distributed, transmitted, displayed, broadcast or otherwise exploited in any manner without the
express prior written permission of MIPI Alliance. MIPI, MIPI Alliance and the dotted rainbow arch and all
related trademarks, service marks, tradenames, and other intellectual property are the exclusive property of
MIPI Alliance Inc. and cannot be used without its express prior written permission. The use or
implementation of this material may involve or require the use of intellectual property rights (“IPR”)
including (but not limited to) patents, patent applications, or copyrights owned by one or more parties,
whether or not members of MIPI. MIPI does not make any search or investigation for IPR, nor does MIPI
require or request the disclosure of any IPR or claims of IPR as respects the contents of this material or
otherwise.
Without limiting the generality of the disclaimers stated above, users of this material are further notified that
MIPI: (a) does not evaluate, test or verify the accuracy, soundness or credibility of the contents of this
material; (b) does not monitor or enforce compliance with the contents of this material; and (c) does not
certify, test, or in any manner investigate products or services or any claims of compliance with MIPI
specifications or related material.
Questions pertaining to this material, or the terms or conditions of its provision, should be addressed to:
MIPI Alliance, Inc.
c/o IEEE-ISTO
445 Hoes Lane, Piscataway New Jersey 08854, United States
Attn: Managing Director
Contents
Figures .......................................................................................................................... ix
Tables ...................................................................................................................... xviii
Release History ............................................................................................................... xxi
1 Introduction .................................................................................................................1
1.1 Scope ............................................................................................................................... 1
1.2 Purpose ............................................................................................................................ 1
2 Terminology .................................................................................................................2
2.1 Use of Special Terms ....................................................................................................... 2
2.2 Definitions ....................................................................................................................... 2
2.3 Abbreviations................................................................................................................... 4
2.4 Acronyms......................................................................................................................... 5
3 References ....................................................................................................................7
4 Overview of CSI-2 .......................................................................................................9
5 CSI-2 Layer Definitions ............................................................................................ 11
6 Camera Control Interface (CCI) .............................................................................13
6.1 CCI (I2C) Data Transfer Protocol .................................................................................. 14
6.1.1 CCI (I2C) Message Type ............................................................................................. 14
6.1.2 CCI (I2C) Read/Write Operations ............................................................................... 15
6.2 CCI (I3C) Data Transfer Protocol.................................................................................. 21
6.2.1 CCI (I3C SDR) Data Transfer Protocol ...................................................................... 21
6.2.2 CCI (I3C DDR) Data Transfer Protocol ..................................................................... 29
6.3 CCI (I3C) Error Detection and Recovery ...................................................................... 39
6.3.1 CCI (I3C SDR) Error Detection and Recovery Method ............................................. 39
6.3.2 CCI (I3C DDR) Error Detection and Recovery Method ............................................ 41
6.3.3 Error Detection and Recovery for CCI (I3C) Controller Devices .............................. 47
6.4 CCI (I2C) Target Addresses............................................................................................ 47
6.5 CCI (I3C) Target Addresses ........................................................................................... 47
6.6 CCI Multi-Byte Registers .............................................................................................. 48
6.6.1 Overview..................................................................................................................... 48
6.6.2 Transmission Byte Order for Multi-Byte Register Values .......................................... 50
6.6.3 Multi-Byte Register Protocol (Informative) ............................................................... 51
6.7 CCI I/O Electrical and Timing Specifications ............................................................... 56
7 Physical Layer ...........................................................................................................59
7.1 D-PHY Physical Layer Option ...................................................................................... 59
7.2 C-PHY Physical Layer Option....................................................................................... 60
7.3 PHY Support for the CSI-2 Unified Serial Link (USL) Feature.................................... 61
7.3.1 D-PHY Support Requirements for USL Feature......................................................... 61
7.3.2 C-PHY Support Requirements for USL Feature ......................................................... 62
Figures
Figure 1 Typical CSI-2 and CCI Transmitter and Receiver Interface for D-PHY .................................. 9
Figure 2 Typical CSI-2 and CCI Transmitter and Receiver Interface for C-PHY................................. 10
Figure 3 CSI-2 Layer Definitions ......................................................................................................... 11
Figure 4 CCI (I2C) Single Read from Random Location ...................................................................... 15
Figure 5 CCI (I2C) Single Read from Current Location ....................................................................... 16
Figure 6 CCI (I2C) Sequential Read Starting from Random Location.................................................. 17
Figure 7 CCI (I2C) Sequential Read Starting from Current Location ................................................... 18
Figure 8 CCI (I2C) Single Write to Random Location .......................................................................... 19
Figure 9 CCI (I2C) Sequential Write Starting from Random Location ................................................. 20
Figure 10 CCI (I3C SDR) Single Read from Random Location .......................................................... 23
Figure 11 CCI (I3C SDR) Single Read from Current Location ............................................................ 24
Figure 12 CCI (I3C SDR) Sequential Read Starting from Random Location ...................................... 25
Figure 13 CCI (I3C SDR) Sequential Read Starting from Current Location........................................ 26
Figure 14 CCI (I3C SDR) Single Write to Random Location .............................................................. 27
Figure 15 CCI (I3C SDR) Sequential Write Starting from Random Location...................................... 28
Figure 16 CCI (I3C DDR) Sequential Read from Random Location: 8-bit LENGTH & INDEX ....... 32
Figure 17 CCI (I3C DDR) Sequential Read from Random Location: 16-bit LENGTH & INDEX ..... 33
Figure 18 CCI (I3C DDR) Concatenated Sequential Read, Random Location: 8-bit LENGTH &
INDEX ................................................................................................................................. 35
Figure 19 CCI (I3C DDR) Concatenated Sequential Read, Random Location: 16-bit LENGTH &
INDEX ................................................................................................................................. 36
Figure 20 CCI (I3C DDR) Sequential Write Starting from Random Location ..................................... 38
Figure 21 Example of SS0 Error Detection .......................................................................................... 40
Figure 22 Example of SD0 Error Detection .......................................................................................... 42
Figure 23 Example of SD1 Error Detection .......................................................................................... 44
Figure 24 Example of MD0 Error Detection ........................................................................................ 46
Figure 25 Corruption of 32-bit Register During Read Message ........................................................... 49
Figure 26 Corruption of 32-bit Register During Write Message........................................................... 49
Figure 27 Example 16-bit Register Write ............................................................................................. 50
Figure 28 Example 32-bit Register Write (Address Not Shown).......................................................... 50
Figure 29 Example 64-bit Register Write (Address Not Shown).......................................................... 50
Figure 30 Example 16-bit Register Read .............................................................................................. 51
Figure 31 Example 32-bit Register Read .............................................................................................. 53
Figure 32 Example 16-bit Register Write ............................................................................................. 54
Figure 33 Example 32-bit Register Write ............................................................................................. 55
Figure 71 Example Interlaced Frame Using LS/LE Short Packet and Line Counting .......................... 98
Figure 72 Multiple Packet Example.................................................................................................... 100
Figure 73 Single Packet Example ....................................................................................................... 100
Figure 74 Line and Frame Blanking Definitions ................................................................................ 101
Figure 75 Vertical Sync Example ........................................................................................................ 102
Figure 76 Horizontal Sync Example ................................................................................................... 102
Figure 77 Interpacket Latency Reduction Using LRTE EPD ............................................................. 103
Figure 78 LRTE Efficient Packet Delimiter Example for CSI-2 Over C-PHY (2 Lanes)................... 105
Figure 79 Example of LRTE EPD for CSI-2 Over D-PHY – Option 1 .............................................. 107
Figure 80 Example of LRTE EPD for CSI-2 Over D-PHY – Option 2 .............................................. 108
Figure 81 Enabling Robust Spacer Byte Detection: General Case ..................................................... 112
Figure 82 Enabling Robust Spacer Byte Detection: Special Case ...................................................... 112
Figure 83 EoTp Usage Examples........................................................................................................ 113
Figure 84 Using EPD with LVLP or ALP Mode Signaling................................................................. 114
Figure 85 USL System Diagram ......................................................................................................... 118
Figure 86 USL Modes Link Transitions .............................................................................................. 131
Figure 87 Examples of USL ALP Mode Clock Lane Management During Sensor Vblank ............... 135
Figure 88 System Diagram Showing Per-Lane Scrambling ............................................................... 138
Figure 89 Example of Data Bursts in Two Lanes Using the D-PHY Physical Layer ......................... 139
Figure 90 Example of Data Bursts in Two Lanes Using the C-PHY Physical Layer.......................... 140
Figure 91 Generating Tx Sync Type as Seed Index (Single Lane View) ............................................ 141
Figure 92 Generating Tx Sync Type Using the C-PHY Physical Layer ............................................. 142
Figure 93 PRBS LFSR Serial Implementation Example .................................................................... 145
Figure 94 ISROI System Supporting Multi-Stack SNS with Integrated SROI VDSP ........................ 148
Figure 95 ESROI System Supporting Standard SNS with an External SROI VDSP ......................... 148
Figure 96 SROI Frame Format Example ............................................................................................ 150
Figure 97 SROI Packet Option 1 ........................................................................................................ 153
Figure 98 SROI Packet Option 2 ........................................................................................................ 154
Figure 99 Use Case 1: SROI Embedded Data Packet Not Transmitted .............................................. 155
Figure 100 Use Case 2: SROI Embedded Data Packet Is Transmitted ............................................... 156
Figure 101 SROI Embedded Data Packet Format .............................................................................. 157
Figure 102 General Frame Format Example ....................................................................................... 161
Figure 103 Digital Interlaced Video Example..................................................................................... 162
Figure 104 Digital Interlaced Video with Accurate Synchronization Timing Information ................. 163
Figure 105 Interleaved Data Transmission using Data Type Value..................................................... 164
Figure 106 Packet Level Interleaved Data Transmission .................................................................... 165
Figure 107 Frame Level Interleaved Data Transmission .................................................................... 166
Figure 108 Interleaved Data Transmission using Virtual Channels .................................................... 167
Figure 109 Byte Packing Pixel Data to C-PHY Symbol Illustration .................................................. 172
Figure 110 Frame Structure with Embedded Data at the Beginning and End of the Frame ............... 174
Figure 111 Legacy YUV420 8-bit Transmission................................................................................. 176
Figure 112 Legacy YUV420 8-bit Pixel to Byte Packing Bitwise Illustration ................................... 176
Figure 113 Legacy YUV420 Spatial Sampling for H.261, H.263 and MPEG 1 ................................. 177
Figure 114 Legacy YUV420 8-bit Frame Format ............................................................................... 177
Figure 115 YUV420 8-bit Data Transmission Sequence .................................................................... 178
Figure 116 YUV420 8-bit Pixel to Byte Packing Bitwise Illustration ................................................ 179
Figure 117 YUV420 Spatial Sampling for H.261, H.263 and MPEG 1 ............................................. 180
Figure 118 YUV420 Spatial Sampling for MPEG 2 and MPEG 4 ..................................................... 180
Figure 119 YUV420 8-bit Frame Format............................................................................................ 181
Figure 120 YUV420 10-bit Transmission ........................................................................................... 182
Figure 121 YUV420 10-bit Pixel to Byte Packing Bitwise Illustration .............................................. 183
Figure 122 YUV420 10-bit Frame Format ......................................................................................... 183
Figure 123 YUV422 8-bit Transmission ............................................................................................. 184
Figure 124 YUV422 8-bit Pixel to Byte Packing Bitwise Illustration ................................................ 184
Figure 125 YUV422 Co-sited Spatial Sampling ................................................................................. 185
Figure 126 YUV422 8-bit Frame Format............................................................................................ 185
Figure 127 YUV422 10-bit Transmitted Bytes ................................................................................... 186
Figure 128 YUV422 10-bit Pixel to Byte Packing Bitwise Illustration .............................................. 186
Figure 129 YUV422 10-bit Frame Format ......................................................................................... 187
Figure 130 RGB888 Transmission ...................................................................................................... 189
Figure 131 RGB888 Transmission in CSI-2 Bus Bitwise Illustration ................................................ 189
Figure 132 RGB888 Frame Format .................................................................................................... 190
Figure 133 RGB666 Transmission with 18-bit BGR Words ............................................................... 191
Figure 134 RGB666 Transmission on CSI-2 Bus Bitwise Illustration ............................................... 191
Figure 135 RGB666 Frame Format .................................................................................................... 192
Figure 136 RGB565 Transmission with 16-bit BGR Words ............................................................... 193
Figure 137 RGB565 Transmission on CSI-2 Bus Bitwise Illustration ............................................... 193
Figure 138 RGB565 Frame Format .................................................................................................... 194
Figure 139 RGB555 Transmission on CSI-2 Bus Bitwise Illustration ............................................... 195
Figure 140 RGB444 Transmission on CSI-2 Bus Bitwise Illustration ............................................... 196
Figure 141 RAW6 Transmission ......................................................................................................... 198
Figure 142 RAW6 Data Transmission on CSI-2 Bus Bitwise Illustration .......................................... 198
Figure 143 RAW6 Frame Format........................................................................................................ 198
Figure 144 RAW7 Transmission ......................................................................................................... 199
Figure 145 RAW7 Data Transmission on CSI-2 Bus Bitwise Illustration .......................................... 199
Figure 146 RAW7 Frame Format........................................................................................................ 199
Figure 147 RAW8 Transmission ......................................................................................................... 200
Figure 148 RAW8 Data Transmission on CSI-2 Bus Bitwise Illustration .......................................... 200
Figure 149 RAW8 Frame Format........................................................................................................ 200
Figure 150 RAW10 Transmission ....................................................................................................... 201
Figure 151 RAW10 Data Transmission on CSI-2 Bus Bitwise Illustration ........................................ 201
Figure 152 RAW10 Frame Format...................................................................................................... 202
Figure 153 RAW12 Transmission ....................................................................................................... 203
Figure 154 RAW12 Transmission on CSI-2 Bus Bitwise Illustration ................................................. 203
Figure 155 RAW12 Frame Format...................................................................................................... 203
Figure 156 RAW14 Transmission ....................................................................................................... 204
Figure 157 RAW14 Transmission on CSI-2 Bus Bitwise Illustration ................................................. 204
Figure 158 RAW14 Frame Format...................................................................................................... 205
Figure 159 RAW16 Transmission ....................................................................................................... 206
Figure 160 RAW16 Transmission on CSI-2 Bus Bitwise Illustration ................................................. 206
Figure 161 RAW16 Frame Format...................................................................................................... 206
Figure 162 RAW20 Transmission ....................................................................................................... 207
Figure 163 RAW20 Transmission on CSI-2 Bus Bitwise Illustration ................................................. 207
Figure 164 RAW20 Frame Format...................................................................................................... 208
Figure 165 RAW24 Transmission ....................................................................................................... 209
Figure 166 RAW24 Transmission on CSI-2 Bus Bitwise Illustration ................................................. 209
Figure 167 RAW24 Frame Format...................................................................................................... 210
Figure 168 RAW28 Transmission ....................................................................................................... 211
Figure 169 RAW28 Transmission on CSI-2 Bus Bitwise Illustration ................................................. 211
Figure 170 RAW28 Frame Format...................................................................................................... 211
Figure 171 User Defined 8-bit Data (128 Byte Packet) ...................................................................... 212
Figure 172 User Defined 8-bit Data Transmission on CSI-2 Bus Bitwise Illustration ....................... 212
Figure 173 Transmission of User Defined 8-bit Data ......................................................................... 212
Figure 174 General/Arbitrary Data Reception .................................................................................... 215
Figure 175 RGB888 Data Format Reception ...................................................................................... 216
Figure 176 RGB666 Data Format Reception ...................................................................................... 216
Figure 177 RGB565 Data Format Reception ...................................................................................... 217
Figure 178 RGB555 Data Format Reception ...................................................................................... 217
Figure 179 RGB444 Data Format Reception ...................................................................................... 218
Figure 180 YUV422 8-bit Data Format Reception ............................................................................. 218
Figure 181 YUV422 10-bit Data Format Reception ........................................................................... 219
Figure 182 YUV420 8-bit Legacy Data Format Reception ................................................................ 220
Figure 183 YUV420 8-bit Data Format Reception ............................................................................. 221
Figure 184 YUV420 10-bit Data Format Reception ........................................................................... 222
Figure 185 RAW6 Data Format Reception ......................................................................................... 223
Figure 186 RAW7 Data Format Reception ......................................................................................... 223
Figure 187 RAW8 Data Format Reception ......................................................................................... 224
Figure 188 RAW10 Data Format Reception ....................................................................................... 224
Figure 189 RAW12 Data Format Reception ....................................................................................... 225
Figure 190 RAW 14 Data Format Reception ...................................................................................... 225
Figure 191 RAW16 Data Format Reception ....................................................................................... 226
Figure 192 RAW20 Data Format Reception ....................................................................................... 226
Figure 193 RAW24 Data Format Reception ....................................................................................... 227
Figure 194 RAW28 Data Format Reception ....................................................................................... 227
Figure 195 Point-To-Point AOSC Systems with USL Solutions ........................................................ 229
Figure 196 Point-To-Point AOSC Systems with Non-USL Solutions ................................................ 230
Figure 197 System Supporting AOSC and CCI Operations Over Multi-Drop I3C ............................ 230
Figure 198 System Supporting Discrete Multicontrollers Mapped to Single SNS I3C Target Port.... 231
Figure 199 AOSC Optimal Transport Mode (OTM) Operation .......................................................... 235
Figure 200 Example OTM RAW10 Format Transport (with I3C SDR Bit Transmission Order) ....... 237
Figure 201 SNS OTM FIFO ............................................................................................................... 239
Figure 202 AOSC IBI MDB Codes .................................................................................................... 241
Figure 203 OTM ISPB Insertion and Frame Start IBI T_RESP Parameter ........................................ 242
Figure 204 AOSC Smart Transport Mode (STM) Operation for the D-PHY Generic STM Types .... 244
Figure 205 Example AOSC STM RAW10 Data Bitwise Transport Illustration with the D-PHY
Generic STM Types ........................................................................................................... 247
Figure 206 JPEG8 Data Flow in the Encoder ..................................................................................... 249
Figure 207 JPEG8 Data Flow in the Decoder ..................................................................................... 249
Figure 208 EXIF Compatible Baseline JPEG DCT Format................................................................ 250
Figure 209 Status Information Field in the End of Baseline JPEG Frame.......................................... 252
Figure 210 Example of TN Image Embedding Inside the Compressed JPEG Data Block ................. 253
Figure 211 JPEG8 Data Format Reception ......................................................................................... 254
Figure 212 Implementation Example Block Diagram and Coverage ................................................. 255
Figure 213 CSI-2 Transmitter Block Diagram .................................................................................... 256
Figure 214 CSI-2 Receiver Block Diagram ........................................................................................ 257
Figure 215 D-PHY Level Block Diagram........................................................................................... 258
Figure 216 CSI-2 Clock Lane Transmitter .......................................................................................... 259
Figure 217 CSI-2 Clock Lane Receiver .............................................................................................. 260
Figure 255 RAW10/12/14 Transmission for MPC for Tetra-Cell Image Sensors ............................... 349
Figure 256 RAW10/12/14 Transmission for MPC for Nona-Cell Image Sensors .............................. 350
Figure 257 MPC Data Compression System....................................................................................... 351
Figure 258 MPC Packet Structures for Bayer Compression Modes ................................................... 352
Figure 259 Reference Pixel Relative Coordinate Indexes (Bayer) ..................................................... 354
Figure 260 MPC Packet Structure for Compression Mode PD........................................................... 356
Figure 261 MPC Packet Structure for Compression Mode DGD (Bayer) .......................................... 359
Figure 262 MPC Packet Structure for Compression Mode FNR (Bayer) ........................................... 361
Figure 263 Decoded and Reference Pixel of Outlier Pixel (Bayer) .................................................... 362
Figure 264 MPC Packet Structure for Compression Mode OUT (Bayer) .......................................... 362
Figure 265 MPC Packet Structure for Compression Mode eDGD ..................................................... 364
Figure 266 MPC Packet Structure for Compression Mode ePD ......................................................... 366
Figure 267 MPC Packet Structure for Compression Mode eSHV (Bayer) ......................................... 369
Figure 268 MPC Packet Structures for Tetra-Cell Compression Modes............................................. 372
Figure 269 Tetra-Cell Multi-Pixel Indexing........................................................................................ 373
Figure 270 Reference Pixel Relative Coordinate Indexes (Tetra-Cell) ............................................... 374
Figure 271 MPC Packet Structure for Compression Mode AD .......................................................... 376
Figure 272 MPC Packet Structure for Compression Mode OD .......................................................... 378
Figure 273 MPC Packet Structure for Compression Mode FNR (Tetra-Cell) .................................... 385
Figure 274 Decoded and Reference Pixel of Outlier Pixel (Tetra) ..................................................... 386
Figure 275 MPC Packet Structure for Compression Mode OUT (Tetra-Cell) .................................... 386
Figure 276 MPC Packet Structure for Compression Mode eMPD (Tetra-Cell).................................. 388
Figure 277 MPC Packet Structure for Compression Mode eHVD (Tetra-Cell).................................. 391
Figure 278 Pixel Couplet Definitions for eHVA Mode ....................................................................... 393
Figure 279 MPC Packet Structure for Compression Mode eHVA ...................................................... 394
Figure 280 MPC Packet Structure for Compression Mode eOUT...................................................... 396
Figure 281 Low Resolution Image Generation by Pbyr (Tetra-Cell) ................................................... 400
Figure 282 MPC Packet Structures for Compression Ratio 10:6 (Tetra-Cell) .................................... 402
Figure 283 MPC Packet Structures for Compression Ratio 10:7 (Tetra-Cell) .................................... 402
Figure 284 Quantization Bits for Compression Ratios (Tetra-Cell) .................................................... 403
Figure 285 MPC Packet Structures for Nona-Cell Compression Modes ............................................ 404
Figure 286 Nona-Cell Multi-Pixel Indexing ....................................................................................... 405
Figure 287 Reference Pixel Relative Coordinate Indexes (Nona-Cell) .............................................. 406
Figure 288 MPC Packet Structure for Compression Mode AD (Nona-Cell) ...................................... 407
Figure 289 MPC Packet Structure for Compression Mode DGD (Nona-Cell) ................................... 409
Figure 290 MPC Packet Structure for Compression Mode FNR (Nona-Cell) .................................... 412
Figure 291 MPC Packet Structure for Compression Mode eAD (Nona-Cell) .................................... 413
Figure 292 MPC Packet Structure for Compression Mode eHVD (Nona-Cell) ................................. 415
Figure 293 Pixel Triplet Definitions for eHVI Mode .......................................................................... 418
Figure 294 MPC Packet Structure for Compression Mode eHVI ....................................................... 419
Figure 295 MPC Packet Structure for Compression Mode eSHV (Nona-Cell) .................................. 420
Figure 296 MPC Packet Structure for Compression Mode eMPD (Nona-Cell) ................................. 423
Figure 297 Low Resolution Image Generation by Pbyr (Nona-Cell) ................................................... 427
Figure 298 MPC Packet Structures for Compression Ratio 10:6 (Nona-Cell) ................................... 428
Figure 299 MPC Packet Structures for Compression Ratio 10:7 (Nona-Cell) ................................... 428
Figure 300 Quantization Bits for Compression Ratios (Nona-Cell) ................................................... 429
Figure 301 Pixel Order Change from 4x4 Multi-Pixel to Tetra-Cell .................................................. 430
Tables
Table 1 CCI (I2C) Read/Write Operations ............................................................................................ 15
Table 2 CCI (I3C SDR) Read/Write Operations ................................................................................... 22
Table 3 CCI (I3C DDR) Read/Write Operations .................................................................................. 30
Table 4 CCI (I3C DDR) Read/Write Operation Command Codes ....................................................... 31
Table 5 CCI (I3C SDR) Target Error Types .......................................................................................... 39
Table 6 CCI (I3C DDR) Target Error Types ......................................................................................... 41
Table 7 CCI (I3C DDR) Controller Error Type..................................................................................... 45
Table 8 CCI I/O Electrical Specifications ............................................................................................. 56
Table 9 CCI I/O Timing Specifications ................................................................................................. 57
Table 10 Data Type Classes .................................................................................................................. 84
Table 11 ECC Syndrome Association Matrix ....................................................................................... 86
Table 12 ECC Parity Generation Rules ................................................................................................. 88
Table 13 Synchronization Short Packet Data Type Codes .................................................................... 96
Table 14 Generic Short Packet Data Type Codes.................................................................................. 99
Table 15 Minimum Spacer Bytes per Lane for ECC Calculation ........................................................111
Table 16 LRTE Transmitter Registers for CSI-2 Over C-PHY ........................................................... 115
Table 17 LRTE Transmitter Registers for CSI-2 Over D-PHY........................................................... 116
Table 18 Image Sensor LPDT LRTE Control Register ....................................................................... 121
Table 19 USL Transport Control (USL_CTL) Bit Description ........................................................... 122
Table 20 USL Transport Integrity ACK and NAK Registers with TSEQ ........................................... 125
Table 21 USL BTA Switch Registers .................................................................................................. 128
Table 22 Register TX_USL_REV_FWD_ENTRY ............................................................................. 129
Table 23 Register TX_USL_SNS_BTA_ACK_TIMEOUT[15:0] ...................................................... 130
Table 24 Register TX_USL_APP_BTA_ACK_TIMEOUT[15:0] ...................................................... 130
Table 25 USL Operation Registers ...................................................................................................... 132
Table 26 USL GPIO Registers ............................................................................................................ 132
Table 27 USL Clock Lane Control Register ....................................................................................... 135
Table 28 Symbol Sequence Values Per Sync Type ............................................................................. 141
Table 29 Fields That Are Not Scrambled ............................................................................................ 143
Table 30 D-PHY Scrambler PRBS Initial Seed Values for Lanes 1 Through 8 .................................. 143
Table 31 C-PHY Scrambler PRBS Initial Seed Values for Lanes 1 Through 8 .................................. 144
Table 32 Example of the PRBS Bit-at-a-Time Shift Sequence ........................................................... 146
Table 33 Example PRBS LFSR Byte Sequence for D-PHY Physical Layer ...................................... 146
Table 34 Example PRBS LFSR Byte Sequence for C-PHY Physical Layer ...................................... 147
Table 72 MPC Compression Modes for Bayer Image Sensors ........................................................... 352
Table 73 Decoder for Compression Mode PD .................................................................................... 357
Table 74 Decoder for Compression Mode DGD (Bayer).................................................................... 360
Table 75 Decoder for Compression Mode FNR (Bayer) .................................................................... 361
Table 76 Decoder for Compression Mode OUT (Bayer) .................................................................... 363
Table 77 Decoder for Compression Mode eDGD ............................................................................... 365
Table 78 Decoder for Compression Mode ePD .................................................................................. 367
Table 79 Decoder for Compression Mode eSHV (Bayer)................................................................... 370
Table 80 MPC Compression Modes for Tetra-Cell Image Sensors..................................................... 372
Table 81 Decoder for Compression Mode AD .................................................................................... 377
Table 82 Decoder for Compression Mode OD.................................................................................... 379
Table 83 Decoder for Compression Mode FNR (Tetra-Cell) .............................................................. 385
Table 84 Decoder for Compression Mode OUT (Tetra-Cell) ............................................................. 387
Table 85 Decoder for Compression Mode eMPD (Tetra-Cell) ........................................................... 389
Table 86 Decoder for Compression Mode eHVD (Tetra-Cell) ........................................................... 392
Table 87 Decoder for Compression Mode eHVA ............................................................................... 394
Table 88 Decoder for Compression Mode eOUT ............................................................................... 397
Table 89 Decoder for Compression Mode OUT (Tetra-Cell) with 10:7 Compression Ratio .............. 401
Table 90 MPC Compression Modes for Nona-Cell Image Sensors .................................................... 404
Table 91 Decoder for Compression Mode AD (Nona-Cell)................................................................ 408
Table 92 Decoder for Compression Mode DGD (Nona-Cell) ............................................................ 410
Table 93 Decoder for Compression Mode FNR (Nona-Cell) ............................................................. 412
Table 94 Decoder for Compression Mode eAD (Nona-Cell).............................................................. 414
Table 95 Decoder for Compression Mode eHVD (Nona-Cell) ........................................................... 416
Table 96 Decoder for Compression Mode eHVI ................................................................................ 419
Table 97 Decoder for Compression Mode eSHV (Nona-Cell) ........................................................... 420
Table 98 Decoder for Compression Mode eMPD (Nona-Cell) ........................................................... 423
Release History
Date Version Description
1 Introduction
1.1 Scope
1 The MIPI Camera Serial Interface 2 Specification (CSI-2) defines an interface between a peripheral device
2 (camera) and a host processor (baseband, application engine). The purpose of this document is to specify a
3 standard interface between a camera and a host processor for mobile applications.
4 This Revision of the Camera Serial Interface 2 Specification (v4.0) leverages both MIPI C-PHY [MIPI02]
5 and MIPI D-PHY [MIPI01], enabling higher interface bandwidth and more flexibility in channel layout, and
6 maintains backwards compatibility with previous CSI-2 versions with the understanding that the D-PHY and
7 C-PHY physical layers themselves are not interoperable. For the first time, this Revision also supports the
8 transmission of image frames over the MIPI I3C bus [MIPI03] for use in ultra-low power, always-on imaging
9 applications.
10 In this document, the term ‘host processor’ refers to the hardware and software that performs essential core
11 functions for telecommunication or application tasks. The engine of a mobile terminal includes hardware and
12 the functions, which enable the basic operation of the mobile terminal. These include, for example, the printed
13 circuit boards, RF components, basic electronics, and basic software, such as the digital signal processing
14 software.
1.2 Purpose
15 Demand for increasingly higher image resolutions is pushing the bandwidth capacity of existing host
16 processor-to-camera sensor interfaces. Common parallel interfaces are difficult to expand, require many
17 interconnects, and consume relatively large amounts of power. Emerging serial interfaces address many of
18 the shortcomings of parallel interfaces while introducing their own problems. Incompatible, proprietary
19 interfaces prevent devices from different manufacturers from working together. This can raise system costs
20 and reduce system reliability by requiring “hacks” to force the devices to interoperate. The lack of a clear
21 industry standard can slow innovation and inhibit new product market entry.
22 CSI-2 provides the mobile industry a standard, robust, scalable, low-power, high-speed, cost-effective
23 interface that supports a wide range of imaging solutions for mobile devices.
2 Terminology
2.2 Definitions
42 AOSC Transfer Mode: Either OTM, LTM, or STM; see Section 13.2.
43 CCI (I2C): CCI supporting I2C [NXP01].
44 CCI (I3C): CCI supporting I3C [MIPI03].
45 CCI (I3C SDR) means CCI supporting I3C SDR.
46 CCI (I3C DDR) means CCI supporting I3C DDR.
47 Controller: An I2C or I3C Device that is capable of controlling an I 2C or I3C Bus, respectively.
48 Note:
49 In previous versions of the CSI-2 Specification, a Controller Device was called a “Master Device”.
50 This version of the CSI-2 Specification has deprecated the term “Master”, and now uses the updated
51 normative term “Controller.” Please note that the technical definition of such a Device, and its Role
52 on an I2C or I3C Bus, are unchanged.
53 Filler: A CSI-2 protocol element that is inserted after CSI-2 Packets in order to ensure that data transmissions
54 on all Lanes end at the same time.
55 Lane: A unidirectional, point-to-point, 2- or 3-wire interface used for high-speed serial clock or data
56 transmission; the number of wires is determined by the PHY specification in use (i.e. either D-PHY or C-PHY,
57 respectively). A CSI-2 camera interface using the D-PHY physical layer consists of one clock Lane and one
58 or more data Lanes. A CSI-2 camera interface using the C-PHY physical layer consists of one or more Lanes,
59 each of which transmits both clock and data information. Note that when describing features or behavior
60 applying to both D-PHY and C-PHY, this specification sometimes uses the term data Lane to refer to both a
61 D-PHY data Lane and a C-PHY Lane.
62 Message: In CCI (I2C) or CCI (I3C SDR), a Message begins with a START or Repeated START condition,
63 followed by the address of the Target(s), R/W bit, other data, and ends with either a STOP or Repeated START
64 condition. In the case of CCI (I3C SDR), a START or Repeated START condition followed by 7’h7E may
65 be added to the beginning. In CCI (I3C DDR), a Message begins with either the I3C ENTHDR0 CCC or the
66 I3C HDR Restart Pattern, followed by an HDR-DDR Command, HDR-DDR Data, and ends with either the
67 I3C HDR Exit Pattern or the I3C HDR Restart Pattern.
68 Multi-Pixel: An N x N pixel structure with the same color filter array for all of its pixels. A Tetra-Cell and a
69 Nona-Cell are both Multi-Pixel structures.
70 Nona-Cell: A 3 x 3 Multi-Pixel (i.e., 9 pixels). That is, a 3 x 3 pixel structure with the same color filter array
71 on each of its pixels.
72 Operation: An Operation is composed of one or more Messages in order to read or write.
73 Packet: A group of bytes organized in a specified way to transfer data across the interface. All packets have
74 a minimum specified set of components. The byte is the fundamental unit of data from which packets are
75 made.
76 Payload: Application data only – with all sync, header, ECC and checksum and other protocol-related
77 information removed. This is the “core” of transmissions between application processor and peripheral.
78 Primary: The Primary is the PHY on the side of a Link that is the main data source. The Primary transmits
79 data in the Forward Direction and receives data in the Reverse Direction. In some Bi-directional systems the
80 functions of the Primary and Secondary are nearly equivalent. The difference between being Primary or
81 Secondary is simply that one side is identified as the Primary, and the other side is identified as the Secondary.
82 The side that is defined as the Primary does not change after the system is initialized.
83 Note:
84 In previous versions of the CSI-2 Specification, a Primary PHY was called a “Master PHY”. This
85 version of the CSI-2 Specification has deprecated the term “Master”, and now uses the updated
86 normative term “Primary.” Please note that the technical definition of such a PHY, and its Role on a
87 Link, are unchanged.
88 Secondary: The Secondary is the PHY on the side of a Link that is the main data sink. The Secondary
89 receives data in the Forward Direction and transmits data in the Reverse Direction. In some Bi-directional
90 systems the functions of the Primary and Secondary are nearly equivalent. The difference between being
91 Primary or Secondary is simply that one side is identified as the Primary, and the other side is identified as
92 the Secondary. The side that is defined as the Secondary does not change after the system is initialized.
93 Note:
94 In previous versions of the CSI-2 Specification, a Secondary PHY was called a “Slave PHY”. This
95 version of the CSI-2 Specification has deprecated the term “Slave”, and now uses the updated
96 normative term “Secondary.” Please note that the technical definition of such a PHY, and its Role on
97 a Link, are unchanged.
98 Sleep Mode: Sleep mode (SLM) is a leakage level only power consumption mode.
99 Spacer: An optional CSI-2 protocol element that may be inserted after CSI-2 Packets and Fillers transmitted
100 using CSI-2 LRTE; not to be confused with the C-PHY “Spacer Code” defined in [MIPI02].
101 Target: A Device on an I2C or I3C Bus that can only respond to commands from a Controller.
102 Note:
103 In previous versions of the CSI-2 Specification, a Target Device was called a “Slave Device”. This
104 version of the CSI-2 Specification has deprecated the term “Slave”, and now uses the updated
105 normative term “Target.” Please note that the technical definition of such a Device, and its Role on
106 an I2C or I3C Bus, are unchanged.
107 Tetra-Cell: A 2 x 2 Multi-Pixel (i.e., 4 pixels). That is, a 2 x 2 pixel structure with the same color filter array
108 on each of its pixels.
109 Transmission: The time during which high-speed serial data is actively traversing the bus. A transmission is
110 bounded by SoT (Start of Transmission) and EoT (End of Transmission) at beginning and end, respectively.
111 Virtual Channel: Multiple independent data streams for up to 32 peripherals are supported by this
112 Specification. The data stream for each peripheral may be a Virtual Channel. These data streams may be
113 interleaved and sent as sequential packets, with each packet dedicated to a particular peripheral or channel.
114 Packet protocol includes information that links each packet to its intended peripheral.
2.3 Abbreviations
115 APP AOSC host processor
116 e.g. For example (Latin: exempli gratia)
117 i.e. That is (Latin: id est)
118 SNS AOSC peripheral device
2.4 Acronyms
119 ALP Alternate Low Power
120 AOSC Always-On Sentinel Conduit
121 BER Bit Error Rate
122 CCI Camera Control Interface
123 CIL Control and Interface Logic
124 CRC Cyclic Redundancy Check
125 CSF Continuously Streaming Frames
126 CSI Camera Serial Interface
127 CSPS Chroma Shifted Pixel Sampling
128 DDR Dual Data Rate
129 DI Data Identifier
130 DT Data Type
131 ECC Error Correction Code
132 EoT End of Transmission
133 EoTp End of Transmission short packet
134 EPD Efficient Packet Delimiter (PHY and / or Protocol generated signaling used in LRTE)
135 EXIF Exchangeable Image File Format
136 FE Frame End
137 FOV Field of View
138 FS Frame Start
139 HS High-Speed; identifier for operation mode
140 HS-LPS-LS High-Speed to Low Power State to High-Speed switching (includes LPS entry and exit
141 latencies)
142 HS-RX High-Speed Receiver
143 HS-TX High-Speed Transmitter
144 I2C Inter-Integrated Circuit [NXP01]
145 ILR Interpacket Latency Reduction
146 JFIF JPEG File Interchange Format
147 JPEG Joint Photographic Expert Group
148 LE Line End
149 LFSR Linear Feedback Shift Register
150 LLP Low Level Protocol
151 LP Low-Power; identifier for operation mode
152 LP-RX Low-Power Receiver (Large-Swing Single Ended)
3 References
185 [NXP01] UM10204, I2C bus specification and user manual, Revision 6,
186 NXP Semiconductors N.V., 4 April 2014.
187 [MIPI01] MIPI Alliance Specification for D-PHY, version 3.0, MIPI Alliance, Inc., 8 June 2021.
188 [MIPI02] MIPI Alliance Specification for C-PHY, version 2.1, MIPI Alliance, Inc., 1 April 2021.
189 [MIPI03] MIPI Alliance Specification for I3C (Improved Inter-Integrated Circuit), version 1.1.1,
190 MIPI Alliance, Inc., 8 June 2021.
191 [MIPI04] MIPI Alliance Specification for Camera Command Set (CCS), version 1.1,
192 MIPI Alliance, Inc., 12 December 2019.
193 [MIPI05] MIPI Alliance Specification for Camera Service Extensions (CSE), version 1.0,
194 MIPI Alliance, Inc., 27 July 2021.
195 [MIPI06] MIPI Alliance Specification for A-PHY, version 1.0, MIPI Alliance, Inc., 6 August 2020.
196 [MIPI07] MIPI Multi Pixel Compression (MPC) Example Code,
197 <https://members.mipi.org/wg/All-Members/document/folder/14072>,
198 MIPI Alliance, Inc., last accessed 8 December 2021.
4 Overview of CSI-2
199 The CSI-2 Specification defines standard data transmission and control interfaces between transmitter and
200 receiver. Two high-speed serial data transmission interface options are defined.
201 The first option, referred to in this specification as the “D-PHY physical layer option,” is typically a
202 unidirectional differential interface with one 2-wire clock Lane and one or more 2-wire data Lanes. The
203 physical layer of this interface is defined by the MIPI Alliance Specification for D-PHY [MIPI01]. Figure 1
204 illustrates the connections for this option between a CSI-2 transmitter and receiver, which typically are a
205 camera module and a receiver module, part of the mobile phone engine.
206 The second high-speed data transmission interface option, referred to in this specification as the “C-PHY
207 physical layer option,” typically consists of one or more unidirectional 3-wire serial data Lanes, each of
208 which has its own embedded clock. The physical layer of this interface is defined by the MIPI Alliance
209 Specification for C-PHY [MIPI02]. Figure 2 illustrates the CSI transmitter and receiver connections for this
210 option.
211 The Camera Control Interface (CCI) for both physical layer options is a bi-directional control interface
212 compatible with the I2C standard [NXP01] and/or the MIPI I3C Specification [MIPI03].
213 Note that beginning with the CSI-2 v3.0 specification, Lane 1 of a D-PHY or C-PHY link interconnecting a
214 camera with a host or application processor (i.e., Data1+ / Data1- in Figure 1, or Data1_A / Data1_B /
215 Data1_C in Figure 2) is permitted to be bidirectional. For such links, there is no requirement to support a
216 physically separate CCI. See Section 9.12.
Data1+ Data1+
Data1- Data1-
One 2-wire Clock Lane
Clock+ Clock+
Clock- Clock-
400kHz Bidirectional
CCI Target Control Link CCI Controller
SCL SCL
SDA SDA
217
Figure 1 Typical CSI-2 and CCI Transmitter and Receiver Interface for D-PHY
Data1_A Data1_A
Data1_B Data1_B
Data1_C Data1_C
400kHz Bidirectional
CCI Target Control Link CCI Controller
SCL SCL
SDA SDA
218
Figure 2 Typical CSI-2 and CCI Transmitter and Receiver Interface for C-PHY
Transmitter Receiver
Application Application
Pixel Control Pixel Control
6-, 7-, 8-, 10-, 12-, 14-, 15-, 16-, 18-, 20-, 24-, or 28-bits
Pixel Control Pixel Control
Pixel to Byte Byte to Pixel
Data Formats
Packing Formats Unpacking Formats
Data Control Data Control
8 bits 8 bits
Data Control Data Control
Packet Based Protocol
Low Level Protocol Arbitrary Data Support
Low Level Protocol
Data Control Data Control
8 bits 8 bits
219
High-Speed Unidirectional Lane N
Figure 3 CSI-2 Layer Definitions
220 Figure 3 defines the conceptual layer structure typically used in CSI-2. The layers can be characterized as
221 follows:
222 • PHY Layer. The PHY Layer specifies the transmission medium (electrical conductors), the
223 input/output circuitry and the clocking mechanism that captures “ones” and “zeroes” from the
224 serial bit stream. This part of the Specification documents the characteristics of the transmission
225 medium, electrical parameters for signaling and for the D-PHY physical layer option, the timing
226 relationship between clock and data Lanes.
227 The mechanism for signaling Start of Transmission (SoT) and End of Transmission (EoT) is
228 specified as well as other “out of band” information that can be conveyed between transmitting
229 and receiving PHYs. Bit-level and byte-level synchronization mechanisms are included as part of
230 the PHY.
231 The PHY layer is described in [MIPI01] and [MIPI02].
232 • Protocol Layer. The Protocol layer is composed of several layers, each with distinct
233 responsibilities. The CSI-2 protocol enables multiple data streams using a single interface on the
234 host processor. The Protocol layer specifies how multiple data streams may be tagged and
235 interleaved so each data stream can be properly reconstructed.
236 • Pixel/Byte Packing/Unpacking Layer. The CSI-2 specification supports image applications
237 with varying pixel formats. In the transmitter this layer packs pixels from the Application layer
238 into bytes before sending the data to the Low Level Protocol layer. In the receiver this layer
239 unpacks bytes from the Low Level Protocol layer into pixels before sending the data to the
240 Application layer. Eight bits per pixel data is transferred unchanged by this layer.
241 • Low Level Protocol. The Low Level Protocol (LLP) includes the means of establishing bit-
242 level and byte-level synchronization for serial data transferred between SoT (Start of
243 Transmission) and EoT (End of Transmission) events and for passing data to the next layer. The
244 minimum data granularity of the LLP is one byte. The LLP also includes assignment of bit-value
245 interpretation within the byte, i.e. the “Endian” assignment.
246 • Lane Management. CSI-2 is Lane-scalable for increased performance. The number of data
247 Lanes is not limited by this specification and may be chosen depending on the bandwidth
248 requirements of the application. The transmitting side of the interface distributes (“distributor”
249 function) bytes from the outgoing data stream to one or more Lanes. On the receiving side, the
250 interface collects bytes from the Lanes and merges (“merger” function) them together into a
251 recombined data stream that restores the original stream sequence. For the C-PHY physical
252 layer option, this layer exclusively distributes or collects byte pairs (i.e. 16-bits) to or from the
253 data Lanes. Scrambling on a per-Lane basis is an optional feature, which is specified in detail in
254 Section 9.17.
255 Data within the Protocol layer is organized as packets. The transmitting side of the interface
256 appends header and error-checking information on to data to be transmitted at the Low Level
257 Protocol layer. On the receiving side, the header is stripped off at the Low Level Protocol layer
258 and interpreted by corresponding logic in the receiver. Error-checking information may be used to
259 test the integrity of incoming data.
260 • Application Layer. This layer describes higher-level encoding and interpretation of data contained
261 in the data stream and is beyond the scope of this specification. The CSI-2 Specification describes
262 the mapping of pixel values to bytes.
263 The normative sections of the Specification only relate to the external part of the Link, e.g. the data and bit
264 patterns that are transferred across the Link. All internal interfaces and layers are purely informative.
326 The INDEX in the Target device must be auto-incremented after each read/write operation. This is also
327 explained in the following sections.
CCI (I2C) Single Read from Random Location with 8-bit index and 8-bit data (7-bit address)
INDEX, value M
CCI (I2C) Single Read from Random Location with 16-bit index and 8-bit data (7-bit address)
INDEX, value M
S TARGET P S TARGET P
1 A DATA A 1 A DATA A
Sr ADDRESS Sr Sr ADDRESS Sr
337
Figure 5 CCI (I2C) Single Read from Current Location
CCI (I2C) Sequential Read Starting from a Random Location with 8-bit index and 8-bit data (7-bit address)
Index Index
Previous Index value, K Index M
(M +L-1) M+L
S SUB P
TARGET S TARGET
0 A ADDRESS A 1 A DATA A DATA A
Sr ADDRESS [7:0]
r ADDRESS Sr
CCI (I2C) Sequential Read Starting from a Random Location with 16-bit index and 8-bit data (7-bit address)
Index Index
Previous Index value, K Index M
(M +L-1) M+L
S SUB SUB P
TARGET S TARGET
0 A ADDRESS A ADDRESS A 1 A DATA A DATA A
Sr ADDRESS [15:8] [7:0]
r ADDRESS Sr
344
Figure 6 CCI (I2C) Sequential Read Starting from Random Location
Index Index
Previous Index value, K Index K+1
(K +L-1) K+L
S TARGET P
1 A DATA A DATA A DATA A
Sr ADDRESS Sr
L bytes of data
348
Figure 7 CCI (I2C) Sequential Read Starting from Current Location
CCI (I2C) Single Write to a Random Location with 8-bit index and 8-bit data (7-bit address)
SUB
STARGET A/ P
0 A ADDRESS A DATA
Sr ADDRESS [7:0]
A Sr
INDEX, value M
CCI (I2C) Single Write to a Random Location with 16-bit index and 8-bit data (7-bit address)
SUB SUB
STARGET A/ P
0 A ADDRESS A ADDRESS A DATA
Sr ADDRESS A Sr
[15:8] [7:0]
INDEX, value M
352
Figure 8 CCI (I2C) Single Write to Random Location
CCI (I2C) Sequential Write Starting from a Random Location with 8-bit index and 8-bit data (7-bit address)
Index
Previous Index value, K Index M Index (M+L-1)
M+L
SUB
S TARGET A/ P
0 A ADDRESS A DATA A DATA
Sr ADDRESS [7:0]
A Sr
CCI (I2C) Sequential Write Starting from a Random Location with 16-bit index and 8-bit data (7-bit address)
Index
Previous Index value, K Index M Index (M+L-1)
M+L
SUB SUB
S TARGET A/ P
0 A ADDRESS A ADDRESS A DATA A DATA
Sr ADDRESS [15:8] [7:0]
A Sr
L bytes of data
INDEX, value M
356
Figure 9 CCI (I2C) Sequential Write Starting from Random Location
387 Other CCI (I3C SDR) Messages starting a Message with a Target address consist of:
388 • START or Repeated START condition
389 • Target address with read/write bit
390 • Acknowledge from Target
391 • Sub-address (INDEX) of a register inside the Target device (not used in Single Read from Current
392 Location)
393 • Transition bit (Parity bit) from Controller (not used in Single Read from Current Location)
394 And then either:
395 • For a write operation:
396 • Data byte from Controller
397 • Transition bit (Parity bit) from Controller
398 • STOP or Repeated START condition;
399 Or:
400 • For a read operation:
401 • Repeated START condition (not used in Single Read from Current Location)
402 • Target address with read bit (not used in Single Read from Current Location)
403 • Acknowledge from Target (not used in Single Read from Current Location)
404 • Data byte from Target
405 • Transition bit (End-of-Data) from Controller or Target
406 • STOP or Repeated START condition.
407 The Target address in CCI (I3C SDR) is 7 bits long.
408 CCI (I3C SDR) supports an 8-bit INDEX with 8-bit data, or a 16-bit INDEX with 8-bit data. The Target
409 device in question defines what Message type is used.
413 The INDEX in the Target device must be auto-incremented after each read/write operation. This is also
414 explained in the following sections.
CCI (I3C SDR) Single Read from Random Location with 8-bit index and 8-bit data with 7'h7E Address
INDEX, value M
CCI (I3C SDR) Single Read from Random Location with 8-bit index and 8-bit data without 7'h7E Address
INDEX, value M
CCI (I3C SDR) Single Read from Random Location with 16-bit index and 8-bit data with 7'h7E Address
INDEX, value M
CCI (I3C SDR) Single Read from Random Location with 16-bit index and 8-bit data without 7'h7E Address
INDEX, value M
CCI (I3C SDR) Single Read from Current Location with 7'h7E Address
CCI (I3C SDR) Single Read from Current Location without 7'h7E Address
S TARGET P S TARGET P
1 A DATA T 1 A DATA T
Sr ADDRESS Sr Sr ADDRESS Sr
CCI (I3C SDR) Sequential Read Starting from a Random Location with 8-bit index and 8-bit data with 7'h7E Address
Index Index
Previous Index value, K Index M
(M + L - 1) M+L
CCI (I3C SDR) Sequential Read Starting from a Random Location with 8-bit index and 8-bit data without 7'h7E Address
Index Index
Previous Index value, K Index M
(M + L - 1) M+L
CCI (I3C SDR) Sequential Read Starting from a Random Location with 16-bit index and 8-bit data with 7'h7E Address
Index Index
Previous Index value, K Index M
(M + L - 1) M+L
L bytes of data
INDEX, value M
CCI (I3C SDR) Sequential Read Starting from a Random Location with 16-bit index and 8-bit data without 7'h7E Address
Index Index
Previous Index value, K Index M
(M + L - 1) M+L
L bytes of data
INDEX, value M
From Target to Controller
S = START condition
From Controller to Target Sr = Repeated START condition
P = STOP condition
Transition Bit (Parity Bit for Write Data) A = Acknowledge
T = Transition Bit alternative to ACK/NACK
Transition Bit (End-of-Data for Read Data)
438
Figure 12 CCI (I3C SDR) Sequential Read Starting from Random Location
CCI (I3C SDR) Sequential Read Starting from the Current Location with 7'h7E Address
Index Index
Previous Index value, K
(K + L - 1) K+L
L bytes of data
CCI (I3C SDR) Sequential Read Starting from the Current Location without 7'h7E Address
Index Index
Previous Index value, K
(K + L-1) K+L
S TARGET P
1 A DATA T DATA T
Sr ADDRESS Sr
L bytes of data
CCI (I3C SDR) Single Write to a Random Location with 8-bit index and 8-bit data with 7'h7E Address
INDEX, value M
CCI (I3C SDR) Single Write to a Random Location with 8-bit index and 8-bit data without 7'h7E Address
INDEX, value M
CCI (I3C SDR) Single Write to a Random Location with 16-bit index and 8-bit data with 7'h7E Address
INDEX, value M
CCI (I3C SDR) Single Write to a Random Location with 16-bit index and 8-bit data without 7'h7E Address
INDEX, value M
6.2.1.2.6 CCI (I3C SDR) Sequential Write Starting from Random Location
447 The Sequential Write Starting from Random Location operation is illustrated in Figure 15. The Target auto-
448 increments the INDEX after each data byte is received. The Sequential Write Starting from Random Location
449 operation is terminated with a STOP or Repeated START condition from the Controller.
CCI (I3C SDR) Sequential Write Starting from a Random Location with 8-bit index and 8-bit data with 7'h7E Address
Index
Previous Index value, K Index M Index (M + L + 1)
M+L
CCI (I3C SDR) Sequential Write Starting from a Random Location with 8-bit index and 8-bit data without 7'h7E Address
Index
Previous Index value, K Index M Index (M + L + 1)
M+L
CCI (I3C SDR) Sequential Write Starting from a Random Location with 16-bit index and 8-bit data with 7'h7E Address
Index
Previous Index value, K Index M Index (M + L + 1)
M+L
CCI (I3C SDR) Sequential Write Starting from a Random Location with 16-bit index and 8-bit data without 7'h7E Address
Index
Previous Index value, K Index M Index (M + L + 1)
M+L
476 The INDEX in the Target device must be auto-incremented after each read/write operation. This is also
477 explained in the following sections.
491 Table 4 defines the I3C HDR-DDR Command Codes (including R/W bit) for each CCI (I3C DDR)
492 Read/Write operation.
493 For CCI (I3C DDR), the Target address is 7 bits long, and appears in bits[7:1] of the HDR-DDR Command
494 Word.
495 Table 4 CCI (I3C DDR) Read/Write Operation Command Codes
R/W Bit
and
Type Operation Command Code Position Command Section
Code
See Note 1
Write Sequential Write Command Word
0x00 6.2.2.2.4
Starting from Random Location
Read Sequential Read Command Word for
0x00
Starting from Random Location LENGTH & INDEX 6.2.2.2.2
Command Word for ReadData 0x80
Concatenated Sequential Read Command Word for
0x00
Starting from Random Location LENGTH & INDEX 6.2.2.2.3
Command Word for ReadData 0x80
Note:
1. In all five cases, the 7-bit Command Code in the low seven bits is 7’b0000000. Only the R/W bit,
which is the high bit of the byte, changes.
CCI (I3C DDR) Sequential Read Starting from a Random Location with 8-bit length and 8-bit index ( even byte read transfer)
Index Index Index Index Index
Previous Index value, K
M M+1 M+L-2 M+L-1 M+L
Command Word for Data Word for Command Word Data Word Data Word
CRC Word CRC Word
LENGTH & INDEX LENGTH & INDEX for ReadData for ReadData for ReadData
TARGET HDR
Preamble
Preamble
Preamble
Preamble
Preamble
Preamble
Preamble
ENTHDR DDR TARGET SUB DDR
HDR
Parity
Parity
Parity
Parity
Parity
Exit
setup
setup
LENGTH ADDRESS DATA DATA DATA DATA
Command ADDRESS ADDRESS 4'hC CRC5 Command 4'hC CRC5
HDR (Write) / 1'b0
[7:0]
[7:0] Restart (Read)
/ Read Parity 0 1 L-2 L-1 HDR
Adjustment
Restart Restart
LENGTH, INDEX,
L bytes of data
value L-1 value M
CCI (I3C DDR) Sequential Read Starting from a Random Location with 8-bit length and 8-bit index ( odd byte read transfer )
Index Index Index Index
Previous Index value, K
M M+1 M+L-1 M+L
Command Word for Data Word for Command Word Data Word Data Word
CRC Word CRC Word
LENGTH & INDEX LENGTH & INDEX for ReadData for ReadData for ReadData
TARGET HDR
Preamble
Preamble
Preamble
Preamble
Preamble
Preamble
Preamble
ENTHDR DDR TARGET SUB DDR padding
HDR
Parity
Parity
Parity
Parity
Parity
Exit
setup
setup
LENGTH ADDRESS DATA DATA DATA
Command ADDRESS ADDRESS 4'hC CRC5 Command byte 4'hC CRC5
HDR (Write) / 1'b0
[7:0]
[7:0] Restart (Read)
/ Read Parity 0 1 L-1
0x00 HDR
Adjustment
Restart Restart
LENGTH, INDEX,
L bytes of data
value L-1 value M
CCI (I3C DDR) Sequential Read Starting from a Random Location with 16-bit length and 16-bit index ( even byte read transfer)
Index Index Index Index Index
Previous Index value, K
M M+1 M+L-2 M+L-1 M+L
Command Word for Data Word for Data Word for Command Word Data Word Data Word
CRC Word CRC Word
LENGTH & INDEX LENGTH INDEX for ReadData for ReadData for ReadData
TARGET HDR
Preamble
Preamble
Preamble
Preamble
Preamble
Preamble
Preamble
Preamble
ENTHDR DDR TARGET SUB SUB DDR
HDR
Parity
Parity
Parity
Parity
Parity
Parity
Exit
setup
setup
LENGTH LENGTH ADDRESS DATA DATA DATA DATA
Command ADDRESS ADDRESS ADDRESS 4'hC CRC5 Command 4'hC CRC5
HDR (Write) / 1'b0
[15:8] [7:0]
[15:8] [7:0] Restart (Read)
/ Read Parity 0 1 L-2 L-1 HDR
Adjustment
Restart Restart
LENGTH, INDEX,
L bytes of data
value L-1 value M
CCI (I3C DDR) Sequential Read Starting from a Random Location with 16-bit length and 16-bit index ( odd byte read transfer )
Index Index Index Index
Previous Index value, K
M M+1 M+L-1 M+L
Command Word for Data Word for Data Word for Command Word Data Word Data Word
CRC Word CRC Word
LENGTH & INDEX LENGTH INDEX for ReadData for ReadData for ReadData
TARGET HDR
Preamble
Preamble
Preamble
Preamble
Preamble
Preamble
Preamble
Preamble
Parity
Parity
Parity
Parity
Parity
Exit
setup
setup
LENGTH LENGTH ADDRESS DATA DATA DATA
Command ADDRESS ADDRESS ADDRESS 4'hC CRC5 Command byte 4'hC CRC5
HDR (Write) / 1'b0
[15:8] [7:0]
[15:8] [7:0] Restart (Read)
/ Read Parity 0 1 L-1
0x00 HDR
Adjustment
Restart Restart
LENGTH, INDEX,
L bytes of data
value L-1 value M
6.2.2.2.3 CCI (I3C DDR) Concatenated Sequential Read from Random Location
516 When the Controller desires to read data longer than the Target’s I3C Max Read Length (MRL) [MIPI03],
517 the Controller can divide the data into multiple units, and efficiently read the data using the Concatenated
518 Sequential Read from Random Location operation (Figure 18 and Figure 19). The Controller shall divide
519 the data into multiple units, where all units except the last unit shall use the MRL size, and the last unit shall
520 use a size less than or equal to the MRL. The MRL size is programmable.
521 In a Concatenated Sequential Read Starting from Random Location:
522 • The Controller shall first transmit the total LENGTH for the data to be read.
523 • The Controller shall use multiple read Messages. The Target shall transmit the initial read
524 Messages to the Controller using the programmed MRL data bytes. And the Target may use no
525 more than the programmed MRL data bytes to transfer the last Message.
526 • If the full amount of requested data has not been received yet, then the Controller shall transmit
527 another read Message, but without LENGTH and INDEX.
528 • After receiving the read Message without LENGTH and INDEX, the Target shall continue
529 transmission of the read data to the Controller, resuming from the previous LENGTH and
530 INDEX.
531 The Controller shall continue to transmit read Messages without LENGTH and INDEX multiple times, until
532 the last data is received.
533 Note:
534 When selecting a suitable value for MRL, the designer of the Target device and the system designer
535 should take into account the needs of the payload that the CCI will carry. For example, in the CCS
536 Data Transfer Interface [MIPI04], it is beneficial to support an MRL of 64 bytes or larger (i.e. 64 bytes
537 for Data payload).
CCI (I3C DDR) Concatenated Sequential Read Starting from a Random Location with 8-bit length and 8-bit index
Index
Previous Index value, K
M
Preamble
Preamble
Preamble
ENTHDR DDR TARGET SUB
HDR
Parity
Parity
setup
LENGTH
Command ADDRESS ADDRESS 4'hC CRC5
HDR (Write) / 1'b0
[7:0]
[7:0] Restart
Restart
LENGTH, INDEX,
value L-1 value M
Preamble
Preamble
Preamble
HDR DDR
HDR
Parity
Parity
Parity
setup
ADDRESS DATA DATA DATA DATA
Command 4'hC CRC5
Restart / Read Parity 0 1 X-2 X-1 Restart
(Read)
Adjustment
X bytes of data
Preamble
Preamble
Preamble
HDR DDR HDR
Parity
Parity
Parity
setup
ADDRESS DATA DATA DATA DATA
Command
/ Read Parity X X+1 X+Y-2 X+Y-1
4'hC CRC5 X+Y+Z
Restart (Read) Restart
Adjustment =L
Y bytes of data
Preamble
Preamble
Preamble
Parity
Parity
Exit
setup
Z bytes of data
CCI (I3C DDR) Concatenated Sequential Read Starting from a Random Location with 16-bit length and 16-bit index
Index
Previous Index value, K
M
Preamble
Preamble
Preamble
Preamble
ENTHDR DDR TARGET SUB SUB
HDR
Parity
Parity
Parity
setup
LENGTH LENGTH
Command ADDRESS ADDRESS ADDRESS 4'hC CRC5
HDR (Write) / 1'b0
[15:8] [7:0]
[15:8] [7:0] Restart
Restart
LENGTH, INDEX,
value L-1 value M
Preamble
Preamble
Preamble
DDR
HDR HDR
Parity
Parity
Parity
setup
ADDRESS DATA DATA DATA DATA
Command 4'hC CRC5
Restart / Read Parity 0 1 X-2 X-1 Restart
(Read)
Adjustment
X bytes of data
Preamble
Preamble
Preamble
DDR
HDR HDR
Parity
Parity
Parity
setup
ADDRESS DATA DATA DATA DATA
Command
/ Read Parity X X+1 X+Y-2 X+Y-1
4'hC CRC5 X+Y+Z
Restart (Read) Restart
Adjustment =L
Y bytes of data
Preamble
Preamble
Preamble
DDR padding
HDR
Parity
Parity
Parity
Exit
setup
Z bytes of data
6.2.2.2.4 CCI (I3C DDR) Sequential Write Starting from Random Location
540 In a Sequential Write Starting from Random Location (Figure 20), the Controller shall transmit:
541 • The HDR-DDR Command Word
542 • The HDR-DDR Data Word including LENGTH and INDEX
543 • One or more HDR-DDR Write Data Words, and
544 • The HDR-DDR CRC Word.
545 If the number of 8-bit data words written is odd (i.e. the value in the LENGTH field is even), then the
546 Controller shall insert one padding byte in the second byte of the last data word, with value 8’h00. When the
547 Target receives the Sub Address, the Target loads it into the INDEX and auto-increments the INDEX after
548 each data byte is received.
549 The Target can identify the padding byte from the value of the LENGTH field and the number of 8-bit data
550 words received, and shall ignore the padding byte. Note that the INDEX is not incremented by the padding
551 byte.
552 In a Sequential Write Starting from Random Location, the value of LENGTH shall be set such that the
553 Controller does not exceed the maximum data byte length limit defined by the Target’s I3C Max Write Length
554 (MWL) [MIPI03]. Note that the total number of bytes of “Data Word for INDEX”, “Data Word for
555 LENGTH”, and “Data Word for Write Data” shall not exceed MWL.
Example
556 For a Target with MWL of 8 bytes, using 16-bit INDEX (so “Data Word for INDEX” is 2 bytes)
557 and 16-bit LENGTH (so “Data Word for LENGTH” is 2 bytes), the maximum number of “Data
558 Word for Write Data” is 8 – (2 + 2) bytes = 4 bytes. Since the LENGTH field is zero-based, it
559 would contain the value 3 (16’d3).
560 The Target cannot terminate the DDR Write Message, and shall receive all HDR-DDR Write Data sent by
561 the Controller.
562 Note:
563 When selecting a suitable value for MWL, the designer of the Target device and the system designer
564 should take into account the needs of the payload that the CCI will carry. For example, in the CCS
565 Data Transfer Interface [MIPI04], it is beneficial to support an MWL of 68 bytes or larger (i.e. 64 bytes
566 for Data payload + 2 bytes for a Data Word for INDEX + 2 bytes for a Data Word for LENGTH).
CCI (I3C DDR) Sequential Write to a Random Location with 8-bit length and 8-bit index ( even byte write transfer)
Index Index Index Index Index
Previous Index value, K
M M+1 M+L-2 M+L-1 M+L
Preamble
Preamble
Preamble
Preamble
Preamble
ENTHDR DDR TARGET SUB
Parity
Parity
Parity
Parity
Exit
setup
LENGTH DATA DATA DATA DATA
Command ADDRESS ADDRESS 4'hC CRC5
HDR (Write) / 1'b0
[7:0]
[7:0]
0 1 L-2 L-1 HDR
Restart Restart
LENGTH, INDEX,
L bytes of data
value L-1 value M
Data Word for LENGTH + Data Word for INDEX + Data Word for Write Data MWL
CCI (I3C DDR) Sequential Write to a Random Location with 8-bit length and 8-bit index ( odd write byte transfer )
Index Index Index Index
Previous Index value, K
M M+1 M+L-1 M+L
Preamble
Preamble
Preamble
Preamble
Preamble
Parity
Parity
Parity
Exit
setup
LENGTH DATA DATA DATA
Command ADDRESS ADDRESS byte 4'hC CRC5
HDR (Write) / 1'b0
[7:0]
[7:0]
0 1 L-1
0x00 HDR
Restart Restart
LENGTH, INDEX,
L bytes of data
value L-1 value M
Data Word for LENGTH + Data Word for INDEX + Data Word for Write Data MWL
CCI (I3C DDR) Sequential Write to a Random Location with 16-bit length and 16-bit index ( even byte write transfer)
Index Index Index Index Index
Previous Index value, K
M M+1 M+L-2 M+L-1 M+L
Preamble
Preamble
Preamble
Preamble
Preamble
Parity
Parity
Parity
Parity
Exit
setup
LENGTH LENGTH DATA DATA DATA DATA
Command ADDRESS ADDRESS ADDRESS 4'hC CRC5
HDR (Write) / 1'b0
[15:8] [7:0]
[15:8] [7:0]
0 1 L-2 L-1 HDR
Restart Restart
LENGTH, INDEX,
L bytes of data
value L-1 value M
Data Word for LENGTH + Data Word for INDEX + Data Word for Write Data MWL
CCI (I3C DDR) Sequential Write to a Random Location with 16-bit length and 16-bit index ( odd write byte transfer )
Index Index Index Index
Previous Index value, K
M M+1 M+L-1 M+L
Preamble
Preamble
Preamble
Preamble
Preamble
Parity
Parity
Parity
Parity
Exit
setup
LENGTH, INDEX,
L bytes of data
value L-1 value M
Data Word for LENGTH + Data Word for INDEX + Data Word for Write Data MWL
6.3.1.1 Error Detection and Recovery Method for CCI (I3C SDR) Target Devices
573 The SS0 error summarized in Table 5 shall be supported for all CCI (I3C SDR) Target Devices. If the CCI
574 Target detects the SS0 error, the CCI Target shall set to 1’b1 in Protocol Error Flag of GETSTATUS. Details
575 of the SS0 error are described in Section 6.3.1.1.2.
576 Table 5 CCI (I3C SDR) Target Error Types
Error
Description Error Detection Method Error Recovery Method
Type
SS0 Read without INDEX Error Detect an error if the Target Enable STOP or Repeated
receives the Target’s Dynamic START detector and neglect
Address (except 7’h7E) with a other patterns.
Read (R/W bit is 1) correctly
but it does not have the INDEX.
NACK
received data until Sr or P
6.3.2.1 Error Detection and Recovery Method for CCI (I3C DDR) Target Devices
610 The two Error Types summarized in Table 6 shall be supported for all CCI (I3C DDR) Target Devices. Each
611 Error Type is further explained below the table. If the Target detects an SD0 or SD1 error, the Target shall set
612 the Protocol Error Flag in GETSTATUS (defined in the I3C specification) to 1’b1. Details of the SD0 and
613 SD1 errors are described in Section 6.3.2.1.2 and Section 6.3.2.1.3, respectively.
614 Table 6 CCI (I3C DDR) Target Error Types
Error
Description Error Detection Method Error Recovery Method
Type
SD0 Read without INDEX Error Detect an error if the Target Enable HDR Exit or HDR
receives the DDR command Restart detector and neglect
Word[15] = 1 (Read) correctly, but other patterns
it does not have the INDEX
SD1 Write over LENGTH Error Detect an error if the value of Clear INDEX value. Enable
Preamble following LENGTH +1 HDR Exit or HDR Restart
bytes of the Write Data is 2'b11 detector and neglect other
patterns
629
Command Word for Data Word for Command Word Command Word for
CRC Word
LENGTH & INDEX LENGTH & INDEX for ReadData LENGTH & INDEX
TARGET
Preamble
Preamble
Preamble
Preamble
Preamble
Preamble
ENTHDR DDR TARGET SUB DDR DDR TARGET
HDR HDR
Parity
Parity
Parity
Parity
setup
LENGTH ADDRESS 19 SCL
Command ADDRESS ADDRESS 4'hC CRC5 Command Command ADDRESS
HDR (Write) / 1'b0
[7:0]
[7:0] Restart (Read)
/ Read Parity clock Restart (Write) / 1'b0
Adjustment
Restart
NACK
value L-1 value M HDR Restart
I3C
Target Normal Parity Error Normal
Status
The I3C Target neglects all received
data until HDR Restart or HDR Exit
The CCI Target clears
CCI the value of INDEX
Target Previous Index value, K No INDEX
INDEX Recovered by
Read w/o INDEX HDR Restart or HDR Exit
CCI
Target Normal SD0 Error Normal
Status
The CCI Target neglects all received
data until HDR Restart or HDR Exit
From Controller to Target From Target to Controller
630
Figure 22 Example of SD0 Error Detection
CCI (I3C DDR) Sequential Write to a Random Location with 8-bit length and 8-bit index
Data Word for Data Word Data Word Data Word
Command Word CRC Word
LENGTH & INDEX for WriteData for WriteData for WriteData
HDR
Preamble
Preamble
Preamble
Preamble
Preamble
Preamble
ENTHDR DDR TARGET Parity SUB
Parity
Parity
Parity
Parity
Exit
setup
LENGTH DATA DATA DATA DATA DATA DATA
Command ADDRESS ADDRESS 4'hC CRC5
HDR (Write) / 1'b0
[7:0]
[7:0]
0 1 L-2 L-1 L L+1 HDR
Restart Restart
6.3.2.2 Error Detection and Recovery Method for CCI (I3C DDR) Controller Devices
638 The MD0 Error Type summarized in Table 7 may be supported for all CCI (I3C DDR) Controller Devices.
639 Each Error Type is further explained below Table 7. Details of MD0 error are described in Section 6.3.2.2.1.
640 Table 7 CCI (I3C DDR) Controller Error Type
Error
Description Error Detection Method Error Recovery Method
Type
MD0 Read over LENGTH Error Detect an error if the value of Send Controller Abort and then
(optional) Preamble[1] following LENGTH +1 HDR Exit or HDR Restart
bytes of the Read Data is 1'b1
CCI (I3C DDR) Sequential Read Starting from a Random Location with 8-bit length and 8-bit index
Command Word for Data Word for Command Word Data Word Data Word
CRC Word
LENGTH & INDEX LENGTH & INDEX for ReadData for ReadData for ReadData
HDR
Preamble[1]
Preamble[0]
TARGET
Preamble
Preamble
Preamble
Preamble
Preamble
Preamble
ENTHDR DDR TARGET SUB DDR
HDR
Parity
Parity
Parity
Parity
Parity
Exit
setup
LENGTH ADDRESS DATA DATA DATA DATA
Command ADDRESS ADDRESS 4'hC CRC5 Command
LENGTH, INDEX,
L bytes of data
Controller Abort
value L-1 value M
Recovered by
I3C
Controller Normal
Status
6.3.3 Error Detection and Recovery for CCI (I3C) Controller Devices
648 In many cases, the Controller can detect an error inside the Target by receiving NACK. However, for example
649 in case of an S2 or S6 error in the CCI (I3C SDR) Write Operations, the Controller cannot detect it by
650 receiving NACK because there is no chance for the Target to send NACK by the end of the operation (STOP
651 or Repeated START). Therefore if high reliability is required, the Controller may transmit GETSTATUS
652 (defined in the I3C specification) at each important point.
653 Note:
654 E.g., the important point is that after critical CCI (I3C SDR) Write Operations, after CCI (I3C SDR)
655 Write Operations before moving to CCI (I3C DDR), after multiple CCI (I3C SDR) Read/Write
656 Operations before long pause if the last message is CCI (I3C SDR) Write Operations.
657 As a result, the Controller can detect each error by the following methods:
658 1. Target’s error by receiving NACK
659 2. Target’s error during CCI (I3C SDR) or CCI (I3C DDR) Write Operations by sending
660 GETSTATUS
661 3. Controller’s I3C SDR Error defined in the I3C specification (M0, M1 or M2 error)
662 4. Controller’s I3C DDR Error defined in the I3C specification (including the Controller sending
663 HDR Exit or HDR Restart pattern)
664 After detecting an error, the Controller should try the following error recovery method:
665 1. The Controller may retry sending the same CCI (I3C SDR) Read/Write Operations or CCI (I3C
666 DDR) Read/Write Operations again.
667 2. The Controller may send certain other CCI (I3C SDR) Read/Write Operations or CCI (I3C DDR)
668 Read/Write Operations, except CCI (I3C SDR) Single/Sequential Read From Current Location
669 because the Target would generate NACK again due to an SS0 or SD0 error.
670 In addition to, or instead of, a retry, the Controller may read GETSTATUS, or try Escalation Handling as
671 defined in the I3C specification.
6.6.1 Overview
676 Peripherals contain a wide range of different register widths for various control and setup purposes. This
677 Specification supports the following register widths:
678 • 8-bit: Generic setup registers
679 • 16-bit: Parameters like line length, frame length, and exposure values
680 • 32-bit: High precision setup values
681 • 64-bit: For needs of future sensors
682 In general, the byte-oriented access protocols described in the previous sections provide an efficient means
683 to access multi-byte registers. However, the registers should reside in a byte-oriented address space, and the
684 address of a multi-byte register should be the address of its first byte. Thus, addresses of contiguous multi-
685 byte registers will not be contiguous. For example, a 32-bit register with its first byte at address 0x8000 can
686 be read by means of a sequential read of four bytes, starting at random address 0x8000. If there is an additional
687 4-byte register with its first byte at 0x8004, then it could then be accessed using a four-byte Sequential Read
688 from the Current Location protocol.
689 The motivation for a generalized multi-byte protocol (rather than fixing register widths at 16 bits) is
690 flexibility. The protocol described below provides a way of transferring 16-bit, 32-bit, or 64-bit values over
691 a 16-bit INDEX, 8-bit data, two-wire serial link while ensuring that the bytes of data transferred for a multi-
692 byte register value are always consistent (temporally coherent).
693 Using this protocol, a single CCI Message can contain one, two, or all of the different register widths used
694 within a device.
695 The MS byte of a multi-byte register shall be located at the lowest address, and the LS byte shall be located
696 at the highest address.
697 The address of the first byte of a multi-byte register is not necessarily related to register size (i.e., not required
698 to be an integer multiple of register size in bytes). Register address alignment represents an implementation
699 choice between processing-optimized vs. bandwidth-optimized organizations. There are no restrictions on
700 the number or mix of multi-byte registers within the available 64K by 8-bit INDEX space, with the exception
701 of certain rules for the valid locations for the MS bytes and LS bytes of registers.
702 Partial access to multi-byte registers is not allowed. A multi-byte register shall only be accessed by a single
703 sequential Message. When a multi-byte register is accessed, its bytes shall be accessed in ascending address
704 order (i.e. first byte is accessed first, second byte is accessed second, etc.).
705 When a multi-byte register is accessed, the following re-timing rules shall be followed:
706 • For a Write operation, the updating of the register shall be deferred to a time when the last bit of
707 the last byte has been received.
708 • For a Read operation, the value read shall reflect the status of all bytes at the time that the first bit
709 of the first byte was read.
710 Section 6.6.3 describes example re-timing behavior for multi-byte register accesses.
711 Figure 25 and Figure 26 illustrate that without re-timing, data could be corrupted.
TARGET
S 1 A DATA = 0xFC A DATA=0xFD A DATA=0x03 A DATA=0x04 A P
ADDRESS
MS Data Byte LS Data Byte
DATA[31:0]
Internal logic
reads register
value
(For example
Register Index only)
TARGET
S 0 A DATA=0x01 A DATA=0x02 A DATA=0x03 A DATA=0x04 A P
ADDRESS
MS Data Byte LS Data Byte
DATA[31:0]
DATA[15:0]
TARGET SUB
S 0 A A DATA[15:8] A DATA[7:0] A P
ADDRESS ADDRESS
Index Value,
MS Data Byte LS Data Byte
M
Index M Index M+1
717
Figure 27 Example 16-bit Register Write
Register Index
Index M Index M+1 Index M+2 Index M+3
A/
A DATA A DATA A DATA A DATA
A
DATA[31:0]
MS Data Byte LS Data Byte
718
Figure 28 Example 32-bit Register Write (Address Not Shown)
Register Index
Index M Index M+1 Index M+6 Index M+7
A/
A DATA A DATA A A DATA A DATA
A
DATA[63:0]
MS Data Byte LS Data Byte
719
Figure 29 Example 64-bit Register Write (Address Not Shown)
Temporary Buffer
0x00 00 0xFC FD 0x03 04
A read from MS byte of the register Incremental read within the same
causes the whole register value to multi-byte register.
be transferred into a temporary Temporary Buffer not updated
buffer
TARGET
S 1 A DATA = 0xFC A DATA=0xFD A DATA=0x03 A DATA=0x04 A P
ADDRESS
MS Data Byte LS Data Byte MS Data Byte LS Data Byte
DATA[15:0] DATA[15:0]
729 In this definition no distinction is made between a register being accessed incrementally via multiple separate
730 single-byte read Messages with no intervening data writes, vs. a register being accessed via a single multi-
731 location read Message. This protocol purely relates to the behavior of the INDEX value.
Temporary Buffer
0x00 00 00 00 0xFC FD FE FF
A read from MS byte of the register Incremental read within the same
causes the whole register value to multi-byte register.
be transferred into a temporary Temporary Buffer not updated
buffer
TARGET
S 1 A DATA = 0xFC A DATA=0xFD A DATA=0xFE A DATA=0xFF A P
ADDRESS
MS Data Byte LS Data Byte
DATA[31:0]
Register Index
Index M Index M+1 Index M+2 Index M+3
Temporary Buffer
0x00 00 0x01 00 0x00 00 0x03 00 0x00 00
TARGET
S 0 A DATA=0x01 A DATA=0x02 A DATA=0x03 A DATA=0x04 A P
ADDRESS
MS Data Byte LS Data Byte MS Data Byte LS Data Byte
DATA[15:0] DATA[15:0]
Register Index
Index M Index M+1 Index M+2 Index M+3
Temporary Buffer
0x00 00 00 00 0x01 00 00 00 0x01 02 00 00 0x01 02 03 00 0x00 00 00 00
TARGET
S 0 A DATA=0x01 A DATA=0x02 A DATA=0x03 A DATA=0x04 A P
ADDRESS
MS Data Byte LS Data Byte
DATA[31:0]
Note:
1. Maximum VIH = VDDmax + 0.5V
2. I/O pins of Fast-mode and Fast-mode Plus devices shall not obstruct the SDA and SCL line if V DD
is switched off
Note:
1. All values referred to VIHmin = 0.7VDD and VILmax = 0.3VDD
2. A device shall internally provide a hold time of at least 300 ns for the SDA signal (referred to the
VIHmin of the SCL signal) to bridge the undefined region of the falling edge of SCL
3. The maximum tHD;DAT could be 0.9 µs and 0.45 µs for Fast-mode and Fast-mode Plus, but must be
less than the maximum of tVD;DAT or tVD;ACK by a transition time. This maximum must only be met if
the device does not stretch the LOW period (tLOW) of the SCL signal. If the clock stretches the SCL,
then the data must be valid by the set-up time before it releases the clock.
4. A Fast-mode I2C-bus device can be used in a Standard-mode I2C-bus system, but the requirement
tSU:DAT ≥ 250 ns shall be then met. This will be automatically the case if the device does not stretch
the LOW period of the SCL signal. If such device does stretch the low period of SCL signal, it shall
output the next data bit to the SDA line trMAX + tSU:DAT = 1000 + 250 = 1250 ns (according to the
Standard-mode I2C Bus specification [NXP01]) before the SCL line is released.
5. tVD;DAT = time for data signal from SCL LOW to SDA output (HIGH or LOW, whichever is worse).
6. tVD;ACK = time for Acknowledgement signal from SCL LOW to SDA output (HIGH or LOW, whichever
is worse)
SDA
tR
tF
tSU;STA
tSU;DAT tVD;ACK tSU;STO
tHD;DAT tHD;STA
SCL
tHIGH
tHD;STA
tSP
754
Figure 34 CCI I/O Timing
7 Physical Layer
755 The CSI-2 specification shall always be used in combination with one or more MIPI physical layer
756 specifications, such as A-PHY [MIPI06], C-PHY [MIPI02], or D-PHY [MIPI01]. The CSI-2 specification
757 shall not be used in combination with non-MIPI physical layers, unless expressly authorized by the MIPI
758 Alliance Board of Directors. Any other use of the CSI-2 specification is strictly prohibited unless approved
759 in advance by the MIPI Alliance Board of Directors.
760 Note:
761 In this specification version, D-PHY “CIL-Mxxx” Lane type descriptors have been replaced with
762 “CIL-Pxxx” in anticipation of them being similarly updated in a forthcoming D-PHY specification.
796 interface channels, and is also central to the CSI-2 Unified Serial Link (USL) feature described in
797 Section 9.12. USL D-PHY support requirements are described in Section 7.3.1.
7.3 PHY Support for the CSI-2 Unified Serial Link (USL) Feature
815 The CSI-2 USL feature, as described in Section 9.12, requires the D-PHY and C-PHY physical layers to
816 support bidirectional data communications on Lane 1 plus additional features as described below in
817 Section 7.3.1 and Section 7.3.2, respectively. In case of any conflict between this Section 7.3 and Section 7.1
818 or Section 7.2, this section takes precedence. The physical layers of all USL implementations shall support
819 PHY LP and/or LVLP Mode signaling and should support ALP Mode signaling.
•••• ••••
Byte 5 Byte 5
Byte 4 Byte 4
Byte Stream
Byte 3 (Conceptual) Byte 3
Byte 2 Byte 2
Byte 1 Byte 1
Byte 0 Byte 0
Byte 3
899
Single Lane
Link N Lane Link
Byte 1
LMF ••••
Byte 5 Byte 5
Byte 4 Byte 4
Byte Stream
Byte 3 (Conceptual) Byte 3
Byte 2 Byte 2
Byte 1 Byte 1
Byte 0 Byte 0
900
Figure 37 Conceptual Overview of the Lane Merging Function for D-PHY
•••
LMF ••••
Byte 5 Byte 5
Byte 2 Byte 2
Byte 1 Byte 1
Byte 0 Byte 0
901
Figure 38 Conceptual Overview of the Lane Merging Function for C-PHY
902 The Lane distributor takes a transmission of arbitrary byte length, buffers up N*b bytes (where N = number
903 of Lanes and b = 1 or 2 for the D-PHY or C-PHY physical layer option, respectively), and then sends groups
904 of N*b bytes in parallel across N Lanes with each Lane receiving b bytes. Before sending data, all Lanes
905 perform the SoT sequence in parallel to indicate to their corresponding receiving units that the first byte of a
906 packet is beginning. After SoT, the Lanes send groups of successive bytes from the first packet in parallel,
907 following a round-robin process.
LANE 1: SoT Byte 0 Byte 2 Byte 4 Byte B-6 Byte B-4 Byte B-2 EoT
LANE 2: SoT Byte 1 Byte 3 Byte 5 Byte B-5 Byte B-3 Byte B-1 EoT
LANE 1: SoT Byte 0 Byte 2 Byte 4 Byte B-5 Byte B-3 Byte B-1 EoT
LANE 2: SoT Byte 1 Byte 3 Byte 5 Byte B-4 Byte B-2 EoT LPS
KEY:
LPS – Low Power State SoT – Start of Transmission EoT – End of Transmission
930
Figure 39 Two Lane Multi-Lane Example for D-PHY
LANE 1: SoT Byte 0 Byte 3 Byte 6 Byte B-9 Byte B-6 Byte B-3 EoT
LANE 2: SoT Byte 1 Byte 4 Byte 7 Byte B-8 Byte B-5 Byte B-2 EoT
LANE 3: SoT Byte 2 Byte 5 Byte 8 Byte B-7 Byte B-4 Byte B-1 EoT
Number of Bytes, B, transmitted is NOT an integer multiple of the number of lanes (Example 1):
LANE 1: SoT Byte 0 Byte 3 Byte 6 Byte B-7 Byte B-4 Byte B-1 EoT
LANE 2: SoT Byte 1 Byte 4 Byte 7 Byte B-6 Byte B-3 EoT LPS
LANE 3: SoT Byte 2 Byte 5 Byte 8 Byte B-5 Byte B-2 EoT LPS
Number of Bytes, B, transmitted is NOT an integer multiple of the number of lanes (Example 2):
LANE 1: SoT Byte 0 Byte 3 Byte 6 Byte B-8 Byte B-5 Byte B-2 EoT
LANE 2: SoT Byte 1 Byte 4 Byte 7 Byte B-7 Byte B-4 Byte B-1 EoT
LANE 3: SoT Byte 2 Byte 5 Byte 8 Byte B-6 Byte B-3 EoT LPS
KEY:
LPS – Low Power State SoT – Start of Transmission EoT – End of Transmission
931
Figure 40 Three Lane Multi-Lane Example for D-PHY
LANE 2: SoT Byte 1 Byte N+1 Byte B-2N+1 Byte B-N+1 EoT
•••
•••
•••
•••
•••
LANE N-1: SoT Byte N-2 Byte 2N-2 Byte B-N-2 Byte B-2 EoT
LANE N: SoT Byte N-1 Byte 2N-1 Byte B-N-1 Byte B-1 EoT
•••
•••
•••
•••
LANE K: SoT Byte K-1 Byte N+K-1 Byte B-N-1 Byte B-1 EoT
LANE K+1: SoT Byte K Byte N+K Byte B-N EoT LPS
•••
•••
•••
•••
•••
LANE N: SoT Byte N-1 Byte 2N-1 Byte B-K-1 EoT LPS
KEY:
932
LPS – Low Power State SoT – Start of Transmission EoT – End of Transmission
Figure 41 N-Lane Multi-Lane Example for D-PHY
•••
LANE 4: SoT Byte 3 EoT LPS
LANE 5: LPS
KEY:
933
LPS – Low Power State SoT – Start of Transmission EoT – End of Transmission
Figure 42 N-Lane Multi-Lane Example for D-PHY Short Packet Transmission
KEY:
958
LPS – Low Power State SoT – Start of Transmission EoT – End of Transmission
Figure 43 Two Lane Multi-Lane Example for C-PHY
KEY:
959
LPS – Low Power State SoT – Start of Transmission EoT – End of Transmission
Figure 44 Three Lane Multi-Lane Example for C-PHY
Bytes 2N+3: Bytes 4N+3: Bytes B-6N+3: Bytes B-4N+3: Bytes B-2N+3:
LANE 2: SoT Bytes 3:2
2N+2 4N+2 B-6N+2 B-4N+2 B-2N+2
EoT
•••
•••
•••
•••
•••
•••
Bytes 2N-3: Bytes 4N-3: Bytes 6N-3: Bytes B-4N-3: Bytes B-2N-3: Bytes B-3:
LANE N-1: SoT 2N-4 4N-4 6N-4 B-4N-4 B-2N-4 B-4
EoT
Bytes 2N-1: Bytes 4N-1: Bytes 6N-1: Bytes B-4N-1: Bytes B-2N-1: Bytes B-1:
LANE N: SoT 2N-2 4N-2 6N-2 B-4N-2 B-2N-2 B-2
EoT
KEY:
960
LPS – Low Power State SoT – Start of Transmission EoT – End of Transmission
Figure 45 General N-Lane Multi-Lane Distribution for C-PHY
1 lane N lane
Transmitter PHY Receiver PHY
Lane Distribution Function
•••
•••
8-bit SerDes Lane 1 SerDes 8-bit
M lane N lane
Transmitter PHY Receiver PHY
SerDes 8-bit
Lane Distribution Function
•••
•••
•••
•••
•••
•••
•••
•••
M lane 1 lane
Transmitter PHY Receiver PHY
Lane Distribution Function
•••
•••
•••
8-bit SerDes Lane 1 SerDes 8-bit
M lane N lane
Transmitter PHY Receiver PHY
8-bit SerDes
Lane Distribution Function
•••
•••
•••
•••
•••
•••
•••
•••
8-bit SerDes Lane 1 SerDes 8-bit
Serial
PPI
Data
C-PHY C-PHY CSI Receiver
Transmitter Receiver
Clk RxDataHS_2[15:0]
Lane
Lane 0
2
Elast Merging Internal
Data
Decoder
RxWordClkHS_2 Store Function Logic
•••
983
Figure 50 Example of Digital Logic to Align All RxDataHS
DATA:
Short Long Long Short
Packet Packet Packet Packet
KEY:
LPS – Low Power State PH – Packet Header
ET – End of Transmission PF – Packet Footer + Filler (if applicable)
996
ST – Start of Transmission
Figure 51 Low Level Protocol Packet Overview
6-bit Error Correction Code (ECC) + 2-bit Virtual Channel Extension (VCX):
ECC (bits 5:0) enables 1-bit errors within the packet header to be corrected and 2-bit errors
to be detected. VCX (bits 7:6) is the most significant two bits of the 4-bit Virtual Channel
Identifier for the D-PHY physical layer option.
Data WC-3
Data WC-2
Data WC-4
Data WC-1
Checksum
Data ID
Data 0
Data 3
Data 1
Data 2
16-Bit
16-bit
1011 Figure 53 shows the Long Packet structure for the C-PHY physical layer option; it shall consist of four
1012 elements: a Packet Header (PH), an application specific Data Payload with a variable number of 8-bit data
1013 words, a 16-bit Packet Footer (PF), and zero or more Filler bytes (FILLER). The Packet Header is 6N x 16-
1014 bits long, where N is the number of C-PHY physical layer Lanes. As shown in Figure 53, the Packet Header
1015 consists of two identical 6N-byte halves, where each half consists of N sequential copies of each of the
1016 following fields: a 16-bit field containing five Reserved bits, a 3-bit Virtual Channel Extension (VCX) field,
1017 and the 8-bit Data Identifier (DI); the 16-bit Packet Data Word Count (WC); and a 16-bit Packet Header
1018 checksum (PH-CRC) which is computed over the previous four bytes. The value of each Reserved bit shall
1019 be zero. The Packet Footer consists of a 16-bit checksum (CRC) computed over the Packet Data using the
1020 same CRC polynomial as the Packet Header CRC and the Packet Footer used in the D-PHY physical layer
1021 option. Packet Filler bytes are inserted after the Packet Footer, if needed, to ensure that the Packet Footer
1022 ends on a 16-bit word boundary and that each C-PHY physical layer Lane transports the same number of 16-
1023 bit words (i.e. byte pairs).
5-bit Reserved Field (RES) + 3-bit Virtual Channel Extension (VCX) field:
RES (bits 7:3) is set to zero and reserved for future use.
VCX (bits 2:0) is the most significant three bits of the 5-bit Virtual Channel Identifier for the C-PHY physical layer option.
8-bit DATA IDENTIFIER (DI):
Contains the 2-bit Virtual Channel (VC) and the 6-bit Data Type (DT) Information.
VC (bits 7:6) is the least significant two bits of the 5-bit Virtual Channel Identifier for the C-PHY physical layer option. DT
(bits 5:0) denotes the format/content of the Application Specific Payload Data. Used by the application specific layer.
16-bit WORD COUNT (WC):
The receiver reads the next WC 8-bit data words following the Packet Header.
The receiver uses the WC value to determine the end of the Packet Payload.
16-bit Cyclic Redundancy Check Code (PH-CRC):
16-bit CRC code for the Packet Header; computed over the
Reserved, Data ID, and Word Count fields (4 bytes). Enables
multi-bit errors to be detected. 16-Bit Packet Data CRC:
Computed over WC
CSI-2 Insert Sync Word PPI Command: Packet Data Words
The physical layer simultaneously inserts an Sync Word on all N
Lanes at this point as a result of executing a CSI-2 PPI command. Set to Set to
0 0
WC PH-CRC APPLICATION SPECIFIC PAYLOAD
PH Checksum
PD Checksum
PH Checksum
Word Count
RES + VCX
Word Count
RES + VCX
Data WC-4
Data WC-3
Data WC-2
Data WC-1
(l.s. byte first)
Filler FC-1
Data ID
Data ID
Filler 0
Data 0
Data 1
Data 2
Data 3
16-Bit
16-Bit
16-Bit
16-Bit
16-Bit
N Copies N Copies N Copies N Copies N Copies N Copies PACKET DATA: 16-bit FILLER:
Length = Word Count (WC) * Data Word PACKET FC 8-bit bytes added to
PACKET HEADER (PH): 6N x 16-bits Width (8-bits). There are NO restrictions FOOTER ensure that all Lanes
(N = Physical Layer Lane Count) on the values of the data words (PF) transport the same number of
1024 16-bit words; FC may be 0.
1025 As shown in Figure 54, the Packet Header structure depicted in Figure 53 effectively results in the C-PHY
1026 Lane Distributor broadcasting the same six 16-bit words to each of N Lanes. Furthermore, the six words per
1027 Lane are split into two identical three-word groups which are separated by a mandatory C-PHY Sync Word
1028 as described in [MIPI02]. The Sync Word is inserted by the C-PHY physical layer in response to a CSI-2
1029 protocol transmitter PPI command.
Data ID Reserved VCX Word Count Word Count Checksum Checksum Data ID Reserved VCX Word Count Word Count Checksum Checksum
LANE 1: (8 Bits) (5 Bits)
(3 Bits) (MS Byte) (LS Byte) (MS Byte) (LS Byte) (8 Bits) (5 Bits)
(3 Bits) (MS Byte) (LS Byte) (MS Byte) (LS Byte)
ms bit ls bit ms bit ls bit
Data ID Reserved VCX Word Count Word Count Checksum Checksum Data ID Reserved VCX Word Count Word Count Checksum Checksum
LANE N: (8 Bits) (5 Bits)
(3 Bits)
(MS Byte) (LS Byte) (MS Byte) (LS Byte) (8 Bits) (5 Bits)
(3 Bits)
(MS Byte) (LS Byte) (MS Byte) (LS Byte)
ms bit ls bit ms bit ls bit
Figure 54 Packet Header Lane Distribution for C-PHY Physical Layer Option
1031 For both physical layer options, the 8-bit Data Identifier field defines the 2-bit Virtual Channel (VC) and the
1032 Data Type for the application specific payload data. The Virtual Channel Extension (VCX) field is also
1033 common to both options, but is a 2-bit field for D-PHY and a 3-bit field for C-PHY. Together, the VC and
1034 VCX fields comprise the 4- or 5-bit Virtual Channel Identifier field which determines the Virtual Channel
1035 number associated with the packet (see Section 9.3).
1036 For both physical layer options, the 16-bit Word Count (WC) field defines the number of 8-bit data words in
1037 the Data Payload between the end of the Packet Header and the start of the Packet Footer. No Packet Header,
1038 Packet Footer, or Packet Filler bytes shall be included in the Word Count.
1039 For the D-PHY physical layer option, the 6-bit Error Correction Code (ECC) allows single-bit errors to be
1040 corrected and 2-bit errors to be detected in the Packet Header. This includes the Data Identifier, Word Count,
1041 and Virtual Channel Extension field values.
1042 The ECC field is not used by the C-PHY physical layer option because a single symbol error on a C-PHY
1043 physical link can cause multiple bit errors in the received CSI-2 Packet Header, rendering an ECC ineffective.
1044 Instead, a CSI-2 protocol transmitter for the C-PHY physical layer option computes a 16-bit CRC over the
1045 four bytes composing the Reserved, Virtual Channel Extension, Data Identifier, and Word Count Packet
1046 Header fields and then transmits multiple copies of all these fields, including the CRC, to facilitate their
1047 recovery by the CSI-2 protocol receiver in the event of one or more C-PHY physical link errors. The multiple
1048 Sync Words inserted into the Packet Header by the C-PHY physical layer (as shown in Figure 54) also
1049 facilitate Packet Header data recovery by enabling the C-PHY receiver to recover from lost symbol clocks;
1050 see [MIPI02] for further information about the C-PHY Sync Word and symbol clock recovery.
1051 For both physical layer options, the CSI-2 receiver reads the next WC 8-bit data words of the Data Payload
1052 following the Packet Header. While reading the Data Payload the receiver shall not look for any embedded
1053 sync codes. Therefore, there are no limitations on the value of an 8-bit payload data word. In the generic case,
1054 the length of the Data Payload shall always be a multiple of 8-bit data words. In addition, each Data Type
1055 may impose additional restrictions on the length of the Data Payload, e.g. require a multiple of four bytes.
1056 For both physical layer options, once the CSI-2 receiver has read the Data Payload, it then reads the 16-bit
1057 checksum (CRC) in the Packet Footer and compares it against its own calculated checksum to determine if
1058 any Data Payload errors have occurred.
1059 Filler bytes are only inserted by the CSI-2 transmitter’s low level protocol layer in conjunction with the
1060 C-PHY physical layer option. The value of any Filler byte shall be zero. If the Packet Data Word Count (WC)
1061 is an odd number (i.e. LSB is “1”), the CSI-2 transmitter shall insert one Packet Filler byte after the Packet
1062 Footer to ensure that the Packet Footer ends on a 16-bit word boundary. The CSI-2 transmitter shall also
1063 insert additional Filler bytes, if needed, to ensure that each C-PHY Lane transports the same number of 16-
1064 bit words. The latter rules require the total number of Filler bytes, FC, to be greater than or equal to (WC
1065 mod 2) + {{N - (([WC + 2 + (WC mod 2)] / 2) mod N)} mod N} * 2, where N is the number of Lanes. Note
1066 that it is possible for FC to be zero.
1067 Figure 55 illustrates the Lane distribution of the minimal number of Filler bytes required for packets of
1068 various lengths transmitted over three C-PHY Lanes. The total number of Filler bytes required per packet
1069 ranges from 0 to 5, depending on the value of the Packet Data Word Count (WC). In general, the minimal
1070 number of Filler bytes required per packet ranges from 0 to 2N-1 for an N-Lane C-PHY system.
1071 For the D-PHY physical layer option, the CSI-2 Lane Distributor function shall pass each byte to the physical
1072 layer which then serially transmits it least significant bit first.
1073 For the C-PHY physical layer option, the Lane Distributor function shall group each pair of consecutive bytes
1074 2n and 2n+1 (for n ≥ 0) received from the Low Level Protocol into a 16-bit word (whose least significant
1075 byte is byte 2n) and then pass this word to a physical layer Lane module. The C-PHY Lane module maps
1076 each 16-bit word into a 7-symbol word which it then serially transmits least significant symbol first.
1077 For both physical layer options, payload data may be presented to the Lane Distributor function in any byte
1078 order restricted only by data format requirements. Multi-byte protocol elements such as Word Count,
1079 Checksum and the Short packet 16-bit Data Field shall be presented to the Lane Distributor function least
1080 significant byte first.
1081 After the EoT sequence the receiver begins looking for the next SoT sequence.
Lane 2 SoT PH SYN PH Byte 3 Byte 2 Byte 6n-3 Byte 6n-4 Filler Filler EoT
Lane 3 SoT PH SYN PH Byte 5 Byte 4 Byte 6n-1 Byte 6n-2 Filler Filler EoT
Lane 2 SoT PH SYN PH Byte 3 Byte 2 Byte 6n-3 Byte 6n-4 Filler PF (MSB) EoT
Lane 3 SoT PH SYN PH Byte 5 Byte 4 Byte 6n-1 Byte 6n-2 Filler Filler EoT
Lane 2 SoT PH SYN PH Byte 3 Byte 2 Byte 6n-3 Byte 6n-4 PF (MSB) PF (LSB) EoT
Lane 3 SoT PH SYN PH Byte 5 Byte 4 Byte 6n-1 Byte 6n-2 Filler Filler EoT
Lane 2 SoT PH SYN PH Byte 3 Byte 2 Byte 6n-3 Byte 6n-4 PF (LSB) Byte 6n+2 EoT
Lane 3 SoT PH SYN PH Byte 5 Byte 4 Byte 6n-1 Byte 6n-2 Filler PF (MSB) EoT
Lane 2 SoT PH SYN PH Byte 3 Byte 2 Byte 6n-3 Byte 6n-4 Byte 6n+3 Byte 6n+2 EoT
Lane 3 SoT PH SYN PH Byte 5 Byte 4 Byte 6n-1 Byte 6n-2 PF (MSB) PF (LSB) EoT
Lane 2 SoT PH SYN PH Byte 3 Byte 2 Byte 6n+3 Byte 6n+2 Filler Filler EoT
Lane 3 SoT PH SYN PH Byte 5 Byte 4 PF (LSB) Byte 6n+4 Filler Filler EoT
KEY:
SoT – Start of Transmission EoT – End of Transmission PF – Packet Footer
SYN – 7-Symbol Sync Word PH – Packet Header (6 Bytes) (2 Bytes)
1082
Figure 55 Minimal Filler Byte Insertion Requirements for Three Lane C-PHY
VCX + ECC
Data Field
Data ID
16-Bit
Short Packet
RES + VCX
RES + VCX
Checksum*
Checksum*
Data Field*
Data Field*
(PH-CRC)
(PH-CRC)
Data ID
Data ID
16-Bit
16-Bit
16-Bit
16-Bit
MS Bits LS Bits
(Bits (N-1):2) (Bits 1:0) Channel 0
Logical Channel Control
VCX VC
Channel 1
Channel 2
Packet Data In
Channel
Channel 3
Detect
Channel 4
Channel 2N-1
1119
Figure 59 Logical Channel Block Diagram (Receiver)
1120 Figure 60 illustrates an example of data streams utilizing virtual channel support.
SoT PH RGB 6:6:6 PF EoT LPS SoT PH YUV 4:2:2 PF EoT LPS SoT PH RGB 6:6:6 PF EoT
SoT PH RGB 5:6:5 PF EoT LPS SoT PH JPEG8 PF EoT LPS SoT PH RGB 5:6:5 PF EoT
SoT PH RGB 6:6:6 PF EoT LPS SoT PH MPEG4 PF EoT LPS SoT PH RGB 6:6:6 PF EoT
KEY:
LPS – Low Power State PH – Packet Header
SoT – Start of Transmission PF – Packet Footer + Filler (if applicable)
1121
EoT – End of Transmission
Figure 60 Interleaved Video Data Streams Examples
9.5 Packet Header Error Correction Code for D-PHY Physical Layer
Option
1130 The correct interpretation of the Data Identifier, Word Count, and Virtual Channel Extension fields is vital to
1131 the packet structure. The 6-bit Packet Header Error Correction Code (ECC) allows single-bit errors in the
1132 latter fields to be corrected, and two-bit errors to be detected for the D-PHY physical layer option; the ECC
1133 is not available for the C-PHY physical layer option. A 26-bit subset of the Hamming-Modified code
1134 described in Section 9.5.2 shall be used. The error state results of ECC decoding shall be available at the
1135 Application layer in the receiver.
1136 The Data Identifier field DI[7:0] shall map to D[7:0] of the ECC input, the Word Count LS Byte (WC[7:0])
1137 to D[15:8], the Word Count MS Byte (WC[15:8]) to D[23:16], and the Virtual Channel Extension (VCX)
1138 field to D[25:24]. This mapping is shown in Figure 61, which also serves as an ECC calculation example.
32-bit
PACKET HEADER
(PH)
VCX[1:0] = 1
Word Count
Data ID
Data 0
ECC
(WC)
VCX
LPS SoT
DOUT 1 1 1 0 1 1 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0
L M L M L M L M
S S S S S S S S
B B B B B B B B
1 1 1 0 1 1 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0
D D P0 P1 P2 P3 P4 P5
0 2
5
1139
Figure 61 26-bit ECC Generation Example
1142 d + p + 1 ≤ 2p, where d is the number of data bits and p is the number of parity bits.
1143 The result of appending the computed parity bits to the data bits is called the Hamming code word. The size
1144 of the code word c is obviously d + p, and a Hamming code word is described by the ordered set (c, d). A
1145 Hamming code word is generated by multiplying the data bits by a generator matrix G. The resulting product
1146 is the code-word vector (c1, c2, c3 … cn), consisting of the original data bits and the calculated parity bits.
1147 The generator matrix G used in constructing Hamming codes consists of I (the identity matrix) and a parity
1148 generation matrix A:
1149 G=[I|A]
1150 The packet header plus the ECC code can be obtained as: PH = p*G where p represents the header (26 or 64
1151 bits) and G is the corresponding generator matrix.
1152 Validating the received code word r, involves multiplying it by a parity check to form s, the syndrome or
1153 parity check vector: s = H*PH where PH is the received packet header and H is the parity check matrix:
1154 H = [ AT | I ]
1155 If all elements of s are zero, the code word was received correctly. If s contains non-zero elements, then at
1156 least one error is present. If a single bit error is encountered then the syndrome s is one of the elements of H
1157 which will point to the bit in error. Further, in this case, if the bit in error is one of the parity bits, then the
1158 syndrome will be one of the elements on I, else it will be the data bit identified by the position of the syndrome
1159 in AT.
d2d1d0
1166 Each cell in the matrix represents a syndrome, and the first 26 cells (the orange cells) use the first three or
1167 five bits to build the syndrome. Each syndrome in the matrix is MSB left aligned:
1169 The top row defines the three LSB of data position bit, and the left column defines the three MSB of data
1170 position bit (there are 64-bit positions in total).
1171 e.g. 37th bit position is encoded 0b100_101 and has the syndrome 0x68.
1172 To derive the parity P0 for 26-bits, the P0’s in the orange cells will define whether the corresponding bit
1173 position is used in P0 parity or not.
1175 Similarly, to derive the parity P0 for 64-bits, all P0’s in Table 12 will define the corresponding bit positions
1176 to be used.
1177 To correct a single data bit error, the syndrome must be one of the syndromes in Table 11. These syndromes
1178 identify the bit position in error. The syndrome is calculated as:
1179 S = PSEND ^ PRECEIVED, where PSEND is the 8/6-bit ECC field in the header and PRECEIVED is the
1180 calculated parity of the received header.
1181 Table 12 represents the same information as the matrix in Table 11, organized so as to provide better insight
1182 into the way in which parity bits are formed out of data bits. The orange area of the table is used to form the
1183 ECC needed to protect a 26-bit header, whereas the whole table must be used to protect a 64-bit header.
1184 Previous CSI-2 specification versions not supporting the Virtual Channel Extension (VCX) field utilize a 30-
1185 bit Hamming-modified code word with 24 data bits and 5+1 parity bits based on the first 24 bit positions of
1186 Table 12 [i.e. a (30,24) ECC]. Packet Header bits 24 and 25 are set to zero by transmitters, and ignored by
1187 receivers conforming to such Specifications.
1188 When receiving Packet Headers with a (30,24) ECC, receivers conforming to this CSI-2 Specification version
1189 shall ignore the contents of bits 24 and 25 in such Packet Headers. The intent is for such receivers to ignore
1190 any errors occurring at these bit positions, in order to match the behavior of previous receivers. (See Section
1191 9.5.4 for implementation recommendations.)
Bit P7 P6 P5 P4 P3 P2 P1 P0 Hex
32 0 1 0 1 0 1 0 0 0x54
33 0 1 0 1 1 0 0 0 0x58
34 0 1 1 0 0 0 0 1 0x61
35 0 1 1 0 0 0 1 0 0x62
36 0 1 1 0 0 1 0 0 0x64
37 0 1 1 0 1 0 0 0 0x68
38 0 1 1 1 0 0 0 0 0x70
39 1 0 0 0 0 0 1 1 0x83
40 1 0 0 0 0 1 0 1 0x85
41 1 0 0 0 0 1 1 0 0x86
42 1 0 0 0 1 0 0 1 0x89
43 1 0 0 0 1 0 1 0 0x8A
44 0 1 0 0 0 0 1 1 0x43
45 0 1 0 0 0 1 0 1 0x45
46 0 1 0 0 1 1 1 1 0x4F
47 0 1 0 1 0 1 1 1 0x57
48 1 0 0 0 1 1 0 0 0x8C
49 1 0 0 1 0 0 0 1 0x91
50 1 0 0 1 0 0 1 0 0x92
51 1 0 0 1 0 1 0 0 0x94
52 1 0 0 1 1 0 0 0 0x98
53 1 0 1 0 0 0 0 1 0xA1
54 1 0 1 0 0 0 1 0 0xA2
55 1 0 1 0 0 1 0 0 0xA4
56 1 0 1 0 1 0 0 0 0xA8
57 1 0 1 1 0 0 0 0 0xB0
58 1 1 0 0 0 0 0 1 0xC1
59 1 1 0 0 0 0 1 0 0xC2
60 1 1 0 0 0 1 0 0 0xC4
61 1 1 0 0 1 0 0 0 0xC8
62 1 1 0 1 0 0 0 0 0xD0
63 1 1 1 0 0 0 0 0 0xE0
Parity Generator
1195
Figure 62 64-bit ECC Generation on TX Side
2 Data Bits
Data Data Data
P Byte Byte Byte
(6 Bits) 2 1 0
Parity
Generator
1197
Figure 63 26-bit ECC Generation on TX Side
1200 For backwards-compatibility, transmitters conforming to this CSI-2 Specification version should always set
1201 Packet Header bits 24 and 25 (the VCX field) to zero in any packets sent to receivers conforming to previous
1202 CSI-2 Specification versions incorporating a (30,24) ECC.
Combinational
Received ECC Logic Block
Rec’d No error
ECC
8-Bit
Corrected Error
XOR SYN Syndrome
Decoder Error
8-Bit Parity Calc’d
Received ECC
Generator
72-Bit
Packet Corrected 64
Packet Header
Header
ECC Data Bits
Byte
Byte Byte
XOR
7 7
Byte Byte
XOR
6 6
Byte Byte
XOR
5 5
Byte Byte
XOR
4 4
Byte Byte
XOR
3 3
Byte Byte
XOR
2 2
Byte Byte
XOR
1 1
Byte Byte
XOR
0 0
1207
Figure 64 64-bit ECC on RX Side Including Error Correction
Combinational
Received
Logic Block
6-bit ECC
Rec’d No error
ECC
6-Bit
Corrected Error
XOR SYN Syndrome
Received Decoder
32-Bit Error
Packet 6-Bit Parity Calc’d Corrected 26
Generator ECC
Header Packet Header
Data Bits
ECC
Byte 3 VCX
VCX XOR
VCX (2 bits)
Override
Byte Byte
XOR
2 2
Byte Byte
XOR
1 1
Byte Byte
XOR
0 0
1224
Figure 65 26-bit ECC on RX Side Including Error Correction
16-bit Checksum
1234 When computed over the Packet Data words of a Long Packet, the 16-bit checksum sequence is transmitted
1235 as part of the Packet Footer. When the Word Count is zero, the CRC shall be 0xFFFF. When computed over
1236 the Reserved, Virtual Channel Extension, Data Identifier, and Word Count fields of a Packet Header for the
1237 C-PHY physical layer option, the 16-bit checksum sequence is transmitted as part of the Packet Header CRC
1238 (PH-CRC) field.
VCX
DI WC ECC Payload Data – Packet 1 CS
VCX
DI WC ECC Payload Data – Packet 2 CS
VCX
DI WC ECC Payload Data – Packet N CS
1240 The definition of a serial CRC implementation is presented in Figure 68. The CRC implementation shall be
1241 functionally equivalent with the C code presented in Figure 69. The CRC shift register is initialized to
1242 0xFFFF at the beginning of each packet. Note that for the C-PHY physical layer option, if the same circuitry
1243 is used to compute both the Packet Header and Packet Footer CRC, the CRC shift register shall be initialized
1244 twice per packet, i.e. once at the beginning of the packet and then again following the computation of the
1245 Packet Header CRC. After all payload data has passed through the CRC circuitry, the CRC circuitry contains
1246 the checksum. The 16-bit checksum produced by the C code in Figure 69 equals the final contents of the
1247 C[15:0] shift register shown in Figure 68. The checksum is then transmitted by the CSI-2 physical layer to
1248 the CSI-2 receiver to verify that no errors have occurred in the transmission.
1251 Beginning with index 0, the contents of the input data array in Figure 69 are given by WC 8-bit payload data
1252 words for packet data CRC computations and by the four 8-bit [Reserved, VCX], Data Identifier, WC (LS
1253 byte), and WC (MS byte) fields for packet header CRC computations.
1254
KEY:
LPS – Low Power State PH – Packet Header
ST – Start of Transmission PF – Packet Footer + Filler (if applicable)
1271
ET – End of Transmission SP – Short Packet
Figure 70 Packet Spacing
VC0 FS
VC0 LS2n+1 VC0 DT2 VC0 DT2 Payload CRC VC0 LE2n+1
VC0 LSm-1 VC0 DT1 VC0 DT1 Payload CRC VC0 LEm-1
VC0 LSm VC0 DT1 VC0 DT1 Payload CRC VC0 LEm
VC0 FE
VC0 FS
VC0 LS2n+2 VC0 DT2 VC0 DT2 Payload CRC VC0 LE2n+2
VC0 LS VC0 DT4 VC0 DT4 Payload CRC VC0 LE
VC0 LS VC0 DT4 VC0 DT4 Payload CRC VC0 LE
VC0 FE
Note:
• For VC0 DT2 Odd Frames LS2n+1 and Even Frames LS2n+2 (where n=0,1,2,3...) the first line n=0
• For VC0 DT1 LSm+1(where m=0,1,2,3...) the first line m=0
1321
Figure 71 Example Interlaced Frame Using LS/LE Short Packet and Line Counting
1324 The intention of the Generic Short Packet Data Types is to provide a mechanism for including timing
1325 information for the opening/closing of shutters, triggering of flashes, etc., within the data stream. The intent
1326 of the 16-bit User defined data field in the generic short packets is to pass a data type value and a 16-bit data
1327 value from the transmitter to application layer in the receiver. The CSI-2 receiver shall pass the data type
1328 value and the associated 16-bit data value to the application layer.
SoT FS EoT LPS SoT PH Data PF EoT SoT PH Data PF EoT LPS SoT FE EoT
VVALID
HVALID
DVALID
KEY:
SoT – Start of Transmission EoT – End of Transmission LPS – Low Power State
PH – Packet Header PF – Packet Footer + Filler (if applicable)
FS – Frame Start FE – Frame End
1336
LS – Line Start LE – Line End
VVALID
HVALID
DVALID
KEY:
SoT – Start of Transmission EoT – End of Transmission LPS – Low Power State
PH – Packet Header PF – Packet Footer + Filler (if applicable)
FS – Frame Start FE – Frame End
1337
LS – Line Start LE – Line End
1 Line 1 Line
SoT PH Data PF EoT LPS SoT PH Data PF EoT LPS SoT PH Data PF EoT
SoT PH Data PF EoT LPS SoT FE EoT LPS SoT FS EoT LPS SoT PH Data PF EoT
KEY:
SoT – Start of Transmission EoT – End of Transmission LPS – Low Power State
PH – Packet Header PF – Packet Footer + Filler (if applicable)
FS – Frame Start FE – Frame End
1338
LS – Line Start LE – Line End
1339 The period between the end of the Packet Footer (or the Packet Filler, if present) of one long packet and the
1340 Packet Header of the next long packet is called the Line Blanking Period.
1341 The period between the Frame End packet in frame N and the Frame Start packet in frame N+1 is called the
1342 Frame Blanking Period (Figure 74).
1343 The Line Blanking Period is not fixed and may vary in length. The receiver should be able to cope with a
1344 near zero Line Blanking Period as defined by the minimum inter-packet spacing defined in [MIPI01] or
1345 [MIPI02], as appropriate. The transmitter defines the minimum time for the Frame Blanking Period. The
1346 Frame Blanking Period duration should be programmable in the transmitter.
1347 Frame Start and Frame End packets shall be used.
1348 Recommendations (informative) for frame start and end packet spacing:
1349 • The Frame Start packet to first data packet spacing should be as close as possible to the minimum
1350 packet spacing
1351 • The last data packet to Frame End packet spacing should be as close as possible to the minimum
1352 packet spacing
1353 The intention is to ensure that the Frame Start and Frame End packets accurately denote the start and end of
1354 a frame of image data. A valid exception is when the positions of the Frame Start and Frame End packets are
1355 being used to convey pixel level accurate vertical synchronization timing information.
1356 The positions of the Frame Start and Frame End packets can be varied within the Frame Blanking Period in
1357 order to provide pixel level accurate vertical synchronization timing information. See Figure 75.
1358 If pixel level accurate horizontal synchronization timing information is required, Line Start and Line End
1359 packets should be used to achieve it.
1360 The positions of the Line Start and Line End packets, if present, can be varied within the Line Blanking
1361 Period in order to provide pixel accurate horizontal synchronization timing information. See Figure 76.
VIDEO
DATA
Black Level
Blanking Level
Sync Level
DVALID
VVALID
SoT FE EoT LPS SoT FS EoT LPS SoT PH Data PF EoT LPS SoT PH Data PF EoT
Frame End Frame Start Valid Video Data Valid Video Data
Packet Packet
1362
Figure 75 Vertical Sync Example
VIDEO
DATA
Black Level
Blanking Level
Sync Level
DVALID
HVALID
PF EoT LPS SoT LE EoT LPS SoT LS EoT LPS SoT PH Data PF EoT LPS SoT LE EoT
SoT SP EoT LPS SoT PH Data PF EoT LPS SoT PH Data PF EoT LPS SoT SP EoT
KEY:
SoT – Start of Transmission
LRTE replaces legacy EoT, LPS, SoT with EPD
EoT – End of Transmission
LPS – Low Power State
PH – Packet Header
EPD – Efficient Packet Delimiter
Short Long Long Short
Packet Packet Packet Packet
1380 As shown in Figure 77, LRTE requires an EPD to be inserted between adjacent CSI-2 packets during PHY
1381 high-speed signaling, but does not permit an EPD to be inserted after a CSI-2 packet just prior to PHY EoT.
1382 However, as described later in this section, it is possible under certain conditions to insert Spacers, but without
1383 PHY-generated PDQ signaling, after a CSI-2 packet just prior to PHY EoT.
EPD
Total Packet Byte Count = 4n
Lane 1 SoT PH SYN PH Byte 1 Byte 0 Byte 4n-7 Byte 4n-8 Byte 4n-3 Byte 4n-4 Spacer SYN PH SYN PH Byte 1 Byte 0
Lane 2 SoT PH SYN PH Byte 3 Byte 2 Byte 4n-5 Byte 4n-6 Byte 4n-1 Byte 4n-2 Spacer SYN PH SYN PH Byte 3 Byte 2
Lane 2 SoT PH SYN PH Byte 3 Byte 2 Byte 4n-1 Byte 4n-2 Filler Filler Spacer SYN PH SYN PH Byte 3 Byte 2
Lane 1 SoT PH SYN PH Byte 1 Byte 0 Byte 4n-3 Byte 4n-4 Byte 4n+1 Byte 4n Spacer SYN PH SYN PH Byte 1 Byte 0
Lane 2 SoT PH SYN PH Byte 3 Byte 2 Byte 4n-1 Byte 4n-2 Filler Filler Spacer SYN PH SYN PH Byte 3 Byte 2
Lane 2 SoT PH SYN PH Byte 3 Byte 2 Byte 4n-1 Byte 4n-2 Filler Byte 4n+2 Spacer SYN PH SYN PH Byte 3 Byte 2
KEY:
SoT – Start of Transmission EoT – End of Transmission EPD – Efficient Packet Delimiter contains optional Spacer
word insertion followed by a mandatory
SYN – Sync Word PH – Packet Header PDQ (Sync Word). An EPD consisting of single
1426 Spacer followed by one PDQ shown for illustration.
Figure 78 LRTE Efficient Packet Delimiter Example for CSI-2 Over C-PHY (2 Lanes)
Number of Bytes, B, transmitted is NOT an integer multiple of the number of lanes, N with alignment using Filler bytes for packet transfers using
PHY generated and consumed PDQ. One optional Spacer byte insertion included for illustration.
LANE 1: SoT Byte 0 Byte N Byte B-N-K Byte B-K Spacer PDQ Byte 0
•••
•••
•••
•••
•••
•••
LANE K: SoT Byte K-1 Byte N+K-1 Byte B-N-1 Byte B-1 Spacer PDQ Byte K-1
•••
LANE K+1: SoT Byte K Byte N+K Byte B-N Filler Spacer PDQ Byte K
•••
•••
•••
•••
•••
•••
LANE N: SoT Byte N-1 Byte 2N-1 Byte B-K-1 Filler Spacer PDQ Byte N-1
KEY:
LPS – Low Power State SoT – Start of Transmission EoT – End of Transmission
PDQ – PHY generated and consumed Packet Delimiter Quick EPD – Efficient Packet Delimiter
1455
Figure 79 Example of LRTE EPD for CSI-2 Over D-PHY – Option 1
Number of Bytes, B, transmitted is NOT an integer multiple of the number of lanes, N with alignment using Filler
bytes for back-to-back transfers. Two optional Spacer byte insertions included for illustration.
LANE 1: SoT Byte 0 Byte N Byte B-N-K Byte B-K Spacer Spacer Byte 0
•••
•••
•••
•••
•••
•••
LANE K: SoT Byte K-1 Byte N+K-1 Byte B-N-1 Byte B-1 Spacer Spacer Byte K-1
•••
LANE K+1: SoT Byte K Byte N+K Byte B-N Filler Spacer Spacer Byte K
•••
•••
•••
•••
•••
•••
LANE N: SoT Byte N-1 Byte 2N-1 Byte B-K-1 Filler Spacer Spacer Byte N-1
KEY:
LPS – Low Power State SoT – Start of Transmission EoT – End of Transmission
EPD – Efficient Packet Delimiter
1476
Figure 80 Example of LRTE EPD for CSI-2 Over D-PHY – Option 2
1519 The following examples apply to the least significant fifteen bits of the two EPD registers:
1520 • For variable-length Spacer insertions:
1521 • A register value of 15’d0 generates zero or more Spacers.
1522 • A register value of 15’d5 generates at least 5 Spacers.
1523 • A register value of 15’d32,767 generates at least 32,767 Spacers.
1524 • For fixed-length Spacer insertions:
1525 • A register value of 15’d0 generates no Spacers.
1526 • A register value of 15’d5 generates exactly 5 Spacers.
1527 • A register value of 15’32,767 generates exactly 32,767 Spacers.
1528 The transmitter shall support at least one non-zero value of the Spacer insertion count field in each of the
1529 TX_REG_CSI_EPD_EN_SSP and TX_REG_CSI_EPD_OP_SLP registers. The duration of the PDQ
1530 sequence is directly proportional to the D-PHY Link rate, and is configured using the HS-Idle timing
1531 parameters defined in [MIPI01] for the D-PHY physical layer option.
1532 For D-PHY EPD, the TX_REG_CSI_EPD_MISC_OPTIONS register is required for image sensors
1533 (transmitters) supporting the insertion of Spacers-without-PDQ under Option 1 or the insertion of EoTp (see
1534 Section 9.11.1.2.5) or a variable number of Spacer bytes under Option 2. If this register is not implemented,
1535 then its value shall be treated as zero by this specification.
1536 Note that registers TX_REG_CSI_EPD_EN_SSP, TX_REG_CSI_EPD_OP_SLP, and
1537 TX_REG_CSI_EPD_MISC_OPTIONS are not intended to control image sensor LRTE when applied to USL
1538 packets transmitted using Escape Mode LPDT; see Section 9.12.
1559 Note that the CSI-2 receiver only needs to check the data integrity of one out of every M potential Spacer
1560 bytes on Lane 1; i.e., once the first byte in a group of M bytes on Lane 1 has been confirmed as a Spacer
1561 byte, then the remaining M-1 bytes can be safely ignored by the CSI-2 receiver because it knows in advance
1562 that Spacer bytes are being inserted in groups of M. See Figure 81.
General Case: Spacer bytes are inserted in groups of M on each Lane; Lane-merged Spacer bytes are ECC-
processed by CSI-2 receiver; results are used to confirm the integrity and presence of at least every M-th
Spacer byte on Lane 1
M = LCM(N,4)/N Bytes L can change with every packet
LANE 1: SoT Byte 0 Byte B-K Spacer 1 Spacer M Spacer M+1 Spacer L*M Byte 0
•••
•••
•••
•••
•••
•••
•••
•••
•••
•••
LANE K: SoT Byte K-1 Byte B-1 Spacer 1 Spacer M Spacer M+1 Spacer L*M Byte K-1
•••
LANE K+1: SoT Byte K Filler Spacer 1 Spacer M Spacer M+1 Spacer L*M Byte K
•••
•••
•••
•••
•••
•••
•••
•••
•••
•••
LANE N: SoT Byte N-1 Filler Spacer 1 Spacer M Spacer M+1 Spacer L*M Byte N-1
1564 However, for N > 4, it is possible to program the CSI-2 transmitter to always insert an arbitrary number of
1565 Spacer bytes per Lane (i.e., to set M = 1) if the CSI-2 receiver examines bytes from the first four Lanes and,
1566 upon confirming a Spacer byte in Lane 1, ignores bytes from the remaining Lanes. See Figure 82.
Special Case for N > 4: Lane-merged Spacer bytes on Lanes 1 to 4 are ECC-processed first by
CSI-2 receiver; if byte on Lane 1 is a confirmed Spacer, then bytes on Lanes 5 to N can be ignored
L can change with every packet
LANE 1: SoT Byte 0 Byte B-N-4 Byte B-4 Spacer 1 Spacer L Byte 0
•••
•••
•••
•••
•••
•••
•••
•••
LANE 4: SoT Byte 3 Byte B-N-1 Byte B-1 Spacer 1 Spacer L Byte 3
•••
•••
•••
•••
•••
•••
•••
•••
LANE N: SoT Byte N-1 Byte B-5 Filler Spacer 1 Spacer L Byte N-1
LPS SoT SoF EoTp EoT LPS SoT PH RAW Data PF EoTp EoT LPS SoT PH RAW Data PF PH RAW Data PF EoF EoTp EoT LPS
Optional No Spacers (EPD) Optional No Spacers (EPD) Optional Optional Optional No Spacers (EPD)
Spacers because of EoT Spacers because of EoT Spacers Spacers Spacers because of EoT
LPS SoT SP EoT LPS SoT PH Data PF EoT LPS SoT PH Data PF EoT LPS SoT SP EoT LPS
KEY:
SoT – Legacy Start of Transmission
Reduce interpacket latency by replacing legacy EoT, LPS, SoT with EPD, and
EoT – Legacy End of Transmission
enhance CSI-2 transport channel with LVLP or ALP Mode signaling
LPS – Legacy Low Power State
LVLP – Low Voltage Low Power
ASoT – Alternate Start of Transmission
Short Long Long Short AEoT – Alternate End of Transmission
Packet Packet Packet Packet ALPM – Alternate Low Power Mode
PH – Packet Header
ALPM ASoT SP EPD PH Data PF EPD PH Data PF EPD SP AEoT ALPM EPD – Efficient Packet Delimiter
Image Application
Sensor Unidirectional Transfer Processor
Using MIPI PHY
(High Bandwidth)
CSI-2 PHY CSI-2
PHY
TX TX RX
RX
Image Application
Sensor Bi-Directional Transfer Processor
Using MIPI PHY
(High Bandwidth)
CSI-2 PHY PHY CSI-2
TX TRX TRX RX
PPI
Interface
1628
Figure 85 USL System Diagram
1691 similarly with USL the same e.g. 0x6C would apply. This field is transmitted as the most significant 7 bits of
1692 a byte whose LSB is analogous to the CCI R/W bit.
1693 A 16-bit Sub_Address field is used for pointing at a register inside the Target device. Product-specific imaging
1694 systems may use an 8-bit and/or 16-bit Sub_Address on an as-needed basis, since Sub_Address is device-
1695 specific and is known at platform level. Note that systems using a single USL link to communicate with
1696 multiple devices, e.g. via local I2C bus, may require using both 8-bit and 16-bit indexes, depending on the
1697 devices.
1698 An 8-bit USL Control (USL_CTL) (Table 19) is used to ensure transport integrity with guaranteed delivery
1699 of commands from the APP to the SNS using ACK, and to improve transport efficiency with support for
1700 contiguous R/W operations often used for imaging and vision firmware uploads from APP to SNS.
1701 A 16-bit Transaction Sequence (TSEQ) field contains a unique non-zero USL command identification
1702 number generated by the SNS and APP. The SNS and APP generate and clear the Transaction Sequence field
1703 upon successful reception of a USL Packet (as detailed in sections below).
1704 Table 18 Image Sensor LPDT LRTE Control Register
Register Name Type RW Comment
SNS_USL_LPDT_LRTE 8-bit RW Bit 7
unsigned 1: Enable image sensor LRTE for USL packets
integer transmitted using Escape Mode LPDT
Bits 6-0
If LRTE is enabled, specifies the fixed number of
Spacers inserted between all USL packets (0 to 127)
1870
SNS_RX SNS_RX
SNS_TX SNS_RX
BTA BTA
ALP ALP
SIGNALING SIGNALING
SNS_TX SNS_TX
PARK
SNS
1876
Figure 86 USL Modes Link Transitions
9.12.5.6 USL Clock Lane Management Under D-PHY ALP Mode (Informative)
1879 When USL is configured to use D-PHY ALP Mode as described in [MIPI01], a running high-speed clock
1880 Lane is required for any active data communications between SNS and APP. Such communications include
1881 the usual forward-direction SNS pixel streaming, as well as any bidirectional transactions on data Lane 1
1882 related to USL packet transmissions (with DT code 0x38), or any low-level PHY fast BTA or ULPS entry
1883 commands initiated by either the SNS or APP. When USL is configured to use D-PHY LP or LVLP Mode,
1884 the clock Lane is only required to be running during SNS pixel streaming.
1930 Figure 87 illustrates examples of USL ALP Mode clock Lane management during the image streaming
1931 vblank period. Beginning at time A in the figure, the SNS automatically keeps the clock Lane running after
1932 transmitting the CSI-2 Frame End short packet and uses the USL protocol to enter USL_REV mode in order
1933 to enable the APP to start accessing SNS CCI registers. At this point, the APP may also wish to start an
1934 internal timer to warn it when the vblank period is about to end. At time B, when the APP is at least
1935 temporarily finished with CCI register accesses, the last access it performs is a write to the
1936 TX_USL_ALP_CTRL register (Table 27), for example, which commands the SNS to turn-off the clock Lane
1937 but also to expect a request to restart it at a later time. USL_REV mode is then maintained (with all D-PHY
1938 clock and data Lanes in the Stop state) until time C when the APP requests the clock Lane to be restarted by
1939 transmitting a short ALP Mode PHY-to-PHY Wake pulse to the SNS. In response, the SNS restarts the clock
1940 Lane and keeps it running while the APP performs more CCI accesses as needed. When finished at time D,
1941 the APP finally switches back to USL_FWD mode prior to the SNS having to transmit the Frame Start short
1942 packet at the beginning of the next image frame.
Frame Blanking
FS Zero or more lines of embedded data
Packet Header, PH
Packet Footer, PF
FE A
Clock Running
vblank
Frame Blanking
C
Clock Running
D FS
PH
Next Frame
PF
hblank
KEY:
PH – Packet Header PF – Packet Footer
1943 FS – Frame Start FE – Frame End
Figure 87 Examples of USL ALP Mode Clock Lane Management During Sensor Vblank
Tx Rx
Per-Lane Scrambling Tx PPI Rx PPI
Byte/Word Byte/Word Lane 1 PHY De- Byte/Word
Scrambling
Lane Distribution Function
2007
Figure 88 System Diagram Showing Per-Lane Scrambling
Scrambled, Packet #1 Header & Data Scrambled, Packet #2 Header & Data
Lane 1 HS
HS-ZERO Sync P1H P1H P1 P1 P1 P1 P1 P1 P1 HS-Idle- HS-Idle HS-Idle- HS P2H P2H P2 P2 P2 P2 P2 P2 P2
B0 B2 B0 B2 B4 B6 B8 Bn-4 Bn-2
Post Pre Sync B0 B2 B0 B2 B4 B6 B8 Bn-4 Bn-2 HS-TRAIL
TxWordValidHS[0]
TxHSIdleClkHS
Lane 2 HS
HS-ZERO Sync P1H P1H P1 P1 P1 P1 P1 P1 P1 HS-Idle- HS-Idle HS-Idle- HS P2H P2H P2 P2 P2 P2 P2 P2 P2
B1 B3 B1 B3 B5 B7 B9 Bn-3 Bn-1
Post Pre Sync B1 B3 B1 B3 B5 B7 B9 Bn-3 Bn-1 HS-TRAIL
TxWordValidHS[0]
TxHSIdleClkHS
Re-initialize the
Scrambler PRBS
2021 Note: The Packet Footer at the end of every packet is scrambled.
Figure 89 Example of Data Bursts in Two Lanes Using the D-PHY Physical Layer
TxSendSyncHS[0]
TxSyncTypeHS0[2:0] ST ST ST
TxWordValidHS[0]
Lane 2 Preamble Sync P1H P1H P1H Sync P1H P1H P1H B2 B6 B10 Bn-6 Bn-2
Sync P2H P2H P2H Sync P2H P2H P2H B2 B6 B10
Bn-6 Bn-2
W0 W1 W2 W0 W1 W2 B3 B7 B11 Bn-5 Bn-1 W0 W1 W2 W0 W1 W2 B3 B7 B11 Bn-5 Bn-1 Post
TxSendSyncHS[0]
TxSyncTypeHS0[2:0] ST ST ST
TxWordValidHS[0]
Re-initialize the
Scrambler PRBS
~TxWordValidHS[0] | TxSendSyncHS[0]
2028 Note: The Packet Footer at the end of every packet is scrambled.
Figure 90 Example of Data Bursts in Two Lanes Using the C-PHY Physical Layer
2029 In some cases, images may cause repetitive transmission of Long Packets having the same or similar Long
2030 Packet Header and the same pixel data (for example: all dark pixels, or all white pixels). If the scrambler is
2031 initialized with the same seed value at the beginning of every packet, coinciding with the beginning of every
2032 pixel row, then the scrambled pseudo-random sequence will repeat at the rate that rows of identical image
2033 data are transmitted. This can cause the emissions to be less random, and instead have peaks at frequencies
2034 equivalent to the rate at which the image data rows are transmitted.
2035 To mitigate this issue, a different seed value is selected by the transmitter every time a Packet Header is
2036 transmitted. The Sync Word in the Packet Header encodes a small amount of data, so that the transmitter can
2037 inform the receiver which starting seed to use to descramble the packet. This small amount of data in the
2038 Sync Word is sent by transmitting a Sync Type that the CSI-2 protocol transmitter chooses. This Sync Type
2039 value is also used to select the starting seed in the scrambler and descrambler.
2040 Table 28 shows the five possible Sync Types that the C-PHY supports. The Sync Word values are normatively
2041 specified in the C-PHY Specification and duplicated in Table 28 for convenience. The CSI-2 protocol uses
2042 only the first four out of the five possible Sync Types, which simplifies the implementation.
2043 Table 28 Symbol Sequence Values Per Sync Type
Scrambler and
TxSyncTypeHS0[2:0],
Sync Type Sync Value Descrambler
TxSyncTypeHS1[2:0]
Seed Index
Type 0 3444440 0 0
Type 1 3444441 1 1
Type 2 3444442 2 2
Type 3 3444443 3 3
Type 4 3444444 4 N/A
2044 Note:
2045 When a single seed value is used, Sync Type 3 is the default Sync Word value.
2046 Figure 91 shows the architecture of the scrambling in a single Lane. The pseudo-random number generated
2047 by the PRBS shall be used as the seed index to select the initial seed value from the seed list prior to sending
2048 the packet. This seed index shall also be sent to the C-PHY using the PPI signals TxSyncTypeHS0[1:0].
2049 TxSyncTypeHS0[2] is always zero. TxSyncTypeHS1 [2:0] is used similarly for a 32-bit data path. The C-
2050 PHY ensures that the very first packet in a burst begins with a Sync Word using Sync Type 3.
Tx PPI Rx PPI
Word Word Lane 1 C-PHY Word De- Word
Scrambling
Stream Stream (Tx→Chan→Rx) Stream Scrambling Stream
TxINIT PRBS
TxSyncTypeHS0[1:0] RxSyncTypeHS0[1:0]
2051
Figure 91 Generating Tx Sync Type as Seed Index (Single Lane View)
2052 The seed list may contain either one or four initial seed values. Transmitters and receivers shall have the
2053 capability to select exactly one seed value from a list of seeds. When a single seed value is used, that seed
2054 shall be identified as Seed 3 and the transmitter shall always transmit Sync Type 3. Transmitters and receivers
2055 should also have the capability to select a seed value from a list of four seed values, as shown in Figure 91.
2056 When a list of four seed values is used then Sync Type 0 through Sync Type 3 shall be used to convey the
2057 seed index value from the transmitter to the receiver.
2058 When the list of four seeds is used, the two-bit seed index shall be generated in the transmitter using a pseudo
2059 random generator (e.g., PRBS).
2060 Slight differences in the implementation of the PRBS generator will not affect the interoperability of the
2061 transmitter and receiver, because the receiver responds to the seed index chosen in the transmitter and
2062 conveyed to the receiver using the Sync Type.
2063 At the receiver, the C-PHY decodes the Sync Word and passes the 2-bit Sync Type value to the CSI-2 protocol
2064 logic. The CSI-2 protocol logic uses the two-bit value as a seed index to select one of four seed values to
2065 initialize the descrambler. This concept is shown in the single Lane diagram in Figure 91. Figure 88 shows
2066 the use of the PPI signals to select which seed value was used to initialize the scrambler and descrambler.
2067 Since the seed selection field is transmitted via the Sync Word, no other mechanism is needed to coordinate
2068 the choice of specific descrambler initial seed values at the receiver.
Per-Lane Scrambling Tx Rx
Tx PPI Rx PPI
Word Word Lane 1 C-PHY Word De- Word
Stream
Scrambling Stream Stream
(Tx→Chan→Rx) Scrambling Stream
Lane Distribution
Lane Merge
Function
Function
CSI-2 CSI-2
Byte Word Word Lane 2 C-PHY Word De- Word Byte
Protocol Stream Stream
Scrambling Stream Stream
Protocol
(Tx→Chan→Rx) Scrambling Stream Stream
Tx Rx
PRBS TxSyncTypeHS0[2:0] RxSyncTypeHS0[2:0]
2074 The data scrambler and descrambler pseudo-random binary sequence (PRBS) shall be generated using the
2075 Galois form of an LFSR implementing the generator polynomial:
2077 The initial D-PHY seed values in Table 30 should be used to initialize the D-PHY scrambler LFSR in Lanes
2078 1 through 8.
2079 Table 30 D-PHY Scrambler PRBS Initial Seed Values for Lanes 1 Through 8
Lane Initial Seed Value
1 0x0810
2 0x0990
3 0x0a51
4 0x0bd0
5 0x0c30
6 0x0db0
7 0x0e70
8 0x0ff0
2080
2081 The initial C-PHY seed values in Table 31 should be used to initialize the C-PHY scrambler LFSR in Lanes
2082 1 through 8. The table provides initial seed values for each of the four possible Sync Type values per Lane
2083 number. If only a single Sync Type is used, then it shall default to Sync Type 3.
2084 Table 31 C-PHY Scrambler PRBS Initial Seed Values for Lanes 1 Through 8
Initial Seed Value
Lane
Sync Type 0 Sync Type 1 Sync Type 2 Sync Type 3
1 0x0810 0x0001 0x1818 0x1008
2 0x0990 0x0180 0x1998 0x1188
3 0x0a51 0x0240 0x1a59 0x1248
4 0x0bd0 0x03c0 0x1bd8 0x13c8
5 0x0c30 0x0420 0x1c38 0x1428
6 0x0db0 0x05a0 0x1db8 0x15a8
7 0x0e70 0x0660 0x1e79 0x1668
8 0x0ff0 0x07e0 0x1ff8 0x17e8
2085 For D-PHY and C-PHY systems requiring more than eight Lanes, Annex G provides 24 additional seed
2086 values for Lanes 9 through 32, as well as a mechanism for finding seed values for Lanes 33 and higher. For
2087 each seed value, the LSB corresponds to scrambler PRBS register bit Q0 and the MSB corresponds to bit
2088 Q15.
2089 The LFSR shall generate an eight-bit sequence at G(x) for every byte of Payload data to be scrambled, starting
2090 from its initial seed value. The LFSR shall generate new bit sequences of G(x) by advancing eight bit cycles
2091 for each subsequent Payload data byte.
2092 Scrambling shall be achieved by modulo-2 bit-wise addition (X-OR) of a sequence of eight bits G(x) with
2093 the CSI-2 Payload data to be scrambled.
2094 Implementation Tip: the 8-bit value from the PRBS is the flip of bits Q15:Q8 of the PRBS LFSR register on
2095 every 8th bit clock. The designer might choose to implement the PRBS LFSR in parallel form to shift the
2096 equivalent of 8 places in a single byte clock, or the PRBS LFSR might even be configured to shift a multiple
2097 of 8 places in a single word clock.
2098 For the example shown in Figure 93, Q[15:8] are captured in a temporary register, then the PRBS LFSR is
2099 shifted eight times before Q[15:8] are captured again. The scrambling is performed as follows:
2100 • TxD[7] = PktD[7] Q’[8];
2101 • TxD[6] = PktD[6] Q’[9];
2102 • TxD[5] = PktD[5] Q’[10];
2103 • TxD[4] = PktD[4] Q’[11];
2104 • TxD[3] = PktD[3] Q’[12];
2105 • TxD[2] = PktD[2] Q’[13];
2106 • TxD[1] = PktD[1] Q’[14];
2107 • TxD[0] = PktD[0] Q’[15];
PRBS LFSR
Reset
SET SET SET SET SET SET SET SET
D Q D Q D Q D Q D Q D Q D Q D Q
Bit Clock
Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7
2108
Figure 93 PRBS LFSR Serial Implementation Example
2109 Table 32 illustrates the sequence of the PRBS register one bit at a time, starting with the initial seed value for
2110 Lane 2. The data scrambling sequence is the output G(x). The first bit output from the scrambler is the value
2111 output from G(x) (also Q15 of the register in Figure 93) when the register contains the initial seed value.
2112 Table 32 Example of the PRBS Bit-at-a-Time Shift Sequence
t Q15 Q14 Q13 Q12 Q11 Q10 Q9 Q8 Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 LFSR
0 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 0x1188
1 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 0 0x2310
2 0 1 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0x4620
3 1 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0x8C40
4 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 1 0x18B9
5 0 0 1 1 0 0 0 1 0 1 1 1 0 0 1 0 0x3172
6 0 1 1 0 0 0 1 0 1 1 1 0 0 1 0 0 0x62E4
7 1 1 0 0 0 1 0 1 1 1 0 0 1 0 0 0 0xC5C8
8 1 0 0 0 1 0 1 1 1 0 1 0 1 0 0 1 0x8BA9
9 0 0 0 1 0 1 1 1 0 1 1 0 1 0 1 1 0x176B
10 0 0 1 0 1 1 1 0 1 1 0 1 0 1 1 0 0x2ED6
11 0 1 0 1 1 1 0 1 1 0 1 0 1 1 0 0 0x5DAC
12 1 0 1 1 1 0 1 1 0 1 0 1 1 0 0 0 0xBB58
13 0 1 1 1 0 1 1 0 1 0 0 0 1 0 0 1 0x7689
14 1 1 1 0 1 1 0 1 0 0 0 1 0 0 1 0 0xED12
15 1 1 0 1 1 0 1 0 0 0 0 1 1 1 0 1 0xDA1D
16 1 0 1 1 0 1 0 0 0 0 0 0 0 0 1 1 0xB403
2113 Table 33 shows the first ten PRBS Byte Outputs produced by the PRBS LFSR in Lane 2 when the D-PHY
2114 physical layer is being used.
2115 Table 33 Example PRBS LFSR Byte Sequence for D-PHY Physical Layer
Scrambling Sequence PRBS Register PRBS Byte Input Byte Output Byte
Byte #Byte 0
Initial Seed, 0x0990 0x90 0x2b 0xbb
Byte 1 0x91f1 0x89 0x0d 0x84
Byte 2 0xee29 0x77 0x63 0x14
Byte 3 0x3dbe 0xbc 0x00 0xbc
Byte 4 0xbba5 0xdd 0x00 0xdd
Byte 5 0xbcb3 0x3d 0x00 0x3d
Byte 6 0xaa1c 0x55 0x19 0x4c
Byte 7 0x061a 0x60 0x41 0x21
Byte 8 0x1a96 0x58 0x22 0x7a
Byte 9 0x942a 0x29 0x53 0x7a
2116 Table 34 shows an example of the PRBS Word Outputs at the beginning of a packet, that are produced by the
2117 PRBS LFSR in Lane 2 when the C-PHY physical layer is being used. In this example, the initial seed value
2118 used for transmitting the first copy of the packet header corresponds to Sync Type 3 for Lane 2. The initial
2119 seed value used for transmitting the second copy of the packet header corresponds to Sync Type 0 for Lane
2120 2. As described in Section 9.13.2, the C-PHY ensures that the very first packet in a burst begins with a Sync
2121 Type 3 sync word. For all subsequent sync words transmitted in a burst, such as when LRTE is enabled, the
2122 CSI-2 protocol layer selects any of Sync Type 0 through Sync Type 3.
2123 Table 34 Example PRBS LFSR Byte Sequence for C-PHY Physical Layer
Scrambling Sequence Word # PRBS Register PRBS Word Input Word Output Word
Initial Seed, Header[47:32] 0x1188 0xd188 0x2b00 0xfa88
Header[31:16] 0xb403 0xd82d 0x13b0 0xcb9d
Header[15:0] 0xd613 0x406b 0x31c8 0x71a3
Sync Word 0xc672 0x0663 0xxxxx
0xxxxx
(see Note 1 below)
Re-initialized Seed, Header[47:32] 0x0990 0x8990 0x2b00 0xa290
Header[31:16] 0xee29 0xbc77 0x13b0 0xafc7
Header[15:0] 0xbba5 0x3ddd 0x31c8 0x0c15
Word 0 0xaa1c 0x6055 0xd000 0xb055
Word 1 0x1a96 0x2958 0x1360 0x3a38
Word 2 0x35f4 0x0fac 0x094c 0x06e0
Word 3 0x7b70 0xdede 0x100b 0xced5
Word 4 0x7873 0x1e1e 0x5fb8 0x41a6
Word 5 0x3338 0x3ccc 0xd030 0xecfc
Word 6 0xfe9c 0xd17f 0x0003 0xd17c
Word 7 0x3303 0xe0cc 0xd039 0x30f5
Word 8 0xfbaf 0x1ddf 0xa35b 0xbe84
Word 9 0xeaf8 0x3757 0x00ea 0x37bd
2124 Note:
1. The Output Word is irrelevant in this word clock cycle because the CSI-2 protocol layer asserts one
of the TxSendSyncHS PPI signals with a valid selection on the corresponding TxSyncTypeHS
signals to transmit a sync word instead of a scrambled data word.
V
D CSI-2 SROI Frame
SNS S APP
P
2141
Figure 94 ISROI System Supporting Multi-Stack SNS with Integrated SROI VDSP
V
CSI-2 Frame D CSI-2 SROI Frame
SNS S APP
P
2142
Figure 95 ESROI System Supporting Standard SNS with an External SROI VDSP
Origin (0, 0)
X
WA Overlapped region
(XC, YC)
C
FS
PH SROI Embedded Data Packet PF
PH SROI Embedded Data Packet PF
PH A(0) D(0) PF
PH A(1) D(1) PF
No interval between A and D
Overlapped region between A
and B is sent only one time.
PH A(n-2) B(0) D(p-k-2) PF
PH A(n-1) B(1) D(p-k-1) PF
PH B(2) D(p-k) PF
PH B(m-2) D(p-1) PF
PH B(m-1) PF
The Virtual Channel of SROI Packet is different from that of non -SROI packets.
FE(VC1)
SROI Short Packet If the Data Type of SROI Packet is different from that of
non-SROI Packet, Data Type Interleaving can be used.
FS(VC0)
FS(VC1)
The Virtual Channel of SROI Packet is the same as that of non-SROI Packet.
FE(VC0)
SROI Short Packet
If the Data Type of SROI Packet is different from that of
FS(VC0) non-SROI Packet, Data Type Interleaving can be used.
FE(VC0)
FS(VC0)
AP detects human face and sends the AP orders to get Full image
position (X0, Y0, H0, W0) to ImageSensor
AP Detecting ROI Idle Ordering Idle
CCI
Bus Idle Bus Idle Bus Idle
(AP->ImageSensor)
activate activate
Status Normal Carving out ROI from the position(X0, Y0, H0, W0) Normal
Image
Sensor
Position
Don t care X0, Y0, H0, W0 Don t care
of ROI(0)
CSI-2 Output Invalid SROI frame SROI frame SROI frame Invalid Full image
Full image frame
(ImageSensor->AP) frame Image Image Image frame frame
AP orders Image Sensor to get human face AP orders Image Sensor to get Full image
CCI
Bus Idle Bus Idle Bus Idle
(AP->ImageSensor)
activate activate
CSI-2 Output Invalid SROI frame SROI frame SROI frame Invalid Full image
Full image frame
(ImageSensor->AP) frame Emb Image Emb Image Emb Image frame frame
Data
1st ROI Info. 2nd ROI Info. Nth ROI Info. End of Padding
PH Format PF
(variable) (variable) (variable) Line (0x07, ,0x07)
Code
8’b00_0_00010 ADC Bit Depth Bit depth of Analog Digital Converter of each ROI
8’b00_0_00011
through Reserved Reserved for future use
8’b00_0_00110
The end of SROI Embedded Data line.
8’b00_0_00111 End of Line
The value of Type Specific Payload is 0x07.
8’b00_0_01000
through Reserved Reserved for future use
8’b00_0_11111
Payload Size = 2 Bytes
8’b01_0_00010
through Reserved Reserved for future use
8’b01_0_00111
8’b01_0_01100
through Reserved Reserved for future use
8’b01_0_11111
Payload Size = 4 Bytes
8’b10_0_00000
through Reserved Reserved for future use
8’b10_0_11111
Payload Size = Length
8’b11_0_00000
through Reserved Reserved for future use
8’b11_0_11111
Frame Blanking
Packet Header, PH
Packet Footer, PF
FE
Frame Blanking
FE
Frame Blanking
Blanking Lines
FS
Frame 1
Line Blanking (Odd, Frame Number = 1)
YUV422 Image Data
Packet Header, PH
Packet Footer, PF
FE
Blanking Lines
FS
Frame 2
Line Blanking (Even, Frame Number = 2)
YUV422 Image Data
FE
Blanking Lines
Blanking Lines
FS
Line Blanking
Frame 1
(Odd, Frame Number = 1)
YUV422 Image Data
Packet Header, PH
Packet Footer, PF
FE
Line Start, LS
Line End, LE
Blanking Lines
FS
Line Blanking
Frame 2
(Even, Frame Number = 2)
YUV422 Image Data
FE
Blanking Lines
Frame Start Packet Embedded Data Embedded Data Data Type 1 Image Data
SoT FS EoT LPS SoT PH Embed Data PF EoT LPS SoT PH Embed Data PF EoT LPS SoT PH Data Type 1 PF EoT
Data Type 1 Image Data Data Type 2 Image Data Data Type 1 Image Data
LPS SoT PH Data Type 1 PF EoT LPS SoT PH Data Type 2 PF EoT LPS SoT PH Data Type 1 PF EoT
Data Type 2 Image Data Data Type 1 Image Data Frame End Packet
LPS SoT PH Data Type 2 PF EoT LPS SoT PH Data Type 1 PF EoT LPS SoT FE EoT
KEY:
LPS – Low Power State FS – Frame Start Packet PH – Packet Header
SoT – Start of Transmission FE – Frame End Packet PF – Packet Footer + Filler (if applicable)
2314
EoT – End of Transmission
2315 All of the packets within the same virtual channel, independent of the Data Type value, share the same frame
2316 start/end and line start/end synchronization information. By definition, all of the packets, independent of data
2317 type, between a Frame Start and a Frame End packet within the same virtual channel belong to the same
2318 frame.
2319 Packets of different data types may be interleaved at either the packet level as illustrated in Figure 106 or
2320 the frame level as illustrated in Figure 107. Data formats are defined in Section 11.
Frame Blanking
Line
Blanking
Frame Blanking
Line
D1 Data Type 1 Image Data PF
Blanking
Frame Blanking
Line
D2 Data Type 2 Image Data PF
Blanking
Frame Blanking
Frame Start Packet Embedded Data Frame Start Packet Embedded Data
Virtual Channel 0 Virtual Channel 0 Virtual Channel 1 Virtual Channel 1
SoT FS EoT LPS SoT PH Embedded Data PF EoT LPS SoT FS EoT LPS SoT PH Embedded Data PF EoT
Data Type 1 Image Data Data Type 2 Image Data Data Type 1 Image Data
Virtual Channel 0 Virtual Channel 1 Virtual Channel 0
LPS SoT PH Data Type 1 PF EoT LPS SoT PH Data Type 2 PF EoT LPS SoT PH Data Type 1 PF EoT
Data Type 2 Image Data Frame End Packet Data Type 1 Image Data Frame End Packet
Virtual Channel 1 Virtual Channel 1 Virtual Channel 0 Virtual Channel 0
LPS SoT PH Data Type 2 PF EoT LPS SoT FE EoT LPS SoT PH Data Type 1 PF EoT LPS SoT FE EoT
KEY:
LPS – Low Power State FS – Frame Start Packet PH – Packet Header
SoT – Start of Transmission FE – Frame End Packet PF – Packet Footer + Filler (if applicable)
2334
EoT – End of Transmission
10 Color Spaces
2335 The color space definitions in this section are simply references to other standards. The references are
2336 included only for informative purposes and not for compliance. The color space used is not limited to the
2337 references given.
11 Data Formats
2345 The intent of this section is to provide a definitive reference for data formats typically used in CSI-2
2346 applications. Table 38 summarizes the formats, followed by individual definitions for each format. Generic
2347 data types not shown in the table are described in Section 11.1. For simplicity, all examples are single Lane
2348 configurations.
2349 The formats most widely used in CSI-2 applications are distinguished by a “primary” designation in Table
2350 38. Transmitter implementations of CSI-2 should support at least one of these primary formats. Receiver
2351 implementations of CSI-2 should support all of the primary formats.
2352 The packet payload data format shall agree with the Data Type value in the Packet Header. See Section 9.4
2353 for a description of the Data Type values.
2354 Table 38 Primary and Secondary Data Formats Definitions
Data Format Primary Secondary
YUV420 8-bit (legacy) – S
YUV420 8-bit – S
YUV420 10-bit – S
YUV420 8-bit (CSPS) – S
YUV420 10-bit (CSPS) – S
YUV422 8-bit P –
YUV422 10-bit – S
RGB888 P –
RGB666 – S
RGB565 P –
RGB555 – S
RGB444 – S
RAW6 – S
RAW7 – S
RAW8 P –
RAW10 P –
RAW12 – S
RAW14 – S
RAW16 – S
RAW20 – S
RAW24 – S
RAW28 – S
Generic 8-bit Long Packet Data Types P –
User Defined Byte-based Data (Note 1) P –
USL Packet Data (See Section 9.12) – S
Note:
1. Compressed image data should use the user defined, byte-based data type codes
2355 For clarity the Start of Transmission and End of Transmission sequences in the figures in this section have
2356 been omitted.
2357 The balance of this section details how sequences of pixels and other application data conforming to each of
2358 the data types listed in Table 38 are converted into equivalent byte sequences by the CSI-2 Pixel to Byte
2359 Packing Formats layer shown in Figure 3.
2360 Various figures in this section depict these byte sequences as shown at the top of Figure 109, where Byte n
2361 always precedes Byte m for n < m. Also note that even though each byte is shown in LSB-first order, this is
2362 not meant to imply that the bytes themselves are bit-reversed by the Pixel to Byte Packing Formats layer
2363 prior to output.
2364 For the D-PHY physical layer option, each byte in the sequence is serially transmitted LSB-first, whereas for
2365 the C-PHY physical layer option, successive byte pairs in the sequence are encoded and then serially
2366 transmitted LSS-first. Figure 109 illustrates these options for a single-Lane system.
D-PHY Physical Layer Byte n* Byte n+1 Byte n+2 Byte n+3
serializes each byte
b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7
and transmits it least
significant bit first
C-PHY Physical Layer B0 C-PHY 16 bit to 7 Symbol Mapper B15 B0 C-PHY 16 bit to 7 Symbol Mapper B15
Mapper composes 7
(B0 = Input LSB, S0 = Output LSS) (B0 = Input LSB, S0 = Output LSS)
symbols from 16-bit
word and transmits S0 S1 S2 S3 S4 S5 S6 S0 S1 S2 S3 S4 S5 S6
least significant symbol * For the C-PHY physical layer option, n = 2k, for k = 0, 1, 2, ...
first
2367
Figure 109 Byte Packing Pixel Data to C-PHY Symbol Illustration
CS (Checksum)
Frame of Arbitrary Pixel and/or Line
User-Defined Byte-Based Data Blanking
Frame Blanking
2381
Figure 110 Frame Structure with Embedded Data at the Beginning and End of the Frame
2396 Bit order in transmission follows the general CSI-2 rule, LSB first. The pixel to byte mapping is illustrated
2397 in Figure 112.
Line Start: Packet Header U1[7:0] Y1[7:0] Y2[7:0] U3[7:0] Y3[7:0] Y4[7:0]
(Odd line)
Line End:
U637[7:0] Y637[7:0] Y638[7:0] U639[7:0] Y639[7:0] Y640[7:0] Packet Footer
(Odd Line)
Line Start:
Packet Header V1[7:0] Y1[7:0] Y2[7:0] V3[7:0] Y3[7:0] Y4[7:0]
(Even Line)
Line End:
V637[7:0] Y637[7:0] Y638[7:0] V639[7:0] Y639[7:0] Y640[7:0] Packet Footer
2398
(Even Line)
B7 B0 B7 B0 B7 B0 B7 B0
Pixel Data V1[7:0] Y1[7:0] Y2[7:0] V3[7:0]
B7 B0 B7 B0 B7 B0 B7 B0
Byte Data V1[7:0] Y1[7:0] Y2[7:0] V3[7:0]
B7 B0 B7 B0 B7 B0
V1[7:0] Y1[7:0] Y2[7:0]
b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7
2399
Figure 112 Legacy YUV420 8-bit Pixel to Byte Packing Bitwise Illustration
Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8
Line 1
Line 2
Line 3
Line 4
Line 5
FS U Y Y U Y Y …. U Y Y
V Y Y V Y Y …. V Y Y
U Y Y U Y Y …. U Y Y
Packet Header, PH
V Y Y V Y Y …. V Y Y Packet Footer, PF
U Y Y U Y Y …. U Y Y
V Y Y V Y Y …. V Y Y
U Y Y U Y Y …. U Y Y
V Y Y V Y Y …. V Y Y
U Y Y U Y Y …. U Y Y
V Y Y V Y Y …. V Y Y
U Y Y U Y Y …. U Y Y
V Y Y V Y Y …. V Y Y FE
2403
Figure 114 Legacy YUV420 8-bit Frame Format
2414 Bit order in transmission follows the general CSI-2 rule, LSB first. The pixel to byte mapping is illustrated
2415 in Figure 116.
Odd lines:
Y1[7:0] (A) Y2[7:0] (B) Y3[7:0] (C) Y4[7:0] (D)
Data A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7
Even lines:
U1[7:0] (A) Y1[7:0] (B) V1[7:0] (C) Y2[7:0] (D)
Data A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7
Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8
Line 1
Line 2
Line 3
Line 4
Line 5
Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8
Line 1
Line 2
Line 3
Line 4
Line 5
FS Y Y Y Y …. Y U Y V Y U Y V Y …. V Y
Y Y Y Y …. Y U Y V Y U Y V Y …. V Y
Y Y Y Y …. Y U Y V Y U Y V Y …. V Y
Packet Header, PH
Packet Header, PH
…. ….
Packet Footer, PF
Packet Footer, PF
Y Y Y Y Y U Y V Y U Y V Y V Y
Y Y Y Y …. Y U Y V Y U Y V Y …. V Y
Y Y Y Y …. Y U Y V Y U Y V Y …. V Y
Y Y Y Y …. Y U Y V Y U Y V Y …. V Y
Y Y Y Y …. Y U Y V Y U Y V Y …. V Y
Y Y Y Y …. Y U Y V Y U Y V Y …. V Y
Y Y Y Y …. Y U Y V Y U Y V Y …. V Y
Y Y Y Y …. Y U Y V Y U Y V Y …. V Y
Y Y Y Y …. Y U Y V Y U Y V Y …. V Y FE
2434 Bit order in transmission follows the general CSI-2 rule, LSB first. The pixel-to-byte mapping is illustrated
2435 in Figure 121.
LSB’s
LSB’s
LSB’s
Line End:
(Even Line) Y638 V637 Y637 U637 Y640 V639 Y639 U639 Packet
[1:0] [1:0] [1:0] [1:0]
U639[9:2] Y639[9:2] V639[9:2] Y640[9:2] [1:0] [1:0] [1:0] [1:0] Footer
LSB’s LSB’s
2436
Figure 120 YUV420 10-bit Transmission
Odd lines: Y1 Y2 Y3 Y4
Y1[9:2] (A) Y2[9:2] (B) Y3[9:2] (C) Y4[9:2] (D) [1:0] [1:0] [1:0] [1:0]
Data A2 A3 A4 A5 A6 A7 A8 A9 B2 B3 B4 B5 B6 B7 B8 B9 C2 C3 C4 C5 C6 C7 C8 C9 D2 D3 D4 D5 D6 D7 D8 D9 A0 A1 B0 B1 C0 C1 D0 D1
Even lines: U1 Y1 V1 Y2
U1[9:2] (A) Y1[9:2] (B) V1[9:2] (C) Y2[9:2] (D) [1:0] [1:0] [1:0] [1:0]
Data A2 A3 A4 A5 A6 A7 A8 A9 B2 B3 B4 B5 B6 B7 B8 B9 C2 C3 C4 C5 C6 C7 C8 C9 D2 D3 D4 D5 D6 D7 D8 D9 A0 A1 B0 B1 C0 C1 D0 D1
2438 The pixel spatial sampling options are the same as for the YUV420 8-bit data format.
Packet Header, PH
…. ….
Packet Footer, PF
Packet Footer, PF
Y Y Y Y LSB Y LSB U Y V Y LSB U Y V Y LSB V Y LSB
Y Y Y Y LSB …. Y LSB U Y V Y LSB U Y V Y LSB …. V Y LSB
Y Y Y Y LSB …. Y LSB U Y V Y LSB U Y V Y LSB …. V Y LSB
Y Y Y Y LSB …. Y LSB U Y V Y LSB U Y V Y LSB …. V Y LSB
Y Y Y Y LSB …. Y LSB U Y V Y LSB U Y V Y LSB …. V Y LSB
Y Y Y Y LSB …. Y LSB U Y V Y LSB U Y V Y LSB …. V Y LSB
Y Y Y Y LSB …. Y LSB U Y V Y LSB U Y V Y LSB …. V Y LSB
Y Y Y Y LSB …. Y LSB U Y V Y LSB U Y V Y LSB …. V Y LSB
Y Y Y Y LSB …. Y LSB U Y V Y LSB U Y V Y LSB …. V Y LSB FE
2445 Bit order in transmission follows the general CSI-2 rule, LSB first. The pixel to byte mapping is illustrated
2446 in Figure 124.
B7 B0 B7 B0 B7 B0 B7 B0
Pixel Data U1[7:0] Y1[7:0] V1[7:0] Y2[7:0]
B7 B0 B7 B0 B7 B0 B7 B0
Byte Data U1[7:0] Y1[7:0] V1[7:0] Y2[7:0]
B7 B0 B7 B0 B7 B0
U1[7:0] Y1[7:0] V1[7:0]
b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7
2448
Figure 124 YUV422 8-bit Pixel to Byte Packing Bitwise Illustration
Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8
Line 1
Line 2
Line 3
Line 4
Line 5
2450 The pixel spatial alignment is the same as in CCIR-656 standard. The frame format for YUV422 is presented
2451 in Figure 126.
FS U Y V Y U …. Y U Y V Y
U Y V Y U …. Y U Y V Y
U Y V Y U …. Y U Y V Y
Packet Header, PH
….
Packet Footer, PF
U Y V Y U Y U Y V Y
U Y V Y U …. Y U Y V Y
U Y V Y U …. Y U Y V Y
U Y V Y U …. Y U Y V Y
U Y V Y U …. Y U Y V Y
U Y V Y U …. Y U Y V Y
U Y V Y U …. Y U Y V Y
U Y V Y U …. Y U Y V Y
U Y V Y U …. Y U Y V Y FE
2452
Figure 126 YUV422 8-bit Frame Format
2458 Bit order in transmission follows the general CSI-2 rule, LSB first. The pixel to byte mapping is illustrated
2459 in Figure 128.
Pixel Data:
B9 B0 B9 B0 B9 B0 B9 B0
U1[9:0] Y1[9:0] V1[9:0] Y2[9:0]
LSB’s
B7 B0 B7 B0 B7 B6 B5 B4 B3 B2 B1 B0
V1[9:2] Y2[9:2] Y2[1:0] V1[1:0] Y1[1:0] U1[1:0]
b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7
2461
Figure 128 YUV422 10-bit Pixel to Byte Packing Bitwise Illustration
2462 The pixel spatial alignment is the same as in the YUV422 8-bit data case. The frame format for YUV422 is
2463 presented in Figure 129.
FS U Y V Y LSBs U …. U Y V Y LSBs
U Y V Y LSBs U …. U Y V Y LSBs
U Y V Y LSBs U …. U Y V Y LSBs
Packer Header, PH
….
Packer Footer, PF
U Y V Y LSBs U U Y V Y LSBs
U Y V Y LSBs U …. U Y V Y LSBs
U Y V Y LSBs U …. U Y V Y LSBs
U Y V Y LSBs U …. U Y V Y LSBs
U Y V Y LSBs U …. U Y V Y LSBs
U Y V Y LSBs U …. U Y V Y LSBs
U Y V Y LSBs U …. U Y V Y LSBs
U Y V Y LSBs U …. U Y V Y LSBs
U Y V Y LSBs U …. U Y V Y LSBs FE
2464
Figure 129 YUV422 10-bit Frame Format
11.3.1 RGB888
2467 RGB888 data transmission is performed by transmitting a BGR byte sequence. This sequence is illustrated
2468 in Figure 130. The RGB888 frame format is illustrated in Figure 132.
2469 Table 47 specifies the packet size constraints for RGB888 packets. The length of each packet must be a
2470 multiple of the values in the table.
2471 Table 47 RGB888 Packet Data Size Constraints
Pixels Bytes Bits
1 3 24
2472 Bit order in transmission follows the general CSI-2 rule, LSB first. The pixel to byte mapping is illustrated
2473 in Figure 131.
Line Start Packet Header B1[7:0] G1[7:0] R1[7:0] B2[7:0] G2[7:0] R2[7:0]
Line End B639[7:0] G639[7:0] R639[7:0] B640[7:0] G640[7:0] R640[7:0] Packet Footer
2474
Figure 130 RGB888 Transmission
B7 B0 B7 B0 B7 B0
B1[7:0] G1[7:0] R1[7:0]
b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7
2475
Figure 131 RGB888 Transmission in CSI-2 Bus Bitwise Illustration
24-bit
FS B G R B G R …. B G R
B G R B G R …. B G R
B G R B G R …. B G R
Packet Header, PH
Packet Footer, PF
B G R B G R …. B G R
B G R B G R …. B G R
…. …. …. …. …. …. …. …. …. ….
…. …. …. …. …. …. …. …. …. ….
B G R B G R …. B G R
B G R B G R …. B G R
B G R B G R …. B G R
B G R B G R …. B G R
B G R B G R …. B G R FE
2476
Figure 132 RGB888 Frame Format
11.3.2 RGB666
2477 RGB666 data transmission is performed by transmitting a B0…5, G0…5, and R0…5 (18-bit) sequence. This
2478 sequence is illustrated in Figure 133. The frame format for RGB666 is presented in the Figure 135.
2479 Table 48 specifies the packet size constraints for RGB666 packets. The length of each packet must be a
2480 multiple of the values in the table.
2481 Table 48 RGB666 Packet Data Size Constraints
Pixels Bytes Bits
4 9 72
2482 Bit order in transmission follows the general CSI-2 rule, LSB first. In RGB666 case the length of one data
2483 word is 18-bits, not eight bits. The word-wise flip is done for 18-bit BGR words; i.e. instead of flipping each
2484 byte (8-bits), each 18-bits pixel value is flipped. This is illustrated in Figure 134.
2486
b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 ...
Figure 134 RGB666 Transmission on CSI-2 Bus Bitwise Illustration
8b 8b 8b 8b 8b 8b 8b 8b 8b
Packer Header, PH
….
Packer Footer, PF
BGR BGR BGR BGR BGR BGR
BGR BGR BGR BGR …. BGR BGR
…. …. …. …. …. …. ….
…. …. …. …. …. …. ….
BGR BGR BGR BGR …. BGR BGR
BGR BGR BGR BGR …. BGR BGR
BGR BGR BGR BGR …. BGR BGR
BGR BGR BGR BGR …. BGR BGR
BGR BGR BGR BGR …. BGR BGR FE
18-bit
2487
Figure 135 RGB666 Frame Format
11.3.3 RGB565
2488 RGB565 data transmission is performed by transmitting B0…B4, G0…G5, R0…R4 in a 16-bit sequence.
2489 This sequence is illustrated in Figure 136. The frame format for RGB565 is presented in the Figure 138.
2490 Table 49 specifies the packet size constraints for RGB565 packets. The length of each packet must be a
2491 multiple of the values in the table.
2492 Table 49 RGB565 Packet Data Size Constraints
Pixels Bytes Bits
1 2 16
2493
2494 Bit order in transmission follows the general CSI-2 rule, LSB first. In RGB565 case the length of one data
2495 word is 16-bits, not eight bits. The word-wise flip is done for 16-bit BGR words; i.e. instead of flipping each
2496 byte (8-bits), each two bytes (16-bits) are flipped. This is illustrated in Figure 137.
b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7
2498
Figure 137 RGB565 Transmission on CSI-2 Bus Bitwise Illustration
16-bit
Packer Header, PH
….
Packer Footer, PF
BGR BGR BGR BGR BGR
BGR BGR BGR …. BGR BGR
…. …. …. …. …. ….
…. …. …. …. …. ….
BGR BGR BGR …. BGR BGR
BGR BGR BGR …. BGR BGR
BGR BGR BGR …. BGR BGR
BGR BGR BGR …. BGR BGR
BGR BGR BGR …. BGR BGR FE
2499
Figure 138 RGB565 Frame Format
11.3.4 RGB555
2500 RGB555 data can be transmitted over a CSI-2 bus with some special arrangements. The RGB555 data should
2501 be made to look like RGB565 data. This can be accomplished by inserting padding bits to the LSBs of the
2502 green color component as illustrated in Figure 139.
2503 Both the frame format and the package size constraints are the same as the RGB565 case.
2504 Bit order in transmission follows the general CSI-2 rule, LSB first. In RGB555 case the length of one data
2505 word is 16-bits, not eight bits. The word-wise flip is done for 16-bit BGR words; i.e. instead of flipping each
2506 byte (8-bits), each two bytes (16-bits) are flipped. This is illustrated in Figure 139.
b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7
2507
Figure 139 RGB555 Transmission on CSI-2 Bus Bitwise Illustration
11.3.5 RGB444
2508 RGB444 data can be transmitted over a CSI-2 bus with some special arrangements. The RGB444 data should
2509 be made to look like RGB565 data. This can be accomplished by inserting padding bits to the LSBs of each
2510 color component as illustrated in Figure 140.
2511 Both the frame format and the package size constraints are the same as the RGB565 case.
2512 Bit order in transmission follows the general CSI-2 rule, LSB first. In RGB444 case the length of one data
2513 word is 16-bits, not eight bits. The word-wise flip is done for 16-bit BGR words; i.e. instead of flipping each
2514 byte (8-bits), each two bytes (16-bits) are flipped. This is illustrated in Figure 140.
b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7
2515
Figure 140 RGB444 Transmission on CSI-2 Bus Bitwise Illustration
11.4.1 RAW6
2525 The 6-bit Raw data transmission is done by transmitting the pixel data over CSI-2 bus. This sequence is
2526 illustrated in Figure 141 (VGA case). Table 51 specifies the packet size constraints for RAW6 packets. The
2527 length of each packet must be a multiple of the values in the table.
2528 Table 51 RAW6 Packet Data Size Constraints
Pixels Bytes Bits
4 3 24
2529 Each 6-bit pixel is sent LSB first. This is an exception to general CSI-2 rule byte wise LSB first.
Packet
Line Start P1[5:0] P2[5:0] P3[5:0] P4[5:0] P5[5:0] P6[5:0] P7[5:0]
Header
Packet
Line End P634[5:0] P635[5:0] P636[5:0] P637[5:0] P638[5:0] P639[5:0] P640[5:0]
Footer
2530
Figure 141 RAW6 Transmission
Data A0 A1 A2 A3 A4 A5 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 D0 D1 D2 D3 D4 D5
….
Packer Footer, PF
11.4.2 RAW7
2533 The 7-bit Raw data transmission is done by transmitting the pixel data over CSI-2 bus. This sequence is
2534 illustrated in Figure 144 (VGA case). Table 52 specifies the packet size constraints for RAW7 packets. The
2535 length of each packet must be a multiple of the values in the table.
2536 Table 52 RAW7 Packet Data Size Constraints
Pixels Bytes Bits
8 7 56
2537 Each 7-bit pixel is sent LSB first. This is an exception to general CSI-2 rule byte-wise LSB first.
Packet
Line Start P1[6:0] P2[6:0] P3[6:0] P4[6:0] P5[6:0] P6[6:0] P7[6:0]
Header
Packet
Line End P634[6:0] P635[6:0] P636[6:0] P637[6:0] P638[6:0] P639[6:0] P640[6:0]
Footer
2538
Figure 144 RAW7 Transmission
Data A0 A1 A2 A3 A4 A5 A6 B0 B1 B2 B3 B4 B5 B6 C0 C1 C2 C3 C4 C5 C6 D0 D1 D2 D3 D4 D5 D6
2539
b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 b4 b5 b6 b7 b0 b1 b2 b3 ...
Figure 145 RAW7 Data Transmission on CSI-2 Bus Bitwise Illustration
….
Packer Footer, PF
11.4.3 RAW8
2541 The 8-bit Raw data transmission is done by transmitting the pixel data over a CSI-2 bus. Table 53 specifies
2542 the packet size constraints for RAW8 packets. The length of each packet must be a multiple of the values in
2543 the table.
2544 Table 53 RAW8 Packet Data Size Constraints
Pixels Bytes Bits
1 1 8
Packet
Line Start P1[7:0] P2[7:0] P3[7:0] P4[7:0] P5[7:0] P6[7:0] P7[7:0]
Header
Packet
Line End P634[7:0] P635[7:0] P636[7:0] P637[7:0] P638[7:0] P639[7:0] P640[7:0]
Footer
2547
Figure 147 RAW8 Transmission
Data A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7
….
Packer Footer, PF
11.4.4 RAW10
2550 The transmission of 10-bit Raw data is done by packing the 10-bit pixel data to look like 8-bit data format.
2551 Table 54 specifies the packet size constraints for RAW10 packets. The length of each packet must be a
2552 multiple of the values in the table.
2553 Table 54 RAW10 Packet Data Size Constraints
Pixels Bytes Bits
4 5 40
LSB’s
Packet P4 P3 P2 P1
Line Start P1[9:2] P2[9:2] P3[9:2] P4[9:2] [1:0] [1:0] [1:0] [1:0] P5[9:2] P6[9:2]
Header
2556
LSB’s LSB’s
Data A2 A3 A4 A5 A6 A7 A8 A9 B2 B3 B4 B5 B6 B7 B8 B9 C2 C3 C4 C5 C6 C7 C8 C9 D2 D3 D4 D5 D6 D7 D8 D9
P1 P2 P3 P4
[1:0] [1:0] [1:0] [1:0] P5[9:2] (E) P6[9:2] (F) P7[9:2] (G)
A0 A1 B0 B1 C0 C1 D0 D1 E2 E3 E4 E5 E6 E7 E8 E9 F2 F3 F4 F5 F6 F7 F8 F9 G2 G3 G4 G5 G6 G7 G8 G9
Packer Header, PH
….
Packer Footer, PF
P1 P2 P3 P4 LSBs P5 P637 P638 P639 P640 LSBs
P1 P2 P3 P4 LSBs P5 …. P637 P638 P639 P640 LSBs
P1 P2 P3 P4 LSBs P5 …. P637 P638 P639 P640 LSBs
P1 P2 P3 P4 LSBs P5 …. P637 P638 P639 P640 LSBs
P1 P2 P3 P4 LSBs P5 …. P637 P638 P639 P640 LSBs
P1 P2 P3 P4 LSBs P5 …. P637 P638 P639 P640 LSBs
P1 P2 P3 P4 LSBs P5 …. P637 P638 P639 P640 LSBs
P1 P2 P3 P4 LSBs P5 …. P637 P638 P639 P640 LSBs
P1 P2 P3 P4 LSBs P5 …. P637 P638 P639 P640 LSBs FE
2558
Figure 152 RAW10 Frame Format
11.4.5 RAW12
2559 The transmission of 12-bit Raw data is done by packing the 12-bit pixel data to look like 8-bit data format.
2560 Table 55 specifies the packet size constraints for RAW12 packets. The length of each packet must be a
2561 multiple of the values in the table.
2562 Table 55 RAW12 Packet Data Size Constraints
Pixels Bytes Bits
2 3 24
LSB’s LSB’s
Packet P2 P1 P4 P3
Line Start P1[11:4] P2[11:4] P3[11:4] P4[11:4] P5[11:4]
Header [3:0] [3:0] [3:0] [3:0]
2565
LSB’s LSB’s LSB’s
P1[11:4] (A) P2[11:4] (B) P1[3:0] (A) P2[3:0 (B)] P3[11:4] (C)
….
Packer Footer, PF
11.4.6 RAW14
2568 The transmission of 14-bit Raw data is done by packing the 14-bit pixel data in 8-bit slices. For every four
2569 pixels, seven bytes of data is generated. Table 56 specifies the packet size constraints for RAW14 packets.
2570 The length of each packet must be a multiple of the values in the table.
2571 Table 56 RAW14 Packet Data Size Constraints
Pixels Bytes Bits
4 7 56
Line Start
LSB s
Packet P2 P1 P3 P2 P4 P3
P1[13:6] P2[13:6] P3[13:6] P4[13:6]
Header [1:0] [5:0] [3:0] [5:2] [5:0] [5:4]
Byte Byte Byte
P638 P637 P639 P638 P640 P639 Packet
Line End P637[13:6] P638[13:6] P639[13:6] P640[13:6]
[1:0] [5:0] [3:0] [5:2] [5:0] [5:4] Footer
2580
Figure 156 RAW14 Transmission
Data A6 A7 A8 A9 A10 A11 A12 A13 B6 B7 B8 B9 B10 B11 B12 B13 C6 C7 C8 C9 C10 C11 C12 C13 D6 D7 D8 D9 D10 D11 D12 D13
P1[5:0] (A) P2[5:0] (B) P3[5:0] (C) P4[5:0] (D) P5[13:6] (E)
Packer Header, PH
….
Packer Footer, PF
P1 P2 P3 P4 LSBs LSBs LSBs LSBs P640 LSBs LSBs LSBs LSBs
P1 P2 P3 P4 LSBs LSBs LSBs LSBs …. P640 LSBs LSBs LSBs LSBs
P1 P2 P3 P4 LSBs LSBs LSBs LSBs …. P640 LSBs LSBs LSBs LSBs
P1 P2 P3 P4 LSBs LSBs LSBs LSBs …. P640 LSBs LSBs LSBs LSBs
P1 P2 P3 P4 LSBs LSBs LSBs LSBs …. P640 LSBs LSBs LSBs LSBs
P1 P2 P3 P4 LSBs LSBs LSBs LSBs …. P640 LSBs LSBs LSBs LSBs
P1 P2 P3 P4 LSBs LSBs LSBs LSBs …. P640 LSBs LSBs LSBs LSBs
P1 P2 P3 P4 LSBs LSBs LSBs LSBs …. P640 LSBs LSBs LSBs LSBs
P1 P2 P3 P4 LSBs LSBs LSBs LSBs …. P640 LSBs LSBs LSBs LSBs FE
2582
Figure 158 RAW14 Frame Format
11.4.7 RAW16
2583 The transmission of 16-bit Raw data is done by packing the 16-bit pixel data to look like the 8-bit data format.
2584 Table 57 specifies the packet size constraints for RAW16 packets. The length of each packet must be a
2585 multiple of the values in the table.
2586 Table 57 RAW16 Packet Data Size Constraints
Pixels Bytes Bits
1 2 16
Packet
Line Start P1[15:8] P1[7:0] P2[15:8] P2[7:0] P3[15:8] P3[7:0] P4[15:8]
Header
Packet
Line End P637[7:0] P638[15:8] P638[7:0] P639[15:8] P639[7:0] P640[15:8] P640[7:0]
2589 Footer
Data A8 A9 A10 A11 A12 A13 A14 A15 A0 A1 A2 A3 A4 A5 A6 A7 B8 B9 B10 B11 B12 B13 B14 B15 B0 B1 B2 B3 B4 B5 B6 B7
Packer Footer, PF
11.4.8 RAW20
2592 The transmission of 20-bit Raw data is done by packing the 20-bit pixel data to look like the 10-bit data
2593 format. Table 58 specifies the packet size constraints for RAW20 packets. The length of each packet must be
2594 a multiple of the values in the table.
2595 Table 58 RAW20 Packet Data Size Constraints
Pixels Bytes Bits
2 5 40
LSB s
Packet
Line Start P1[19:12] P1[9:2] P2[19:12] P2[9:2] P2
[1:0]
P2
[11:10]
P1
[1:0]
P1
[11:10] P3[19:12] P3[9:2]
Header
Packet
Line End P 638
[1:0]
P 638
[11:10]
P 637
[1:0]
P 637
[11:10] P639[19:12] P639[9:2] P640[19:12] P640[9:2] P 640
[1:0]
P 640
[11:10]
P 639
[1:0]
P 639
[11:10]
Footer
Data A12 A13 A14 A15 A16 A17 A18 A19 A2 A3 A4 A5 A6 A7 A8 A9 B12 B13 B14 B15 B16 B17 B18 B19 B2 B3 B4 B5 B6 B7 B8 B9
P1 P1 P2 P2
[11:10] [1:0] [11:10] [1:0] P3[19:12] (C) P3[9:2] (C) P4[19:12] (D)
A10 A11 A0 A1 B10 B11 B0 B1 C12 C13 C14 C15 C16 C17 C18 C19 C2 C3 C4 C5 C6 C7 C8 C9 D12 D13 D14 D15 D16 D17 D18 D19
Packer Footer, PF
P1 P1 P2 P2 LSBs P3 . P639 P639 P640 P640 LSBs
P1 P1 P2 P2 LSBs P3 . P639 P639 P640 P640 LSBs
P1 P1 P2 P2 LSBs P3 . P639 P639 P640 P640 LSBs
P1 P1 P2 P2 LSBs P3 . P639 P639 P640 P640 LSBs
P1 P1 P2 P2 LSBs P3 . P639 P639 P640 P640 LSBs
P1 P1 P2 P2 LSBs P3 . P639 P639 P640 P640 LSBs
P1 P1 P2 P2 LSBs P3 . P639 P639 P640 P640 LSBs
P1 P1 P2 P2 LSBs P3 . P639 P639 P640 P640 LSBs
P1 P1 P2 P2 LSBs P3 . P639 P639 P640 P640 LSBs FE
2600
Figure 164 RAW20 Frame Format
11.4.9 RAW24
2601 The transmission of 24-bit Raw data is done by packing the 24-bit pixel data to look like the 12-bit data
2602 format. Table 59 specifies the packet size constraints for RAW24 packets. The length of each packet must be
2603 a multiple of the values in the table.
2604 Table 59 RAW24 Packet Data Size Constraints
Pixels Bytes Bits
1 3 24
LSB’s LSB’s
Packet P1 P1 P2 P2
Line Start P1[23:16] P1[11:4] P2[23:16] P2[11:4] P3[23:16]
Header [3:0] [15:12] [3:0] [15:12]
2607
LSB’s LSB’s LSB’s
Figure 165 RAW24 Transmission
P1[23:16] (A) P1[11:4] (A) P1[15:12] (A) P1[3:0] (A) P2[23:16] (B)
Data A16 A17 A18 A19 A20 A21 A22 A23 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 A0 A1 A2 A3 B16 B17 B18 B19 B20 B21 B22 B23
Packer Footer, PF
P1 P1 LSBs P2 P2 LSBs P639 LSBs P640 P640 LSBs
P1 P1 LSBs P2 P2 LSBs …. P639 LSBs P640 P640 LSBs
P1 P1 LSBs P2 P2 LSBs …. P639 LSBs P640 P640 LSBs
P1 P1 LSBs P2 P2 LSBs …. P639 LSBs P640 P640 LSBs
P1 P1 LSBs P2 P2 LSBs …. P639 LSBs P640 P640 LSBs
P1 P1 LSBs P2 P2 LSBs …. P639 LSBs P640 P640 LSBs
P1 P1 LSBs P2 P2 LSBs …. P639 LSBs P640 P640 LSBs
P1 P1 LSBs P2 P2 LSBs …. P639 LSBs P640 P640 LSBs
P1 P1 LSBs P2 P2 LSBs …. P639 LSBs P640 P640 LSBs FE
2609
Figure 167 RAW24 Frame Format
11.4.10 RAW28
2610 The transmission of 28-bit Raw data is done by packing the 28-bit pixel data to look like the 14-bit data
2611 format. Table 60 specifies the packet size constraints for RAW28 packets. The length of each packet must be
2612 a multiple of the values in the table.
2613 Table 60 RAW28 Packet Data Size Constraints
Pixels Bytes Bits
2 7 56
Line Start
LSB s
Packet P1 P1 P2 P1 P2 P2
P1[27:20] P1[13:6] P2[27:20] P2[13:6] [19:18]
Header [1:0] [19:14] [17:14] [5:2] [5:0]
Byte Byte Byte
P639 P639 P640 P639 P640 P640 Packet
Line End P639[27:20] P639[13:6] P640[27:20] P640[13:6]
[1:0] [19:14] [17:14] [5:2] [5:0] [19:18] Footer
2616
Figure 168 RAW28 Transmission
Data A20 A21 A22 A23 A24 A25 A26 A27 A6 A7 A8 A9 A10 A11 A12 A13 B20 B21 B22 B23 B24 B25 B26 B27 B6 B7 B8 B9 B10 B11 B12 B13
P1 P2
P1[19:14] (A) [1:0] P1[5:2] (A) P2[17:14] (B) [19:18] P2[5:0] (B) P3[27:20] (C)
A14 A15 A16 A17 A18 A19 A0 A1 A2 A3 A4 A5 B14 B15 B16 B17 B18 B19 B0 B1 B2 B3 B4 B5 C20 C21 C22 C23 C24 C25 C26 C27
FS P1 P1 P2 P2 LSBs LSBs LSBs P639 P639 P640 P640 LSBs LSBs LSBs
P1 P1 P2 P2 LSBs LSBs LSBs P639 P639 P640 P640 LSBs LSBs LSBs
P1 P1 P2 P2 LSBs LSBs LSBs P639 P639 P640 P640 LSBs LSBs LSBs
Packer Header, PH
Packer Footer, PF
P1 P1 P2 P2 LSBs LSBs LSBs P639 P639 P640 P640 LSBs LSBs LSBs
P1 P1 P2 P2 LSBs LSBs LSBs P639 P639 P640 P640 LSBs LSBs LSBs
P1 P1 P2 P2 LSBs LSBs LSBs P639 P639 P640 P640 LSBs LSBs LSBs
P1 P1 P2 P2 LSBs LSBs LSBs P639 P639 P640 P640 LSBs LSBs LSBs
P1 P1 P2 P2 LSBs LSBs LSBs P639 P639 P640 P640 LSBs LSBs LSBs
P1 P1 P2 P2 LSBs LSBs LSBs P639 P639 P640 P640 LSBs LSBs LSBs
P1 P1 P2 P2 LSBs LSBs LSBs P639 P639 P640 P640 LSBs LSBs LSBs
P1 P1 P2 P2 LSBs LSBs LSBs P639 P639 P640 P640 LSBs LSBs LSBs
P1 P1 P2 P2 LSBs LSBs LSBs P639 P639 P640 P640 LSBs LSBs LSBs FE
2618
Figure 170 RAW28 Frame Format
Packet
Line Start B1[7:0] B2[7:0] B3[7:0] B4[7:0] B5[7:0] B6[7:0] B7[7:0]
Header
Packet
Line End B121[7:0] B122[7:0] B123[7:0] B124[7:0] B125[7:0] B126[7:0] B127[7:0]
Footer
2623
Figure 171 User Defined 8-bit Data (128 Byte Packet)
Data A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7
2625 The packet data size in bits shall be divisible by eight, i.e. a whole number of bytes shall be transmitted.
2626 For User Defined data:
2627 • The frame is transmitted as a sequence of arbitrary sized packets.
2628 • The packet size may vary from packet to packet.
2629 • The packet spacing may vary between packets.
SoT FS EoT LPS SoT PH Data PF EoT LPS SoT PH Data PF EoT LPS SoT FE EoT
VVALID
HVALID
DVALID
KEY:
SoT – Start of Transmission EoT – End of Transmission LPS – Low Power State
PH – Packet Header PF – Packet Footer
FS – Frame Start FE – Frame End
2630
LE – Line End
2631 Eight different User Defined data type codes are available as shown in Table 61.
2632 Table 61 User Defined 8-bit Data Types
Data Type Description
0x30 User Defined 8-bit Data Type 1
0x31 User Defined 8-bit Data Type 2
0x32 User Defined 8-bit Data Type 3
0x33 User Defined 8-bit Data Type 4
0x34 User Defined 8-bit Data Type 5
0x35 User Defined 8-bit Data Type 6
0x36 User Defined 8-bit Data Type 7
0x37 User Defined 8-bit Data Type 8
2642
32-bit standard memory width
2644
32-bit standard memory width
2645
32-bit standard memory width
2646
32-bit standard memory width
2647
32-bit standard memory width
2650
32-bit standard memory width
U3 Y3 V3 Y4
e0 e1 e2 e3 e4 e5 e6 e7 f0 f1 f2 f3 f4 f5 f6 f7 g0 g1 g2 g3 g4 g5 g6 g7 h0 h1 h2 h3 h4 h5 h6 h7
2656
32-bit standard memory width
2658
32-bit standard memory width
Y3 Y4 U5 Y5
e0 e1 e2 e3 e4 e5 e6 e7 f0 f1 f2 f3 f4 f5 f6 f7 g0 g1 g2 g3 g4 g5 g6 g7 h0 h1 h2 h3 h4 h5 h6 h7
Buffer
Data in receiver's buffer
Addr
MSB U1 Y1 Y2 U3 LSB
00h a7 a6 a5 a4 a3 a2 a1 a0 b7 b6 b5 b4 b3 b2 b1 b0 c7 c6 c5 c4 c3 c2 c1 c0 d7 d6 d5 d4 d3 d2 d1 d0
Y3 Y4 U5 Y5
01h e7 e6 e5 e4 e3 e2 e1 e0 f7 f6 f5 f4 f3 f2 f1 f0 g7 g6 g5 g4 g3 g2 g1 g0 h7 h6 h5 h4 h3 h2 h1 h0
Y3 Y4 V5 Y5
e
e1 e2 e3 e4 e5 e6 e7 f0 f1 f2 f3 f4 f5 f6 f7 g0 g1 g2 g3 g4 g5 g6 g7 h0 h1 h2 h3 h4 h5 h6 h7
0
Buffer
Data in receiver's buffer
Addr
MSB V1 Y1 Y2 V3 LSB
N a7 a6 a5 a4 a3 a2 a1 a0 b7 b6 b5 b4 b3 b2 b1 b0 c7 c6 c5 c4 c3 c2 c1 c0 d7 d6 d5 d4 d3 d2 d1 d0
Y3 Y4 V5 Y5
N+1 e7 e6 e5 e4 e3 e2 e1 e0 f7 f6 f5 f4 f3 f2 f1 f0 g7 g6 g5 g4 g3 g2 g1 g0 h7 h6 h5 h4 h3 h2 h1 h0
2664
32-bit standard memory width
Y5 Y6 Y7 Y8
e0 e1 e2 e3 e4 e5 e6 e7 f0 f1 f2 f3 f4 f5 f6 f7 g0 g1 g2 g3 g4 g5 g6 g7 h0 h1 h2 h3 h4 h5 h6 h7
U3 Y3 V3 Y4
e0 e1 e2 e3 e4 e5 e6 e7 f0 f1 f2 f3 f4 f5 f6 f7 g0 g1 g2 g3 g4 g5 g6 g7 h0 h1 h2 h3 h4 h5 h6 h7
2666
32-bit standard memory width
P6 P7 P8 P9 P10 P11
f2 f3 f4 f5 g0 g1 g2 g3 g4 g5 h0 h1 h2 h3 h4 h5 i0 i1 i2 i3 i4 i5 j0 j1 j2 j3 j4 j5 k0 k1 k2 k3
2669
32-bit standard memory width
P5 P6 P7 P8 P9 P10
e4 e5 e6 f0 f1 f2 f3 f4 f5 f6 g0 g1 g2 g3 g4 g5 g6 h0 h1 h2 h3 h4 h5 h6 i0 i1 i2 i3 i4 i5 i6 j0
P5 P6 P7 P8
e0 e1 e2 e3 e4 e5 e6 e7 f0 f1 f2 f3 f4 f5 f6 f7 g0 g1 g2 g3 g4 g5 g6 g7 h0 h1 h2 h3 h4 h5 h6 h7
2672
32-bit standard memory width
Buffer
Data in receiver's buffer:
Addr
MSB P4[9:2] P3[9:2] P2[9:2] P1[9:2] LSB
00h d9 d8 d7 d6 d5 d4 d3 d2 c9 c8 c7 c6 c5 c4 c3 c2 b9 b8 b7 b6 b5 b4 b3 b2 a9 a8 a7 a6 a5 a4 a3 a2
2674
32-bit standard memory width
2676
32-bit standard memory width
Buffer
Data in receiver's buffer:
Addr
MSB P2[9:2] P2[19:12] P1[9:2] P1[19:12] LSB
00h b9 b8 b7 b6 b5 b4 b3 b2 b19b18 b17b16b15b14b13b12 a9 a8 a7 a6 a5 a4 a3 a2 a19a18 a17a16a15a14a13a12
2683
32-bit standard memory width
Data a20a21 a22a23 a24a25 a26 a27 a6 a7 a8 a9 a10a11 a12a13 b20b21 b22b23 b24b25 b26b27 b6 b7 b8 b9 b10b11 b12b13
a14a15 a16a17 a18a19 a0 a1 a2 a3 a4 a5 b14b15 b16 b17 b18 b19 b0 b1 b2 b3 b4 b5 c20c21 c22c23 c24c25 c26c27
c6 c7 c8 c9 c10c11 c12 c13 d20d21 d22d23 d24d25 d26d27 d6 d7 d8 d9 d10d11 d12 d13 c14c15 c16c17 c18c19 c0 c1
13.1 Introduction
2686 Always-On Sentinel Conduit (AOSC) is an optional normative feature. AOSC provides an ultra-low power
2687 imaging conduit solution for broad range of always-on and always-aware applications using Vision Digital
2688 Signal Processor (VDSP). The AOSC solution entails CSI-2 protocol transport using I3C I/O, in which the
2689 VDSP is the I3C Controller, and SNS is the I3C Target. The CSI-2 Specification defines an interface between
2690 a peripheral device (SNS) and a host processor (APP) using MIPI D-PHY [MIPI01] or MIPI C-PHY
2691 [MIPI02] as the physical layer. AOSC defines how the CSI-2 protocol may instead be used with MIPI I3C
2692 [MIPI03] as the physical layer for the purpose of transporting low data rate pixels and/or other data from a
2693 SNS to a VDSP. AOSC shall support the I3C SDR and HDR-DDR data rates, and may optionally support the
2694 HDR-BT data rate. Imaging solutions requiring higher throughput should utilize Dual Mode and Quad Mode
2695 I3C Multi-Lane capabilities with bitwise striping.
2696 A key difference between image transport as described in AOSC and traditional CSI-2 is that in AOSC, the
2697 host (VDSP) reads (or “pulls”) pixel data from an image sensor (SNS), whereas in CSI-2 the host passively
2698 receives pixel data transmitted (or “pushed”) to it by a SNS.
2699 AOSC product solutions may include:
2700 • SNS connected to an APP supporting VDSP functionality,
2701 • SNS connected to an VDSP, or
2702 • SNS connected to an APP and an external VDSP,
2703 where APP and VDSP operations may or may not be mutually exclusive as illustrated in Figure 195 through
2704 Figure 197.
SNS
CSI-2 over C/D-PHY APP
(USL)
VDSP
2705
Figure 195 Point-To-Point AOSC Systems with USL Solutions
APP
2
CCI over I C / I3C
VDSP
2
CCI over I C / I3C
SNS APP
CSI-2 over C/D-PHY
2706
Figure 196 Point-To-Point AOSC Systems with Non-USL Solutions
2707
Figure 197 System Supporting AOSC and CCI Operations Over Multi-Drop I3C
2708
Figure 198 System Supporting Discrete Multicontrollers Mapped to Single SNS I3C Target
Port
2709 • The Figure 195 system illustrates the USL (Unified Serial Link) encapsulated solution for APP
2710 and SNS communications as defined in Section 9.11.
2711 • The Figure 196 non-USL solution requires additional I2C / I3C / SPI wires for APP-initiated CCI
2712 operations to the SNS; in such operations, the SNS shall be designated as the Target and APP as
2713 the Controller.
2714 • The Figure 198 system enables non-integrated or discrete VDSP and APP supporting I3C host
2715 arbitration and handshake on the platform using Multi-Controller topology.
2716 An AOSC SNS supporting CSI-2 transport over I3C and C/D-PHY may provide respective dedicated control
2717 registers (i.e., 3A control registers). An AOSC SNS may support simultaneous and mutually exclusive CSI-2
2718 frame transport operations over I3C and C/D-PHY (as illustrated in the above figures). An AOSC SNS limited
2719 to low resolution operations may only support CSI-2 transport over I3C.
SCL
2811
Figure 199 AOSC Optimal Transport Mode (OTM) Operation
2822 OTM control registers are summarized in Table 62. Note that some register bits also apply to STM.
REG_AOSC_CONTROL[15:0] RW –
1’b0: AOSC feature disabled
Bit [0]* – 13.1.2
1’b1: AOSC feature enabled
2’b00: Privacy disabled
2’b01: Privacy enabled with event detection
Bit [2:1]* – 13.1.4
2’b10: Privacy enabled
2’b01: Reserved
1’b0: ODF Mode
Bit [3] – 13.2.5
1’b1: CSF Mode
1’b0: The SNS shall not squelch Frame Start IBI
Bit [4] – 13.2.6
1’b1: The SNS shall squelch Frame Start IBI
1’b0: Dynamic ISPB insertion disabled
Bit [5] – 13.2.7
1’b1: Dynamic ISPB insertion enabled
2’b00: OTM
2’b01: STM
Bit [7:6]* – 13.1.2
2’b10: Reserved for future AOSC Transport Mode
2’b11: Reserved for future AOSC Transport Mode
1’b0: 16-bit CRC disabled
Bit [8] – 13.2
1’b1: 16-bit CRC enabled
REG_AOSC_ISPB_IBI_WM[15:0] RW 13.2.7
REG_AOSC_EHDR_RATE_BPS[31:0] RW 13.2
Byte 1 Byte 0
...
SNS ... P2[9] P2[8] P2[7] P2[6] P2[5] P2[4] P2[3] P2[2] P2[1] P2[0] P1[9] P1[8] P1[7] P1[6] P1[5] P1[4] P1[3] P1[2] P1[1] P1[0] DOUT
P2[9:0] P1[9:0]
2833
Figure 200 Example OTM RAW10 Format Transport (with I3C SDR Bit Transmission Order)
2834 Table 63 provides comprehensive OTM SNS bitwise transmission mapping for all frame formats. These are
2835 mapped into data bytes for I3C read transfers, which shall be transmitted in the appropriate order based on
2836 the I3C Mode.
2837 The SNS shall use an appropriate byte format and protocol for the chosen I3C Mode.
2838 For example:
2839 • In I3C SDR Mode the bytes shall be sent in the defined order, one byte at a time, starting with
2840 Byte 0 and using a T-Bit after each byte. The bits within each byte shall be sent in MSb-first order,
2841 per standard SDR Mode protocol (see [MIPI03] at Section 5.1.2.3).
2842 • In I3C HDR-DDR Mode the bytes shall be sent in 2-byte HDR-DDR Data Words, starting with
2843 Bytes 0 and 1. The bits within each byte shall be sent according to the HDR-DDR Mode protocol
2844 (see [MIPI03] at Section 5.2.2.1). However, HDR-DDR Multi-Lane transfers might use additional
2845 Data Lanes and a modified protocol, per the configured I3C ML Frame Format and Data Transfer
2846 Coding (see [MIPI03] at Section 5.3.2.2).
2847 • In I3C HDR-BT Mode the bytes shall be sent in 32-byte HDR-BT Data Blocks, unless the end of
2848 the data is ‘ragged’ and requires a Last Data Block. The protocol for HDR-BT data is a function of
2849 the number of additional Data Lanes (see [MIPI03] at Section 5.2.4.1), which depends on the
2850 configured I3C ML Frame Format and Data Transfer Coding (see [MIPI03] at Section 5.3.2.4).
2851 Table 63 OTM Bitwise Transport Mapping for All Frame Formats
2852
I3C Bus
OTM LPs FIFO VDSP
2857
Figure 201 SNS OTM FIFO
2858 The FIFO shall be empty prior to the start of image streaming. After the SNS finishes writing all the pixel
2859 bytes from an LP payload into the FIFO, and the total payload consists of an odd number of bytes, then the
2860 SNS shall also write one additional “padding” byte with value 0x00 to the FIFO. The VDSP is able to detect
2861 and discard this padding byte upon reception because it knows in advance how many pixel bytes are
2862 transported by each OTM LP.
2863 Because the I3C HDR-DDR word size is 16 bits, there is no byte granularity with 16-bit transport for
2864 HDR-DDR.
VDSP
SDA
SNS IBI
T_RESP
2942
Figure 203 OTM ISPB Insertion and Frame Start IBI T_RESP Parameter
2943 The AOSC SNS should support REG_AOSC_ISPB_IBI_WM[15:0] to help facilitate appropriate VDSP
2944 transport link rate. The VDSP configures REG_AOSC_ISPB_IBI_WM[15:0] (field ISPB IBI WATERMARK)
2945 with one of the FIFO watermark levels shown below in order to direct the SNS as to when it should generate
2946 the frame-start IBI, based on FIFO fullness. An SNS datasheet may restrict watermark support to only a
2947 subset of these levels:
2948 {12’d0, 4’b0000}: The SNS shall generate an IBI when FIFO is not empty
2949 {12’d0, 4’b0001}: The SNS shall generate an IBI when FIFO WATERMARK is 1/16 th full
2950 {12’d0, 4’b0010}: The SNS shall generate an IBI when FIFO WATERMARK is 2/16 th full
2951 …
2952 {4’b0100, 12’d0}: The SNS shall generate IBI when FIFO WATERMARK is 15/16 th full
2953 {4’b1000, 12’d0}: The SNS shall generate IBI when FIFO is full
VDSP
SDA
SNS IBI
S DA/R A/N HD0 T HD1 T HD2 T DT0 T DT1 T DT3 T DT4 T DTN T CRC T CRC T P
VCX + ECC
Word Count
Data WC-3
Data WC-4
Data WC-2
Data WC-1
Checksum
(l.s. byte
Data ID
Data 2
Data 0
Data 1
Data 3
16-Bit
16-bit
first)
LPS SoT EoT LPS
S = START condition
P = STOP condition
Interrupt Group Identifier Specific Interrupt Identifier A/N = ACK/NACK
MDB[7] MDB[6] MDB[5] MDB[4] MDB[3] MDB[2] MDB[1] MDB[0] T = Transition Bit alternative to ACK/NACK
2974
2975 Figure 204 AOSC Smart Transport Mode (STM) Operation for the D-PHY Generic STM Types
2976 • IBI: In-Band Interrupt generated by the SNS at the beginning of an image line or frame
2977 The IBI consists of the following data:
2978 • DA/R: The Dynamic Address with RnW bit set to 1’b1 (i.e., READ)
2979 • HD0: MDB as the first Header Byte for STM shown in Table 66
2980 • MDB: The Mandatory Data Byte of the IBI payload is the data that follows the Dynamic
2981 Address when the SNS sends an IBI request:
2982 • MDB[7:5]: Interrupt Group Identifier
2983 • 3’b010: MIPI Groups
2984 • MDB[4:0]: Specific Interrupt Identifier Value
2985 • 5’h01: AOSC Transport Mode for STM
2986 • HD1: The second Header Byte that defines the Word Count Extension Enable ( WCX_EN) and
2987 the STM Type for the STM specific payload data, which provides some flexibility depending on
2988 the applications:
2989 • Bit[7]: Reserved for future use
2990 • WCX_EN[6]: Word Count Extension Enable
2991 • 1'b0: The Word Count Extension is disabled, so the next Header Byte HD2 may be omitted.
2992 Only DT1 and DT2 are valid as 16-bit Word Count (WC).
2993 • 1'b1: the Word Count Extension is enabled, so the next Header Byte HD2 represents the
2994 most significant byte of the 24-bit Word Count (WC) along with DT1 and DT2
2995 • STMTYP[5:0]: STM Type
2996 • 6'h00: Reserved for future use
2997 • 6'h01–6'h1F: User Defined 1–31
2998 • 6’h20: D-PHY Generic Use 0, which is equivalent to Long Packet Structure for D-PHY
2999 Physical Layer Option shown in Figure 52, while the 32-bit Packet Header (PH) element is
3000 considered as payload in STM. The Word Count Extension (WCX_EN[6]) is ignored in this
3001 case, or handled as 1’b0 as if it’s disabled so that the following third Header Byte (HD2) is
3002 omitted.
3003 • 6’h21: D-PHY Generic Use 1, which is defined as an extension of D-PHY Generic Use 0
3004 above that allows the Word Count Extension, making the Word Count (WC) a 24-bit (not
3005 16-bit) field in order to support transport of more data than D-PHY Generic Use 0.
3006 • 6'h22–6'h3F: Reserved for future use
3007 • HD2: The third Header Byte, which defines the most significant byte of the 24-bit Word Count
3008 (WC) along with DT1 and DT2 when WCX_EN[6] = 1’b1
3009 • WCX[7:0]: The most significant byte of the 24-bit Word Count (WC)
3010 • DT0: The 8-bit Data Identifier (DI) as the first byte of the 32-bit Packet Header (PH) shown in
3011 Figure 52 when STMTYP[5:0] = 6’h20 or 6’h21
3012 • VC[7:6]: The 2-bit Virtual Channel (VC) that defines the least significant two bits of the 4-bit
3013 Virtual Channel Identifier for the D-PHY physical layer option
3014 • DT[5:0]: The 6-bit Data Type that denotes the format/content of the Application Specific
3015 Payload Data used by the application specific layer
3016 • DT1: The least significant byte of the 16-bit or 24-bit Word Count (WC) as the second byte of
3017 the 32-bit Packet Header (PH) shown in Figure 52 when STMTYP[5:0] = 6’h20 or 6’h21
3018 • WC[7:0]: The least significant byte of the 16-bit or 24-bit Word Count (WC)
3019 • DT2: The second least significant byte of the 16-bit or 24-bit Word Count (WC) as the third byte
3020 of the 32-bit Packet Header (PH) shown in Figure 52 when STMTYP[5:0] = 6’h20 or 6’h21
3021 • WC[15:8]: The second least significant byte of the 16-bit or 24-bit Word Count (WC)
3022 • DT3: The 6-bit Error Correction Code (ECC) and the 2-bit Virtual Channel Extension (VCX) as
3023 the fourth byte of the 32-bit Packet Header (PH) shown in Figure 52 when STMTYP[5:0] =
3024 6’h20 or 6’h21
3025 • ECC[5:0]: The 6-bit ECC enables 1-bit errors within the packet header to be corrected, and
3026 2-bit errors to be detected
3027 • VCX[1:0]: The 2-bit Virtual Channel Extension (VCX) that defines the most significant two
3028 bits of the 4-bit Virtual Channel Identifier for the D-PHY physical layer option
3029 • DT4–DTN: The SNS transports the Application Specific Payload Data shown in Figure 52 when
3030 STMTYP[5:0] = 6’h20 or 6’h21
3031 • CRC: The SNS generates the 16-bit Checksum/CRC (the least significant byte first) shown in
3032 Figure 52 when STMTYP[5:0] = 6’h20 or 6’h21
3033 See Section 9.1.1 for further descriptions.
3034 Table 66 Header Definitions for AOSC Smart Transport Mode (STM)
Header
Bits Field Values
Byte
0 MDB Interrupt Group
MDB[7:5] 3’b010: MIPI Groups
(HD0) Identifier
5’h00: AOSC Transport Mode for OTM
5’h01: AOSC Transport Mode for STM
MDB Specific Interrupt
MDB[4:0] 5’h02–5’h1B: MIPI Alliance Reserved
Identifier Value
5’h1C–5’h1D: MIPI Alliance Debug WG Reserved
5’h1E–5’h1F: MIPI Alliance Reserved
1 Bit[7] – Reserved
(HD1)
Word Count Extension 1'b0: Word Count Extension Disabled
WCX_EN[6]
Enable 1'b1: Word Count Extension Enabled
6'h00: Reserved
6'h01–6'h1F: User Defined 1 - 31
STMTYP[5:0] STM Type 6'h20: D-PHY Generic Use 0
6'h21: D-PHY Generic Use 1
6'h22–6'h3F: Reserved
2
8’h00–8’hFF: Most significant byte of the 24-bit
(HD2: WCX[7:0] Word Count Extension
Word Count when WCX_EN[6] = 1'b1
Optional)
3035 AOSC STM shall follow the data packing defined in Section 11 with the D-PHY generic STM types, when
3036 STMTYP[5:0] = 6’h20 or 6’h21.
3037 Figure 205 illustrates an example of RAW10 format bitwise transport with the D-PHY generic STM types
3038 above.
3039 Note:
3040 Data packing for the D-PHY generic STM types differs from that shown in Table 63 for OTM.
Data A2 A3 A4 A5 A6 A7 A8 A9 B2 B3 B4 B5 B6 B7 B8 B9 C2 C3 C4 C5 C6 C7 C8 C9 D2 D3 D4 D5 D6 D7 D8 D9
P1 P2 P3 P4
[1:0] [1:0] [1:0] [1:0] P5[9:2] P6[9:2] P7[9:2]
A0 A1 B0 B1 C0 C1 D0 D1 E2 E3 E4 E5 E6 E7 E8 E9 F2 F3 F4 F5 F6 F7 F8 F9 G2 G3 G4 G5 G6 G7 G8 G9
8 bits 8 bits 8 bits 8 bits
JPEG encoding
Camera image according to SOSI, EOSI, SOEI and
data processing baseline JPEG EOEI marker application CSI
(color separation, DCT with JPEG8 and additional data transmitter
AWB, etc.) additional embedding
definitions
Thumbnail image
scaling and sRGB
conversion
Image status
information
3050
Figure 206 JPEG8 Data Flow in the Encoder
Additional data
Addition of EXIF
CSI extraction based on
information,
receiver SOSI, EOSI, SOEI
Storing into a file
and EOEI markers
Thumbnail image
Image status
information
3051
Figure 207 JPEG8 Data Flow in the Decoder
Compressed Data
Compressed Data
SOEI
Embedded Image data
End Of Image (EOI)
EOEI
Start of Status Information (SOSI)
Compressed Data
Image Status Information
End of Status Information (EOSI)
3114
Figure 210 Example of TN Image Embedding Inside the Compressed JPEG Data Block
B5 B6 B7 B8
e0 e1 e2 e3 e4 e5 e6 e7 f0 f1 f2 f3 f4 f5 f6 f7 g0 g1 g2 g3 g4 g5 g6 g7 h0 h1 h2 h3 h4 h5 h6 h7
Coverage of this
CSI Transmitter 2 Data Lanes CSI Receiver implementation
Data2+ Data2+ example
Data2- Data2-
Data1+ Data1+
Data1- Data1-
Clock+ Clock+
Clock- Clock-
400kHz Bidirectional
CCI Target Control Link CCI Controller
SCL SCL
SDA SDA
3127
Figure 212 Implementation Example Block Diagram and Coverage
3128 For this implementation example a layered structure is described with the following parts:
3129 • D-PHY implementation details
3130 • Multi lane merger details
3131 • Protocol layer details
3132 This implementation example refers to a RAW8 data type only; hence no packing/unpacking or byte
3133 clock/pixel clock timing will be referenced as for this type of implementation they are not needed.
3134 No error recovery mechanism or error processing details will be presented, as the intent of the document is
3135 to present an implementation from the data flow perspective.
TxDDRClkHS-Q
TxDDRClkHS-I TxDDRClkHS-Q LP-TX Cp
Clock HS-TX
TxByteClkHS CIL-MCNN
management unit TxRequestHS Cn
TxByteClk TxReadyHS
TxClkEsc D-PHY
ShutdownClk
PHY Handshake TxUlpmClk
elasticity FIFO
Clock Lane
TxByteClk
FrameValid Protocol level
TxDDRClkHS-I LP-TX D2p
LineValid control logic
HS-TX
TxByteClkHS CIL-MFEN D2n
TxByteDataHS[7:0] TxDataHS[7:0]
Fixed ID
(RAW8) ECC[7:0] TxWriteHS TxRequestHS D-PHY
ECC generator
TxReadyHS
Shutdown2
WC[15:0] TxUlpm
CSI2 packet PH[7:0] TxWrite
VC[1:0] TxClkEsc
header (PH)
TxByteData[7:0]
Data Lane 2
Cp LP-RX RxDDRClkHS
HS-RX
Cn CIL-SCNN
RxClkActiveHS
D-PHY
StopstateClk
ShutdownClk
RxUlpmClk
PHY delay FIFO
Clock Lane
LP-RX RxDDRClkHS
D2p HS-RX
CIL-SFEN RxByteClkHS
RxDataHS[7:0] RxByteDataHS[7:0]
D2n
RxSyncHS
RxValidHS
RxActiveHS
Packet header ECC
D-PHY Stopstate2 ECC decode elasticity FIFO
Shutdown2 and correct
ErrSotHS
ErrSotSyncHS
RxByteDataHS[7:0] RAW8_Data[7:0]
WC1
WC0
ECC
ErrControl
ID
RxUlpmEsc
ErrEsc
CSI2 packet VC[1:0]
Data Lane 2 header/footer WC[15:0]
ECC generator processing
LP-RX RxDDRClkHS
D1p HS-RX RxByteClkHS
CIL-SFEN RxByteDataHS[7:0]
RxDataHS[7:0] 16-bit MISR (LFSR)
D1n
RxSyncHS
RxValidHS Receiver Payload CRC error
RxActiveHS Error control CRC detect
block
Stopstate1 AppErrors[n:0]
D-PHY
Shutdown1
ErrSotHS Stopstate
ErrSotSyncHS Lane merger ErrSotSyncHS RxByteClk
control logic ErrSotHS FrameValid
ErrControl
(including ErrControl Protocol level LineValid
RxUlpmEsc
PHY control/ RxValidHS1 control logic
ErrEsc
error signals) RxValidHS2
RxByteClk
Data Lane 1
ErrEsc
D-PHY level Lane Merger Level CSI2 Protocol Level
Clock Lane
LP-RX RxDDRClkHS
TxDDRClkHS-I LP-TX D1p D1p HS-RX RxByteClkHS
HS-TX CIL-SFEN
CIL-MFEN RxDataHS[7:0]
TxByteClkHS D1n D1n
TxDataHS[7:0] RxSyncHS
RxValidHS
TxRequestHS D-PHY RxActiveHS
TxReadyHS
RxUlpmEsc
D-PHY
Shutdown Stopstate
TxUlpm Shutdown
TxClkEsc
ErrSotHS
ErrSotSyncHS
ErrEsc
ErrControl
Data Lane 1
LP-RX RxDDRClkHS
TxDDRClkHS-I LP-TX D2p D2p HS-RX RxByteClkHS
HS-TX CIL-SFEN
CIL-MFEN RxDataHS[7:0]
TxByteClkHS D2n D2n
TxDataHS[7:0] RxSyncHS
RxValidHS
TxRequestHS D-PHY RxActiveHS
TxReadyHS
RxUlpmEsc
D-PHY
Shutdown Stopstate
TxUlpm Shutdown
TxClkEsc
ErrSotHS
ErrSotSyncHS
ErrEsc
ErrControl
Data Lane 2
Low-power Function
Cp
TX Ctrl Logic
LP-TX
Cn
TxDDRClkHS-Q HS-TX
TxRequestHS
TX Ctrl IF Logic
CIL-MCNN
Lane Control and Interface Logic
3154
Figure 216 CSI-2 Clock Lane Transmitter
3155 The modular D-PHY components used to build a CSI-2 clock lane transmitter are:
3156 • LP-TX for the Low-power function
3157 • HS-TX for the High-speed function
3158 • CIL-MCNN for the Lane control and interface logic
3159 The PPI interface signals to the CSI-2 clock lane transmitter are:
3160 • TxDDRClkHS-Q (Input): High-Speed Transmit DDR Clock (Quadrature).
3161 • TxRequestHS (Input): High-Speed Transmit Request. This active high signal causes the lane
3162 module to begin transmitting a high-speed clock.
3163 • TxReadyHS (Output): High-Speed Transmit Ready. This active high signal indicates that the
3164 clock lane is transmitting HS clock.
3165 • Shutdown (Input): Shutdown Lane Module. This active high signal forces the lane module into
3166 “shutdown”, disabling all activity. All line drivers, including terminators, are turned off when
3167 Shutdown is asserted. When Shutdown is high, all other PPI inputs are ignored and all PPI outputs
3168 are driven to the default inactive state. Shutdown is a level sensitive signal and does not depend on
3169 any clock.
3170 • TxUlpmClk (Input): Transmit Ultra Low-Power mode on Clock Lane This active high signal is
3171 asserted to cause a Clock Lane module to enter the Ultra Low-Power mode. The lane module
3172 remains in this mode until TxUlpmClk is de-asserted.
High-speed Function
RxDDRClkHS HS-RX RT
Cp
RX Ctrl Decoder
LP-RX
Cn
RX Ctrl IF Logic
RxUlpmEsc RX State
RxClkActiveHS Machine Low-power Function
Stopstate
Shutdown
CIL-SCNN
Lane Control and Interface Logic
3174
Figure 217 CSI-2 Clock Lane Receiver
3175 The modular D-PHY components used to build a CSI-2 clock lane receiver are:
3176 • LP-RX for the Low-power function
3177 • HS-RX for the High-speed function
3178 • CIL-SCNN for the Lane control and interface logic
3179 The PPI interface signals to the CSI-2 clock lane receiver are:
3180 • RxDDRClkHS (Output): High-Speed Receive DDR Clock used to sample the data in all data
3181 lanes.
3182 • RxClkActiveHS (Output): High-Speed Reception Active. This active high signal indicates that the
3183 clock lane is receiving valid clock. This signal is asynchronous.
3184 • Stopstate (Output): Lane is in Stop state. This active high signal indicates that the lane module is
3185 currently in Stop state. This signal is asynchronous.
3186 • Shutdown (Input): Shutdown Lane Module. This active high signal forces the lane module into
3187 “shutdown”, disabling all activity. All line drivers, including terminators, are turned off when
3188 Shutdown is asserted. When Shutdown is high, all PPI outputs are driven to the default inactive
3189 state. Shutdown is a level sensitive signal and does not depend on any clock.
3190 • RxUlpmEsc (Output): Escape Ultra Low Power (Receive) mode. This active high signal is
3191 asserted to indicate that the lane module has entered the Ultra Low-Power mode. The lane module
3192 remains in this mode with RxUlpmEsc asserted until a Stop state is detected on the lane
3193 interconnect.
Low-power Function
TX Ctrl Logic
Dp
TX Data IF Logic
LP-TX
TxDDRClkHS-I
Dn
TxByteClkHS
HS-Serialize
TxDataHS[7:0]
Sync sequence HS-TX
Deskew sequence
High-speed Function
TxRequestHS
TX Ctrl IF Logic
TxReadyHS
Shutdown
TxRequestEsc TX State
Machine
TxUlpm TxUlpmEsc
TxClkEsc
CIL-MFEN
3196 The modular D-PHY components used to build a CSI-2 data lane transmitter are:
3197 • LP-TX for the Low-power function
3198 • HS-TX for the High-speed function
3199 • CIL-MFEN for the Lane control and interface logic. For optional deskew calibration support, the
3200 data lane transmitter transmits a deskew sequence. The deskew sequence transmission is enabled
3201 by a mechanism out of the scope of this specification.
3202 The PPI interface signals to the CSI-2 data lane transmitter are:
3203 • TxDDRClkHS-I (Input): High-Speed Transmit DDR Clock (in-phase).
3204 • TxByteClkHS (Input): High-Speed Transmit Byte Clock. This is used to synchronize PPI signals
3205 in the high-speed transmit clock domain. It is recommended that both transmitting data lane
3206 modules share one TxByteClkHS signal. The frequency of TxByteClkHS must be exactly 1/8 the
3207 high-speed bit rate.
3208 • TxDataHS[7:0] (Input): High-Speed Transmit Data. Eight bit high-speed data to be transmitted.
3209 The signal connected to TxDataHS[0] is transmitted first. Data is registered on rising edges of
3210 TxByteClkHS.
3211 • TxRequestHS (Input): High-Speed Transmit Request. A low-to-high transition on TxRequestHS
3212 causes the lane module to initiate a Start-of-Transmission sequence. A high-to-low transition on
3213 TxRequest causes the lane module to initiate an End-of-Transmission sequence. This active high
3214 signal also indicates that the protocol is driving valid data on TxByteDataHS to be transmitted.
3215 The lane module accepts the data when both TxRequestHS and TxReadyHS are active on the same
3216 rising TxByteClkHS clock edge. The protocol always provides valid transmit data when
3217 TxRequestHS is active. Once asserted, TxRequestHS should remain high until the all the data has
3218 been accepted.
3219 • TxReadyHS (Output): High-Speed Transmit Ready. This active high signal indicates that
3220 TxDataHS is accepted by the lane module to be serially transmitted. TxReadyHS is valid on rising
3221 edges of TxByteClkHS. Valid data has to be provided for the whole duration of active
3222 TxReadyHS.
3223 • Shutdown (Input): Shutdown Lane Module. This active high signal forces the lane module into
3224 “shutdown”, disabling all activity. All line drivers, including terminators, are turned off when
3225 Shutdown is asserted. When Shutdown is high, all other PPI inputs are ignored and all PPI outputs
3226 are driven to the default inactive state. Shutdown is a level sensitive signal and does not depend on
3227 any clock.
3228 • TxUlpmEsc (Input): Escape Mode Transmit Ultra Low Power. This active high signal is asserted
3229 with TxRequestEsc to cause the lane module to enter the Ultra Low-Power mode. The lane
3230 module remains in this mode until TxRequestEsc is de-asserted.
3231 • TxRequestEsc (Input): This active high signal, asserted together with TxUlpmEsc is used to
3232 request entry into Escape Mode. Once in Escape Mode, the lane stays in Escape Mode until
3233 TxRequestEsc is de-asserted. TxRequestEsc is only asserted by the protocol while TxRequestHS
3234 is low.
3235 • TxClkEsc (Input): Escape Mode Transmit Clock. This clock is directly used to generate escape
3236 sequences. The period of this clock determines the symbol time for low power signals. It is
3237 therefore constrained by the normative part of the [MIPI01].
High-speed Function
RX Data IF Logic
RxDDRClkHS
RxByteClkHS
HS-Deskew
RxDataHS[7:0]
HS-Deserialize HS-RX RT
RxUlpmEsc Dp
RX Esc ULPS Decoder
LP-RX
RX Ctrl Decoder Dn
RxValidHS
RxActiveHS
Low-power Function
RxSyncHS
RX Ctrl IF Logic
RX State
Stopstate Machine
Shutdown
ErrSotHS
ErrSotSyncHS
ErrControl
ErrEsc
CIL-SFEN
3240 The modular D-PHY components used to build a CSI-2 data lane receiver are:
3241 • LP-RX for the Low-power function
3242 • HS-RX for the High-speed function
3243 • CIL-SFEN for the Lane control and interface logic. For optional deskew calibration support the
3244 data lane receiver detects a transmitted deskew calibration pattern and performs optimum deskew
3245 of the Data with respect to the RxDDRClkHS Clock.
3246 The PPI interface signals to the CSI-2 data lane receiver are:
3247 • RxDDRClkHS (Input): High-Speed Receive DDR Clock used to sample the date in all data lanes.
3248 This signal is supplied by the CSI-2 clock lane receiver.
3249 • RxByteClkHS (Output): High-Speed Receive Byte Clock. This signal is used to synchronize
3250 signals in the high-speed receive clock domain. The RxByteClkHS is generated by dividing the
3251 received RxDDRClkHS.
3252 • RXDataHS[7:0] (Output): High-Speed Receive Data. Eight bit high-speed data received by the
3253 lane module. The signal connected to RxDataHS[0] was received first. Data is transferred on
3254 rising edges of RxByteClkHS.
3255 • RxValidHS (Output): High-Speed Receive Data Valid. This active high signal indicates that the
3256 lane module is driving valid data to the protocol on the RxDataHS output. There is no
3257 “RxReadyHS” signal, and the protocol is expected to capture RxDataHS on every rising edge of
3258 RxByteClkHS where RxValidHS is asserted. There is no provision for the protocol to slow down
3259 (“throttle”) the receive data.
3260 • RxActiveHS (Output): High-Speed Reception Active. This active high signal indicates that the
3261 lane module is actively receiving a high-speed transmission from the lane interconnect.
3262 • RxSyncHS (Output): Receiver Synchronization Observed. This active high signal indicates that
3263 the lane module has seen an appropriate synchronization event. In a typical high-speed
3264 transmission, RxSyncHS is high for one cycle of RxByteClkHS at the beginning of a high-speed
3265 transmission when RxActiveHS is first asserted. This signal missing is signaled using
3266 ErrSotSyncHS.
3267 • RxUlpmEsc (Output): Escape Ultra Low Power (Receive) mode. This active high signal is
3268 asserted to indicate that the lane module has entered the Ultra Low-Power mode. The lane module
3269 remains in this mode with RxUlpmEsc asserted until a Stop state is detected on the lane
3270 interconnect.
3271 • Stopstate (Output): Lane is in Stop state. This active high signal indicates that the lane module is
3272 currently in Stop state. This signal is asynchronous.
3273 • Shutdown (Input): Shutdown Lane Module. This active high signal forces the lane module into
3274 “shutdown”, disabling all activity. All line drivers, including terminators, are turned off when
3275 Shutdown is asserted. When Shutdown is high, all PPI outputs are driven to the default inactive
3276 state. Shutdown is a level sensitive signal and does not depend on any clock.
3277 • ErrSotHS (Output): Start-of-Transmission (SoT) Error. If the high-speed SoT leader sequence is
3278 corrupted, but in such a way that proper synchronization can still be achieved, this error signal is
3279 asserted for one cycle of RxByteClkHS. This is considered to be a “soft error” in the leader
3280 sequence and confidence in the payload data is reduced.
3281 • ErrSotSyncHS (Output): Start-of-Transmission Synchronization Error. If the high-speed SoT
3282 leader sequence is corrupted in a way that proper synchronization cannot be expected, this error is
3283 asserted for one cycle of RxByteClkHS.
3284 • ErrControl (Output): Control Error. This signal is asserted when an incorrect line state sequence
3285 is detected.
3286 • ErrEsc (Output): Escape Entry Error. If an unrecognized escape entry command is received, this
3287 signal is asserted and remains high until the next change in line state. The only escape entry
3288 command supported by the receiver is the ULPS.
Using signal XSHUTDOWN to confirm entry and exit from Sleep mode
Using the ULPS Sequence on Data Lane to confirm entry and exit from Sleep mode
Dp (D-PHY) or
Data_A (C-PHY)
Dn (D-PHY) or
Data_C (C-PHY)
Initial
3438 State
3485 The data compression system consists of encoder, decoder and predictor blocks as shown in Figure 221.
Transmitter Receiver
Codec
Selector and
Encoder Encoded Encoded
Symbols Symbols Decoded
+ DPCM1 Symbols
... Decoder
Unencoded DPCMN
- PCM
Symbols M-pixel
Memory
M-pixel
Predictor Decoder
Memory Predictor
3486
Figure 221 Data Compression System Block Diagram
3487 The encoder uses a simple algorithm to encode the pixel values. A fixed number of pixel values at the
3488 beginning of each line are encoded without using prediction. These first few values are used to initialize the
3489 predictor block. The remaining pixel values on the line are encoded using prediction.
3490 If the predicted value of the pixel (Xpred) is close enough to the original value of the pixel (Xorig)
3491 (abs(Xorig - Xpred) < difference limit), its difference value (Xdiff) is quantized using a DPCM codec.
3492 Otherwise, Xorig is quantized using a PCM codec. The quantized value is combined with a code word
3493 describing the codec used to quantize the pixel and the sign bit, if applicable, to create the encoded value
3494 (Xenco).
E.1 Predictors
3495 In order to have meaningful data transfer, both the transmitter and the receiver need to use the same predictor
3496 block.
3497 The order of pixels in a raw image is shown in Figure 222.
3498
Figure 222 Pixel Order of the Original Image
3499 Figure 223 shows an example of the pixel order with RGB data.
G0 R1 G2 R3 G4 R5 G6 R7
B0 G1 B2 G3 B4 G5 B6 G7
3500
Figure 223 Example Pixel Order of the Original Image
3501 Two predictors are defined for use in the data compression schemes.
3502 Predictor1 uses a very simple algorithm and is intended to minimize processing power and memory size
3503 requirements. Typically, this predictor is used when the compression requirements are modest and the original
3504 image quality is high. Predictor1 should be used with 10–8–10, 10–7–10, 12-10-12, and 12–8–12 data
3505 compression schemes.
3506 The second predictor, Predictor2, is more complex than Predictor1. This predictor provides slightly better
3507 prediction than Predictor1 and therefore the decoded image quality can be improved compared to Predictor1.
3508 Predictor2 should be used with 10–6–10, 12–7–12, and 12–6–12 data compression schemes.
3509 Both receiver and transmitter shall support Predictor1 for all data compression schemes.
E.1.1 Predictor1
3510 Predictor1 uses only the previous same color component value as the prediction value. Therefore, only a
3511 two-pixel deep memory is required.
3512 The first two pixels (C00, C11 / C20, C31 or as in example G0, R1 / B0, G1) in a line are encoded without
3513 prediction.
3514 The prediction values for the remaining pixels in the line are calculated using the previous same color
3515 decoded value, Xdeco. Therefore, the predictor equation can be written as follows:
3516 Xpred( n ) = Xdeco( n-2 )
E.1.2 Predictor2
3517 Predictor2 uses the four previous pixel values, when the prediction value is evaluated. This means that also
3518 the other color component values are used, when the prediction value has been defined. The predictor
3519 equations can be written as shown in the following formulas.
3520 Predictor2 uses all color components of the four previous pixel values to create the prediction value.
3521 Therefore, a four-pixel deep memory is required.
3522 The first pixel (C00 / C20, or as in example G0 / B0) in a line is coded without prediction.
3523 The second pixel (C11 / C31 or as in example R1 / G1) in a line is predicted using the previous decoded
3524 different color value as a prediction value. The second pixel is predicted with the following equation:
3525 Xpred( n ) = Xdeco( n-1 )
3526 The third pixel (C02 / C22 or as in example G2 / B2) in a line is predicted using the previous decoded same
3527 color value as a prediction value. The third pixel is predicted with the following equation:
3528 Xpred( n ) = Xdeco( n-2 )
3529 The fourth pixel (C13 / C33 or as in example R3 / G3) in a line is predicted using the following equation:
3530 if ((Xdeco( n-1 ) <= Xdeco( n-2 ) AND Xdeco( n-2 ) <= Xdeco( n-3 )) OR
3531 (Xdeco( n-1 ) >= Xdeco( n-2 ) AND Xdeco( n-2 ) >= Xdeco( n-3 ))) then
3532 Xpred( n ) = Xdeco( n-1 )
3533 else
3534 Xpred( n ) = Xdeco( n-2 )
3535 endif
3536 Other pixels in all lines are predicted using the equation:
3537 if ((Xdeco( n-1 ) <= Xdeco( n-2 ) AND Xdeco( n-2 ) <= Xdeco( n-3 )) OR
3538 (Xdeco( n-1 ) >= Xdeco( n-2 ) AND Xdeco( n-2 ) >= Xdeco( n-3 ))) then
3539 Xpred( n ) = Xdeco( n-1 )
3540 else if ((Xdeco( n-1 ) <= Xdeco( n-3 ) AND Xdeco( n-2 ) <= Xdeco( n-4 )) OR
3541 (Xdeco( n-1 ) >= Xdeco( n-3 ) AND Xdeco( n-2 ) >= Xdeco( n-4 ))) then
3542 Xpred( n ) = Xdeco( n-2 )
3543 else
3544 Xpred( n ) = (Xdeco( n-2 ) + Xdeco( n-4 ) + 1) / 2
3545 endif
E.2 Encoders
3546 There are seven different encoders available, one for each data compression scheme.
3547 For all encoders, the formula used for non-predicted pixels (beginning of lines) is different than the formula
3548 for predicted pixels.
E.3 Decoders
4163 There are six different decoders available, one for each data compression scheme.
4164 For all decoders, the formula used for non-predicted pixels (beginning of lines) is different than the formula
4165 for predicted pixels.
Frame Start Packet YUV422 Data Type User Defined Data Type
LPS SoT FS EoT LPS SoT PH YUV422 Data PF EoT LPS SoT PH JPEG Data PF EoT
YUV422 Data Type YUV422 Data Type User Defined Data Type
LPS SoT PH YUV422 Data PF EoT LPS SoT PH YUV422 Data PF EoT LPS SoT PH JPEG Data PF EoT
YUV422 Data Type User Defined Data Type Frame End Packet
LPS SoT PH YUV422 Data PF EoT LPS SoT PH JPEG Data PF EoT LPS SoT FE EoT LPS
KEY:
LPS – Low Power State PH – Packet Header FS – Frame Start Packet
SoT – Start of Transmission PF – Packet Footer FE – Frame End Packet
4941
EoT – End of Transmission
Figure 224 Data Type Interleaving: Concurrent JPEG and YUV Image Data
SoT FS EoT LPS SoT PH JPEG Data PF EoT LPS SoT FS EoT LPS SoT PH YUV422 Data PF EoT
LPS SoT PH JPEG Data PF EoT LPS SoT PH YUV422 Data PF EoT LPS SoT PH JPEG Data PF EoT
LPS SoT PH YUV422 Data PF EoT LPS SoT FE EoT LPS SoT PH JPEG Data PF EoT LPS SoT FE EoT
KEY:
LPS – Low Power State PH – Packet Header FS – Frame Start Packet
SoT – Start of Transmission PF – Packet Footer FE – Frame End Packet
4942
EoT – End of Transmission
Figure 225 Virtual Channel Interleaving: Concurrent JPEG and YUV Image Data
4943 Both Figure 224 and Figure 225 can be similarly extended to the interleaving of JPEG image data with any
4944 other type of image data, e.g. RGB565.
4945 Figure 226 illustrates the use of Virtual Channels to support three different JPEG interleaving usage cases:
4946 • Concurrent JPEG and YUV422 image data.
4947 • Alternating JPEG and YUV422 output - one frame JPEG, then one frame YUV
4948 • Streaming YUV22 with occasional JPEG for still capture
4949 Again, these examples could also represent interleaving JPEG data with any other image data type.
JPEG JPEG JPEG JPEG 1 Frame 1 Frame JPEG JPEG JPEG JPEG
CSI-2 RX
VC0 Frame VC0
CSI-2 TX
Frame Frame Frame Frame Frame Frame Frame
YJYJ YJYJ YJYJ YJYJ
YUV YUV YUV YUV YUV YUV YUV YUV
VC1 Frame Packet interleaved JPEG and VC1
Frame Frame Frame Frame Frame Frame Frame
YUV data
Use Case 2: Alternating JPEG and YUV output – one frame JPEG, then one frame YUV
CSI-2 RX
VC0
CSI-2 TX
VC0 Frame Frame Frame Frame
YUV JPEG YUV JPEG
YUV YUV YUV YUV
VC1 Frame CSI-2 RX uses the Virtual VC1
Frame Frame Frame
Channel and Data Type
codes to de-multiplex data
JPEG JPEG
CSI-2 RX
VC0
CSI-2 TX
4950
Figure 226 Example JPEG and YUV Interleaving Use Cases
4962 Note that the binary representation of each initial seed value is symmetrical with respect to the forwards and
4963 backwards directions, with the exceptions of Lanes 11, 17, and 27. The initial seed values can be created
4964 easily using a Lane index value (i.e., Lane number minus one).
4985 ALP Mode supports the transmission of High-Speed data bursts as well as the transmission of control
4986 sequences that are traditionally transmitted using legacy LP mode Escape Mode sequences. The format of all
4987 ALP mode bursts is like the timing diagram in Figure 228.
4988 The burst begins and ends in an ALP-Pause state. There are two types of ALP-Pause: ALP-Pause Stop and
4989 ALP-Pause ULPS. ALP-Pause Stop is analogous to the legacy LP mode Stop state; ALP-Pause ULPS is
4990 analogous to the legacy LP mode ULPS state. The only difference between these two types of ALP-Pause
4991 states is the time allowed to wake up from each, which is the duration of the ALP-Pause Wake interval. The
4992 nominal time allowed to wake from ALP-Pause Stop is 100 ns, which is about the same time as the duration
4993 of the LP-001 and LP-000 states at the beginning of a HS Data Burst using legacy LP mode. The nominal
4994 time to wake from the ALP-Pause ULPS state is 1 msec, which is approximately the time allowed in legacy
4995 LP mode for tWAKEUP. (The time that a transmitter drives a Mark-1 state prior to a Stop state to initiate an exit
4996 from ULPS.) The longer wake-up time from ALP-Pause ULPS compared to ALP-Pause Stop allows a lower
4997 power consumption while in the ALP-Pause ULPS state.
4998 The ALP-Pause Stop and ALP-Pause ULPS line states are defined by the following relationships of the Line
4999 levels: VA = VB = VC, and VOD_AB = VOD_BC = VOD_CA = 0. Examples of the ALP-Pause and the ALP-Pause
5000 Wake states are illustrated at the beginning and end of the waveform in Figure 228. The ALP-Pause Wake
5001 state, which is very long compared to a High-Speed Unit Interval, is detected by the low-power wake-up
5002 receiver. This causes the system to leave one of the ALP-Pause states and to begin receiving a High-Speed
5003 signal.
5005 To minimize power consumption while Lane activity has ceased during one of the ALP-Pause states, a special
5006 low-speed and low-power differential receiver circuit is present, in addition to the three High-Speed
5007 differential receivers for A-B, B-C and C-A. This special low-speed and low-power differential receiver has
5008 a nominal +80 mV offset input threshold voltage that detects the difference in differential levels between the
5009 ALP-Pause state (VOD = 0) and ALP-Pause Wake state (VOD = |VOD| Strong). This allows the line signals to
5010 collapse to zero with the 100 ZID termination still connected, and still have a well-defined method to detect
5011 the difference between the ALP-Pause and ALP-Pause Wake line conditions. Collapsing to zero with the
5012 terminations still connected makes it possible for implementations to have very low power consumption
5013 during the ALP-Pause states. The ALP-Pause Wake pulse is very long compared to a High-Speed Unit
5014 Interval so that the wake receiver can be slow and consume very little power compared to the High-Speed
5015 differential receivers.
5016 An example of the differential receiver circuit to support ALP mode is shown in Figure 229. Two different
5017 offset receivers are shown for wake from stop versus wake from ULPS, because the power consumption in
5018 the ALP-Pause ULPS state is expected to be lower than in ALP-Pause Stop state. The ALP-Pause Wake pulse
5019 from the ULPS state can be longer than waking from ALP-Pause Stop, so the ALP ULPS receiver can be
5020 slower and consume less power compared to the ALP Stop receiver.
LP Rx
A + HS Rx_AB
ZTERM
50 - LP Rx
B + HS Rx_BC
ZTERM
50 - LP Rx
C + HS Rx_CA
ZTERM
50 -
CCP
+ ALP_Stop
ALP_Pause_Wake_from_Stop
VOFFSET
+80mV
-
+ ALP_ULPS
ALP_Pause_Wake_from_ULPS
VOFFSET
+80mV
-
5021
Figure 229 High-Speed and ALP-Pause Wake Receiver Example
5022 The C-PHY specification defines thirteen unique 7-symbol ALP Code Words that are the functional
5023 equivalent of the LP pulse sequences of legacy LP mode. In some cases, a single 7-symbol ALP Code Word
5024 can replace the transmission of a long sequence of legacy LP mode pulses, such as for the transmission of
5025 Escape Mode triggers or low-power data transmission. The CSI-2 specification needs only three of these LP
5026 mode pulse sequences to emulate the functionality of legacy LP mode: Stop Code, ULPS Code, and Post. A
5027 fourth code, the TAC Code, is used for Fast Bus Turnaround.
5028 Exit from and entry into the ALP-Pause state, which is the functional equivalent of the legacy LP mode Stop
5029 state, requires a special ALP Mode sequence consisting of one or more Stop Codes or ULPS codes followed
5030 by a string of Post codes followed by setting the voltage of all three Lines of a Lane to the same value.
5031 As illustrated in Figure 227, the burst starting sequence of the legacy LP mode consisting of: LP-111, LP-
5032 001, and LP-000 followed by preamble, has a functional equivalent sequence in ALP Mode consisting of:
5033 ALP-Pause Stop followed by ALP Pause Wake followed by preamble. Similarly, the burst ending sequence
5034 of legacy LP mode consisting of Post sequence followed by LP-111, has a functional equivalent sequence in
5035 ALP Mode consisting of: the Post1 field by two or more Stop Codes followed by the Post2 field followed by
5036 ALP-Pause Stop.
5052 Figure 231 shows the ALP state machine transitions (highlighted in red) necessary to transmit a High-Speed
5053 data burst in ALP mode. States and state transitions that are not used by CSI-2 for any type of burst are shown
5054 using dashed lines. The red highlighted states and transitions indicate the path required to transmit and receive
5055 the High-Speed Data Burst example in Figure 230.
Power-up +x state
ALP-Pause Wake
HS Burst
ALP Post2 ALP-Pause
Preamble
ULPS Code to ULPS ULPS
from ULPS
ALP Codes
(not Stop
LP or ULPS)
Stop State +x state
ALP-Pause Wake
HS Burst
ALP-Pause HS Sync ALP
Preamble HS Data Post1
Stop Word Stop Code
from Stop
HS Cal. HS Cal.
HS Cal. Post2
Alt. Seq. Alternate
Preamble to Stop
Identifier Sequence
HS Cal.
HS Cal.
User-
UD Seq.
Defined
Identifier
Seq.
5056
Figure 231 State Transitions for an HS Data Burst
5057 Figure 232 shows the ALP state machine transitions (highlighted in red) necessary to enter the ALP-Pause
5058 ULPS state.
Power-up +x state
ALP-Pause Wake
HS Burst
ALP Post2 ALP-Pause
Preamble
ULPS Code to ULPS ULPS
from ULPS
ALP Codes
(not Stop
LP or ULPS)
Stop State +x state
ALP-Pause Wake
HS Burst
ALP-Pause HS Sync ALP
Preamble HS Data Post1
Stop Word Stop Code
from Stop
HS Cal. HS Cal.
HS Cal. Post2
Alt. Seq. Alternate
Preamble to Stop
Identifier Sequence
HS Cal.
HS Cal.
User-
UD Seq.
Defined
Identifier
Seq.
5059
Figure 232 State Transitions to Enter the ULPS State
5060 Figure 233 shows the ALP state machine transitions (highlighted in red) necessary to enter the ALP-Pause
5061 Stop state.
Power-up +x state
ALP-Pause Wake
HS Burst
ALP Post2 ALP-Pause
Preamble
ULPS Code to ULPS ULPS
from ULPS
ALP Codes
(not Stop
LP or ULPS)
Stop State +x state
ALP-Pause Wake
HS Burst
ALP-Pause HS Sync ALP
Preamble HS Data Post1
Stop Word Stop Code
from Stop
HS Cal. HS Cal.
HS Cal. Post2
Alt. Seq. Alternate
Preamble to Stop
Identifier Sequence
HS Cal.
HS Cal.
User-
UD Seq.
Defined
Identifier
Seq.
5062
Figure 233 State Transitions to Exit from the ULPS State
5063 Table 70 describes the 7-symbol codes transmitted in ALP mode. The corresponding LP mode or Escape
5064 mode function is described, where applicable.
5065 Table 70 ALP Code Definitions used by CSI-2
Symbol PPI ALP
ALP Code Corresponding LP State or Escape Mode Sequence
Sequence Code
Stop Code 0244440 0b0000 LP-111 (End of Transmission, or EoT)
ULPS Code 0244441 0b0001 Escape Mode Entry + Ultra-Low Power State (ULPS)
Post1 No equivalent legacy LP mode sequence exists. The CSI-2
4444444 0b1011 TX can cause the Post sequence to be transmitted by
Post2 sending this code.
2144441 0b1100 No equivalent legacy LP mode sequence exists,
Turnaround
although TAC triggers a Fast Lane Turnaround that is
Code (TAC)
functionally similar to Control Mode Turnaround.
Data
TxDataHS[15:0] RxDataHS[15:0]
TxWordValidHS[0] RxInvalidCodeHS[0]
RxValidHS[0]
Sync Codes
TxSyncTypeHS0[2:0] RxSyncTypeHS0[2:0]
TxSendSyncHS[0] RxSyncHS[0]
A
ALP Codes B
CSI-2 TX TxALPCodeHS0[3:0] C-PHY TX C-PHY RX RxALPCode0[3:0] CSI-2 RX
C
TxSendALPHS[0] RxALPValidHS[0]
TxALPNibble0[3:0] RxALPNibble0[3:0]
TxRequestHS
TxReadyHS RxActiveHS
TxWordClkHS RxWordClkHS
5077
Figure 234 PPI Example: HS Signals for Transmission of Data, Sync and ALP Commands
5078 Figure 235 and Figure 236 show examples of PPI signals and the corresponding PHY data for transmission
5079 and reception of high-speed data in ALP mode. These figures show additional detail of the High-Speed Data
5080 Burst waveform in Figure 230.
5081 The signal TxRequestHS is asserted simultaneously with TxWordValidHS to request that a high-speed burst
5082 be transmitted. The PHY will know to send a data burst because TxWordValidHS is asserted early in the burst
5083 timing. This will cause the C-PHY Tx to transmit the first Sync Word at the end of the Preamble. Note that
5084 the first Sync Word is transmitted autonomously by the C-PHY Tx, and has the default Sync Type value of
5085 3. Subsequent Sync Words transmitted in a burst are sent as a result of asserting the TxSendSyncHS[0] signal,
5086 and the associated Sync Type is defined by the TxSyncTypeHS0[2:0] signals.
5087 The end of burst in the Transmitter functions differently for ALP mode compared to the non-ALP high-speed
5088 mode. In the non-ALP high-speed mode, the end of burst is signaled to the PHY by pulling TxRequestHS
5089 low, as described in Annex A of the C-PHY specification. After TxRequestHS goes low, the C-PHY Tx will
5090 generate the Post sequence of length determined by a PHY configuration parameter that sets the length of
5091 Post.
5092 In ALP mode, the protocol transmit unit generates all fields of the burst after the first sync word, including
5093 the packet headers, data burst, Stop Code, ULPS Code, Post1, and Post2. The burst is ended by pulling
5094 TxRequestHS low, and no additional data is transmitted on the Lane after this time.
HS Burst
ALP-Pause ALP-Pause
ALP-Pause Stop ALP Command
Wake Stop
Lane +x state Preamble Sync
Packet
Sync
Packet High-Speed
Post1
Stop Stop
Post2
Header Header Forward Data Code Code
Signals
VA = VB = VC VA = VB = VC
PH PH PH PH PH PH
TxDataHS[X:0] dc W1 W2 W3 dc W1 W2 W3 W4 W5 Wn dc
TxWordValidHS
TxSendSyncHS
TxSendALPHS
Stop Stop
TxALPCodeHS[3:0] dc Post1
Code Code
Post2 dc
TxRequestHS
TxReadyHS
5095
Figure 235 PPI Example Transmit Side Timing for an HS Data Burst
HS Burst
ALP-Pause ALP-Pause ALP-Pause
Stop Wake ALP Command
Stop
Lane +x state Preamble Sync
Packet
Sync
Packet High-Speed
Post1
Stop Stop
Post2
Header Header Forward Data Code Code
Signals
VA = VB = VC VA = VB = VC
PH PH PH PH PH PH
RxDataHS[X:0] dc W1 W2 W3 dc W1 W2 W3 W4 W5 Wn dc
RxValidHS
RxSyncHS
RxALPValidHS dc
Stop Stop
RxALPCode[3:0] dc Post1
Code Code
Post2 dc
RxActiveHS dc
5096
Figure 236 PPI Example Receive Side Timing for an HS Data Burst
5097 Figure 237, Figure 238, Figure 239, and Figure 240 show examples of PPI signals and the corresponding
5098 PHY data for transmission and reception ALP Commands to enter into and exit from the ALP-Pause ULPS
5099 state in ALP mode. These figures show additional detail of the Command to Enter ULPS and the Command
5100 to Exit from ULPS waveforms in Figure 230.
5101 The signal TxRequestHS is asserted simultaneously with TxSendALPHS to request that a high-speed burst
5102 be transmitted. The PHY will know to send a ALP commands in the burst rather than the Sync Word because
5103 TxSendALPHS is asserted early in the burst timing, and TxWordValidHS is not asserted.
ALP-Pause
ALP-Pause Stop Preamble ALP Command ALP-Pause ULPS
Wake
Lane +x state Preamble
ULPS ULPS
Post2
Code Code
Signals
VA = VB = VC VA = VB = VC
TxDataHS[X:0] dc
TxWordValidHS
TxSendSyncHS
TxSendALPHS
TxRequestHS
TxReadyHS
5104
Figure 237 PPI Example Transmit Side Timing to Enter the ULPS State
ALP-Pause
ALP-Pause Stop Preamble ALP Command ALP-Pause ULPS
Wake
Lane +x state Preamble
ULPS ULPS
Code Code
Post2
Signals
VA = VB = VC VA = VB = VC
RxDataHS[X:0] dc
RxValidHS
RxSyncHS
RxALPValidHS
ULPS ULPS
RxALPCode[3:0] dc Code Code
Post2 dc
RxActiveHS dc
5105
Figure 238 PPI Example Receive Side Timing to Enter the ULPS State
ALP-Pause Wake
ALP-Pause ULPS Preamble ALP Command ALP-Pause Stop
(from ULPS, ~1 msec)
Lane +x state Preamble Stop Stop
Post2
Code Code
Signals
VA = VB = VC VA = VB = VC
TxDataHS[X:0]
TxWordValidHS
TxSendSyncHS
TxSendALPSHS
TxRequestHS
TxReadyHS
5106
Figure 239 PPI Example Transmit Side Timing to Exit from the ULPS State
ALP-Pause Wake
ALP-Pause ULPS Preamble ALP Command ALP-Pause Stop
(from ULPS, ~1 msec)
Lane +x state Preamble Stop Stop
Post2
Code Code
Signals
VA = VB = VC VA = VB = VC
TxDataHS[X:0] dc
RxValidHS
RxSyncHS
RxALPValidHS dc
Stop Stop
RxALPCode[3:0] dc Code Code Post2 dc
RxActiveHS dc
5107
Figure 240 PPI Example Receive Side Timing to Exit from the ULPS State
ALP
ALP-Pause Stop HS Burst Command ALP-Pause Stop
Lane 2 +x state Sync PH PH PH Sync PH PH PH DW DW DW DW DW Stop Stop
Preamble Post1 Code Code Post2
Signals VA = VB = VC W0 W1 W2 W0 W1 W2 1 4 7 10 n-2
VA = VB = VC
ALP-Pause ALP
ALP-Pause Stop Wake HS Burst Command ALP-Pause Stop
Lane 3 +x state Sync PH PH PH Sync PH PH PH DW DW DW DW DW Stop Stop
Preamble Post1 Code Code Post2
Signals VA = VB = VC W0 W1 W2 W0 W1 W2 2 5 8 11 n-1
VA = VB = VC
5117
Figure 241 Example Showing a Data Transmission Burst using Three Lanes
ALP-Pause ALP
ALP-Pause Stop Wake Command ALP-Pause ULPS
Lane 2 +x state ULPS ULPS
Signals Preamble Code Code Post2
VA = V B = V C VA = VB = VC
ALP-Pause ALP
ALP-Pause Stop Wake Command ALP-Pause ULPS
Lane 3 +x state ULPS ULPS
Signals Preamble Code Code Post2
VA = V B = V C VA = VB = VC
5118
Figure 242 Example Showing an ALP Command Burst using Three Lanes
Sync
Sync
Preamble Post Preamble Post Preamble Post
Forward Data Reverse Data Forward Data
High-Speed Forward Data Turnaround High-Speed Reverse Data Turnaround High-Speed Forward Data
SoT EoT SoT EoT SoT EoT
Primary is Driving Primary is Driving
Secondary is Driving
5132
Figure 243 High-Level View of the Control Mode Lane Turnaround Procedure
5133 A somewhat less likely configuration is to combine ALP mode and Control Mode Lane Turnaround if optional
5134 Dynamic LP and ALP operation is supported by the C-PHY, and if the electrical specifications can be met
5135 with the transmission channel being used in the system. An example is shown in Figure 244.
Post1
Post2
Stop
High-Speed High-Speed High-Speed
Sync
Sync
Sync
5137 Fast Lane Turnaround is the most likely method to be used with the CSI-2 USL feature. Fast Lane Turnaround
5138 is performed without having to return to LP mode. This reduces the latency to change the transmission
5139 direction of a Bi-directional lane. Fast Lane Turnaround is handled completely in High-Speed mode. One or
5140 more Turnaround Codes (TAC) is transmitted near the end of the burst (between Post1 and Post 2) to inform
5141 the receiver that the Lane is about to change the transmission direction. A small Turnaround Gap (TGAP)
5142 exists between Post2 from the First Transmitting Device and the Preamble from the Second Transmitting
5143 Device to allow the Primary and Secondary to swap roles as transmitter and receiver. Figure 245 shows a
5144 high-level view of the Fast Lane Turnaround Procedure with ALP Mode. It is anticipated that the Fast Lane
5145 Turnaround will most often be used with ALP Mode, and infrequently with Control Mode.
Post2
Post1
Post1
Post2
Post1
Post2
Sync
Stop
High-Speed High-Speed High-Speed
Sync
Sync
TAC
TAC
+x state Preamble TGAP TGAP
Preamble Preamble
Forward Data Reverse Data Forward Data
Primary is Driving Secondary is Driving Primary is Driving
5146
Figure 245 High-Level View of the Fast Lane Turnaround Procedure with ALP Mode
5147 Figure 246 is a comparison of events that occur in the Fast Lane Turnaround Procedure versus the Control
5148 Mode Lane Turnaround Procedure. Fields that are the same color are either the same field in the two
5149 waveforms, or have comparable durations. Post1 + TAC + Post2 in the Fast Lane Turnaround is like Post in
5150 the Control Mode Lane Turnaround. The Preambles are the same duration and Syncs are the same duration.
5151 Fields that cause the durations of the two Turnaround methods to be different are highlighted with “Time
5152 difference between Fast Lane Turnaround and Control Mode Lane Turnaround” in the figure. In this case,
5153 the TGAP (nominally 14 UI) in the Fast Lane Turnaround waveform is usually much shorter in duration
5154 compared to the LP signaling (EoT + Turnaround + SoT, in the Control Mode Lane Turnaround waveform).
Post1
Post1
Post2
Post2
Post1
Post2
Stop
High-Speed High-Speed High-Speed
Sync
Sync
Sync
TAC
TAC
+x state Preamble TGAP TGAP
Preamble Preamble
Forward Data Reverse Data Forward Data
Primary is Driving Primary is Driving
Secondary is Driving
Sync
Sync
Preamble Post Preamble Post Preamble Post
Forward Data Reverse Data Forward Data
SoT Transmitting High-Speed Forward Data Turnaround SoT Transmitting High-Speed Reverse Data Turnaround SoT Transmitting High-Speed Forward Data
EoT EoT EoT
Primary is Driving Primary is Driving
Secondary is Driving
5155
Figure 246 High-Level View, Comparing Lane Turnaround Procedures
5156 The Fast Lane Turnaround Procedure is triggered by the transmission of a sequence of ALP codes at the end
5157 of a burst.
5158 Figure 247 shows the detailed sequence of events that occur during the Fast Lane Turnaround Procedure.
5159 The transmitting C-PHY ends the data burst by sending Post1, followed by the TAC symbol sequence,
5160 followed by Post2. TAC is the symbol sequence “2144441”, which is an unmapped sequence of seven
5161 symbols. The least significant symbol of TAC (“1”) is transmitted first and the most significant symbol (“2”)
5162 is transmitted last, which is the same convention used for transmitting any ALP code word. TAC may be
5163 transmitted multiple times for improved system reliability, to increase the probability that TAC will be
5164 detected by the receiver. The Post1 + TAC + Post2 is somewhat similar to the end of a burst in ALP mode,
5165 except that the TAC Code is sent instead of the Stop Code. The protocol receiver can easily identify the end
5166 of Packet Data when it detects Post1. The duration of the TAC and Post2 are programmable in the transmitter,
5167 and this duration is determined by the protocol layer. The protocol layer enables the transmission of Post1,
5168 TAC, and Post2 via the PPI signals TxSendALPHS[1:0], TxALPCodeHS0[3:0], and TxALPCodeHS1[3:0].
5169 The purpose of Post1 is to indicate the end of the burst and provide a sufficient number of word clock intervals
5170 so the protocol layer can gracefully stop transmitting and receiving packet data that is sent prior to Post1.
5171 Post2 exists so the C-PHY transmitter and receiver has a sufficient number of clock intervals following TAC
5172 to be able to shut down transmitter and receiver circuitry and change the direction of transmission.
5173 A Turnaround Gap (TGAP) exists to allow one transmitter to be disabled before the other is enabled. This
5174 avoids contention between the two drivers. The First Transmitting Device that sent the TAC disables its
5175 output by placing the driver into a high-impedance state just after the last symbol of Post2. The C-PHY
5176 ensures that the transmitter in the First Transmitting Device is completely disabled at the end of TGAP. The
5177 Second Transmitting Device begins to enable its output after TGAP at the beginning of the Preamble.
5178 When the Second Transmitting Device receives TAC, it starts a timer that is used to determine when the end
5179 of TGAP, and the beginning of Preamble, should occur. It is necessary for the Second Transmitting Device
5180 to identify this interval using a timer, because there are no transmissions during TGAP to identify when the
5181 Second Transmitting Device needs to begin transmitting the Preamble. The number of words of TAC and
5182 duration of Post2 can be stored in registers in both the First Transmitting Device and Second Transmitting
5183 Device, so the C-PHY can determine the proper t3-TAC_TO_TX time. This is so the Second Transmitting Device
5184 starts transmitting Preamble at the proper time at the end of TGAP. The number of words of TAC and duration
5185 of Post2 can be different when transmission changes from Primary to Secondary, versus from Secondary to
5186 Primary. Therefore, it is necessary for the Primary and Secondary to have registers related to the TAC duration
5187 and Post2 duration for both types of turnaround (Primary-to-Secondary and Secondary-to-Primary).
5188 An interval t3-TA-SETTLE exists to allow the driver transmitting the Preamble to have sufficient time to stabilize
5189 before it is used by the receiver for symbol clock recovery. The t 3-TA-SETTLE interval is a time during which
5190 the HS receiver in the C-PHY will ignore any HS transitions on the Lane. This concept is very similar to the
5191 t3-SETTLE time at the beginning of a HS burst from LP mode.
to Post1 Post2
Rev. Forward Data PreBegin + ProgSeq + PreEnd Reverse Data
to Post1 Post2
Fwd. Reverse Data PreBegin + ProgSeq + PreEnd Forward Data
t3-TA-SETTLE
t3-TAC-TO-TX
First Transmitting Device disabled Second Transmitting Device enabled
5192
Figure 247 Detailed View of the Fast Lane Turnaround Procedure
5193 Figure 248 shows an example of ALP state machine transitions (highlighted in red) that occur when a burst
5194 begins in the conventional manner with an ALP-Pause Wake pulse and finishes by performing a Fast Lane
5195 Turnaround Procedure. This is the sequence of events that occur during the first “Primary is Driving” interval
5196 shown in Figure 245. The highlighted sequence begins from the ALP-Pause Stop state, and ends when the
5197 turnaround event occurs during the HS-BTA Rx Wait state. This state diagram presents a high-level view of
5198 events. It can be interpreted to illustrate states that occur in the transmitter as well as the receiver.
Power-up +x state
ALP-Pause Wake
HS Burst
ALP Post2 ALP-Pause
Preamble
ULPS Code to ULPS ULPS
from ULPS
ALP Codes
(not Stop
LP or ULPS)
Stop State +x state
ALP-Pause Wake
HS Cal. HS Cal.
HS Cal.
Alt. Seq. Alternate
TAC
Preamble
Identifier Sequence
Code
HS-BTA
Rx Wait HS Cal.
HS Cal.
Post2
User- Post2
UD Seq.
Defined
to to Stop
Identifier
Seq.
HS-BTA
5199
Figure 248 State Transitions from ALP-Pause Stop to Turnaround
5200 Figure 249 shows an example of ALP state machine transitions (highlighted in red) that occur between two
5201 Fast Lane Turnaround events. This is the sequence of events that occur during the “Secondary is Driving”
5202 interval shown in Figure 245.
Power-up +x state
ALP-Pause Wake
HS Burst
ALP Post2 ALP-Pause
Preamble
ULPS Code to ULPS ULPS
from ULPS
ALP Codes
(not Stop
LP or ULPS)
Stop State +x state
ALP-Pause Wake
HS Cal. HS Cal.
HS Cal.
Alt. Seq. Alternate
TAC
Preamble
Identifier Sequence
Code
HS-BTA
Rx Wait HS Cal.
HS Cal.
Post2
User- Post2
UD Seq.
Defined
to to Stop
Identifier
Seq.
HS-BTA
5203
Figure 249 State Transitions from Turnaround to Turnaround
5204 Figure 250 shows an example of ALP state machine transitions (highlighted in red) that occur, starting from
5205 a Fast Lane Turnaround Procedure (the HS-BTA Rx Wait state) and finishing when the burst ends and there
5206 is a transition to the ALP-Pause Stop state. This is the sequence of events that occur during the second
5207 “Primary is Driving” interval shown in Figure 245.
Power-up +x state
ALP-Pause Wake
HS Burst
ALP Post2 ALP-Pause
Preamble
ULPS Code to ULPS ULPS
from ULPS
ALP Codes
(not Stop
LP or ULPS)
Stop State +x state
ALP-Pause Wake
HS Cal. HS Cal.
HS Cal.
Alt. Seq. Alternate
TAC
Preamble
Identifier Sequence
Code
HS-BTA
Rx Wait HS Cal.
HS Cal.
Post2
User- Post2
UD Seq.
Defined
to to Stop
Identifier
Seq.
HS-BTA
5208
Figure 250 State Transitions from Turnaround to ALP-Pause Stop
5209 The PPI signals that support ALP functions are used to perform a Fast Lane Turnaround. The first transmitting
5210 device stops transmission in much the same way as a transmitter signals the end of an ALP burst, except that
5211 a TAC code is sent instead of a Stop code. The first transmitting device becomes a receiver after it ceases
5212 transmission, so it can immediately switch to receive mode. In this case, the device that becomes a receiver
5213 does not need to be triggered by a long ALP Pause Wake pulse prior to the preamble. Instead, the trigger for
5214 assuming the role of a receiver is the transmission of the TAC code prior to the TGAP interval.
5215 Figure 251 shows an example of the of the transmitter and receiver PPI signaling in the first transmitting
5216 device when a Fast Lane Turnaround occurs.
Transmission from First Transmitting Device TGAP Transmission from Second Transmitting Device
TxDataHS[X:0] Wn dc
TxWordValidHS
TxSendSyncHS
TxSendALPHS
TAC TAC
TxALPCodeHS[3:0] dc Post1
Code Code
Post2 dc
TxRequestHS
TxReadyHS
Direction
(First Transmitting Device)
PH PH PH PH PH PH
RxDataHS[X:0] dc W1 W2 W3 dc W1 W2 W3 W4 W5
RxValidHS
RxSyncHS
RxALPValidHS
RxALPCode[3:0] dc
RxActiveHS
5217
Figure 251 Example Fast Lane Turnaround at the First Transmitting Device
5218 Figure 252 shows an example of the of the receiver and transmitter PPI signaling in the second transmitting
5219 device when a Fast Lane Turnaround occurs.
Transmission from First Transmitting Device TGAP Transmission from Second Transmitting Device
RxDataHS[X:0] Wn dc
RxValidHS
RxSyncHS
RxALPValidHS dc
TAC TAC
RxALPCode[3:0] dc Post1
Code Code
Post2 dc
RxActiveHS dc
Direction
(Second Transmitting Device)
PH PH PH PH PH PH
TxDataHS[X:0] W1 W2 W3 dc W1 W2 W3 W4 W5
TxWordValidHS
TxSendSyncHS
TxSendALPHS
TxALPCodeHS[3:0] dc
TxRequestHS
TxReadyHS
5220
Figure 252 Example Fast Lane Turnaround at the Second Transmitting Device
MPC SPECIFICATION
10:6 10:6
Compression Ratio Compression Ratio
10:7 10:7
Compression Ratio Compression Ratio
5232
Figure 253 MPC Data Compression Schemes
5233 To support high image quality even at high compression ratios, MPC features the following two Prediction
5234 Mode types:
5235 • Basic Prediction Mode includes a simple algorithm to handle image details oriented in a specific
5236 direction, or basic cases of differences between neighboring pixels.
5237 • Advanced Prediction Mode has a more extensive algorithm for better direction awareness.
5238 MPC Packet data is identified using one of the User Defined data type codes in Table 61. Note that User
5239 Defined data type codes are not reserved for compressed data types. Therefore, it is recommended that the
5240 assignment of specific User Defined data type codes to compression schemes be communicated to the image
5241 sensor via the CCI. The protocol and CCI register address to map a data compression scheme to a Data Type
5242 code are beyond the scope of this specification.
5243 The number of bits in an MPC Packet shall be a multiple of eight. Therefore, implementations with data
5244 compression schemes that result in each pixel having other than eight encoded bits per pixel shall transfer
5245 the encoded data using a packed pixel format. For example, the 10–5–10 data compression scheme cannot
5246 use the RAW6, RAW7, or RAW8 packed pixel formats described in Section 11.4. For this example, the RAW
5247 10 format described in Section 11.4.2 is appropriate, except that the Data Type value in the Packet Header is
5248 a User Defined data type code. MPC with a Tetra-Cell sensor uses the RAW10, RAW12, or RAW14 formats
5249 depending on the data compression ratio. MPC with a Nona-Cell image sensor uses the RAW10, RAW12, or
5250 RAW14 formats by concatenating two MPC Blocks of encoded data.
5251 The MPC encoded data stream shall consist of a series of Blocks, where each Block represents one
5252 compression processing unit. Each Block shall consist of a 4-bit Header and a Payload whose length shall
5253 depend upon the image sensor type (i.e., Bayer, Tetra-Cell, or Nona-Cell) and the data compression ratio as
5254 defined by Table 71. The number of pixels encoded per Block shall be 4 (1x4) for Bayer image sensors, 4
5255 (2x2) for Tetra-Cell image sensors, and 9 (3x3) for Nona-Cell image sensors.
5256 Example: The MPC Packet for Tetra-Cell image sensors always has 4 compressed pixels per Block and a 4-
5257 bit Header. The Payload size is either 16 bits for compression ratio 10:5, or 20 bits for 10:6 compression, or
5258 24 bits for 10:7 compression.
5259 Table 71 MPC Bits Per Block and CSI-2 Image Data Format
Bits Per Block
Image Pixels CSI-2 RAW Image Data Format
Header Payload Size
Sensor Per
Size (bits)
Type Block
(bits) 10:5 10:6 10:7 10:5 10:6 10:7
RAW10
Bayer 1x4 4 16 N/A N/A N/A N/A
User Defined
RAW10 RAW12 RAW14
Tetra-Cell 2x2 4 16 20 24
User Defined User Defined User Defined
RAW10 (2 Blocks) RAW12 (2 Blocks) RAW14 (2 Blocks)
Nona-Cell 3x3 4 41 50 59
User Defined User Defined User Defined
5260 Figure 254 illustrates the RAW10 transmission scheme for MPC with Bayer image sensors. The MPC
5261 encoded data stream from the Bayer pixel array includes the Header and the Payload, which can be divided
5262 into STR n and STR n+1 to fit into the RAW10 transmission format: STR n includes the Header and some
5263 of the Payload, and STR n+1 includes the rest of the Payload.
* P : Pixel
Line Start / Data P00 P01 P0n P0n+1 P0n+2 P0n+3 P0n+4
After compression
Line Start / Data STR 0 STR 1 STR n STR n+1 STR n+2 STR n+3 STR n+4 RAW 10 transmission
5264
Figure 254 RAW10 Transmission for MPC for Bayer Image Sensors
5265 Figure 255 illustrates the RAW10/12/14 transmission scheme for MPC for Tetra-Cell image sensors. The
5266 MPC encoded data stream from the Tetra-Cell pixel array includes the Header and the Payload, which can
5267 be divided into STR n and STR n+1 to fit into the RAW10/12/14 transmission format. STR n includes the
5268 Header and some of Payload, and STR n+1 includes the rest of the Payload.
* P : Pixel
Line Start: 0/ Data P00 P01 P0n P0n+1 P0n+2 P0n+3 P0n+4 0 line
Line Start: 1/ Data P10 P11 P1n P1n+1 P1n+2 P1n+3 P1n+4 1 line
After compression
Line Start / Data STR 0 STR 1 STR n STR n+1 STR n+2 STR n+3 STR n+4 RAW 10/12/14 transmission
5269
Figure 255 RAW10/12/14 Transmission for MPC for Tetra-Cell Image Sensors
5270 Figure 256 illustrates the RAW10/12/14 transmission scheme for MPC for Nona-Cell image sensors. The
5271 MPC encoded data stream from the Nona-Cell pixel array includes the Header and the Payload, which can
5272 be divided into the series STR n, STR n+1, …, STR n+8 to fit into the RAW10/12/14 transmission format.
5273 With this division method, STR n, STR n+4, and STR n+5 each include a Header and some of the Payload,
5274 and STR n+1, STR n+2, STR n+3, STR n+6, STR n+7, and STR n+8 include the rest of the Payload.
* P : Pixel
P00 P01 P02 P03 P04 P05 P06 P07 P08 P09 P010 P011
P10 P11 P12 P13 P14 P15 P16 P17 P18 P19 P110 P111
P20 P21 P22 P23 P24 P25 P26 P27 P28 P29 P210 P211
P30 P31 P32 P33 P34 P35 P36 P37 P38 P39 P310 P311
P40 P41 P42 P43 P44 P45 P46 P47 P48 P49 P410 P411
P50 P51 P52 P53 P54 P55 P56 P57 P58 P59 P510 P511
Line Start: 0 / Data P00 P0n P0n+1 P0n+2 P0n+3 P0n+4 P0n+5 0 line
Line Start: 1 / Data P10 P1n P1n+1 P1n+2 P1n+3 P1n+4 P1n+5 1 line
Line Start: 2 / Data P20 P2n P2n+1 P2n+2 P2n+3 P2n+4 P2n+5 2 line
1 block 1 block
10 : 5 / Encoded data stream : 90bit
MSB LSB
(STR n : 10 bits / STR n+1 : 10 bits / STR n+2 : 10 bits)
Encoded data stream Encoded data stream (STR n+3 : 10 bits / STR n+4 : 10 bits / STR n+5 : 10 bits) RAW 10 transmission
(STR n+6 : 10 bits / STR n+7 : 10 bits / STR n+8 : 10 bits)
Header Payload Header Payload
10 : 6 / Encoded data stream : 108 bits
Ratio/ 10:5 40bit 10bit 40bit
Ratio/ 10:6 48bit 12bit 48bit (STR n : 12 bits / STR n+1 : 12 bits / STR n+2 : 12 bits)
Ratio/ 10:7 56bit 14bit 56bit (STR n+3 : 12 bits / STR n+4 : 12 bits / STR n+5 : 12 bits) RAW 12 transmission
(STR n+6 : 12 bits / STR n+7 : 12 bits / STR n+8 : 12 bits)
STR STR STR STR STR STR STR STR STR
n n+1 n+2 n+3 n+4 n+5 n+6 n+7 n+8 10 : 7 / Encoded data stream : 126 bits
(STR n : 14 bits / STR n+1 : 14 bits / STR n+2 : 14 bits)
Ratio/ 10:5 10bit (STR n+3 : 14 bits / STR n+4 : 14 bits / STR n+5 : 14 bits) RAW 14 transmission
Ratio/ 10:6 12bit (STR n+6 : 14 bits / STR n+7 : 14 bits / STR n+8 : 14 bits)
Ratio/ 10:7 14bit
After compression
Line Start / Data STR 0 STR 1 STR n STR n+1 STR n+2 STR n+8 STR n+9 RAW 10/12/14 transmission
5275
Figure 256 RAW10/12/14 Transmission for MPC for Nona-Cell Image Sensors
5276 The MPC data compression system consists of an MPC Encoder and an MPC Decoder as shown in Figure
5277 257.
Encoder Decoder
Encoded
Original pixel data
Pixel data Mode
Quantization Difference Decoder Decoded
Prediction value
Prediction value
Quantized
Quantized
Prediction Decoder Prediction
5278
Figure 257 MPC Data Compression System
5279 To maintain constant bandwidth, MPC encodes data differences using a lossy scheme. The MPC Encoder
5280 uses a variety of defined Compression Modes to improve image quality for object edge patterns. In the MPC
5281 Encoder, each Compression Mode encodes the original pixel data based on direction awareness. The MPC
5282 Encoder uses direction awareness to automatically select the Compression Mode that is the best choice for
5283 minimizing data loss. Pixel values at the beginning of the first image line are encoded using simple prediction.
5284 These first few pixels can use User Control Parameters for boundary fill (see Section I.1.1.1, Section I.2.1.1,
5285 and Section I.3.1.1), so prediction does not need to be initialized for them. The remaining pixel values except
5286 for the first image line are then encoded using normal prediction methods.
5287 The first step in MPC decoding is to calculate the prediction value, based on the Compression Mode that the
5288 MPC Encoder used. In the MPC Packet, this is indicated via Header fields PredictionIDX and ModeIDX.
5289 When performing prediction, previously decoded pixels are used as reference pixels and the image is
5290 reconstructed using difference values relative to those reference pixels. After the prediction the reference
5291 pixel is quantized, again based on the Compression Mode that the MPC Encoder used. The value after
5292 quantization is added to the difference value (i.e., the incoming compressed data for that pixel). The MPC
5293 Decoder’s final output is the reconstructed image, i.e., the decoded image after de-quantization.
5294 The following sections define the MPC Compression Modes for each image sensor type (i.e., Bayer, Tetra-
5295 Cell, and Nona-Cell), and describe the decoding process for each Compression Mode.
5296 Note:
5297 Example code implementing MPC decompression is available from the MIPI Members site [MIPI07].
5303
Figure 258 MPC Packet Structures for Bayer Compression Modes
5324 Using this notation, the relative coordinates of reference pixels are as illustrated in Figure 259, where the
5325 color of each square indicates the color filter of the corresponding pixel.
Pixels to be Encoded
Blue Pixel First
Pixels to be Encoded
Not Shown: Red Pixel First
5326
Figure 259 Reference Pixel Relative Coordinate Indexes (Bayer)
5327 For a Bayer image sensor, the four highlighted pixels in the bottom row will be encoded. This corresponds
5328 to pixel coordinates p(h, v) (i.e., the current pixel), p(h+1, v), p(h+2, v), and p(h+3, v). The other colored
5329 squares represent the previously decoded pixels, which are available to be used as reference data.
5348
Figure 260 MPC Packet Structure for Compression Mode PD
5349 Note:
5350 This pseudo-code assumes that the Green pixel appears first in the image. If the first pixel in the
5351 image is Red or Blue then the processing sequence must be changed, but compression is performed
5352 in the same way for each color.
39: if p(h,v-2) >= max{p(h+2,v-2), p(h,v)} //Prediction value q of the preview pixel
40: q(h+2,v) = min {p(h+2,v-2), p(h,v)}
41: else if p(h,v-2) <= min{p(h+2,v-2), p(h,v)}
42: q(h+2,v) = max{p(h+2,v-2), p(h,v)}
43: else
44: q(h+2,v) = p(h,v) + p(h+2,v-2) - p(h,v-2)
45: end if
46: end if
47: p(h+2,v) = ((q(h+2,v) >> shift0 + Diff2) << shift0) + (1 << (shift0 -1))
48: // For decoding the pixel p(h+3,v)
49: if (Line count < 4) // Vertical line counter, Boundary condition
50: q(h+3,v) = p(h+1,v)
51: else if (unit count == 0) // unit count is for processing unit block, boundary condition
52: q(h+3,v) = p(h+3,v-2)
53: else
54: if p(h+1,v-2) < min{p(h+3,v-2), p(h+1,v)} //Prediction value q of the preview pixel
55: q(h+3,v) = max{p(h+3,v-2), p(h+1,v)}
56: else if p(h+1,v-2) > max{p(h+3,v-2), p(h+1,v)}
57: q(h+3,v) = min{p(h+3,v-2), p(h+1,v)}
58: else
59: q(h+3,v) = p(h+3,v-2) + p(h+1,v) - p(h+1,v-2)
60: end if
61: end if
62: p(h+3,v) = ((q(h+3,v) >> shift0 + Diff3) << shift0) + (1 << (shift0 -1))
5364
Figure 261 MPC Packet Structure for Compression Mode DGD (Bayer)
5365 Note:
5366 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5367 processing sequence must be changed, but compression is performed in the same way for each
5368 color. The Red- or Blue-first case is described in comments.
5369 Table 74 Decoder for Compression Mode DGD (Bayer)
1: // Quantization step
2: shift0 = (Qstep==0) ? 0 : 1
3: // direction for p(h,v)
4: ldiff0 = abs(p(h-2,v-2) - p(h-1,v-1)) // color pixel first: ldiff0 = abs(p(h-1,v-2) - p(h,v-1))
5: ldiff1 = abs(p(h,v-2) - p(h+1,v-1)) // color pixel first: ldiff1 = abs(p(h+1,v-2) - p(h+2,v-1))
6: ldiff2 = abs(p(h+2,v-2) - p(h+3,v-1)) // color pixel first: ldiff2 = abs(p(h+3,v-2) - p(h+4,v-1))
7: rdiff0 = abs(p(h,v-2) - p(h-1,v-1)) // color pixel first: rdiff0 = abs(p(h-1,v-2) - p(h-2,v-1))
8: rdiff1 = abs(p(h+2,v-2) - p(h+1,v-1)) // color pixel first: rdiff1 = abs(p(h+1,v-2) - p(h,v-1))
9: rdiff2 = abs(p(h+4,v-2) - p(h+3,v-1)) // color pixel first: rdiff2 = abs(p(h+3,v-2) - p(h+2,v-1))
10: diff0 = rdiff0 + rdiff1
11: diff1 = ldiff0 + ldiff1
12: diff2 = abs(diff0 - diff1)
13: rup_diff = (diff2 <= 10) ? (diff0 + rdiff2) : diff0
14: lup_diff = (diff2 <= 10) ? (diff1 + ldiff2) : diff1
15: q(h,v) = (rup_diff < lup_diff) ? p(h+1,v-1) : p(h-1,v-1) // Prediction pixel
16: q(h+1,v) = (rup_diff < lup_diff) ? p(h+3,v-2) : p(h-1,v-2) // Prediction pixel
17: // color pixel first: q(h,v) = (rup_diff < lup_diff) ? p(h+2,v-2) : p(h-2,v-2)
18: // color pixel first: q(h+1,v) = (rup_diff < lup_diff) ? p(h+2,v-1) : p(h,v-1)
19: // direction for p(h+1,v)
20: ldiff0 = abs(p(h,v-2) - p(h+1,v-1)) // color pixel first: ldiff0 = abs(p(h-1,v-2) - p(h,v-1))
21: ldiff1 = abs(p(h+2,v-2) - p(h+3,v-1)) // color pixel first: ldiff1 = abs(p(h+1,v-2) - p(h+2,v-1))
22: ldiff2 = abs(p(h+4,v-2) - p(h+5,v-1)) // color pixel first: ldiff2 = abs(p(h+3,v-2) - p(h+4,v-1))
23: rdiff0 = abs(p(h+2,v-2) - p(h+1,v-1)) // color pixel first: rdiff0 = abs(p(h+3,v-2) - p(h+2,v-1))
24: rdiff1 = abs(p(h+4,v-2) - p(h+3,v-1)) // color pixel first: rdiff1 = abs(p(h+5,v-2) - p(h+4,v-1))
25: rdiff2 = abs(p(h,v-2) - p(h-1,v-1)) // color pixel first: rdiff2 = abs(p(h+1,v-2) - p(h,v-1))
26: diff0 = rdiff0 + rdiff1
27: diff1 = ldiff0 + ldiff1
28: diff2 = abs(diff0 - diff1)
29: rup_diff = (diff2 <= 10) ? (diff0 + rdiff2) : diff0
30: lup_diff = (diff2 <= 10) ? (diff1 + ldiff2) : diff1
31: q(h+2,v) = (rup_diff < lup_diff) ? p(h+3,v-1) : p(h+1,v-1) // Prediction pixel
32: q(h+3,v) = (rup_diff < lup_diff) ? p(h+5,v-2) : p(h+1,v-2) // Prediction pixel
33: // color pixel first: q(h+2,v) = (rup_diff < lup_diff) ? p(h+4,v-2) : p(h,v-2)
34: // color pixel first: q(h+3,v) = (rup_diff < lup_diff) ? p(h+4,v-1) : p(h+2,v-1)
35: // For decoding the pixel p(h+i,v), i={0,1,2,3}
36: p(h,v) = ((q(h,v) >> shift0 + Diff0) << shift0) + (1 << (shift0 -1))
37: p(h+1,v) = ((q(h+1,v) >> shift0 + Diff1) << shift0) + (1 << (shift0 -1))
38: p(h+2,v) = ((q(h+2,v) >> shift0 + Diff2) << shift0) + (1 << (shift0 -1))
39: p(h+3,v) = ((q(h+3,v) >> shift0 + Diff3) << shift0) + (1 << (shift0 -1))
5378
Figure 262 MPC Packet Structure for Compression Mode FNR (Bayer)
5379 Note:
5380 In this pseudo-code, any color pixel can appear first.
k0 Threshold
value
Replace
p0 p1 p2 p3 p0 pq0 Decoded
pixel value
Outlier Reference
pixel pixel value
5399
Figure 263 Decoded and Reference Pixel of Outlier Pixel (Bayer)
5400 Figure 264 defines the packet structure for Compression Mode OUT (Bayer). For this Compression Mode,
5401 Header field Prediction IDX shall contain 0, and Header field Mode IDX shall contain 3’b111.
5402 The Payload shall contain:
5403 • The location of the outlier pixel in field Pos.
5404 • The quantization step size in field Qstep.
5405 • Encoded data for the three good pixels in fields Diff1 through Diff3 (i.e., for each good pixel, the
5406 difference between the predicted pixel and the original pixel).
5407 Table 76 shows pseudo-code for decoding an MPC Packet for Compression Mode OUT (Bayer).
5408
Figure 264 MPC Packet Structure for Compression Mode OUT (Bayer)
5409 Note:
5410 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5411 processing sequence must be changed, but compression is performed in the same way for each
5412 color.
5413 Table 76 Decoder for Compression Mode OUT (Bayer)
1: // Quantization step
2: shift0 = (Qstep==0) ? 1 : (Qstep==1) ? 2 : (Qstep==2) ? 3 : 4
3: // Prediction value
4: if (Pos == 0)
5: q0 = p(h+1,v-2) // color pixel first: q0 = (p(h,v-1) + p(h+2,v-1)) >> 1
6: q1= (p(h+1,v-1) + p(h+3,v-1)) >> 1 // color pixel first: q1 = p(h+2,v-2)
7: q2= p(h+3,v-2) // color pixel first: q2 = (p(h+4,v-1) + p(h+2,v-1)) >> 1
8: else if (Pos == 1)
9: q0 = (p(h-1,v-1) + p(h+1,v-1)) >> 1 // color pixel first: q0 = p(h,v-2)
10: q1= (p(h+1,v-1) + p(h+3,v-1)) >> 1 // color pixel first: q1 = p(h+2,v-2)
11: q2= p(h+3,v-2) // color pixel first: q2 = (p(h+4,v-1) + p(h+2,v-1)) >> 1
12: else if (Pos == 2)
13: q0 = (p(h-1,v-1) + p(h+1,v-1)) >> 1 // color pixel first: q0 = p(h,v-2)
14: q1= p(h+1,v-2) // color pixel first: q1 = (p(h,v-1) + p(h+2,v-1)) >> 1
15: q2= p(h+3,v-2) // color pixel first: q2 = (p(h+4,v-1) + p(h+2,v-1)) >> 1
16: else
17: q0 = (p(h-1,v-1) + p(h+1,v-1)) >> 1 // color pixel first: q0 = p(h,v-2)
18: q1= p(h+1,v-2) // color pixel first: q1 = (p(h,v-1) + p(h+2,v-1)) >> 1
19: q2= (p(h+1,v-1) + p(h+3,v-1)) >> 1 // color pixel first: q1 = p(h+2,v-2)
20: end if
21: k0= (p(h-2,v-2) + p(h,v-2) + p(h+2,v-2) + p(h+4,v-2) )>>2
22: // color pixel first: k0= (p(h-1,v-2) + p(h+1,v-2) + p(h+3,v-2) + p(h+5,v-2) )>>2
23: k1 = ((q0>> shift0 + Diff1) << shift0) + (1 << (shift0 -1))
24: k2 = ((q1>> shift0 + Diff2) << shift0) + (1 << (shift0 -1))
25: k3 = ((q2>> shift0 + Diff3) << shift0) + (1 << (shift0 -1))
26: k`0= (k0 + outlier_thresh) > 1023 ? 1023 : (k0 + outlier_thresh)
27: // outlier_thresh is user control parameter to detect outlier pixel with threshold value
28: // According to outlier pixel position Pos, decoded data mapping
29: // pq (h+i,v) is not output data but prediction pixel for using as reference pixel
30: pq (h,v) = (Pos == 0) ? k0 : k1
31: pq (h+1,v) = (Pos == 1) ? k0 : (Pos <1) ? k1 : k2
32: pq (h+2,v) = (Pos == 2) ? k0 : (Pos <2) ? k2 : k3
33: pq (h+3,v) = (Pos == 3) ? k0 : k3
34: // p(h+i,v) is output data, p and pq are different (basically these are same in other mode)
35: p (h,v) = (Pos == 0) ? k`0 : k1
36: p (h+1,v) = (Pos == 1) ? k`0 : (Pos <1) ? k1 : k2
37: p (h+2,v) = (Pos == 2) ? k`0 : (Pos <2) ? k2 : k3
38: p (h+3,v) = (Pos == 3) ? k`0 : k3
5426
Figure 265 MPC Packet Structure for Compression Mode eDGD
5427 Note:
5428 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5429 processing sequence must be changed, but compression is performed in the same way for each
5430 color. The Red- or Blue-first case is described in comments.
Table 77 Decoder for Compression Mode eDGD
1: // Quantization step
2: shift0 = (Qstep==0) ? 2 : (Qstep==1) ? 3 : (Qstep==2) ? 4 : 5
3: // direction for p(h,v)
4: ldiff0 = abs(p(h-2,v-2) - p(h-1,v-1)) // color pixel first: ldiff0 = abs(p(h-1,v-2) - p(h,v-1))
5: ldiff1 = abs(p(h,v-2) - p(h+1,v-1)) // color pixel first: ldiff1 = abs(p(h+1,v-2) - p(h+2,v-1))
6: ldiff2 = abs(p(h+2,v-2) - p(h+3,v-1)) // color pixel first: ldiff2 = abs(p(h+3,v-2) - p(h+4,v-1))
7: rdiff0 = abs(p(h,v-2) - p(h-1,v-1)) // color pixel first: rdiff0 = abs(p(h-1,v-2) - p(h-2,v-1))
8: rdiff1 = abs(p(h+2,v-2) - p(h+1,v-1)) // color pixel first: rdiff1 = abs(p(h+1,v-2) - p(h,v-1))
9: rdiff2 = abs(p(h+4,v-2) - p(h+3,v-1)) // color pixel first: rdiff2 = abs(p(h+3,v-2) - p(h+2,v-1))
10: diff0 = rdiff0 + rdiff1
11: diff1 = ldiff0 + ldiff1
12: diff2 = abs(diff0 - diff1)
13: rup_diff = (diff2 <= 10) ? (diff0 + rdiff2) : diff0
14: lup_diff = (diff2 <= 10) ? (diff1 + ldiff2) : diff1
15: q(h,v) = (rup_diff < lup_diff) ? p(h+1,v-1) : p(h-1,v-1) // Prediction pixel
16: q(h+1,v) = (rup_diff < lup_diff) ? p(h+3,v-2) : p(h-1,v-2) // Prediction pixel
17: // color pixel first: q(h,v) = (rup_diff < lup_diff) ? p(h+2,v-2) : p(h-2,v-2)
18: // color pixel first: q(h+1,v) = (rup_diff < lup_diff) ? p(h+2,v-1) : p(h,v-1)
19: // direction for p(h+1,v)
20: ldiff0 = abs(p(h,v-2) - p(h+1,v-1)) // color pixel first: ldiff0 = abs(p(h-1,v-2) - p(h,v-1))
21: ldiff1 = abs(p(h+2,v-2) - p(h+3,v-1)) // color pixel first: ldiff1 = abs(p(h+1,v-2) - p(h+2,v-1))
22: ldiff2 = abs(p(h+4,v-2) - p(h+5,v-1)) // color pixel first: ldiff2 = abs(p(h+3,v-2) - p(h+4,v-1))
23: rdiff0 = abs(p(h+2,v-2) - p(h+1,v-1)) // color pixel first: rdiff0 = abs(p(h+3,v-2) - p(h+2,v-1))
24: rdiff1 = abs(p(h+4,v-2) - p(h+3,v-1)) // color pixel first: rdiff1 = abs(p(h+5,v-2) - p(h+4,v-1))
25: rdiff2 = abs(p(h,v-2) - p(h-1,v-1)) // color pixel first: rdiff2 = abs(p(h+1,v-2) - p(h,v-1))
26: diff0 = rdiff0 + rdiff1
27: diff1 = ldiff0 + ldiff1
28: diff2 = abs(diff0 - diff1)
29: rup_diff = (diff2 <= 10) ? (diff0 + rdiff2) : diff0
30: lup_diff = (diff2 <= 10) ? (diff1 + ldiff2) : diff1
31: q(h+2,v) = (rup_diff < lup_diff) ? p(h+3,v-1) : p(h+1,v-1) // Prediction pixel
32: q(h+3,v) = (rup_diff < lup_diff) ? p(h+5,v-2) : p(h+1,v-2) // Prediction pixel
33: // color pixel first: q(h+2,v) = (rup_diff < lup_diff) ? p(h+4,v-2) : p(h,v-2)
34: // color pixel first: q(h+3,v) = (rup_diff < lup_diff) ? p(h+4,v-1) : p(h+2,v-1)
35: // For decoding the pixel p(h+i,v), i={0,1,2,3}
36: p(h,v) = ((q(h,v) >> shift0 + Diff0) << shift0) + (1 << (shift0 -1))
37: p(h+1,v) = ((q(h+1,v) >> shift0 + Diff1) << shift0) + (1 << (shift0 -1))
38: p(h+2,v) = ((q(h+2,v) >> shift0 + Diff2) << shift0) + (1 << (shift0 -1))
39: p(h+3,v) = ((q(h+3,v) >> shift0 + Diff3) << shift0) + (1 << (shift0 -1))
5439
Figure 266 MPC Packet Structure for Compression Mode ePD
5440 Note:
5441 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5442 processing sequence must be changed, but compression is performed in the same way for each
5443 color.
39: if p(h,v-2) >= max{p(h+2,v-2), p(h,v)} //Prediction value q of the preview pixel
40: q(h+2,v) = min {p(h+2,v-2), p(h,v)}
41: else if p(h,v-2) <= min{p(h+2,v-2), p(h,v)}
42: q(h+2,v) = max{p(h+2,v-2), p(h,v)}
43: else
44: q(h+2,v) = p(h,v) + p(h+2,v-2) - p(h,v-2)
45: end if
46: end if
47: p(h+2,v) = ((q(h+2,v) >> shift0 + Diff2) << shift0) + (1 << (shift0 -1))
48: // For decoding the pixel p(h+3,v)
49: if (Line count < 4) // Vertical line counter, Boundary condition
50: q(h+3,v) = p(h+1,v)
51: else if (unit count == 0) // unit count is for processing unit block, boundary condition
52: q(h+3,v) = p(h+3,v-2)
53: else
54: if p(h+1,v-2) < min{p(h+3,v-2), p(h+1,v)} //Prediction value q of the preview pixel
55: q(h+3,v) = max{p(h+3,v-2), p(h+1,v)}
56: else if p(h+1,v-2) > max{p(h+3,v-2), p(h+1,v)}
57: q(h+3,v) = min{p(h+3,v-2), p(h+1,v)}
58: else
59: q(h+3,v) = p(h+3,v-2) + p(h+1,v) - p(h+1,v-2)
60: end if
61: end if
62: p(h+3,v) = ((q(h+3,v) >> shift0 + Diff3) << shift0) + (1 << (shift0 -1))
5453
Figure 267 MPC Packet Structure for Compression Mode eSHV (Bayer)
5454 Note:
5455 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5456 processing sequence must be changed, but compression is performed in the same way for each
5457 color. The Red- or Blue-first case is described in comments.
39: p(h+1,v) = ((q(h+1,v) >> shift0 + Diff1) << shift0) + (1 << (shift0 -1))
40: // Prediction value q(h,v) from DGD mode for p(h+i,v), i={2,3}
41: if (q(h+2,v) == p(h+1,v-1)) // color pixel first: if (q(h+3,v) == p(h+2,v-1))
42: left_en(h+2,v) = 1; left_en(h+3,v) = 1
43: else
44: left_en(h+2,v) = 0; left_en(h+3,v) = 0
45: end if
46: offset(h+2,v) = left_en(h+2,v) ? 0 : (p(h+2,v-2) > p(h+3,v-1)) ? (p(h+3,v-1) – 40) : (p(h+3,v-1) + 40)
47: /* color pixel first: offset(h+2,v) = left_en(h+2,v) ? 0 :
48: (p(h+3,v-2) > p(h+4,v-1)) ? (p(h+4,v-2) – 40) : (p(h+4,v-2) + 40) */
49: offset(h+3,v) = left_en(h+2,v) ? 0 : (p(h+2,v-2) > p(h+3,v-1)) ? (p(h+5,v-2) – 40) : (p(h+5,v-2) + 40)
50: /* color pixel first: offset(h+3,v) = left_en(h+3,v) ? 0 :
51: (p(h+3,v-2) > p(h+4,v-1)) ? (p(h+4,v-1) – 40) : (p(h+4,v-1) + 40) */
52: offset(h+2,v) = (offset(h+2,v) > 1023) ? 0 : (offset(h+2,v) < 0) ? 0 : offset(h+2,v)
53: offset(h+3,v) = (offset(h+3,v) > 1023) ? 0 : (offset(h+3,v) < 0) ? 0 : offset(h+3,v)
54: // Prediction for high
55: qh(h+2,v) = left_en(h+2,v) ? (p(h+1,v-1) + p(h+2,v-2)) >> 1 : (p(h+2,v-2) + p(h+3,v-1)) >> 1
56: /* color pixel first: qh(h+2,v) = left_en(h+2,v) ? (p(h,v-2) + p(h+2,v-2)) >> 1 :
57: (p(h+2,v-2) + p(h+4,v -2)) >> 1 */
58: qh(h+3,v) = left_en(h+2,v) ? (p(h+1,v-2) + p(h+3,v-2)) >> 1 : (p(h+3,v-2) + p(h+5,v-2)) >> 1
59: /* color pixel first: qh(h+3,v) = left_en(h+3,v) ? (p(h+2,v-1) + p(h+3,v-2)) >> 1 :
60: : (p(h+3,v-2) + p(h+4,v-1)) >> 1 */
61: // Prediction for low
62: ql(h+2,v) = left_en(h+2,v) ? (p(h+1,v-1) + p(h,v)) >> 1 : offset(h+2,v)
63: // color pixel first: ql(h+2,v) = left_en(h+2,v) ? (p(h,v-2) + p(h,v)) >> 1 : offset(h+2,v)
64: ql(h+3,v) = left_en(h+2,v) ? (p(h+1,v-2) + p(h+1,v)) >> 1 : offset(h+3,v)
65: // color pixel first: ql(h+3,v) = left_en(h+3,v) ? (p(h+2,v-1) + p(h+1,v)) >> 1 : offset(h+3,v)
66: // Recon
67: low2 = left_en(h+2,v) ? p(h,v) : offset(h+2,v)
68: // color pixel first: low2 = left_en(h+2,v) ? p(h+1,v) : offset(h+3,v)
69: cent2 = left_en(h+2,v) ? p(h+1,v-1) : p(h+3,v-1)
70: // color pixel first: cent2 = left_en(h+2,v) ? p(h+2,v-1) : p(h+4,v-1)
71: high2 = p(h+2,v-2) // color pixel first: high2 = p(h+3,v-2)
72: ldiff2 = abs(cent2 - low2)
73: hdiff2 = abs(cent2 - high2)
74: q(h+2,v) = (ldiff2 < hdiff2) ? ql(h+2,v) : qh(h+2,v)
75: q(h+3,v) = (ldiff2 < hdiff2) ? ql(h+3,v) : qh(h+3,v)
76: p(h+2,v) = ((q(h+2,v) >> shift0 + Diff2) << shift0) + (1 << (shift0 -1))
77: p(h+3,v) = ((q(h+3,v) >> shift0 + Diff3) << shift0) + (1 << (shift0 -1))
5464
Figure 268 MPC Packet Structures for Tetra-Cell Compression Modes
p0 p1
p2 p3
5474
5492 Using this notation, the relative coordinates of reference pixels are as illustrated in Figure 270, where the
5493 color of each square indicates the color filter of the corresponding pixel.
Pixels to be Encoded
Blue Pixel First
Pixels to be Encoded
5494 Not Shown: Red Pixel First
5495 For a Tetra-Cell image sensor, the eight highlighted pixels in the bottom two rows will be encoded. This
5496 corresponds to Tetra-Cell coordinates p(h, v) (i.e., the current Tetra-Cell) and p(h+1, v). The other colored
5497 squares represent the previously decoded pixels, which are available to be used as reference data.
5523
Figure 271 MPC Packet Structure for Compression Mode AD
5524 Note:
5525 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5526 processing sequence must be changed, but compression is performed in the same way for each
5527 color.
5528 Note also that this pseudo-code only describes 2x2 pixels pk (h, v) to be compressed. These should
5529 be Green or Red/Blue pixels.
5546
Figure 272 MPC Packet Structure for Compression Mode OD
5547 Note:
5548 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5549 processing sequence must be changed, but compression is performed in the same way for each
5550 color. The Red- or Blue-first case is described in comments.
5551 Note also that this pseudo-code describes each case of 2x2 Green pk (h, v) and 2x2 Red/Blue
5552 pk (h+1, v) pixels.
37: mode = 7
38: end if
39: else
40: mode = 5
41: end if
42: end if
43: // Decoding process
44: if mode == 0
45: q0 = p3(h-1, v-1) // color pixel first: q0 = p3(h-2, v-2)
46: q1 = p1(h-1, v-1) // color pixel first: q1 = p1(h-2, v-2)
47: q2 = p2(h-1, v-1) // color pixel first: q2 = p2(h-2, v-2)
48: p0(h,v) = ((q0>>shift0 + ByrDiff) << shift0) + (1 << (shift0-1))
49: p1(h,v) = ((q1>>shift0 + MltDiff1) << shift0) + (1 << (shift0-1))
50: p2(h,v) = ((q2>>shift0 + MltDiff2) << shift0) + (1 << (shift0-1))
51: p3(h,v) = ((p0(h,v)>>shift0 + MltDiff3) << shift0) + (1 << (shift0-1))
52: else if mode == 1
53: q0 = p3(h-1, v-1) // color pixel first: q0 = p3(h-2, v-2)
54: q1 = p1(h-1, v-1) // color pixel first: q1 = p1(h-2, v-2)
55: q2 = (p2(h-1, v-1) +p3(h-1, v-1)) >> 1 // color pixel first: q2 = (p2(h-2, v-2) +p3(h-2, v-2)) >> 1
56: p0(h,v) = ((q0>>shift0 + ByrDiff) << shift0) + (1 << (shift0-1))
57: p1(h,v) = ((q1>>shift0 + MltDiff1) << shift0) + (1 << (shift0-1))
58: p2(h,v) = ((q2>>shift0 + MltDiff2) << shift0) + (1 << (shift0-1))
59: p3(h,v) = ((p0(h,v)>>shift0 + MltDiff3) << shift0) + (1 << (shift0-1))
60: else if mode == 2
61: q0 = p3(h-1, v-1) // color pixel first: q0 = p3(h-2, v-2)
62: q1 = (p1(h-1, v-1) +p3(h-1, v-1)) >> 1 // color pixel first: q1 = (p1(h-2, v-2) +p3(h-2, v-2)) >> 1
63: q2 = p2(h-1, v-1) // color pixel first: q2 = p2(h-2, v-2)
64: p0(h,v) = ((q0>>shift0 + ByrDiff) << shift0) + (1 << (shift0-1))
65: p1(h,v) = ((q1>>shift0 + MltDiff1) << shift0) + (1 << (shift0-1))
66: p2(h,v) = ((q2>>shift0 + MltDiff3) << shift0) + (1 << (shift0-1))
67: p3(h,v) = ((p0(h,v)>>shift0 + MltDiff2) << shift0) + (1 << (shift0-1))
68: else if mode == 3
69: q0 = p1(h-1, v-1) // color pixel first: q0 = p1(h-2, v-2)
70: q1 = (p2(h, v-2) +p1(h-1, v-1)) >> 1 // color pixel first: q1 = p1(h-2, v-2)
71: q2 = p0(h-1, v-1) // color pixel first: q2 = p3(h-2, v-2)
72: p0(h,v) = ((q0>>shift0 + ByrDiff) << shift0) + (1 << (shift0-1))
73: p1(h,v) = ((q1>>shift0 + MltDiff1) << shift0) + (1 << (shift0-1))
74: p2(h,v) = ((q2>>shift0 + MltDiff3) << shift0) + (1 << (shift0-1))
75: p3(h,v) = ((p0(h,v)>>shift0 + MltDiff2) << shift0) + (1 << (shift0-1))
76: else if mode == 4
77: q0 = p2(h-1, v-1) // color pixel first: q0 = p2(h-2, v-2)
78: q1 = p3(h-1, v-1) // color pixel first: q1 = p3(h-2, v-2)
79: q2 = p2(h-1, v-1) // color pixel first: q2 = p2(h-2, v-2)
166: end if
167: // Decoding process
168: if mode == 0
169: q0 = p3(h-1, v-2) // color pixel first: q0 = p3(h, v-1)
170: q1 = p1(h-1, v-2) // color pixel first: q1 = p1(h, v-1)
171: q2 = p2(h-1, v-2) // color pixel first: q2 = p2(h, v-1)
172: p0(h+1,v) = ((q0>>shift0 + ByrDiff) << shift0) + (1 << (shift0-1))
173: p1(h+1,v) = ((q1>>shift0 + MltDiff1) << shift0) + (1 << (shift0-1))
174: p2(h+1,v) = ((q2>>shift0 + MltDiff2) << shift0) + (1 << (shift0-1))
175: p3(h+1,v) = ((p0(h+1,v)>>shift0 + MltDiff3) << shift0) + (1 << (shift0-1))
176: else if mode == 1
177: q0 = p3(h-1, v-2) // color pixel first: q0 = p3(h, v-1)
178: q1 = p1(h-1, v-2) // color pixel first: q1 = p1(h, v-1)
179: q2 = (p2(h-1, v-2) + p3(h-1, v-2)) >> 1 // color pixel first: q2 = (p2(h, v-1) +p3(h, v-1)) >> 1
180: p0(h+1,v) = ((q0>>shift0 + ByrDiff) << shift0) + (1 << (shift0-1))
181: p1(h+1,v) = ((q1>>shift0 + MltDiff1) << shift0) + (1 << (shift0-1))
182: p2(h+1,v) = ((q2>>shift0 + MltDiff2) << shift0) + (1 << (shift0-1))
183: p3(h+1,v) = ((p0(h+1,v)>>shift0 + MltDiff3) << shift0) + (1 << (shift0-1))
184: else if mode == 2
185: q0 = p3(h-1, v-2) // color pixel first: q0 = p3(h, v-1)
186: q1 = (p1(h-1, v-2) +p3(h-1, v-2)) >> 1 // color pixel first: q1 = (p1(h, v-1) +p3(h, v-1)) >> 1
187: q2 = p2(h-1, v-2) // color pixel first: q2 = p2(h, v-1)
188: p0(h+1,v) = ((q0>>shift0 + ByrDiff) << shift0) + (1 << (shift0-1))
189: p1(h+1,v) = ((q1>>shift0 + MltDiff1) << shift0) + (1 << (shift0-1))
190: p2(h+1,v) = ((q2>>shift0 + MltDiff3) << shift0) + (1 << (shift0-1))
191: p3(h+1,v) = ((p0(h+1,v)>> shift0 + MltDiff2) << shift0) + (1 << (shift0-1))
192: else if mode == 3
193: q0 = p1(h-1, v-2) // color pixel first: q0 = p1(h, v-1)
194: q1 = p1(h-1, v-2) // color pixel first: q1 = (p1(h, v-1) + p2(h+1, v-2)) >> 1
195: q2 = p3(h-1, v-2) // color pixel first: q2 = p0(h, v-1)
196: p0(h+1,v) = ((q0>>shift0 + ByrDiff) << shift0) + (1 << (shift0-1))
197: p1(h+1,v) = ((q1>>shift0 + MltDiff1) << shift0) + (1 << (shift0-1))
198: p2(h+1,v) = ((q2>>shift0 + MltDiff3) << shift0) + (1 << (shift0-1))
199: p3(h+1,v) = ((p0(h+1,v)>>shift0 + MltDiff2) << shift0) + (1 << (shift0-1))
200: else if mode == 4
201: q0 = p2(h-1, v-2) // color pixel first: q0 = p2(h, v-1)
202: q1 = p3(h-1, v-2) // color pixel first: q1 = p3(h, v-1)
203: q2 = p2(h-1, v-2) // color pixel first: q2 = p2(h, v-1)
204: p0(h+1,v) = ((q0>>shift0 + ByrDiff) << shift0) + (1 << (shift0-1))
205: p1(h+1,v) = ((q1>>shift0 + MltDiff1) << shift0) + (1 << (shift0-1))
206: p2(h+1,v) = ((q2>>shift0 + MltDiff2) << shift0) + (1 << (shift0-1))
207: p3(h+1,v) = ((p0(h+1,v)>>shift0 + MltDiff3) << shift0) + (1 << (shift0-1))
208: else if mode == 5
5564
Figure 273 MPC Packet Structure for Compression Mode FNR (Tetra-Cell)
5565 Note:
5566 In this pseudo-code, any color pixel can appear first.
5567 Note also that this pseudo-code only describes 2x2 pixels pk (h, v) to be compressed. These should
5568 be Green or Red/Blue pixels.
5584 If p0(h+1,v) through p3(h+1,v) in Figure 270 are red or green, and one of them is the outlier
5585 pixel, then:
5586 k0 shall be the average of p (h−1,v−2), p (h+1,v−2), p (h+1,v−2), and p (h+3,v−2)
3 2 3 2
Outlier k0 Threshold
pixel value
Replace
p0 p1 p0 pq0 Decoded
pixel value
p2 p3 Reference
pixel value
5587
Figure 274 Decoded and Reference Pixel of Outlier Pixel (Tetra)
5588 Figure 275 defines the packet structure for Compression Mode OUT (Tetra-Cell). For this Compression
5589 Mode, Header field Prediction IDX shall contain 0, and Header field Mode IDX shall contain 3’b111.
5590 The Payload shall contain compressed data for the four pixels of a Tetra-Cell:
5591 • The location of the outlier pixel in field Pos
5592 • The quantization step size in field Qstep
5593 • Encoded data for the three good pixels in fields MltDiff1 through MltDiff3 (i.e., for each good
5594 pixel, the difference between the predicted pixel and the original pixel).
5595 For Compression Mode OUT, the Bayer image is generated by averaging neighboring
5596 pixels.
5597 Table 84 shows pseudo-code for decoding an MPC Packet for Compression Mode OUT (Tetra-Cell).
5598
Figure 275 MPC Packet Structure for Compression Mode OUT (Tetra-Cell)
5599 Note:
5600 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5601 processing sequence must be changed, but compression is performed in the same way for each
5602 color.
5603 Note also that this pseudo-code only describes 2x2 pixels pk (h, v) to be compressed. These should
5604 be Green or Red/Blue pixels.
5621
Figure 276 MPC Packet Structure for Compression Mode eMPD (Tetra-Cell)
5622 Note:
5623 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5624 processing sequence must be changed, but compression is performed in the same way for each
5625 color. The Red- or Blue-first case is described in comments.
5626 Note also that this pseudo-code only describes 2x2 pixels pk (h, v) to be compressed. These should
5627 be Green or Red/Blue pixels.
5643
Figure 277 MPC Packet Structure for Compression Mode eHVD (Tetra-Cell)
5644 Note:
5645 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5646 processing sequence must be changed, but compression is performed in the same way for each
5647 color.
5648 Note also that this pseudo-code only describes 2x2 pixels pk (h, v) to be compressed. These should
5649 be Green or Red/Blue pixels.
First
p0 p1 p0 p1 Pixel
Couplet
Second
p2 p3 p2 p3 Pixel
Couplet
First Second
Pixel Pixel
5663 Couplet Couplet
5664 • Field ByrDiff shall contain the quantized differences between the predicted value and the average
5665 of the two pixels in the first pixel couplet. Field MltDiff shall contain the quantized differences
5666 between the predicted value and the average of the two pixels in the second pixel couplet.
5667 Note:
5668 Field ByrDiff can also be regarded as MltDiff; it is used for generation of the Bayer image,
5669 see Section I.3.4).
5670 That is,
5671 If field Dir indicates vertical orientation (value 0), then:
5672 • Field ByrDiff shall contain the average of p0(h, v) and p2(h, v)
5673 • Field MltDiff shall contain the average of p1(h, v) and p3(h, v)
5674 If field Dir indicates horizontal orientation (value 1), then:
5675 • Field ByrDiff shall contain the average of p0(h, v) and p1(h, v)
5676 • Field MltDiff shall contain the average of p2(h, v) and p3(h, v)
5677 • 1-bit field Slope shall indicate, for both pixel couplets, whether the slope of the gradient is
5678 increasing or decreasing in the Dir direction.
5679 If Slope contains 0, then the gradient slope is decreasing and the MPC packet shall be decoded
5680 as:
5681 First pixel couplet = (ByrDiff + alpha, ByrDiff − alpha)
5682 Second pixel couplet = (MltDiff + beta, MltDiff − beta)
5683 If Slope contains 1, then the gradient slope is increasing and the MPC Packet shall be decoded as:
5684 First pixel couplet = (ByrDiff − alpha, ByrDiff + alpha)
5685 Second pixel couplet = (MltDiff − beta, MltDiff + beta)
5686 Where alpha and beta are both defined as:
5687 4 for compression ratio 10:5, or
5688 1 for compression ratio 10:6, or
5689 0 for compression ratio 10:7
5690 • 1-bit fields Detail[0] and Detail[1] shall determine, for each pixel couplet, whether the pixel value
5691 variations alpha and beta shown above shall be (value 1) or shall not be (value 0) replaced with
5692 the difference from the neighboring pixels.
5693 Example: Assume that field Slope indicates decreasing slope (value 0). If field Detail[0]
5694 contains 1, then the first pixel couplet shall be decoded not as (MltDiff + alpha, MltDiff −
5695 alpha) as shown above, but rather as: (MltDiff + delta, MltDiff − delta) (where delta is the
5696 difference from the neighboring pixels).
5697 Table 87 shows pseudo-code for decoding an MPC Packet for Compression Mode eHVA.
5698
Figure 279 MPC Packet Structure for Compression Mode eHVA
5699 Note:
5700 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5701 processing sequence must be changed, but compression is performed in the same way for each
5702 color.
5703 Note also that this pseudo-code only describes 2x2 pixels pk (h, v) to be compressed. These should
5704 be Green or Red/Blue pixels.
13: q2 = p1(h-2,v)
14: q3 = p3(h-2,v)
15: end if
16: if Detail[1] == 0 // for Horizontal direction p0(h,v), p1(h,v) or Vertical direction p0(h,v), p2(h,v)
17: diff0 = abs(q0 – q1) >> 1
18: >> 1
else
19: diff0 = 4
20: end if
21: if Detail[0] == 0 // for Horizontal direction p2(h,v), p3(h,v) or Vertical direction p1(h,v), p3(h,v)
22: diff1 = abs(q2 – q3) >> 1
23: >> 1
else
24: diff1 = 4
25: end if
26: if Dir == 1 // Horizontal direction
27: if Slope == 1
28: p0(h,v) = average0 – diff0
29: p1(h,v) = average0 + diff0
30: p2(h,v) = average1 – diff1
31: p3(h,v) = average1 + diff1
32: else
33: p0(h,v) = average0 + diff0
34: p1(h,v) = average0 – diff0
35: p2(h,v) = average1 + diff1
36: p3(h,v) = average1 – diff1
37: end if
38: else // Vertical direction
39: if Slope == 1
40: p0(h,v) = average0 – diff0
41: p1(h,v) = average1 – diff1
42: p2(h,v) = average0 + diff0
43: p3(h,v) = average1 + diff1
44: else
45: p0(h,v) = average0 + diff0
46: p1(h,v) = average1 + diff1
47: p2(h,v) = average0 – diff0
48: p3(h,v) = average1 – diff1
49: end if
50: p0(h,v) = (p0(h,v) > 1023) ? 1023 : (p0(h,v) < 0) ? 0 : p0(h,v)
51: p1(h,v) = (p1(h,v) > 1023) ? 1023 : (p1(h,v) < 0) ? 0 : p1(h,v)
52: p2(h,v) = (p2(h,v) > 1023) ? 1023 : (p2(h,v) < 0) ? 0 : p2(h,v)
53: p3(h,v) = (p3(h,v) > 1023) ? 1023 : (p3(h,v) < 0) ? 0 : p3(h,v)
54: // p1(h,v),…, p3(h,v) should be p1(h,v),…, p3(h,v) = average0, when you want to get the pbyr(h,v)
55: pbyr(h,v) = average0 // Bayer pixel pbyr(h,v)
5720
Figure 280 MPC Packet Structure for Compression Mode eOUT
5721 Note:
5722 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5723 processing sequence must be changed, but compression is performed in the same way for each
5724 color.
5725 Note also that this pseudo-code describes each case of 2x2 Green pk (h, v) and 2x2 Red/Blue
5726 pk (h+1, v) pixels.
5735
Figure 281 Low Resolution Image Generation by Pbyr (Tetra-Cell)
5742 Figure 282 and Figure 283 define the Packet structures for Compression Ratios 10:6 and 10:7, respectively,
5743 for Tetra-Cell. Differences in the bit allocations are highlighted in red.
5744
Figure 282 MPC Packet Structures for Compression Ratio 10:6 (Tetra-Cell)
5745
Figure 283 MPC Packet Structures for Compression Ratio 10:7 (Tetra-Cell)
5746 Figure 284 defines the values of shift0 and shift1 to use (i.e., in the respective Decoder pseudo-code per
5747 Compression Mode) for each combination of Tetra-Cell Compression Mode, value of field Qstep, and
5748 Compression Ratio.
5749
Figure 284 Quantization Bits for Compression Ratios (Tetra-Cell)
5755
Figure 285 MPC Packet Structures for Nona-Cell Compression Modes
p0 p1 p2
p3 p4 p5
p6 p7 p8
5765
Figure 286 Nona-Cell Multi-Pixel Indexing
5783 Using this notation, the relative coordinates of reference pixels are as illustrated in Figure 287, where the
5784 color of each square indicates the color filter of the corresponding pixel.
Green Pixel First
Pixels to be Encoded
Blue Pixel First
Pixels to be Encoded
5786 For a Nona-Cell image sensor, the eighteen highlighted pixels in the bottom three rows will be encoded. This
5787 corresponds to Nona-Cell coordinates p(h, v) (i.e., the current Nona-Cell) and p(h+1, v). The other colored
5788 squares represent the previously decoded pixels, which are available to be used as reference data.
5812
Figure 288 MPC Packet Structure for Compression Mode AD (Nona-Cell)
5813 Note:
5814 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5815 processing sequence must be changed, but compression is performed in the same way for each
5816 color.
5817 Note also that this pseudo-code only describes 3x3 pixels pk (h, v) to be compressed. These should
5818 be Green or Red/Blue pixels.
5829
Figure 289 MPC Packet Structure for Compression Mode DGD (Nona-Cell)
5830 Note:
5831 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5832 processing sequence must be changed, but compression is performed in the same way for each
5833 color. The Red- or Blue-first case is described in comments.
5834 Note also that this pseudo-code only describes 3x3 pixels pk (h, v) to be compressed. These should
5835 be Green or Red/Blue pixels.
5847
Figure 290 MPC Packet Structure for Compression Mode FNR (Nona-Cell)
5848 Note:
5849 In this pseudo-code, any color pixel can appear first.
5850 Note also that this pseudo-code only describes 3x3 pixels pk(h, v) to be compressed. These should
5851 be Green or Red/Blue pixels.
5868
Figure 291 MPC Packet Structure for Compression Mode eAD (Nona-Cell)
5869 Note:
5870 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5871 processing sequence must be changed, but compression is performed in the same way for each
5872 color. The Red- or Blue-first case is described in comments.
5873 Note also that this pseudo-code only describes 3x3 pixels pk(h, v) to be compressed. These should
5874 be Green or Red/Blue pixels.
5889
Figure 292 MPC Packet Structure for Compression Mode eHVD (Nona-Cell)
5890 Note:
5891 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5892 processing sequence must be changed, but compression is performed in the same way for each
5893 color. The Red- or Blue-first case is described in comments.
5894 Note also that this pseudo-code only describes 3x3 pixels pk(h, v) to be compressed. These should
5895 be Green or Red/Blue pixels.
First
p0 p1 p2 p0 p1 p2 Pixel
Triplet
Second
p3 p4 p5 p3 p4 p5 Pixel
Triplet
Third
p6 p7 p8 p6 p7 p8 Pixel
Triplet
5928 Table 96 shows pseudo-code for decoding an MPC Packet for Compression Mode eHVI.
5929
Figure 294 MPC Packet Structure for Compression Mode eHVI
5930 Note:
5931 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5932 processing sequence must be changed, but compression is performed in the same way for each
5933 color.
5934 Note also that this pseudo-code only describes 3x3 pixels pk(h, v) to be compressed. These should
5935 be Green or Red/Blue pixels.
5947
Figure 295 MPC Packet Structure for Compression Mode eSHV (Nona-Cell)
5948 Note:
5949 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5950 processing sequence must be changed, but compression is performed in the same way for each
5951 color. The Red- or Blue-first case is described in comments.
5952 Note also that this pseudo-code only describes 3x3 pixels pk(h, v) to be compressed. These should
5953 be Green or Red/Blue pixels.
21: if left_en == 1
22: if high_en == 1
23: q0(h,v) = p5(h-1,v-1) // color pixel first: q0(h,v) = p5(h-2,v-2)
24: q1(h,v) = p2(h-1,v-1) // color pixel first: q1(h,v) = p2(h-2,v-2)
25: q2(h,v) = (p2(h-1,v-1) + p6(h,v-2)) >> 1 // color pixel first: q2(h,v) = p2(h-2,v-2)
26: q3(h,v) = p8(h-1,v-1) // color pixel first: q3(h,v) = p8(h-2,v-2)
27: q6(h,v) = p7(h-1,v-1) // color pixel first: q6(h,v) = p7(h-2,v-2)
28: else
29: q0(h,v) = p7(h-1,v-1) // color pixel first: q0(h,v) = p7(h-2,v-2)
30: q1(h,v) = p8(h-1,v-1) // color pixel first: q1(h,v) = p8(h-2,v-2)
31: q2(h,v) = p5(h-1,v-1) // color pixel first: q2(h,v) = p5(h-2,v-2)
32: q3(h,v) = p6(h-1,v-1) // color pixel first: q3(h,v) = p6(h-2,v-2)
33: q6(h,v) = p6(h-1,v-1) // color pixel first: q6(h,v) = p6(h-2,v-2)
34: end if
35: // For decoding the pixel
36: p0(h,v) = ((q0(h,v) >> shift0 + ByrDiff) << shift0) + (1 << (shift0 -1))
37: p1(h,v) = ((q1(h,v) >> shift0 + MltPixel1) << shift0) + (1 << (shift0 -1))
38: p2(h,v) = ((q2(h,v) >> shift0 + MltPixel2) << shift0) + (1 << (shift0 -1))
39: p3(h,v) = ((q3(h,v) >> shift0 + MltPixel3) << shift0) + (1 << (shift0 -1))
40: p6(h,v) = ((q6(h,v) >> shift0 + MltPixel4) << shift0) + (1 << (shift0 -1))
41: // Prediction pixel
42: q4(h,v) = p0(h,v)
43: q5(h,v) = p1(h,v)
44: q7(h,v) = p3(h,v)
45: // For decoding the pixel
46: p4(h,v) = ((q4(h,v) >> shift0 + MltPixel5) << shift0) + (1 << (shift0 -1))
47: p5(h,v) = ((q5(h,v) >> shift0 + MltPixel6) << shift0) + (1 << (shift0 -1))
48: p7(h,v) = ((q7(h,v) >> shift0 + MltPixel7) << shift0) + (1 << (shift0 -1))
49: // Prediction pixel
50: q8(h,v) = p4(h,v)
51: p8(h,v) = ((q8(h,v) >> shift0 + MltPixel8) << shift0) + (1 << (shift0 -1))
52: // Prediction pixel
53: else // right direction
54: if high_en == 1
55: q2(h,v) = p3(h+1,v-1) // color pixel first: q2(h,v) = p3(h+2,v-2)
56: q1(h,v) = p0(h+1,v-1) // color pixel first: q1(h,v) = p0(h+2,v-2)
57: q0(h,v) = (p0(h+1,v-1) + p8(h,v-2)) >> 1 // color pixel first: q0(h,v) = p0(h+2,v-2)
58: q5(h,v) = p6(h+1,v-1) // color pixel first: q5(h,v) = p6(h+2,v-2)
59: q8(h,v) = p7(h+1,v-1) // color pixel first: q8(h,v) = p7(h+2,v-2)
60: else
61: q2(h,v) = p7(h+1,v-1) // color pixel first: q2(h,v) = p7(h+2,v-2)
62: q1(h,v) = p6(h+1,v-1) // color pixel first: q1(h,v) = p6(h+2,v-2)
63: q0(h,v) = p3(h+1,v-1) // color pixel first: q0(h,v) = p3(h+2,v-2)
5966
Figure 296 MPC Packet Structure for Compression Mode eMPD (Nona-Cell)
5967 Note:
5968 This pseudo-code assumes that the Green pixel appears first. If the first pixel is Red or Blue then the
5969 processing sequence must be changed, but compression is performed in the same way for each
5970 color. The Red- or Blue-first case is described in comments.
5971 Note also that this pseudo-code only describes 3x3 pixels pk(h, v) to be compressed. These should
5972 be Green or Red/Blue pixels.
106: else
107: q7(h,v) = p6(h,v) + p4(h,v) – p3(h,v)
108: end if
109: end if
110: p7 (h,v)= ((q7 >> shift0 + MltDiff7) << shift0) + (1 << (shift0 -1))
111: // For decoding the pixel p8 (h,v)
112: if (Line count < 6) // Vertical line counter, Boundary condition
113: q8 = p7 (h,v)
114: else if (unit count == 0) // unit count is for processing unit block, boundary condition
115: q8 = p5 (h,v)
116: else //Prediction value q
117: if p4(h,v) >= max{p7(h,v), p5(h,v)} //Prediction value q of the preview pixel
118: q8(h,v) = min{ p7(h,v), p5(h,v)}
119: else if p4(h,v) <= min{ p7(h,v), p5(h,v)}
120: q8(h,v) = max{ p7(h,v), p5(h,v)}
121: else
122: q8(h,v) = p7(h,v) + p5(h,v) – p4(h,v)
123: end if
124: end if
125: p8 (h,v)= ((q8 >> shift0 + MltDiff8) << shift0) + (1 << (shift0 -1))
126: // p1(h,v),…, p8(h,v) should be p1(h,v),…, p8(h,v) = p0(h,v), when you want to get the pbyr(h,v)
127: pbyr(h,v) = p0 (h,v) // Bayer pixel pbyr(h,v)
5979
Figure 297 Low Resolution Image Generation by Pbyr (Nona-Cell)
5982
Figure 298 MPC Packet Structures for Compression Ratio 10:6 (Nona-Cell)
5983
Figure 299 MPC Packet Structures for Compression Ratio 10:7 (Nona-Cell)
5984 Figure 300 defines the values of shift0 and shift1 to use (i.e., in the respective Decoder pseudo-code per
5985 Compression Mode) for each combination of Nona-Cell Compression Mode, value of field Qstep, and
5986 Compression Ratio.
5987
Figure 300 Quantization Bits for Compression Ratios (Nona-Cell)
* P : Pixel * P : Pixel
P00 P01 P02 P03 P04 P05 P06 P07 P08 P09 P010 P011 P012 P013 P014 P015 P00 P01 P04 P05 P02 P03 P06 P07 P08 P09 P012 P013 P010 P011 P014 P015
P10 P11 P12 P13 P14 P15 P16 P17 P18 P19 P110 P111 P112 P113 P114 P115 P10 P11 P14 P15 P12 P13 P16 P17 P18 P19 P112 P113 P110 P111 P114 P115
P20 P21 P22 P23 P24 P25 P26 P27 P28 P29 P210 P211 P212 P213 P214 P215 P40 P41 P44 P45 P42 P43 P46 P47 P48 P49 P412 P413 P410 P411 P414 P415
P30 P31 P32 P33 P34 P35 P36 P37 P38 P39 P310 P311 P312 P313 P314 P315 P50 P51 P54 P55 P52 P53 P56 P57 P58 P59 P512 P513 P510 P511 P514 P515
P40 P41 P42 P43 P44 P45 P46 P47 P48 P49 P410 P411 P412 P413 P414 P415 P20 P21 P24 P25 P22 P23 P26 P27 P28 P29 P212 P213 P210 P211 P214 P215
P50 P51 P52 P53 P54 P55 P56 P57 P58 P59 P510 P511 P512 P513 P514 P515 P30 P31 P34 P35 P32 P33 P36 P37 P38 P39 P312 P313 P310 P311 P314 P315
P60 P61 P62 P63 P64 P65 P66 P67 P68 P69 P610 P611 P612 P613 P614 P615 P60 P61 P64 P65 P62 P63 P66 P67 P68 P69 P612 P613 P610 P611 P614 P615
P70 P71 P72 P73 P74 P75 P76 P77 P78 P79 P710 P711 P712 P713 P714 P715 P70 P71 P74 P75 P72 P73 P76 P77 P78 P79 P712 P713 P710 P711 P714 P715
Participants
The list below includes those persons who participated in the Working Group that developed this
Specification and who consented to appear on this list.
Andy Baldman, Keysight Technologies Inc. Takashi Miyamoto, Sony Group Corporation
Nadav Banet, Valens Semiconductor Alexander Mokhoria, Robert Bosch GmbH
Craig Bezek, Teledyne LeCroy Makoto Nariya, Sony Group Corporation
Thomas Blon, Silicon Line GmbH Kavitha Naveen, Tektronix, Inc.
Steven Chang, MediaTek Inc. Allan Paul, Cadence Design Systems, Inc.
Geraud Cheenne, STMicroelectronics Joao Pereira, Synopsys, Inc.
Wei Cheng Ku, MediaTek Inc. Radu Pitigoi-Aron, Qualcomm Incorporated
Stephen Creaney, Cadence Design Systems, Inc. Alex Qiu, NVIDIA
Yoshihiko Deoka, Sony Group Corporation Loren Reiss, Cadence Design Systems, Inc.
James Goel, Qualcomm Incorporated Teong Rong Chua, Sony Group Corporation
Jason Gonzalez, Qualcomm Incorporated Matthew Ronning, Sony Group Corporation
Philip Hawkes, Qualcomm Incorporated Hugo Santos, Synopsys, Inc.
Thomas Hogenmueller, Robert Bosch GmbH Frank Seto, Samsung Electronics, Co.
Timo Kaikumaa, Intel Corporation Greg Stewart, Analogix Semiconductor, Inc.
JaeHyuck Kang, Samsung Electronics, Co. Dale Stolitzka, Samsung Electronics, Co.
Soichi Kayamori, Sony Group Corporation Hiroo Takahashi, Sony Group Corporation
Samson Kim, Qualcomm Incorporated Giuseppe Tofanicchio, STMicroelectronics
Tom Kopet, onsemi Guizhen Wang, HiSilicon Technologies Co. Ltd.
Radha Krishna Atukula, NVIDIA Frank Wang, OmniVision Technologies, Inc.
Raj Kumar Nagpal, Synopsys, Inc. Rick Wietfeldt, Qualcomm Incorporated
Daechul Kwon, Samsung Electronics, Co. George Wiley, Qualcomm Incorporated
Ariel Lasry, Qualcomm Incorporated Stephen Wong, Intel Corporation
Ethan Lau, MediaTek Inc. Charles Wu, OmniVision Technologies, Inc.
Wonseok Lee, Samsung Electronics, Co. Kevin Yee, Samsung Electronics, Co.
William Lo, Axonne Inc. Michel Yeh, MediaTek Inc.
Larry Madar, Google LLC Naoki Yokoshima, Sony Group Corporation
Cedric Marta, Synopsys, Inc. Sang Young Youn, Google LLC
Nuno Martins, onsemi Eunseung Yun, Samsung Electronics, Co.
Wonseok Lee, Samsung Electronics, Co. Charles Wu, OmniVision Technologies, Inc.
Mark Lewis, Cadence Design Systems, Inc. Eunseung Yun, Samsung Electronics, Co.
Kumaravel Manickam, L&T Technology Services Charles Wu, OmniVision Technologies, Inc.