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

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

#ifndef _isp_capture_defs_h
#define _isp_capture_defs_h

#define _ISP_CAPTURE_REG_ALIGN
#define _ISP_CAPTURE_BITS_PER_ELEM
#define _ISP_CAPTURE_BYTES_PER_ELEM
#define _ISP_CAPTURE_BYTES_PER_WORD
#define _ISP_CAPTURE_ELEM_PER_WORD

/* --------------------------------------------------*/

#define NOF_IRQS

/* --------------------------------------------------*/
/* REGISTER INFO */
/* --------------------------------------------------*/

// Number of registers
#define CAPT_NOF_REGS

// Register id's of MMIO slave accessible registers
#define CAPT_START_MODE_REG_ID
#define CAPT_START_ADDR_REG_ID
#define CAPT_MEM_REGION_SIZE_REG_ID
#define CAPT_NUM_MEM_REGIONS_REG_ID
#define CAPT_INIT_REG_ID
#define CAPT_START_REG_ID
#define CAPT_STOP_REG_ID

#define CAPT_PACKET_LENGTH_REG_ID
#define CAPT_RECEIVED_LENGTH_REG_ID
#define CAPT_RECEIVED_SHORT_PACKETS_REG_ID
#define CAPT_RECEIVED_LONG_PACKETS_REG_ID
#define CAPT_LAST_COMMAND_REG_ID
#define CAPT_NEXT_COMMAND_REG_ID
#define CAPT_LAST_ACKNOWLEDGE_REG_ID
#define CAPT_NEXT_ACKNOWLEDGE_REG_ID
#define CAPT_FSM_STATE_INFO_REG_ID

// Register width
#define CAPT_START_MODE_REG_WIDTH

#define CAPT_START_REG_WIDTH
#define CAPT_STOP_REG_WIDTH

/* --------------------------------------------------*/
/* FSM */
/* --------------------------------------------------*/
#define CAPT_WRITE2MEM_FSM_STATE_BITS
#define CAPT_SYNCHRONIZER_FSM_STATE_BITS

#define CAPT_PACKET_LENGTH_REG_WIDTH
#define CAPT_RECEIVED_LENGTH_REG_WIDTH
#define CAPT_RECEIVED_SHORT_PACKETS_REG_WIDTH
#define CAPT_RECEIVED_LONG_PACKETS_REG_WIDTH
#define CAPT_LAST_COMMAND_REG_WIDTH
#define CAPT_LAST_ACKNOWLEDGE_REG_WIDTH
#define CAPT_NEXT_ACKNOWLEDGE_REG_WIDTH
#define CAPT_FSM_STATE_INFO_REG_WIDTH

/* register reset value */
#define CAPT_START_MODE_REG_RSTVAL
#define CAPT_START_ADDR_REG_RSTVAL
#define CAPT_MEM_REGION_SIZE_REG_RSTVAL
#define CAPT_NUM_MEM_REGIONS_REG_RSTVAL
#define CAPT_INIT_REG_RSTVAL

#define CAPT_START_REG_RSTVAL
#define CAPT_STOP_REG_RSTVAL

#define CAPT_PACKET_LENGTH_REG_RSTVAL
#define CAPT_RECEIVED_LENGTH_REG_RSTVAL
#define CAPT_RECEIVED_SHORT_PACKETS_REG_RSTVAL
#define CAPT_RECEIVED_LONG_PACKETS_REG_RSTVAL
#define CAPT_LAST_COMMAND_REG_RSTVAL
#define CAPT_NEXT_COMMAND_REG_RSTVAL
#define CAPT_LAST_ACKNOWLEDGE_REG_RSTVAL
#define CAPT_NEXT_ACKNOWLEDGE_REG_RSTVAL
#define CAPT_FSM_STATE_INFO_REG_RSTVAL

/* bit definitions */
#define CAPT_INIT_RST_REG_BIT
#define CAPT_INIT_FLUSH_BIT
#define CAPT_INIT_RESYNC_BIT
#define CAPT_INIT_RESTART_BIT
#define CAPT_INIT_RESTART_MEM_ADDR_LSB

