linux/drivers/staging/media/atomisp/pci/css_2401_system/hrt/ibuf_cntrl_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 _ibuf_cntrl_defs_h_
#define _ibuf_cntrl_defs_h_

#include <stream2mmio_defs.h>
#include <dma_v2_defs.h>

#define _IBUF_CNTRL_REG_ALIGN
/* alignment of register banks, first bank are shared configuration and status registers: */
#define _IBUF_CNTRL_PROC_REG_ALIGN

/* the actual amount of configuration registers per proc: */
#define _IBUF_CNTRL_CONFIG_REGS_PER_PROC
/* the actual amount of shared configuration registers: */
#define _IBUF_CNTRL_CONFIG_REGS_NO_PROC

/* the actual amount of status registers per proc */
#define _IBUF_CNTRL_STATUS_REGS_PER_PROC
/* the actual amount shared status registers */
#define _IBUF_CNTRL_STATUS_REGS_NO_PROC

/* time out bits, maximum time out value is 2^_IBUF_CNTRL_TIME_OUT_BITS - 1 */
#define _IBUF_CNTRL_TIME_OUT_BITS

/* command token definition */
#define _IBUF_CNTRL_CMD_TOKEN_LSB
#define _IBUF_CNTRL_CMD_TOKEN_MSB

/* Str2MMIO defines */
#define _IBUF_CNTRL_STREAM2MMIO_CMD_TOKEN_MSB
#define _IBUF_CNTRL_STREAM2MMIO_CMD_TOKEN_LSB
#define _IBUF_CNTRL_STREAM2MMIO_NUM_ITEMS_BITS
#define _IBUF_CNTRL_STREAM2MMIO_ACK_EOF_BIT
#define _IBUF_CNTRL_STREAM2MMIO_ACK_TOKEN_VALID_BIT

/* acknowledge token definition */
#define _IBUF_CNTRL_ACK_TOKEN_STORES_IDX
#define _IBUF_CNTRL_ACK_TOKEN_STORES_BITS
#define _IBUF_CNTRL_ACK_TOKEN_ITEMS_IDX
#define _IBUF_CNTRL_ACK_TOKEN_ITEMS_BITS
#define _IBUF_CNTRL_ACK_TOKEN_LSB
#define _IBUF_CNTRL_ACK_TOKEN_MSB
/* bit 31 indicates a valid ack: */
#define _IBUF_CNTRL_ACK_TOKEN_VALID_BIT

/*shared registers:*/
#define _IBUF_CNTRL_RECALC_WORDS_STATUS
#define _IBUF_CNTRL_ARBITERS_STATUS

#define _IBUF_CNTRL_SET_CRUN

/*register addresses for each proc: */
#define _IBUF_CNTRL_CMD
#define _IBUF_CNTRL_ACK

/* number of items (packets or words) per frame: */
#define _IBUF_CNTRL_NUM_ITEMS_PER_STORE

/* number of stores (packets or words) per store/buffer: */
#define _IBUF_CNTRL_NUM_STORES_PER_FRAME

/* the channel and command in the DMA */
#define _IBUF_CNTRL_DMA_CHANNEL
#define _IBUF_CNTRL_DMA_CMD

/* the start address and stride of the buffers */
#define _IBUF_CNTRL_BUFFER_START_ADDRESS
#define _IBUF_CNTRL_BUFFER_STRIDE
#define _IBUF_CNTRL_BUFFER_END_ADDRESS

/* destination start address, stride and end address; should be the same as in the DMA */
#define _IBUF_CNTRL_DEST_START_ADDRESS
#define _IBUF_CNTRL_DEST_STRIDE
#define _IBUF_CNTRL_DEST_END_ADDRESS

/* send a frame sync or not, default 1 */
#define _IBUF_CNTRL_SYNC_FRAME

/* str2mmio cmds */
#define _IBUF_CNTRL_STR2MMIO_SYNC_CMD
#define _IBUF_CNTRL_STR2MMIO_STORE_CMD

/* num elems p word*/
#define _IBUF_CNTRL_SHIFT_ITEMS
#define _IBUF_CNTRL_ELEMS_P_WORD_IBUF
#define _IBUF_CNTRL_ELEMS_P_WORD_DEST

/* STATUS */
/* current frame and stores in buffer */
#define _IBUF_CNTRL_CUR_STORES
#define _IBUF_CNTRL_CUR_ACKS

/* current buffer and destination address for DMA cmd's */
#define _IBUF_CNTRL_CUR_S2M_IBUF_ADDR
#define _IBUF_CNTRL_CUR_DMA_IBUF_ADDR
#define _IBUF_CNTRL_CUR_DMA_DEST_ADDR
#define _IBUF_CNTRL_CUR_ISP_DEST_ADDR

#define _IBUF_CNTRL_CUR_NR_DMA_CMDS_SEND

#define _IBUF_CNTRL_MAIN_CNTRL_STATE
#define _IBUF_CNTRL_DMA_SYNC_STATE
#define _IBUF_CNTRL_ISP_SYNC_STATE

/*Commands: */
#define _IBUF_CNTRL_CMD_STORE_FRAME_IDX
#define _IBUF_CNTRL_CMD_ONLINE_IDX

/* initialize, copy st_addr to cur_addr etc */
#define _IBUF_CNTRL_CMD_INITIALIZE

/* store an online frame (sync with ISP, use end cfg start, stride and end address: */
#define _IBUF_CNTRL_CMD_STORE_ONLINE_FRAME

/* store an offline frame (don't sync with ISP, requires start address as 2nd token, no end address: */
#define _IBUF_CNTRL_CMD_STORE_OFFLINE_FRAME

/* false command token, should be different then commands. Use online bit, not store frame: */
#define _IBUF_CNTRL_FALSE_ACK

#endif