linux/drivers/staging/media/atomisp/pci/hive_isp_css_common/dma_global.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 __DMA_GLOBAL_H_INCLUDED__
#define __DMA_GLOBAL_H_INCLUDED__

#include <type_support.h>

#define IS_DMA_VERSION_2

#define HIVE_ISP_NUM_DMA_CONNS
#define HIVE_ISP_NUM_DMA_CHANNELS

#define N_DMA_CHANNEL_ID

#include "dma_v2_defs.h"

/*
 * Command token bit mappings
 *
 * transfer / config
 *    param id[4] channel id[5] cmd id[6]
 *	| b14 .. b11 | b10 ... b6 | b5 ... b0 |
 *
 *
 * fast transfer:
 *    height[5]     width[8]      width[8]  channel id[5] cmd id[6]
 *	| b31 .. b26 | b25 .. b18 | b17 .. b11 | b10 ... b6 | b5 ... b0 |
 *
 */

#define _DMA_PACKING_SETUP_PARAM
#define _DMA_HEIGHT_PARAM
#define _DMA_STRIDE_A_PARAM
#define _DMA_ELEM_CROPPING_A_PARAM
#define _DMA_WIDTH_A_PARAM
#define _DMA_STRIDE_B_PARAM
#define _DMA_ELEM_CROPPING_B_PARAM
#define _DMA_WIDTH_B_PARAM

#define _DMA_ZERO_EXTEND
#define _DMA_SIGN_EXTEND

dma_channel;

dma_connection;

dma_extension;

#define DMA_PROP_SHIFT(val, param)
#define DMA_PROP_MASK(param)
#define DMA_PACK(val, param)

#define DMA_PACK_COMMAND(cmd)
#define DMA_PACK_CHANNEL(ch)
#define DMA_PACK_PARAM(par)
#define DMA_PACK_EXTENSION(ext)
#define DMA_PACK_LEFT_CROPPING(lc)
#define DMA_PACK_WIDTH_A(w)
#define DMA_PACK_WIDTH_B(w)
#define DMA_PACK_HEIGHT(h)

#define DMA_PACK_CMD_CHANNEL(cmd, ch)
#define DMA_PACK_SETUP(conn, ext)
#define DMA_PACK_CROP_ELEMS(elems, crop)

#define hive_dma_snd(dma_id, token)

#define DMA_PACK_BLOCK_CMD(cmd, ch, width_a, width_b, height)

#define hive_dma_move_data(dma_id, read, channel, addr_a, addr_b, to_is_var, from_is_var)

#define hive_dma_move_data_no_ack(dma_id, read, channel, addr_a, addr_b, to_is_var, from_is_var)

#define hive_dma_move_b2a_data(dma_id, channel, to_addr, from_addr, to_is_var, from_is_var)

#define hive_dma_move_a2b_data(dma_id, channel, from_addr, to_addr, from_is_var, to_is_var)

#define hive_dma_set_data(dma_id, channel, address, value, is_var)

#define hive_dma_clear_data(dma_id, channel, address, is_var)

#define hive_dma_configure(dma_id, channel, connection, extension, height, \
	stride_A, elems_A, cropping_A, width_A, \
	stride_B, elems_B, cropping_B, width_B)

#define hive_dma_execute(dma_id, channel, cmd, to_addr, from_addr_value, to_is_var, from_is_var)

#define hive_dma_configure_fast(dma_id, channel, connection, extension, elems_A, elems_B)

#define hive_dma_set_parameter(dma_id, channel, param, value)

#define DMA_SPECIFIC_CMDBIT
#define DMA_CHECK_CMDBIT
#define DMA_RW_CMDBIT
#define DMA_CLEAR_CMDBIT
#define DMA_ACK_CMDBIT
#define DMA_CFG_CMDBIT
#define DMA_PARAM_CMDBIT

/* Write complete check not necessary if there's no ack */
#define DMA_NOACK_CMD
#define DMA_CFG_CMD
#define DMA_CFGPARAM_CMD

#define DMA_CMD_NEEDS_ACK(cmd)
#define DMA_CMD_IS_TRANSFER(cmd)
#define DMA_CMD_IS_WR(cmd)
#define DMA_CMD_IS_RD(cmd)
#define DMA_CMD_IS_CLR(cmd)
#define DMA_CMD_IS_CFG(cmd)
#define DMA_CMD_IS_PARAMCFG(cmd)

/* As a matter of convention */
#define DMA_TRANSFER_READ
#define DMA_TRANSFER_WRITE
/* store/load from the PoV of the system(memory) */
#define DMA_TRANSFER_STORE
#define DMA_TRANSFER_LOAD
#define DMA_TRANSFER_CLEAR

dma_transfer_type_t;

dma_config_type_t;

struct dma_port_config {};

/* Descriptor for dma configuration */
struct dma_channel_config {};

#endif /* __DMA_GLOBAL_H_INCLUDED__ */