#define CAPT_INIT_RST_REG_IDX
#define CAPT_INIT_RST_REG_BITS
#define CAPT_INIT_FLUSH_IDX
#define CAPT_INIT_FLUSH_BITS
#define CAPT_INIT_RESYNC_IDX
#define CAPT_INIT_RESYNC_BITS
#define CAPT_INIT_RESTART_IDX
#define CAPT_INIT_RESTART_BITS
#define CAPT_INIT_RESTART_MEM_ADDR_IDX

/* --------------------------------------------------*/
/* TOKEN INFO */
/* --------------------------------------------------*/
#define CAPT_TOKEN_ID_LSB
#define CAPT_TOKEN_ID_MSB
#define CAPT_TOKEN_WIDTH

/* Command tokens IDs */
#define CAPT_START_TOKEN_ID
#define CAPT_STOP_TOKEN_ID
#define CAPT_FREEZE_TOKEN_ID
#define CAPT_RESUME_TOKEN_ID
#define CAPT_INIT_TOKEN_ID

#define CAPT_START_TOKEN_BIT
#define CAPT_STOP_TOKEN_BIT
#define CAPT_FREEZE_TOKEN_BIT
#define CAPT_RESUME_TOKEN_BIT
#define CAPT_INIT_TOKEN_BIT

/* Acknowledge token IDs */
#define CAPT_END_OF_PACKET_RECEIVED_TOKEN_ID
#define CAPT_END_OF_PACKET_WRITTEN_TOKEN_ID
#define CAPT_END_OF_REGION_WRITTEN_TOKEN_ID
#define CAPT_FLUSH_DONE_TOKEN_ID
#define CAPT_PREMATURE_SOP_TOKEN_ID
#define CAPT_MISSING_SOP_TOKEN_ID
#define CAPT_UNDEF_PH_TOKEN_ID
#define CAPT_STOP_ACK_TOKEN_ID

#define CAPT_PACKET_LENGTH_TOKEN_MSB
#define CAPT_PACKET_LENGTH_TOKEN_LSB
#define CAPT_SUPER_PACKET_LENGTH_TOKEN_MSB
#define CAPT_SUPER_PACKET_LENGTH_TOKEN_LSB
#define CAPT_PACKET_DATA_FORMAT_ID_TOKEN_MSB
#define CAPT_PACKET_DATA_FORMAT_ID_TOKEN_LSB
#define CAPT_PACKET_CH_ID_TOKEN_MSB
#define CAPT_PACKET_CH_ID_TOKEN_LSB
#define CAPT_PACKET_MEM_REGION_ID_TOKEN_MSB
#define CAPT_PACKET_MEM_REGION_ID_TOKEN_LSB

/*  bit definition */
#define CAPT_CMD_IDX
#define CAPT_CMD_BITS
#define CAPT_SOP_IDX
#define CAPT_SOP_BITS
#define CAPT_PKT_INFO_IDX
#define CAPT_PKT_INFO_BITS
#define CAPT_PKT_TYPE_IDX
#define CAPT_PKT_TYPE_BITS
#define CAPT_HEADER_DATA_IDX
#define CAPT_HEADER_DATA_BITS
#define CAPT_PKT_DATA_IDX
#define CAPT_PKT_DATA_BITS
#define CAPT_WORD_CNT_IDX
#define CAPT_WORD_CNT_BITS
#define CAPT_ACK_TOKEN_ID_IDX
#define CAPT_ACK_TOKEN_ID_BITS
//#define CAPT_ACK_PKT_LEN_IDX                      CAPT_PACKET_LENGTH_TOKEN_LSB
//#define CAPT_ACK_PKT_LEN_BITS                     (CAPT_PACKET_LENGTH_TOKEN_MSB - CAPT_PACKET_LENGTH_TOKEN_LSB + 1)
//#define CAPT_ACK_PKT_INFO_IDX                     20
//#define CAPT_ACK_PKT_INFO_BITS                    8
//#define CAPT_ACK_MEM_REG_ID1_IDX                  20			/* for capt_end_of_packet_written */
//#define CAPT_ACK_MEM_REG_ID2_IDX                  4       /* for capt_end_of_region_written */
#define CAPT_ACK_PKT_LEN_IDX
#define CAPT_ACK_PKT_LEN_BITS
#define CAPT_ACK_SUPER_PKT_LEN_IDX
#define CAPT_ACK_SUPER_PKT_LEN_BITS
#define CAPT_ACK_PKT_INFO_IDX
#define CAPT_ACK_PKT_INFO_BITS
#define CAPT_ACK_MEM_REGION_ID_IDX
#define CAPT_ACK_MEM_REGION_ID_BITS
#define CAPT_ACK_PKT_TYPE_IDX
#define CAPT_ACK_PKT_TYPE_BITS
#define CAPT_INIT_TOKEN_INIT_IDX
#define CAPT_INIT_TOKEN_INIT_BITS

