2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2015, Intel Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 #ifndef __IBUF_CTRL_GLOBAL_H_INCLUDED__
16 #define __IBUF_CTRL_GLOBAL_H_INCLUDED__
18 #include <type_support.h>
20 #include <ibuf_cntrl_defs.h> /* _IBUF_CNTRL_RECALC_WORDS_STATUS,
21 * _IBUF_CNTRL_ARBITERS_STATUS,
22 * _IBUF_CNTRL_PROC_REG_ALIGN,
26 /* Definition of contents of main controller state register is lacking
27 * in ibuf_cntrl_defs.h, so define these here:
29 #define _IBUF_CNTRL_MAIN_CNTRL_FSM_MASK 0xf
30 #define _IBUF_CNTRL_MAIN_CNTRL_FSM_NEXT_COMMAND_CHECK 0x9
31 #define _IBUF_CNTRL_MAIN_CNTRL_MEM_INP_BUF_ALLOC (1 << 8)
32 #define _IBUF_CNTRL_DMA_SYNC_WAIT_FOR_SYNC 1
33 #define _IBUF_CNTRL_DMA_SYNC_FSM_WAIT_FOR_ACK (0x3 << 1)
35 typedef struct ib_buffer_s ib_buffer_t;
37 uint32_t start_addr; /* start address of the buffer in the
38 * "input-buffer hardware block"
41 uint32_t stride; /* stride per buffer line (in bytes) */
42 uint32_t lines; /* lines in the buffer */
45 typedef struct ibuf_ctrl_cfg_s ibuf_ctrl_cfg_t;
46 struct ibuf_ctrl_cfg_s {
51 /* DMA configuration */
53 uint32_t cmd; /* must be _DMA_V2_MOVE_A2B_NO_SYNC_CHK_COMMAND */
55 /* DMA reconfiguration */
56 uint32_t shift_returned_items;
57 uint32_t elems_per_word_in_ibuf;
58 uint32_t elems_per_word_in_dest;
61 ib_buffer_t ib_buffer;
69 uint32_t items_per_store;
70 uint32_t stores_per_frame;
73 uint32_t sync_cmd; /* must be _STREAM2MMIO_CMD_TOKEN_SYNC_FRAME */
74 uint32_t store_cmd; /* must be _STREAM2MMIO_CMD_TOKEN_STORE_PACKETS */
78 extern const uint32_t N_IBUF_CTRL_PROCS[N_IBUF_CTRL_ID];
80 #endif /* __IBUF_CTRL_GLOBAL_H_INCLUDED__ */