no-OS
Loading...
Searching...
No Matches
max96793_diag.h
Go to the documentation of this file.
1/*******************************************************************************
2 * @file max96793_diag.h
3 * @brief Header file of Diagnostics Driver Implementation of MAX96793 Serializer.
4 * @author Automotive Software and Systems team, Bangalore, India
5********************************************************************************
6 * Copyright 2025(c) Analog Devices, Inc.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright notice,
12 * this list of conditions and the following disclaimer.
13 *
14 * 2. Redistributions in binary form must reproduce the above copyright notice,
15 * this list of conditions and the following disclaimer in the documentation
16 * and/or other materials provided with the distribution.
17 *
18 * 3. Neither the name of Analog Devices, Inc. nor the names of its
19 * contributors may be used to endorse or promote products derived from this
20 * software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. "AS IS" AND ANY EXPRESS OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
25 * EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32******************************************************************************/
33
34#ifndef MAX96793_DIAG_H
35#define MAX96793_DIAG_H
36
37#include "max96793.h"
38#include "gmsl_common.h"
39#define MAX96793_CSI_DIAG_NUM_OF_MIPI_PKT_READ (4U)
40#define MAX96793_CSI_DIAG_MIPI_PKT_READ_DELAY (10U)
41#define MAX96793_MAX_LANE_COUNT (4U)
42#define MAX96793_MAX_VIDEO_STREAMS (16U)
43#define MAX96793_MAX_VIRTUAL_CHANNEL (16U)
44
56
65
76
87
96
126
149
157
173
181
189
198
207
215
230
240
250
258
266
274
282
295
307
319
331
340
353
362
370
379
389
400
414
428
446
457
458extern int max96793_dev_diag_get_device_id(struct gmsl_dev *dev,
459 void *dev_id_status, bool *diag_err);
460extern int max96793_dev_diag_check_device_rev(struct gmsl_dev *dev,
461 void *dev_revision_status, bool *diag_err);
463 void *part_config_status, bool *diag_err);
465 void *decode_err_status, bool *diag_err);
467 void *idle_err_status, bool *diag_err);
469 void *link_lock_status, bool *diag_err);
471 struct gmsl_dev *dev, void *max_retransmission_status, bool *diag_err);
473 void *mipi_rx_err_status, bool *diag_err);
475 struct gmsl_dev *dev, void *vid_tx_pclk_drift_status, bool *diag_err);
477 void *line_fault_status, bool *diag_err);
479 void *pclk_detect_status, bool *diag_err);
481 void *vid_tx_ovrflw_status, bool *diag_err);
483 struct gmsl_dev *dev, void *uncorrectable_2b_mem_ecc_err_status,
484 bool *diag_err);
486 struct gmsl_dev *dev, void *lp_err_status, bool *diag_err);
488 void *mipi_pkt_cnt_err_status, bool *diag_err);
489extern int max96793_pipe_diag_check_stream_id(struct gmsl_dev *dev,
490 void *stream_id_status, bool *diag_err);
492 struct gmsl_dev *dev, void* eom_status, bool *diag_err);
493extern int max96793_csi_diag_check_fec_status(struct gmsl_dev *dev,
494 void *fec_active_status, bool *diag_err);
496 void* rem_err_status, bool *diag_err);
498 bool *locked);
499extern int max96793_dev_diag_get_errb_status(struct gmsl_dev *dev, bool *errb);
500#endif
501
int max96793_link_diag_check_decode_error_status(struct gmsl_dev *dev, void *decode_err_status, bool *diag_err)
Check decode error status for MAX96793 link diagnostics.
Definition max96793_diag.c:1033
int max96793_link_diag_check_phy_low_power_state_error_status(struct gmsl_dev *dev, void *lp_err_status, bool *diag_err)
Check the PHY error details of the MAX96793 serializer.
Definition max96793_diag.c:1665
int max96793_link_diag_check_line_fault_status(struct gmsl_dev *dev, void *line_fault_status, bool *diag_err)
Check the line fault status of the MAX96793 device.
Definition max96793_diag.c:1176
int max96793_csi_diag_check_vid_tx_pclk_drift_err_status(struct gmsl_dev *dev, void *vid_tx_pclk_drift_status, bool *diag_err)
Check the video transmitter PCLK drift error status of the MAX96793 serializer.
Definition max96793_diag.c:1346
int max96793_dev_diag_get_errb_status(struct gmsl_dev *dev, bool *errb)
Get the status of Error flag (ERRB) in the MAX96793 serializer.
Definition max96793_diag.c:2101
int max96793_dev_diag_check_part_config_status(struct gmsl_dev *dev, void *part_config_status, bool *diag_err)
Check the part configuration status of the MAX96793 device.
Definition max96793_diag.c:2051
int max96793_pipe_diag_check_vid_tx_overflow_status(struct gmsl_dev *dev, void *vid_tx_ovrflw_status, bool *diag_err)
Check the video transmitter overflow status of the MAX96793 serializer.
Definition max96793_diag.c:1310
int max96793_pipe_diag_check_stream_id(struct gmsl_dev *dev, void *stream_id_status, bool *diag_err)
Check the stream ID status of the MAX96793 serializer.
Definition max96793_diag.c:1869
int max96793_csi_diag_check_fec_status(struct gmsl_dev *dev, void *fec_active_status, bool *diag_err)
Check if FEC (Forward Error Correction) is enabled and running on the MAX96793 device.
Definition max96793_diag.c:1995
int max96793_dev_diag_check_remote_error_status(struct gmsl_dev *dev, void *rem_err_status, bool *diag_err)
Check the remote error flag status of the MAX96793 device.
Definition max96793_diag.c:1949
int max96793_link_diag_check_link_lock_status(struct gmsl_dev *dev, void *link_lock_status, bool *diag_err)
Check the link lock status of the MAX96793 device.
Definition max96793_diag.c:1136
int max96793_link_diag_check_eye_open_monitor_status(struct gmsl_dev *dev, void *eom_status, bool *diag_err)
Check the Eye Open Monitor (EOM) status of the MAX96793 device.
Definition max96793_diag.c:1914
int max96793_mem_diag_check_uncorrectable_2b_mem_ecc_err_status(struct gmsl_dev *dev, void *uncorrectable_2b_mem_ecc_err_status, bool *diag_err)
Check the 2-bit uncorrectable memory ECC errors seen in any memories of the MAX96793 serializer.
Definition max96793_diag.c:1383
int max96793_link_diag_check_max_retransmission_error_status(struct gmsl_dev *dev, void *max_retransmission_status, bool *diag_err)
Checks the maximum retransmission error status for the MAX96793 device.
Definition max96793_diag.c:1422
int max96793_link_diag_check_idle_error_status(struct gmsl_dev *dev, void *idle_err_status, bool *diag_err)
Check the idle error status of the MAX96793 link.
Definition max96793_diag.c:1085
int max96793_dev_diag_get_device_id(struct gmsl_dev *dev, void *dev_id_status, bool *diag_err)
Retrieve the device ID of the MAX96793 device.
Definition max96793_diag.c:965
int max96793_csi_diag_check_pclk_detect_status(struct gmsl_dev *dev, void *pclk_detect_status, bool *diag_err)
Check the PCLK detect status of the MAX96793 serializer.
Definition max96793_diag.c:1275
int max96793_link_diag_get_link_lock_status(struct gmsl_dev *dev, bool *locked)
Get the link lock status of the MAX96793 serializer.
Definition max96793_diag.c:2085
int max96793_csi_diag_check_mipi_phy_pkt_cnt_status(struct gmsl_dev *dev, void *mipi_pkt_cnt_err_status, bool *diag_err)
Check the MIPI PHY packet count status of MAX96793 serializer.
Definition max96793_diag.c:1737
#define MAX96793_PORT_B
Definition max96793_diag.c:58
int max96793_csi_diag_check_mipi_rx_err_status(struct gmsl_dev *dev, void *mipi_rx_err_status, bool *diag_err)
Check the MIPI RX error status of the MAX96793 serializer.
Definition max96793_diag.c:1547
int max96793_dev_diag_check_device_rev(struct gmsl_dev *dev, void *dev_revision_status, bool *diag_err)
Retrieve the device revision status of the MAX96793 device.
Definition max96793_diag.c:999
#define MAX96793_MIPI_PHY_COUNT
Definition max96793.h:41
#define MAX96793_LMN_COUNT
Definition max96793.h:40
max96793_sensor_lane
Sensor lane number.
Definition max96793_diag.h:70
@ MAX96793_SENSOR_LANE_0
Definition max96793_diag.h:71
@ MAX96793_SENSOR_LANE_2
Definition max96793_diag.h:73
@ MAX96793_SENSOR_LANE_1
Definition max96793_diag.h:72
@ MAX96793_SENSOR_LANE_3
Definition max96793_diag.h:74
max96793_video_stream
Enumerates video streams for MAX96793 device.
Definition max96793_diag.h:131
@ MAX96793_VID_STREAM_12
Definition max96793_diag.h:144
@ MAX96793_VID_STREAM_9
Definition max96793_diag.h:141
@ MAX96793_VID_STREAM_1
Definition max96793_diag.h:133
@ MAX96793_VID_STREAM_15
Definition max96793_diag.h:147
@ MAX96793_VID_STREAM_5
Definition max96793_diag.h:137
@ MAX96793_VID_STREAM_3
Definition max96793_diag.h:135
@ MAX96793_VID_STREAM_7
Definition max96793_diag.h:139
@ MAX96793_VID_STREAM_8
Definition max96793_diag.h:140
@ MAX96793_VID_STREAM_11
Definition max96793_diag.h:143
@ MAX96793_VID_STREAM_14
Definition max96793_diag.h:146
@ MAX96793_VID_STREAM_13
Definition max96793_diag.h:145
@ MAX96793_VID_STREAM_0
Definition max96793_diag.h:132
@ MAX96793_VID_STREAM_10
Definition max96793_diag.h:142
@ MAX96793_VID_STREAM_2
Definition max96793_diag.h:134
@ MAX96793_VID_STREAM_4
Definition max96793_diag.h:136
@ MAX96793_VID_STREAM_6
Definition max96793_diag.h:138
#define MAX96793_CSI_DIAG_NUM_OF_MIPI_PKT_READ
Definition max96793_diag.h:39
max96793_link_diag_lmn_status
Line fault monitor status.
Definition max96793_diag.h:49
@ MAX96793_LINK_DIAG_LMN_SHORT_TO_GND
Definition max96793_diag.h:51
@ MAX96793_LINK_DIAG_LMN_LINE_TO_LINE_SHORT
Definition max96793_diag.h:54
@ MAX96793_LINK_DIAG_LMN_LINE_OPEN
Definition max96793_diag.h:53
@ MAX96793_LINK_DIAG_LMN_NORMAL
Definition max96793_diag.h:52
@ MAX96793_LINK_DIAG_LMN_SHORT_TO_BAT
Definition max96793_diag.h:50
max96793_port
Enumerates ports for MAX96793 device.
Definition max96793_diag.h:154
max96793_lane_polarity
Lane polarity.
Definition max96793_diag.h:92
@ MAX96793_LANE_POLARITY_NORMAL
Definition max96793_diag.h:93
@ MAX96793_LANE_POLARITY_INVERSE
Definition max96793_diag.h:94
max96793_serializer_lane
Serializer lane number.
Definition max96793_diag.h:81
@ MAX96793_SERIALIZER_LANE_3
Definition max96793_diag.h:85
@ MAX96793_SERIALIZER_LANE_2
Definition max96793_diag.h:84
@ MAX96793_SERIALIZER_LANE_1
Definition max96793_diag.h:83
@ MAX96793_SERIALIZER_LANE_0
Definition max96793_diag.h:82
#define MAX96793_MAX_LANE_COUNT
Definition max96793_diag.h:41
#define MAX96793_MAX_VIDEO_STREAMS
Definition max96793_diag.h:42
max96793_data_type_size
Enumerates data type size for MAX96793 device.
Definition max96793_diag.h:162
@ MAX96793_DT_SIZE_10
Definition max96793_diag.h:165
@ MAX96793_DT_SIZE_0
Definition max96793_diag.h:163
@ MAX96793_DT_SIZE_24
Definition max96793_diag.h:171
@ MAX96793_DT_SIZE_14
Definition max96793_diag.h:167
@ MAX96793_DT_SIZE_12
Definition max96793_diag.h:166
@ MAX96793_DT_SIZE_18
Definition max96793_diag.h:169
@ MAX96793_DT_SIZE_8
Definition max96793_diag.h:164
@ MAX96793_DT_SIZE_20
Definition max96793_diag.h:170
@ MAX96793_DT_SIZE_16
Definition max96793_diag.h:168
max96793_link_diag_lmn
Line fault monitor number.
Definition max96793_diag.h:61
@ MAX96793_LINK_LMN_1
Definition max96793_diag.h:63
@ MAX96793_LINK_LMN_0
Definition max96793_diag.h:62
max96793_data_type
DATA Type for MAX96793 device.
Definition max96793_diag.h:101
@ MAX96793_DATA_TYPE_UDP8_C
Definition max96793_diag.h:120
@ MAX96793_DATA_TYPE_UDP8_E
Definition max96793_diag.h:122
@ MAX96793_DATA_TYPE_RAW12
Definition max96793_diag.h:113
@ MAX96793_DATA_TYPE_YUV422_8BIT
Definition max96793_diag.h:106
@ MAX96793_DATA_TYPE_UDP8_G
Definition max96793_diag.h:124
@ MAX96793_DATA_TYPE_YUV422_10BIT
Definition max96793_diag.h:107
@ MAX96793_DATA_TYPE_RGB666
Definition max96793_diag.h:109
@ MAX96793_DATA_TYPE_RAW8
Definition max96793_diag.h:111
@ MAX96793_DATA_TYPE_UDP8_B
Definition max96793_diag.h:119
@ MAX96793_DATA_TYPE_RAW10
Definition max96793_diag.h:112
@ MAX96793_DATA_TYPE_UDP8_A
Definition max96793_diag.h:118
@ MAX96793_DATA_TYPE_RAW20
Definition max96793_diag.h:116
@ MAX96793_DATA_TYPE_UDP8_D
Definition max96793_diag.h:121
@ MAX96793_DATA_TYPE_RGB888
Definition max96793_diag.h:110
@ MAX96793_DATA_TYPE_RGB565
Definition max96793_diag.h:108
@ MAX96793_DATA_TYPE_UDP8_F
Definition max96793_diag.h:123
@ MAX96793_DATA_TYPE_RAW16
Definition max96793_diag.h:115
@ MAX96793_DATA_TYPE_EMB8
Definition max96793_diag.h:105
@ MAX96793_DATA_TYPE_DEFAULT
Definition max96793_diag.h:102
@ MAX96793_DATA_TYPE_YUV422_12BIT
Definition max96793_diag.h:117
@ MAX96793_DATA_TYPE_RAW14
Definition max96793_diag.h:114
@ MAX96793_DATA_TYPE_GENERIC8_A
Definition max96793_diag.h:103
@ MAX96793_DATA_TYPE_GENERIC8_B
Definition max96793_diag.h:104
Structure representing a GMSL device handle, containing configuration parameters and diagnostic opera...
Definition gmsl_common.h:159
Structure to hold the Forward Error Correction (FEC) active status for the MAX96793 device.
Definition max96793_diag.h:384
bool is_remote_cc_disabled
Definition max96793_diag.h:385
bool is_fec_active
Definition max96793_diag.h:387
bool is_fec_enabled
Definition max96793_diag.h:386
Structure holding the MIPI controller error details of the MAX96793 device.
Definition max96793_diag.h:300
bool csi_ctrl_frame_cnt_err_detected
Definition max96793_diag.h:305
bool csi_ctrl_crc_err_detected
Definition max96793_diag.h:303
bool csi_ctrl_pkt_terminated_early_err_detected
Definition max96793_diag.h:304
bool csi_ctrl_1b_ecc_err_detected
Definition max96793_diag.h:301
bool csi_ctrl_2b_ecc_err_detected
Definition max96793_diag.h:302
Structure holding the MIPI PHY error details of the MAX96793 device.
Definition max96793_diag.h:287
bool phy_hispeed_rx_skew_calib_lane0_err_detected
Definition max96793_diag.h:292
bool phy_hsync_lane1_1b_err_detected
Definition max96793_diag.h:289
bool phy_hsync_lane0_2b_err_detected
Definition max96793_diag.h:290
bool phy_hispeed_rx_skew_calib_lane1_err_detected
Definition max96793_diag.h:293
bool phy_hsync_lane0_1b_err_detected
Definition max96793_diag.h:288
bool phy_hsync_lane1_2b_err_detected
Definition max96793_diag.h:291
Structure holding the MIPI packet count status of the MAX96793 device.
Definition max96793_diag.h:345
uint8_t phy_clk_cnt[MAX96793_CSI_DIAG_NUM_OF_MIPI_PKT_READ]
Definition max96793_diag.h:351
bool mipi_pkt_cnt_err_detected
Definition max96793_diag.h:346
uint8_t csi1_pkt_cnt[MAX96793_CSI_DIAG_NUM_OF_MIPI_PKT_READ]
Definition max96793_diag.h:349
bool tunnel_mode_enabled
Definition max96793_diag.h:347
uint8_t tun_pkt_cnt[MAX96793_CSI_DIAG_NUM_OF_MIPI_PKT_READ]
Definition max96793_diag.h:350
uint8_t phy_pkt_cnt[MAX96793_CSI_DIAG_NUM_OF_MIPI_PKT_READ]
Definition max96793_diag.h:348
Structure holding the MIPI RX error status of the MAX96793 device.
Definition max96793_diag.h:312
struct max96793_csi_diag_mipi_phy_err_details mipi_phy_err_details[MAX96793_MIPI_PHY_COUNT]
Definition max96793_diag.h:314
bool mipi_rx_err_detected
Definition max96793_diag.h:313
struct max96793_csi_diag_mipi_ctrl_err_details mipi_ctrl_err_details
Definition max96793_diag.h:316
Structure holding the CSI configuration status of the MAX96793 device.
Definition max96793_diag.h:433
bool is_pixel_doubling_enabled
Definition max96793_diag.h:444
struct max96793_pipe_diag_stream_id_status stream_id_status
Definition max96793_diag.h:441
bool is_soft_bpp_enabled
Definition max96793_diag.h:437
enum max96793_data_type_size soft_bpp_override
Definition max96793_diag.h:435
bool is_pipe_enabled
Definition max96793_diag.h:438
bool tunnel_mode_enabled
Definition max96793_diag.h:434
struct max96793_csi_video_stream_config video_stream_config[MAX96793_MAX_VIDEO_STREAMS]
Definition max96793_diag.h:439
bool is_independent_mode_enabled
Definition max96793_diag.h:443
Definition max96793_diag.h:255
bool pclk_detected
Definition max96793_diag.h:256
Structure holding the video stream configuration of the MAX96793 device.
Definition max96793_diag.h:394
bool is_virtual_channel_enabled
Definition max96793_diag.h:395
bool is_data_type_enabled
Definition max96793_diag.h:396
enum max96793_data_type data_type
Definition max96793_diag.h:397
Structure holding the device ID status of the MAX96793 device.
Definition max96793_diag.h:178
uint8_t dev_id
Definition max96793_diag.h:179
Structure holding the device revision status of the MAX96793 device.
Definition max96793_diag.h:186
uint8_t dev_rev
Definition max96793_diag.h:187
Structure holding the device configuration status of the MAX96793 device.
Definition max96793_diag.h:451
struct max96793_pipe_diag_config_status pipe_config_status
Definition max96793_diag.h:452
struct max96793_csi_diag_part_config_status csi_config_status
Definition max96793_diag.h:454
Structure to hold the Remote error flag status for the MAX96793 device.
Definition max96793_diag.h:375
bool remote_error
Definition max96793_diag.h:377
bool is_remote_cc_disabled
Definition max96793_diag.h:376
Structure holding the lane configuration status of the MAX96793 device.
Definition max96793_diag.h:405
enum max96793_lane_polarity clk_lane_polarity
Definition max96793_diag.h:411
uint8_t lane_count
Definition max96793_diag.h:406
enum max96793_lane_polarity data_lane_polarity[MAX96793_MAX_LANE_COUNT]
Definition max96793_diag.h:409
enum max96793_sensor_lane sensor_lane[MAX96793_MAX_LANE_COUNT]
Definition max96793_diag.h:407
Structure holding the uncorrectable 2-bit memory ECC error status of the MAX96793 device.
Definition max96793_diag.h:279
bool uncorrectable_2b_mem_ecc_err_detected
Definition max96793_diag.h:280
Structure holding the pipe configuration status of the MAX96793 device.
Definition max96793_diag.h:419
bool is_port_enabled
Definition max96793_diag.h:423
bool is_video_started_in_port
Definition max96793_diag.h:424
uint8_t phy_config
Definition max96793_diag.h:420
struct max96793_lane_config_status lane_config_status
Definition max96793_diag.h:425
enum max96793_port port_selected
Definition max96793_diag.h:421
Structure holding the decode error status of the MAX96793 device.
Definition max96793_diag.h:194
uint8_t decode_err_cnt
Definition max96793_diag.h:196
bool decode_err_link
Definition max96793_diag.h:195
Structure holding the idle error status of the MAX96793 device.
Definition max96793_diag.h:203
uint8_t idle_err_cnt
Definition max96793_diag.h:205
bool idle_err_detected
Definition max96793_diag.h:204
Structure holding the Max Retransmission Error Status.
Definition max96793_diag.h:235
struct max96793_pipe_max_retrans_data max_retrans_data
Definition max96793_diag.h:237
bool max_retrans_err_detected
Definition max96793_diag.h:236
Structure holding the stream ID status of the MAX96793 device.
Definition max96793_diag.h:358
uint8_t stream_id
Definition max96793_diag.h:360
bool pipe_enabled
Definition max96793_diag.h:359
Structure holding the video transmit overflow status of the MAX96793 device.
Definition max96793_diag.h:263
bool vid_tx_overflowed
Definition max96793_diag.h:264
Structure holding the video transmit pixel clock drift error status of the MAX96793 device.
Definition max96793_diag.h:271
bool vid_tx_pclk_drift_err_detected
Definition max96793_diag.h:272
Definition max96793_diag.h:220
uint8_t spi_chnl_retrans_count
Definition max96793_diag.h:222
bool spi_chnl_retrans_err_detected
Definition max96793_diag.h:221
bool gpio_chnl_retrans_err_detected
Definition max96793_diag.h:223
uint8_t pass_thru_chnl1_retrans_count
Definition max96793_diag.h:226
uint8_t gpio_chnl_retrans_count
Definition max96793_diag.h:224
uint8_t pass_thru_chnl2_retrans_count
Definition max96793_diag.h:228
bool pass_thru_chnl1_retrans_err_detected
Definition max96793_diag.h:225
bool pass_thru_chnl2_retrans_err_detected
Definition max96793_diag.h:227