/* --------------------------------------------------*/
/* MIPI */
/* --------------------------------------------------*/

#define CAPT_WORD_COUNT_WIDTH
#define CAPT_PKT_CODE_WIDTH
#define CAPT_CHN_NO_WIDTH
#define CAPT_ERROR_INFO_WIDTH

#define LONG_PKTCODE_MAX
#define LONG_PKTCODE_MIN
#define SHORT_PKTCODE_MAX

/* --------------------------------------------------*/
/* Packet Info */
/* --------------------------------------------------*/
#define CAPT_START_OF_FRAME
#define CAPT_END_OF_FRAME
#define CAPT_START_OF_LINE
#define CAPT_END_OF_LINE
#define CAPT_LINE_PAYLOAD
#define CAPT_GEN_SH_PKT

/* --------------------------------------------------*/
/* Packet Data Type */
/* --------------------------------------------------*/

#define CAPT_YUV420_8_DATA
#define CAPT_YUV420_10_DATA
#define CAPT_YUV420_8L_DATA
#define CAPT_YUV422_8_DATA
#define CAPT_YUV422_10_DATA
#define CAPT_RGB444_DATA
#define CAPT_RGB555_DATA
#define CAPT_RGB565_DATA
#define CAPT_RGB666_DATA
#define CAPT_RGB888_DATA
#define CAPT_RAW6_DATA
#define CAPT_RAW7_DATA
#define CAPT_RAW8_DATA
#define CAPT_RAW10_DATA
#define CAPT_RAW12_DATA
#define CAPT_RAW14_DATA
#define CAPT_USR_DEF_1_DATA
#define CAPT_USR_DEF_2_DATA
#define CAPT_USR_DEF_3_DATA
#define CAPT_USR_DEF_4_DATA
#define CAPT_USR_DEF_5_DATA
#define CAPT_USR_DEF_6_DATA
#define CAPT_USR_DEF_7_DATA
#define CAPT_USR_DEF_8_DATA
#define CAPT_Emb_DATA
#define CAPT_SOF_DATA
#define CAPT_EOF_DATA
#define CAPT_SOL_DATA
#define CAPT_EOL_DATA
#define CAPT_GEN_SH1_DATA
#define CAPT_GEN_SH2_DATA
#define CAPT_GEN_SH3_DATA
#define CAPT_GEN_SH4_DATA
#define CAPT_GEN_SH5_DATA
#define CAPT_GEN_SH6_DATA
#define CAPT_GEN_SH7_DATA
#define CAPT_GEN_SH8_DATA
#define CAPT_YUV420_8_CSPS_DATA
#define CAPT_YUV420_10_CSPS_DATA
#define CAPT_RESERVED_DATA_TYPE_MIN
#define CAPT_RESERVED_DATA_TYPE_MAX
#define CAPT_GEN_LONG_RESERVED_DATA_TYPE_MIN
#define CAPT_GEN_LONG_RESERVED_DATA_TYPE_MAX
#define CAPT_YUV_RESERVED_DATA_TYPE
#define CAPT_RGB_RESERVED_DATA_TYPE_MIN
#define CAPT_RGB_RESERVED_DATA_TYPE_MAX
#define CAPT_RAW_RESERVED_DATA_TYPE_MIN
#define CAPT_RAW_RESERVED_DATA_TYPE_MAX

/* --------------------------------------------------*/
/* Capture Unit State */
/* --------------------------------------------------*/
#define CAPT_FREE_RUN
#define CAPT_NO_SYNC
#define CAPT_SYNC_SWP
#define CAPT_SYNC_MWP
#define CAPT_SYNC_WAIT
#define CAPT_FREEZE
#define CAPT_RUN

/* --------------------------------------------------*/

#endif /* _isp_capture_defs_h */