Commit 641c2292 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: atomisp: get rid of version-dependent globals

Replace all occurrences along the atomisp tree for the conditional
compilation macros found at system_global.h, replacing them by
tests wheather ISP2401 is defined or not.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent bd674b5a
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <type_support.h> #include <type_support.h>
#if defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(ISP2401)
typedef struct isys_irqc_state_s isys_irqc_state_t; typedef struct isys_irqc_state_s isys_irqc_state_t;
...@@ -31,6 +31,6 @@ struct isys_irqc_state_s { ...@@ -31,6 +31,6 @@ struct isys_irqc_state_s {
/*hrt_data clear; */ /* write-only register */ /*hrt_data clear; */ /* write-only register */
}; };
#endif /* defined(USE_INPUT_SYSTEM_VERSION_2401) */ #endif /* defined(ISP2401) */
#endif /* __ISYS_IRQ_LOCAL_H__ */ #endif /* __ISYS_IRQ_LOCAL_H__ */
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "isys_irq_global.h" #include "isys_irq_global.h"
#include "isys_irq_local.h" #include "isys_irq_local.h"
#if defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(ISP2401)
/* -------------------------------------------------------+ /* -------------------------------------------------------+
| Native command interface (NCI) | | Native command interface (NCI) |
...@@ -102,6 +102,6 @@ STORAGE_CLASS_ISYS2401_IRQ_C hrt_data isys_irqc_reg_load( ...@@ -102,6 +102,6 @@ STORAGE_CLASS_ISYS2401_IRQ_C hrt_data isys_irqc_reg_load(
/* end of DLI */ /* end of DLI */
#endif /* defined(USE_INPUT_SYSTEM_VERSION_2401) */ #endif /* defined(ISP2401) */
#endif /* __ISYS_IRQ_PRIVATE_H__ */ #endif /* __ISYS_IRQ_PRIVATE_H__ */
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#ifndef __ISYS_IRQ_GLOBAL_H__ #ifndef __ISYS_IRQ_GLOBAL_H__
#define __ISYS_IRQ_GLOBAL_H__ #define __ISYS_IRQ_GLOBAL_H__
#if defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(ISP2401)
/* Register offset/index from base location */ /* Register offset/index from base location */
#define ISYS_IRQ_EDGE_REG_IDX (0) #define ISYS_IRQ_EDGE_REG_IDX (0)
...@@ -31,6 +31,6 @@ ...@@ -31,6 +31,6 @@
#define ISYS_IRQ_CLEAR_REG_VALUE (0xFFFF) #define ISYS_IRQ_CLEAR_REG_VALUE (0xFFFF)
#define ISYS_IRQ_ENABLE_REG_VALUE (0xFFFF) #define ISYS_IRQ_ENABLE_REG_VALUE (0xFFFF)
#endif /* defined(USE_INPUT_SYSTEM_VERSION_2401) */ #endif /* defined(ISP2401) */
#endif /* __ISYS_IRQ_GLOBAL_H__ */ #endif /* __ISYS_IRQ_GLOBAL_H__ */
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "system_global.h" #include "system_global.h"
#ifdef USE_INPUT_SYSTEM_VERSION_2 #ifndef ISP2401
#include "input_formatter.h" #include "input_formatter.h"
#include <type_support.h> #include <type_support.h>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "system_global.h" #include "system_global.h"
#ifdef USE_INPUT_SYSTEM_VERSION_2 #ifndef ISP2401
#include "input_system.h" #include "input_system.h"
#include <type_support.h> #include <type_support.h>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#ifndef __CSI_RX_PUBLIC_H_INCLUDED__ #ifndef __CSI_RX_PUBLIC_H_INCLUDED__
#define __CSI_RX_PUBLIC_H_INCLUDED__ #define __CSI_RX_PUBLIC_H_INCLUDED__
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
/***************************************************** /*****************************************************
* *
* Native command interface (NCI). * Native command interface (NCI).
...@@ -132,5 +132,5 @@ void csi_rx_be_ctrl_reg_store( ...@@ -132,5 +132,5 @@ void csi_rx_be_ctrl_reg_store(
const hrt_address reg, const hrt_address reg,
const hrt_data value); const hrt_data value);
/* end of DLI */ /* end of DLI */
#endif /* USE_INPUT_SYSTEM_VERSION_2401 */ #endif /* ISP2401 */
#endif /* __CSI_RX_PUBLIC_H_INCLUDED__ */ #endif /* __CSI_RX_PUBLIC_H_INCLUDED__ */
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#ifndef __IBUF_CTRL_PUBLIC_H_INCLUDED__ #ifndef __IBUF_CTRL_PUBLIC_H_INCLUDED__
#define __IBUF_CTRL_PUBLIC_H_INCLUDED__ #define __IBUF_CTRL_PUBLIC_H_INCLUDED__
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
/***************************************************** /*****************************************************
* *
* Native command interface (NCI). * Native command interface (NCI).
...@@ -90,5 +90,5 @@ STORAGE_CLASS_IBUF_CTRL_H void ibuf_ctrl_reg_store( ...@@ -90,5 +90,5 @@ STORAGE_CLASS_IBUF_CTRL_H void ibuf_ctrl_reg_store(
const hrt_data value); const hrt_data value);
/* end of DLI */ /* end of DLI */
#endif /* USE_INPUT_SYSTEM_VERSION_2401 */ #endif /* ISP2401 */
#endif /* __IBUF_CTRL_PUBLIC_H_INCLUDED__ */ #endif /* __IBUF_CTRL_PUBLIC_H_INCLUDED__ */
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#ifndef __ISYS_DMA_PUBLIC_H_INCLUDED__ #ifndef __ISYS_DMA_PUBLIC_H_INCLUDED__
#define __ISYS_DMA_PUBLIC_H_INCLUDED__ #define __ISYS_DMA_PUBLIC_H_INCLUDED__
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
#include "system_local.h" #include "system_local.h"
#include "type_support.h" #include "type_support.h"
...@@ -34,6 +34,6 @@ void isys2401_dma_set_max_burst_size( ...@@ -34,6 +34,6 @@ void isys2401_dma_set_max_burst_size(
const isys2401_dma_ID_t dma_id, const isys2401_dma_ID_t dma_id,
uint32_t max_burst_size); uint32_t max_burst_size);
#endif /* USE_INPUT_SYSTEM_VERSION_2401 */ #endif /* ISP2401 */
#endif /* __ISYS_DMA_PUBLIC_H_INCLUDED__ */ #endif /* __ISYS_DMA_PUBLIC_H_INCLUDED__ */
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "isys_irq_global.h" #include "isys_irq_global.h"
#include "isys_irq_local.h" #include "isys_irq_local.h"
#if defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(ISP2401)
STORAGE_CLASS_ISYS2401_IRQ_H void isys_irqc_state_get( STORAGE_CLASS_ISYS2401_IRQ_H void isys_irqc_state_get(
const isys_irq_ID_t isys_irqc_id, const isys_irq_ID_t isys_irqc_id,
...@@ -41,6 +41,6 @@ STORAGE_CLASS_ISYS2401_IRQ_H hrt_data isys_irqc_reg_load( ...@@ -41,6 +41,6 @@ STORAGE_CLASS_ISYS2401_IRQ_H hrt_data isys_irqc_reg_load(
STORAGE_CLASS_ISYS2401_IRQ_H void isys_irqc_status_enable( STORAGE_CLASS_ISYS2401_IRQ_H void isys_irqc_status_enable(
const isys_irq_ID_t isys_irqc_id); const isys_irq_ID_t isys_irqc_id);
#endif /* defined(USE_INPUT_SYSTEM_VERSION_2401) */ #endif /* defined(ISP2401) */
#endif /* __ISYS_IRQ_PUBLIC_H__ */ #endif /* __ISYS_IRQ_PUBLIC_H__ */
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#ifndef __ISYS_PUBLIC_H_INCLUDED__ #ifndef __ISYS_PUBLIC_H_INCLUDED__
#define __ISYS_PUBLIC_H_INCLUDED__ #define __ISYS_PUBLIC_H_INCLUDED__
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
/*! Read the state of INPUT_SYSTEM[ID] /*! Read the state of INPUT_SYSTEM[ID]
\param ID[in] INPUT_SYSTEM identifier \param ID[in] INPUT_SYSTEM identifier
\param state[out] pointer to input system state structure \param state[out] pointer to input system state structure
...@@ -34,5 +34,5 @@ STORAGE_CLASS_INPUT_SYSTEM_H input_system_err_t input_system_get_state( ...@@ -34,5 +34,5 @@ STORAGE_CLASS_INPUT_SYSTEM_H input_system_err_t input_system_get_state(
STORAGE_CLASS_INPUT_SYSTEM_H void input_system_dump_state( STORAGE_CLASS_INPUT_SYSTEM_H void input_system_dump_state(
const input_system_ID_t ID, const input_system_ID_t ID,
input_system_state_t *state); input_system_state_t *state);
#endif /* USE_INPUT_SYSTEM_VERSION_2401 */ #endif /* ISP2401 */
#endif /* __ISYS_PUBLIC_H_INCLUDED__ */ #endif /* __ISYS_PUBLIC_H_INCLUDED__ */
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#ifndef __PIXELGEN_PUBLIC_H_INCLUDED__ #ifndef __PIXELGEN_PUBLIC_H_INCLUDED__
#define __PIXELGEN_PUBLIC_H_INCLUDED__ #define __PIXELGEN_PUBLIC_H_INCLUDED__
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
/***************************************************** /*****************************************************
* *
* Native command interface (NCI). * Native command interface (NCI).
...@@ -76,5 +76,5 @@ STORAGE_CLASS_PIXELGEN_H void pixelgen_ctrl_reg_store( ...@@ -76,5 +76,5 @@ STORAGE_CLASS_PIXELGEN_H void pixelgen_ctrl_reg_store(
const hrt_data value); const hrt_data value);
/* end of DLI */ /* end of DLI */
#endif /* USE_INPUT_SYSTEM_VERSION_2401 */ #endif /* ISP2401 */
#endif /* __PIXELGEN_PUBLIC_H_INCLUDED__ */ #endif /* __PIXELGEN_PUBLIC_H_INCLUDED__ */
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <type_support.h> #include <type_support.h>
#include <system_local.h> #include <system_local.h>
#if defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(ISP2401)
#ifndef __INLINE_ISYS2401_IRQ__ #ifndef __INLINE_ISYS2401_IRQ__
...@@ -35,6 +35,6 @@ ...@@ -35,6 +35,6 @@
#endif /* __INLINE_ISYS2401_IRQ__ */ #endif /* __INLINE_ISYS2401_IRQ__ */
#endif /* defined(USE_INPUT_SYSTEM_VERSION_2401) */ #endif /* defined(ISP2401) */
#endif /* __IA_CSS_ISYS_IRQ_H__ */ #endif /* __IA_CSS_ISYS_IRQ_H__ */
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <type_support.h> #include <type_support.h>
#include <system_local.h> #include <system_local.h>
#if !defined(USE_INPUT_SYSTEM_VERSION_2401) #if !defined(ISP2401)
#include <input_system.h> #include <input_system.h>
#endif #endif
#include "ia_css_types.h" #include "ia_css_types.h"
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
struct ia_css_stream { struct ia_css_stream {
struct ia_css_stream_config config; struct ia_css_stream_config config;
struct ia_css_stream_info info; struct ia_css_stream_info info;
#if !defined(USE_INPUT_SYSTEM_VERSION_2401) #if !defined(ISP2401)
rx_cfg_t csi_rx_config; rx_cfg_t csi_rx_config;
#endif #endif
bool reconfigure_css_rx; bool reconfigure_css_rx;
......
...@@ -81,7 +81,7 @@ ia_css_raw_config( ...@@ -81,7 +81,7 @@ ia_css_raw_config(
const struct ia_css_frame_info *internal_info = from->internal_info; const struct ia_css_frame_info *internal_info = from->internal_info;
(void)size; (void)size;
#if !defined(USE_INPUT_SYSTEM_VERSION_2401) #if !defined(ISP2401)
/* 2401 input system uses input width width */ /* 2401 input system uses input width width */
in_info = internal_info; in_info = internal_info;
#else #else
...@@ -105,7 +105,7 @@ ia_css_raw_config( ...@@ -105,7 +105,7 @@ ia_css_raw_config(
to->two_ppc = from->two_ppc; to->two_ppc = from->two_ppc;
to->stream_format = css2isp_stream_format(from->stream_format); to->stream_format = css2isp_stream_format(from->stream_format);
to->deinterleaved = from->deinterleaved; to->deinterleaved = from->deinterleaved;
#if (defined(USE_INPUT_SYSTEM_VERSION_2401) || defined(CONFIG_CSI2_PLUS)) #if defined(ISP2401)
to->start_column = in_info->crop_info.start_column; to->start_column = in_info->crop_info.start_column;
to->start_line = in_info->crop_info.start_line; to->start_line = in_info->crop_info.start_line;
to->enable_left_padding = from->enable_left_padding; to->enable_left_padding = from->enable_left_padding;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#define __INPUT_SYSTEM_PUBLIC_H_INCLUDED__ #define __INPUT_SYSTEM_PUBLIC_H_INCLUDED__
#include <type_support.h> #include <type_support.h>
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
#include "isys_public.h" #include "isys_public.h"
#else #else
...@@ -365,6 +365,6 @@ input_system_error_t input_system_gpfifo_channel_cfg( ...@@ -365,6 +365,6 @@ input_system_error_t input_system_gpfifo_channel_cfg(
u32 nof_frames, u32 nof_frames,
target_cfg2400_t target target_cfg2400_t target
); );
#endif /* #ifdef USE_INPUT_SYSTEM_VERSION_2401 */ #endif /* #ifdef ISP2401 */
#endif /* __INPUT_SYSTEM_PUBLIC_H_INCLUDED__ */ #endif /* __INPUT_SYSTEM_PUBLIC_H_INCLUDED__ */
/* 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.
*/
#define USE_INPUT_SYSTEM_VERSION_2
/* 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.
*/
#define HAS_NO_INPUT_FORMATTER
#define USE_INPUT_SYSTEM_VERSION_2401
#define HAS_INPUT_SYSTEM_VERSION_2401
#define CSI2P_DISABLE_ISYS2401_ONLINE_MODE
...@@ -1045,7 +1045,7 @@ binary_in_frame_padded_width(int in_frame_width, ...@@ -1045,7 +1045,7 @@ binary_in_frame_padded_width(int in_frame_width,
int rval; int rval;
int nr_of_left_paddings; /* number of paddings pixels on the left of an image line */ int nr_of_left_paddings; /* number of paddings pixels on the left of an image line */
#if defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(ISP2401)
/* the output image line of Input System 2401 does not have the left paddings */ /* the output image line of Input System 2401 does not have the left paddings */
nr_of_left_paddings = 0; nr_of_left_paddings = 0;
#else #else
......
...@@ -27,15 +27,9 @@ enum sh_css_queue_id { ...@@ -27,15 +27,9 @@ enum sh_css_queue_id {
SH_CSS_QUEUE_E_ID, SH_CSS_QUEUE_E_ID,
SH_CSS_QUEUE_F_ID, SH_CSS_QUEUE_F_ID,
SH_CSS_QUEUE_G_ID, SH_CSS_QUEUE_G_ID,
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
SH_CSS_QUEUE_H_ID, /* for metadata */ SH_CSS_QUEUE_H_ID, /* for metadata */
#endif
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
#define SH_CSS_MAX_NUM_QUEUES (SH_CSS_QUEUE_H_ID + 1) #define SH_CSS_MAX_NUM_QUEUES (SH_CSS_QUEUE_H_ID + 1)
#else
#define SH_CSS_MAX_NUM_QUEUES (SH_CSS_QUEUE_G_ID + 1)
#endif
}; };
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "system_global.h" #include "system_global.h"
#include <linux/kernel.h> #include <linux/kernel.h>
#ifdef USE_INPUT_SYSTEM_VERSION_2 #ifndef ISP2401
#include "ia_css_ifmtr.h" #include "ia_css_ifmtr.h"
#include <math_support.h> #include <math_support.h>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <system_global.h> #include <system_global.h>
#include "ia_css_isys_comm.h" #include "ia_css_isys_comm.h"
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
/** /**
* Virtual Input System. (Input System 2401) * Virtual Input System. (Input System 2401)
*/ */
...@@ -32,14 +32,12 @@ typedef input_system_cfg_t ia_css_isys_descr_t; ...@@ -32,14 +32,12 @@ typedef input_system_cfg_t ia_css_isys_descr_t;
/* end of Virtual Input System */ /* end of Virtual Input System */
#endif #endif
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
input_system_error_t ia_css_isys_init(void); input_system_error_t ia_css_isys_init(void);
void ia_css_isys_uninit(void); void ia_css_isys_uninit(void);
enum mipi_port_id ia_css_isys_port_to_mipi_port( enum mipi_port_id ia_css_isys_port_to_mipi_port(
enum mipi_port_id api_port); enum mipi_port_id api_port);
#endif
#if defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(ISP2401)
/** /**
* @brief Register one (virtual) stream. This is used to track when all * @brief Register one (virtual) stream. This is used to track when all
...@@ -78,7 +76,7 @@ unsigned int ia_css_csi2_calculate_input_system_alignment( ...@@ -78,7 +76,7 @@ unsigned int ia_css_csi2_calculate_input_system_alignment(
enum atomisp_input_format fmt_type); enum atomisp_input_format fmt_type);
#endif #endif
#if !defined(USE_INPUT_SYSTEM_VERSION_2401) #if !defined(ISP2401)
/* CSS Receiver */ /* CSS Receiver */
void ia_css_isys_rx_configure( void ia_css_isys_rx_configure(
const rx_cfg_t *config, const rx_cfg_t *config,
...@@ -95,7 +93,7 @@ void ia_css_isys_rx_clear_irq_info(enum mipi_port_id port, ...@@ -95,7 +93,7 @@ void ia_css_isys_rx_clear_irq_info(enum mipi_port_id port,
unsigned int irq_infos); unsigned int irq_infos);
unsigned int ia_css_isys_rx_translate_irq_infos(unsigned int bits); unsigned int ia_css_isys_rx_translate_irq_infos(unsigned int bits);
#endif /* #if !defined(USE_INPUT_SYSTEM_VERSION_2401) */ #endif /* #if !defined(ISP2401) */
/* @brief Translate format and compression to format type. /* @brief Translate format and compression to format type.
* *
...@@ -113,7 +111,7 @@ int ia_css_isys_convert_stream_format_to_mipi_format( ...@@ -113,7 +111,7 @@ int ia_css_isys_convert_stream_format_to_mipi_format(
mipi_predictor_t compression, mipi_predictor_t compression,
unsigned int *fmt_type); unsigned int *fmt_type);
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
/** /**
* Virtual Input System. (Input System 2401) * Virtual Input System. (Input System 2401)
*/ */
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <type_support.h> #include <type_support.h>
#include <input_system.h> #include <input_system.h>
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
#include <platform_support.h> /* inline */ #include <platform_support.h> /* inline */
#include <input_system_global.h> #include <input_system_global.h>
#include <ia_css_stream_public.h> /* IA_CSS_STREAM_MAX_ISYS_STREAM_PER_CH */ #include <ia_css_stream_public.h> /* IA_CSS_STREAM_MAX_ISYS_STREAM_PER_CH */
...@@ -50,5 +50,5 @@ static inline uint32_t ia_css_isys_generate_stream_id( ...@@ -50,5 +50,5 @@ static inline uint32_t ia_css_isys_generate_stream_id(
return sp_thread_id * IA_CSS_STREAM_MAX_ISYS_STREAM_PER_CH + stream_id; return sp_thread_id * IA_CSS_STREAM_MAX_ISYS_STREAM_PER_CH + stream_id;
} }
#endif /* USE_INPUT_SYSTEM_VERSION_2401*/ #endif /* ISP2401*/
#endif /*_IA_CSS_ISYS_COMM_H */ #endif /*_IA_CSS_ISYS_COMM_H */
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "system_global.h" #include "system_global.h"
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
#include "assert_support.h" #include "assert_support.h"
#include "platform_support.h" #include "platform_support.h"
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "system_global.h" #include "system_global.h"
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
#include "assert_support.h" #include "assert_support.h"
#include "platform_support.h" #include "platform_support.h"
......
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
#include "ia_css_isys.h" #include "ia_css_isys.h"
#include "platform_support.h" #include "platform_support.h"
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
#include "isys_dma.h" /* isys2401_dma_set_max_burst_size() */ #include "isys_dma.h" /* isys2401_dma_set_max_burst_size() */
#include "isys_irq.h" #include "isys_irq.h"
#endif #endif
#if defined(USE_INPUT_SYSTEM_VERSION_2) #if !defined(ISP2401)
input_system_error_t ia_css_isys_init(void) input_system_error_t ia_css_isys_init(void)
{ {
backend_channel_cfg_t backend_ch0; backend_channel_cfg_t backend_ch0;
...@@ -86,7 +86,7 @@ input_system_error_t ia_css_isys_init(void) ...@@ -86,7 +86,7 @@ input_system_error_t ia_css_isys_init(void)
return error; return error;
} }
#elif defined(USE_INPUT_SYSTEM_VERSION_2401) #elif defined(ISP2401)
input_system_error_t ia_css_isys_init(void) input_system_error_t ia_css_isys_init(void)
{ {
ia_css_isys_csi_rx_lut_rmgr_init(); ia_css_isys_csi_rx_lut_rmgr_init();
...@@ -106,11 +106,11 @@ input_system_error_t ia_css_isys_init(void) ...@@ -106,11 +106,11 @@ input_system_error_t ia_css_isys_init(void)
} }
#endif #endif
#if defined(USE_INPUT_SYSTEM_VERSION_2) #if !defined(ISP2401)
void ia_css_isys_uninit(void) void ia_css_isys_uninit(void)
{ {
} }
#elif defined(USE_INPUT_SYSTEM_VERSION_2401) #elif defined(ISP2401)
void ia_css_isys_uninit(void) void ia_css_isys_uninit(void)
{ {
ia_css_isys_csi_rx_lut_rmgr_uninit(); ia_css_isys_csi_rx_lut_rmgr_uninit();
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "system_global.h" #include "system_global.h"
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
#include "assert_support.h" #include "assert_support.h"
#include "platform_support.h" #include "platform_support.h"
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "ia_css_irq.h" #include "ia_css_irq.h"
#include "sh_css_internal.h" #include "sh_css_internal.h"
#if !defined(USE_INPUT_SYSTEM_VERSION_2401) #if !defined(ISP2401)
void ia_css_isys_rx_enable_all_interrupts(enum mipi_port_id port) void ia_css_isys_rx_enable_all_interrupts(enum mipi_port_id port)
{ {
hrt_data bits = receiver_port_reg_load(RX0_ID, hrt_data bits = receiver_port_reg_load(RX0_ID,
...@@ -209,7 +209,7 @@ void ia_css_isys_rx_clear_irq_info(enum mipi_port_id port, ...@@ -209,7 +209,7 @@ void ia_css_isys_rx_clear_irq_info(enum mipi_port_id port,
return; return;
} }
#endif /* #if !defined(USE_INPUT_SYSTEM_VERSION_2401) */ #endif /* #if !defined(ISP2401) */
int ia_css_isys_convert_stream_format_to_mipi_format( int ia_css_isys_convert_stream_format_to_mipi_format(
enum atomisp_input_format input_format, enum atomisp_input_format input_format,
...@@ -311,7 +311,7 @@ int ia_css_isys_convert_stream_format_to_mipi_format( ...@@ -311,7 +311,7 @@ int ia_css_isys_convert_stream_format_to_mipi_format(
case ATOMISP_INPUT_FORMAT_EMBEDDED: case ATOMISP_INPUT_FORMAT_EMBEDDED:
*fmt_type = MIPI_FORMAT_EMBEDDED; *fmt_type = MIPI_FORMAT_EMBEDDED;
break; break;
#ifndef USE_INPUT_SYSTEM_VERSION_2401 #ifndef ISP2401
case ATOMISP_INPUT_FORMAT_RAW_16: case ATOMISP_INPUT_FORMAT_RAW_16:
/* This is not specified by Arasan, so we use /* This is not specified by Arasan, so we use
* 17 for now. * 17 for now.
...@@ -356,7 +356,7 @@ int ia_css_isys_convert_stream_format_to_mipi_format( ...@@ -356,7 +356,7 @@ int ia_css_isys_convert_stream_format_to_mipi_format(
return 0; return 0;
} }
#if defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(ISP2401)
static mipi_predictor_t sh_css_csi2_compression_type_2_mipi_predictor( static mipi_predictor_t sh_css_csi2_compression_type_2_mipi_predictor(
enum ia_css_csi2_compression_type type) enum ia_css_csi2_compression_type type)
{ {
...@@ -474,7 +474,7 @@ unsigned int ia_css_csi2_calculate_input_system_alignment( ...@@ -474,7 +474,7 @@ unsigned int ia_css_csi2_calculate_input_system_alignment(
#endif #endif
#if !defined(USE_INPUT_SYSTEM_VERSION_2401) #if !defined(ISP2401)
void ia_css_isys_rx_configure(const rx_cfg_t *config, void ia_css_isys_rx_configure(const rx_cfg_t *config,
const enum ia_css_input_mode input_mode) const enum ia_css_input_mode input_mode)
{ {
...@@ -588,4 +588,4 @@ void ia_css_isys_rx_disable(void) ...@@ -588,4 +588,4 @@ void ia_css_isys_rx_disable(void)
} }
return; return;
} }
#endif /* if !defined(USE_INPUT_SYSTEM_VERSION_2401) */ #endif /* if !defined(ISP2401) */
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "system_global.h" #include "system_global.h"
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
#include "ia_css_isys.h" #include "ia_css_isys.h"
#include "ia_css_debug.h" #include "ia_css_debug.h"
......
...@@ -243,7 +243,7 @@ bool ia_css_pipeline_uses_params(struct ia_css_pipeline *pipeline); ...@@ -243,7 +243,7 @@ bool ia_css_pipeline_uses_params(struct ia_css_pipeline *pipeline);
*/ */
bool ia_css_pipeline_get_sp_thread_id(unsigned int key, unsigned int *val); bool ia_css_pipeline_get_sp_thread_id(unsigned int key, unsigned int *val);
#if defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(ISP2401)
/** /**
* @brief Get the pipeline io status * @brief Get the pipeline io status
* *
......
...@@ -455,7 +455,7 @@ bool ia_css_pipeline_has_stopped(struct ia_css_pipeline *pipeline) ...@@ -455,7 +455,7 @@ bool ia_css_pipeline_has_stopped(struct ia_css_pipeline *pipeline)
return sp_group.pipe[thread_id].num_stages == 0; return sp_group.pipe[thread_id].num_stages == 0;
} }
#if defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(ISP2401)
struct sh_css_sp_pipeline_io_status *ia_css_pipeline_get_pipe_io_status(void) struct sh_css_sp_pipeline_io_status *ia_css_pipeline_get_pipe_io_status(void)
{ {
return(&sh_css_sp_group.pipe_io_status); return(&sh_css_sp_group.pipe_io_status);
......
This diff is collapsed.
...@@ -397,10 +397,6 @@ RGB[0,8191],coef[-8192,8191] -> RGB[0,8191] ...@@ -397,10 +397,6 @@ RGB[0,8191],coef[-8192,8191] -> RGB[0,8191]
#define SH_CSS_MAX_STAGES 8 /* primary_stage[1-6], capture_pp, vf_pp */ #define SH_CSS_MAX_STAGES 8 /* primary_stage[1-6], capture_pp, vf_pp */
/* For CSI2+ input system, it requires extra paddinga from vmem */ /* For CSI2+ input system, it requires extra paddinga from vmem */
#ifdef CONFIG_CSI2_PLUS
#define _ISP_EXTRA_PADDING_VECS 2
#else
#define _ISP_EXTRA_PADDING_VECS 0 #define _ISP_EXTRA_PADDING_VECS 0
#endif /* CONFIG_CSI2_PLUS */
#endif /* _SH_CSS_DEFS_H_ */ #endif /* _SH_CSS_DEFS_H_ */
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <platform_support.h> #include <platform_support.h>
#include <stdarg.h> #include <stdarg.h>
#if !defined(HAS_NO_INPUT_FORMATTER) #if !defined(ISP2401)
#include "input_formatter.h" #include "input_formatter.h"
#endif #endif
#include "input_system.h" #include "input_system.h"
...@@ -86,11 +86,9 @@ ...@@ -86,11 +86,9 @@
#define SH_CSS_MAX_IF_CONFIGS 3 /* Must match with IA_CSS_NR_OF_CONFIGS (not defined yet).*/ #define SH_CSS_MAX_IF_CONFIGS 3 /* Must match with IA_CSS_NR_OF_CONFIGS (not defined yet).*/
#define SH_CSS_IF_CONFIG_NOT_NEEDED 0xFF #define SH_CSS_IF_CONFIG_NOT_NEEDED 0xFF
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
#define SH_CSS_ENABLE_METADATA #define SH_CSS_ENABLE_METADATA
#endif
#if defined(SH_CSS_ENABLE_METADATA) && !defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(SH_CSS_ENABLE_METADATA) && !defined(ISP2401)
#define SH_CSS_ENABLE_METADATA_THREAD #define SH_CSS_ENABLE_METADATA_THREAD
#endif #endif
...@@ -320,15 +318,9 @@ struct sh_css_sp_debug_state { ...@@ -320,15 +318,9 @@ struct sh_css_sp_debug_state {
#elif SP_DEBUG == SP_DEBUG_TRACE #elif SP_DEBUG == SP_DEBUG_TRACE
#if 1
/* Example of just one global trace */ /* Example of just one global trace */
#define SH_CSS_SP_DBG_NR_OF_TRACES (1) #define SH_CSS_SP_DBG_NR_OF_TRACES (1)
#define SH_CSS_SP_DBG_TRACE_DEPTH (40) #define SH_CSS_SP_DBG_TRACE_DEPTH (40)
#else
/* E.g. if you like separate traces for 4 threads */
#define SH_CSS_SP_DBG_NR_OF_TRACES (4)
#define SH_CSS_SP_DBG_TRACE_DEPTH (10)
#endif
#define SH_CSS_SP_DBG_TRACE_FILE_ID_BIT_POS (13) #define SH_CSS_SP_DBG_TRACE_FILE_ID_BIT_POS (13)
...@@ -371,7 +363,7 @@ struct sh_css_sp_debug_command { ...@@ -371,7 +363,7 @@ struct sh_css_sp_debug_command {
u32 dma_sw_reg; u32 dma_sw_reg;
}; };
#if !defined(HAS_NO_INPUT_FORMATTER) #if !defined(ISP2401)
/* SP input formatter configuration.*/ /* SP input formatter configuration.*/
struct sh_css_sp_input_formatter_set { struct sh_css_sp_input_formatter_set {
u32 stream_format; u32 stream_format;
...@@ -391,7 +383,7 @@ struct sh_css_sp_config { ...@@ -391,7 +383,7 @@ struct sh_css_sp_config {
frames are locked when their EOF event is successfully sent to the frames are locked when their EOF event is successfully sent to the
host (true) or when they are passed to the preview/video pipe host (true) or when they are passed to the preview/video pipe
(false). */ (false). */
#if !defined(HAS_NO_INPUT_FORMATTER) #if !defined(ISP2401)
struct { struct {
u8 a_changed; u8 a_changed;
u8 b_changed; u8 b_changed;
...@@ -400,7 +392,7 @@ struct sh_css_sp_config { ...@@ -400,7 +392,7 @@ struct sh_css_sp_config {
set[SH_CSS_MAX_IF_CONFIGS]; /* CSI-2 port is used as index. */ set[SH_CSS_MAX_IF_CONFIGS]; /* CSI-2 port is used as index. */
} input_formatter; } input_formatter;
#endif #endif
#if defined(USE_INPUT_SYSTEM_VERSION_2) #if !defined(ISP2401)
sync_generator_cfg_t sync_gen; sync_generator_cfg_t sync_gen;
tpg_cfg_t tpg; tpg_cfg_t tpg;
prbs_cfg_t prbs; prbs_cfg_t prbs;
...@@ -423,7 +415,7 @@ enum sh_css_stage_type { ...@@ -423,7 +415,7 @@ enum sh_css_stage_type {
#define SH_CSS_PIPE_CONFIG_SAMPLE_PARAMS_MASK \ #define SH_CSS_PIPE_CONFIG_SAMPLE_PARAMS_MASK \
((SH_CSS_PIPE_CONFIG_SAMPLE_PARAMS << SH_CSS_MAX_SP_THREADS) - 1) ((SH_CSS_PIPE_CONFIG_SAMPLE_PARAMS << SH_CSS_MAX_SP_THREADS) - 1)
#if defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(ISP2401)
struct sh_css_sp_pipeline_terminal { struct sh_css_sp_pipeline_terminal {
union { union {
/* Input System 2401 */ /* Input System 2401 */
...@@ -679,7 +671,7 @@ struct sh_css_sp_stage { ...@@ -679,7 +671,7 @@ struct sh_css_sp_stage {
struct sh_css_sp_group { struct sh_css_sp_group {
struct sh_css_sp_config config; struct sh_css_sp_config config;
struct sh_css_sp_pipeline pipe[SH_CSS_MAX_SP_THREADS]; struct sh_css_sp_pipeline pipe[SH_CSS_MAX_SP_THREADS];
#if defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(ISP2401)
struct sh_css_sp_pipeline_io pipe_io[SH_CSS_MAX_SP_THREADS]; struct sh_css_sp_pipeline_io pipe_io[SH_CSS_MAX_SP_THREADS];
struct sh_css_sp_pipeline_io_status pipe_io_status; struct sh_css_sp_pipeline_io_status pipe_io_status;
#endif #endif
...@@ -828,11 +820,9 @@ struct host_sp_communication { ...@@ -828,11 +820,9 @@ struct host_sp_communication {
ia_css_ptr host2sp_offline_frames[NUM_CONTINUOUS_FRAMES]; ia_css_ptr host2sp_offline_frames[NUM_CONTINUOUS_FRAMES];
ia_css_ptr host2sp_offline_metadata[NUM_CONTINUOUS_FRAMES]; ia_css_ptr host2sp_offline_metadata[NUM_CONTINUOUS_FRAMES];
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
ia_css_ptr host2sp_mipi_frames[N_CSI_PORTS][NUM_MIPI_FRAMES_PER_STREAM]; ia_css_ptr host2sp_mipi_frames[N_CSI_PORTS][NUM_MIPI_FRAMES_PER_STREAM];
ia_css_ptr host2sp_mipi_metadata[N_CSI_PORTS][NUM_MIPI_FRAMES_PER_STREAM]; ia_css_ptr host2sp_mipi_metadata[N_CSI_PORTS][NUM_MIPI_FRAMES_PER_STREAM];
u32 host2sp_num_mipi_frames[N_CSI_PORTS]; u32 host2sp_num_mipi_frames[N_CSI_PORTS];
#endif
u32 host2sp_cont_avail_num_raw_frames; u32 host2sp_cont_avail_num_raw_frames;
u32 host2sp_cont_extra_num_raw_frames; u32 host2sp_cont_extra_num_raw_frames;
u32 host2sp_cont_target_num_raw_frames; u32 host2sp_cont_target_num_raw_frames;
...@@ -840,20 +830,12 @@ struct host_sp_communication { ...@@ -840,20 +830,12 @@ struct host_sp_communication {
}; };
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
#define SIZE_OF_HOST_SP_COMMUNICATION_STRUCT \ #define SIZE_OF_HOST_SP_COMMUNICATION_STRUCT \
(sizeof(uint32_t) + \ (sizeof(uint32_t) + \
(NUM_CONTINUOUS_FRAMES * SIZE_OF_HRT_VADDRESS * 2) + \ (NUM_CONTINUOUS_FRAMES * SIZE_OF_HRT_VADDRESS * 2) + \
(N_CSI_PORTS * NUM_MIPI_FRAMES_PER_STREAM * SIZE_OF_HRT_VADDRESS * 2) + \ (N_CSI_PORTS * NUM_MIPI_FRAMES_PER_STREAM * SIZE_OF_HRT_VADDRESS * 2) + \
((3 + N_CSI_PORTS) * sizeof(uint32_t)) + \ ((3 + N_CSI_PORTS) * sizeof(uint32_t)) + \
(NR_OF_PIPELINES * SIZE_OF_SH_CSS_EVENT_IRQ_MASK_STRUCT)) (NR_OF_PIPELINES * SIZE_OF_SH_CSS_EVENT_IRQ_MASK_STRUCT))
#else
#define SIZE_OF_HOST_SP_COMMUNICATION_STRUCT \
(sizeof(uint32_t) + \
(NUM_CONTINUOUS_FRAMES * SIZE_OF_HRT_VADDRESS * 2) + \
(3 * sizeof(uint32_t)) + \
(NR_OF_PIPELINES * SIZE_OF_SH_CSS_EVENT_IRQ_MASK_STRUCT))
#endif
struct host_sp_queues { struct host_sp_queues {
/* /*
...@@ -987,7 +969,7 @@ sh_css_frame_info_set_width(struct ia_css_frame_info *info, ...@@ -987,7 +969,7 @@ sh_css_frame_info_set_width(struct ia_css_frame_info *info,
unsigned int width, unsigned int width,
unsigned int aligned); unsigned int aligned);
#if defined(USE_INPUT_SYSTEM_VERSION_2) #if !defined(ISP2401)
unsigned int unsigned int
sh_css_get_mipi_sizes_for_check(const unsigned int port, sh_css_get_mipi_sizes_for_check(const unsigned int port,
...@@ -1036,7 +1018,7 @@ sh_css_continuous_is_enabled(uint8_t pipe_num); ...@@ -1036,7 +1018,7 @@ sh_css_continuous_is_enabled(uint8_t pipe_num);
struct ia_css_pipe * struct ia_css_pipe *
find_pipe_by_num(uint32_t pipe_num); find_pipe_by_num(uint32_t pipe_num);
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
void void
ia_css_get_crop_offsets( ia_css_get_crop_offsets(
struct ia_css_pipe *pipe, struct ia_css_pipe *pipe,
......
...@@ -30,10 +30,8 @@ ...@@ -30,10 +30,8 @@
#include "sh_css_sp.h" /* sh_css_update_host2sp_mipi_frame sh_css_update_host2sp_num_mipi_frames ... */ #include "sh_css_sp.h" /* sh_css_update_host2sp_mipi_frame sh_css_update_host2sp_num_mipi_frames ... */
#include "sw_event_global.h" /* IA_CSS_PSYS_SW_EVENT_MIPI_BUFFERS_READY */ #include "sw_event_global.h" /* IA_CSS_PSYS_SW_EVENT_MIPI_BUFFERS_READY */
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
static u32 static u32
ref_count_mipi_allocation[N_CSI_PORTS]; /* Initialized in mipi_init */ ref_count_mipi_allocation[N_CSI_PORTS]; /* Initialized in mipi_init */
#endif
int int
ia_css_mipi_frame_specify(const unsigned int size_mem_words, ia_css_mipi_frame_specify(const unsigned int size_mem_words,
...@@ -120,7 +118,7 @@ ia_css_mipi_frame_calculate_size(const unsigned int width, ...@@ -120,7 +118,7 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
unsigned int mem_words = 0; unsigned int mem_words = 0;
unsigned int width_padded = width; unsigned int width_padded = width;
#if defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(ISP2401)
/* The changes will be reverted as soon as RAW /* The changes will be reverted as soon as RAW
* Buffers are deployed by the 2401 Input System * Buffers are deployed by the 2401 Input System
* in the non-continuous use scenario. * in the non-continuous use scenario.
...@@ -246,7 +244,7 @@ ia_css_mipi_frame_calculate_size(const unsigned int width, ...@@ -246,7 +244,7 @@ ia_css_mipi_frame_calculate_size(const unsigned int width,
return err; return err;
} }
#if defined(USE_INPUT_SYSTEM_VERSION_2) #if !defined(ISP2401)
int int
ia_css_mipi_frame_enable_check_on_size(const enum mipi_port_id port, ia_css_mipi_frame_enable_check_on_size(const enum mipi_port_id port,
const unsigned int size_mem_words) { const unsigned int size_mem_words) {
...@@ -275,19 +273,17 @@ ia_css_mipi_frame_enable_check_on_size(const enum mipi_port_id port, ...@@ -275,19 +273,17 @@ ia_css_mipi_frame_enable_check_on_size(const enum mipi_port_id port,
void void
mipi_init(void) mipi_init(void)
{ {
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
unsigned int i; unsigned int i;
for (i = 0; i < N_CSI_PORTS; i++) for (i = 0; i < N_CSI_PORTS; i++)
ref_count_mipi_allocation[i] = 0; ref_count_mipi_allocation[i] = 0;
#endif
} }
int int
calculate_mipi_buff_size( calculate_mipi_buff_size(
struct ia_css_stream_config *stream_cfg, struct ia_css_stream_config *stream_cfg,
unsigned int *size_mem_words) { unsigned int *size_mem_words) {
#if !defined(USE_INPUT_SYSTEM_VERSION_2401) #if !defined(ISP2401)
int err = -EINVAL; int err = -EINVAL;
(void)stream_cfg; (void)stream_cfg;
(void)size_mem_words; (void)size_mem_words;
...@@ -409,7 +405,6 @@ static bool buffers_needed(struct ia_css_pipe *pipe) ...@@ -409,7 +405,6 @@ static bool buffers_needed(struct ia_css_pipe *pipe)
int int
allocate_mipi_frames(struct ia_css_pipe *pipe, allocate_mipi_frames(struct ia_css_pipe *pipe,
struct ia_css_stream_info *info) { struct ia_css_stream_info *info) {
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
int err = -EINVAL; int err = -EINVAL;
unsigned int port; unsigned int port;
struct ia_css_frame_info mipi_intermediate_info; struct ia_css_frame_info mipi_intermediate_info;
...@@ -427,7 +422,7 @@ allocate_mipi_frames(struct ia_css_pipe *pipe, ...@@ -427,7 +422,7 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
return -EINVAL; return -EINVAL;
} }
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
if (pipe->stream->config.online) if (pipe->stream->config.online)
{ {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
...@@ -459,13 +454,13 @@ allocate_mipi_frames(struct ia_css_pipe *pipe, ...@@ -459,13 +454,13 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
return -EINVAL; return -EINVAL;
} }
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
err = calculate_mipi_buff_size( err = calculate_mipi_buff_size(
&pipe->stream->config, &pipe->stream->config,
&my_css.mipi_frame_size[port]); &my_css.mipi_frame_size[port]);
#endif #endif
#if defined(USE_INPUT_SYSTEM_VERSION_2) #if !defined(ISP2401)
if (ref_count_mipi_allocation[port] != 0) if (ref_count_mipi_allocation[port] != 0)
{ {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
...@@ -560,16 +555,10 @@ allocate_mipi_frames(struct ia_css_pipe *pipe, ...@@ -560,16 +555,10 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
"allocate_mipi_frames(%p) exit:\n", pipe); "allocate_mipi_frames(%p) exit:\n", pipe);
return err; return err;
#else
(void)pipe;
(void)info;
return 0;
#endif
} }
int int
free_mipi_frames(struct ia_css_pipe *pipe) { free_mipi_frames(struct ia_css_pipe *pipe) {
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
int err = -EINVAL; int err = -EINVAL;
unsigned int port; unsigned int port;
...@@ -609,7 +598,7 @@ free_mipi_frames(struct ia_css_pipe *pipe) { ...@@ -609,7 +598,7 @@ free_mipi_frames(struct ia_css_pipe *pipe) {
} }
if (ref_count_mipi_allocation[port] > 0) { if (ref_count_mipi_allocation[port] > 0) {
#if defined(USE_INPUT_SYSTEM_VERSION_2) #if !defined(ISP2401)
assert(ref_count_mipi_allocation[port] == 1); assert(ref_count_mipi_allocation[port] == 1);
if (ref_count_mipi_allocation[port] != 1) { if (ref_count_mipi_allocation[port] != 1) {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
...@@ -641,7 +630,7 @@ free_mipi_frames(struct ia_css_pipe *pipe) { ...@@ -641,7 +630,7 @@ free_mipi_frames(struct ia_css_pipe *pipe) {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
"free_mipi_frames(%p) exit (deallocated).\n", pipe); "free_mipi_frames(%p) exit (deallocated).\n", pipe);
} }
#if defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(ISP2401)
else { else {
/* 2401 system allows multiple streams to use same physical port. This is not /* 2401 system allows multiple streams to use same physical port. This is not
* true for 2400 system. Currently 2401 uses MIPI buffers as a temporary solution. * true for 2400 system. Currently 2401 uses MIPI buffers as a temporary solution.
...@@ -675,15 +664,11 @@ free_mipi_frames(struct ia_css_pipe *pipe) { ...@@ -675,15 +664,11 @@ free_mipi_frames(struct ia_css_pipe *pipe) {
ref_count_mipi_allocation[port] = 0; ref_count_mipi_allocation[port] = 0;
} }
} }
#else
(void)pipe;
#endif
return 0; return 0;
} }
int int
send_mipi_frames(struct ia_css_pipe *pipe) { send_mipi_frames(struct ia_css_pipe *pipe) {
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
int err = -EINVAL; int err = -EINVAL;
unsigned int i; unsigned int i;
#ifndef ISP2401 #ifndef ISP2401
...@@ -751,8 +736,5 @@ send_mipi_frames(struct ia_css_pipe *pipe) { ...@@ -751,8 +736,5 @@ send_mipi_frames(struct ia_css_pipe *pipe) {
(uint8_t)my_css.num_mipi_frames[port], (uint8_t)my_css.num_mipi_frames[port],
0 /* not used */); 0 /* not used */);
IA_CSS_LEAVE_ERR_PRIVATE(0); IA_CSS_LEAVE_ERR_PRIVATE(0);
#else
(void)pipe;
#endif
return 0; return 0;
} }
...@@ -258,7 +258,7 @@ prepare_shading_table(const struct ia_css_shading_table *in_table, ...@@ -258,7 +258,7 @@ prepare_shading_table(const struct ia_css_shading_table *in_table,
/* We use the ISP input resolution for the shading table because /* We use the ISP input resolution for the shading table because
shading correction is performed in the bayer domain (before bayer shading correction is performed in the bayer domain (before bayer
down scaling). */ down scaling). */
#if defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(ISP2401)
padded_width = CEIL_MUL(binary->effective_in_frame_res.width + 2 * padded_width = CEIL_MUL(binary->effective_in_frame_res.width + 2 *
ISP_VEC_NELEMS, ISP_VEC_NELEMS,
2 * ISP_VEC_NELEMS); 2 * ISP_VEC_NELEMS);
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "sh_css_sp.h" #include "sh_css_sp.h"
#if !defined(HAS_NO_INPUT_FORMATTER) #if !defined(ISP2401)
#include "input_formatter.h" #include "input_formatter.h"
#endif #endif
...@@ -227,7 +227,7 @@ sh_css_sp_start_binary_copy(unsigned int pipe_num, ...@@ -227,7 +227,7 @@ sh_css_sp_start_binary_copy(unsigned int pipe_num,
IA_CSS_LOG("pipe_id %d port_config %08x", IA_CSS_LOG("pipe_id %d port_config %08x",
pipe->pipe_id, pipe->inout_port_config); pipe->pipe_id, pipe->inout_port_config);
#if !defined(HAS_NO_INPUT_FORMATTER) #if !defined(ISP2401)
sh_css_sp_group.config.input_formatter.isp_2ppc = (uint8_t)two_ppc; sh_css_sp_group.config.input_formatter.isp_2ppc = (uint8_t)two_ppc;
#else #else
(void)two_ppc; (void)two_ppc;
...@@ -305,7 +305,7 @@ sh_css_sp_start_raw_copy(struct ia_css_frame *out_frame, ...@@ -305,7 +305,7 @@ sh_css_sp_start_raw_copy(struct ia_css_frame *out_frame,
IA_CSS_LOG("pipe_id %d port_config %08x", IA_CSS_LOG("pipe_id %d port_config %08x",
pipe->pipe_id, pipe->inout_port_config); pipe->pipe_id, pipe->inout_port_config);
#if !defined(HAS_NO_INPUT_FORMATTER) #if !defined(ISP2401)
sh_css_sp_group.config.input_formatter.isp_2ppc = (uint8_t)two_ppc; sh_css_sp_group.config.input_formatter.isp_2ppc = (uint8_t)two_ppc;
#else #else
(void)two_ppc; (void)two_ppc;
...@@ -636,7 +636,7 @@ set_view_finder_buffer(const struct ia_css_frame *frame) { ...@@ -636,7 +636,7 @@ set_view_finder_buffer(const struct ia_css_frame *frame) {
return 0; return 0;
} }
#if !defined(HAS_NO_INPUT_FORMATTER) #if !defined(ISP2401)
void sh_css_sp_set_if_configs( void sh_css_sp_set_if_configs(
const input_formatter_cfg_t *config_a, const input_formatter_cfg_t *config_a,
const input_formatter_cfg_t *config_b, const input_formatter_cfg_t *config_b,
...@@ -660,7 +660,7 @@ void sh_css_sp_set_if_configs( ...@@ -660,7 +660,7 @@ void sh_css_sp_set_if_configs(
} }
#endif #endif
#if defined(USE_INPUT_SYSTEM_VERSION_2) #if !defined(ISP2401)
void void
sh_css_sp_program_input_circuit(int fmt_type, sh_css_sp_program_input_circuit(int fmt_type,
int ch_id, int ch_id,
...@@ -679,7 +679,7 @@ sh_css_sp_program_input_circuit(int fmt_type, ...@@ -679,7 +679,7 @@ sh_css_sp_program_input_circuit(int fmt_type,
} }
#endif #endif
#if defined(USE_INPUT_SYSTEM_VERSION_2) #if !defined(ISP2401)
void void
sh_css_sp_configure_sync_gen(int width, int height, sh_css_sp_configure_sync_gen(int width, int height,
int hblank_cycles, int hblank_cycles,
...@@ -760,7 +760,7 @@ sh_css_sp_init_group(bool two_ppc, ...@@ -760,7 +760,7 @@ sh_css_sp_init_group(bool two_ppc,
bool no_isp_sync, bool no_isp_sync,
uint8_t if_config_index) uint8_t if_config_index)
{ {
#if !defined(HAS_NO_INPUT_FORMATTER) #if !defined(ISP2401)
sh_css_sp_group.config.input_formatter.isp_2ppc = two_ppc; sh_css_sp_group.config.input_formatter.isp_2ppc = two_ppc;
#else #else
(void)two_ppc; (void)two_ppc;
...@@ -769,7 +769,7 @@ sh_css_sp_init_group(bool two_ppc, ...@@ -769,7 +769,7 @@ sh_css_sp_init_group(bool two_ppc,
sh_css_sp_group.config.no_isp_sync = (uint8_t)no_isp_sync; sh_css_sp_group.config.no_isp_sync = (uint8_t)no_isp_sync;
/* decide whether the frame is processed online or offline */ /* decide whether the frame is processed online or offline */
if (if_config_index == SH_CSS_IF_CONFIG_NOT_NEEDED) return; if (if_config_index == SH_CSS_IF_CONFIG_NOT_NEEDED) return;
#if !defined(HAS_NO_INPUT_FORMATTER) #if !defined(ISP2401)
assert(if_config_index < SH_CSS_MAX_IF_CONFIGS); assert(if_config_index < SH_CSS_MAX_IF_CONFIGS);
sh_css_sp_group.config.input_formatter.set[if_config_index].stream_format = sh_css_sp_group.config.input_formatter.set[if_config_index].stream_format =
input_format; input_format;
...@@ -934,7 +934,7 @@ sh_css_sp_init_stage(struct ia_css_binary *binary, ...@@ -934,7 +934,7 @@ sh_css_sp_init_stage(struct ia_css_binary *binary,
return 0; return 0;
} }
#if defined(USE_INPUT_SYSTEM_VERSION_2401) #if defined(ISP2401)
(void)continuous; (void)continuous;
sh_css_sp_stage.deinterleaved = 0; sh_css_sp_stage.deinterleaved = 0;
#else #else
...@@ -1019,7 +1019,7 @@ sh_css_sp_init_stage(struct ia_css_binary *binary, ...@@ -1019,7 +1019,7 @@ sh_css_sp_init_stage(struct ia_css_binary *binary,
if (err) if (err)
return err; return err;
#ifdef USE_INPUT_SYSTEM_VERSION_2401 #ifdef ISP2401
if (stage == 0) { if (stage == 0) {
pipe = find_pipe_by_num(sh_css_sp_group.pipe[thread_id].pipe_num); pipe = find_pipe_by_num(sh_css_sp_group.pipe[thread_id].pipe_num);
if (!pipe) if (!pipe)
...@@ -1255,12 +1255,10 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me, ...@@ -1255,12 +1255,10 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me,
offline, if_config_index); offline, if_config_index);
} /* if (first_binary != NULL) */ } /* if (first_binary != NULL) */
#if defined(USE_INPUT_SYSTEM_VERSION_2401) || defined(USE_INPUT_SYSTEM_VERSION_2)
/* Signal the host immediately after start for SP_ISYS_COPY only */ /* Signal the host immediately after start for SP_ISYS_COPY only */
if ((me->num_stages == 1) && me->stages && if ((me->num_stages == 1) && me->stages &&
(me->stages->sp_func == IA_CSS_PIPELINE_ISYS_COPY)) (me->stages->sp_func == IA_CSS_PIPELINE_ISYS_COPY))
sh_css_sp_group.config.no_isp_sync = true; sh_css_sp_group.config.no_isp_sync = true;
#endif
/* Init stage data */ /* Init stage data */
sh_css_init_host2sp_frame_data(); sh_css_init_host2sp_frame_data();
...@@ -1467,7 +1465,6 @@ sh_css_update_host2sp_offline_frame( ...@@ -1467,7 +1465,6 @@ sh_css_update_host2sp_offline_frame(
store_sp_array_uint(host_sp_com, offset, metadata ? metadata->address : 0); store_sp_array_uint(host_sp_com, offset, metadata ? metadata->address : 0);
} }
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
/* /*
* @brief Update the mipi frame information in host_sp_communication. * @brief Update the mipi frame information in host_sp_communication.
* Refer to "sh_css_sp.h" for more details. * Refer to "sh_css_sp.h" for more details.
...@@ -1532,7 +1529,6 @@ sh_css_update_host2sp_num_mipi_frames(unsigned int num_frames) ...@@ -1532,7 +1529,6 @@ sh_css_update_host2sp_num_mipi_frames(unsigned int num_frames)
store_sp_array_uint(host_sp_com, offset, num_frames); store_sp_array_uint(host_sp_com, offset, num_frames);
} }
#endif
void void
sh_css_update_host2sp_cont_num_raw_frames(unsigned int num_frames, sh_css_update_host2sp_cont_num_raw_frames(unsigned int num_frames,
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <system_global.h> #include <system_global.h>
#include <type_support.h> #include <type_support.h>
#if !defined(HAS_NO_INPUT_FORMATTER) #if !defined(ISP2401)
#include "input_formatter.h" #include "input_formatter.h"
#endif #endif
...@@ -96,7 +96,6 @@ sh_css_update_host2sp_offline_frame( ...@@ -96,7 +96,6 @@ sh_css_update_host2sp_offline_frame(
struct ia_css_frame *frame, struct ia_css_frame *frame,
struct ia_css_metadata *metadata); struct ia_css_metadata *metadata);
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
/** /**
* @brief Update the mipi frame information in host_sp_communication. * @brief Update the mipi frame information in host_sp_communication.
* *
...@@ -126,7 +125,6 @@ sh_css_update_host2sp_mipi_metadata( ...@@ -126,7 +125,6 @@ sh_css_update_host2sp_mipi_metadata(
*/ */
void void
sh_css_update_host2sp_num_mipi_frames(unsigned int num_frames); sh_css_update_host2sp_num_mipi_frames(unsigned int num_frames);
#endif
/** /**
* @brief Update the nr of offline frames to use in host_sp_communication. * @brief Update the nr of offline frames to use in host_sp_communication.
...@@ -156,7 +154,7 @@ sh_css_sp_get_debug_state(struct sh_css_sp_debug_state *state); ...@@ -156,7 +154,7 @@ sh_css_sp_get_debug_state(struct sh_css_sp_debug_state *state);
#endif #endif
#if !defined(HAS_NO_INPUT_FORMATTER) #if !defined(ISP2401)
void void
sh_css_sp_set_if_configs( sh_css_sp_set_if_configs(
const input_formatter_cfg_t *config_a, const input_formatter_cfg_t *config_a,
......
...@@ -55,7 +55,6 @@ struct sh_css { ...@@ -55,7 +55,6 @@ struct sh_css {
bool check_system_idle; bool check_system_idle;
unsigned int num_cont_raw_frames; unsigned int num_cont_raw_frames;
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
unsigned int num_mipi_frames[N_CSI_PORTS]; unsigned int num_mipi_frames[N_CSI_PORTS];
struct ia_css_frame struct ia_css_frame
*mipi_frames[N_CSI_PORTS][NUM_MIPI_FRAMES_PER_STREAM]; *mipi_frames[N_CSI_PORTS][NUM_MIPI_FRAMES_PER_STREAM];
...@@ -64,7 +63,6 @@ struct sh_css { ...@@ -64,7 +63,6 @@ struct sh_css {
unsigned int unsigned int
mipi_sizes_for_check[N_CSI_PORTS][IA_CSS_MIPI_SIZE_CHECK_MAX_NOF_ENTRIES_PER_PORT]; mipi_sizes_for_check[N_CSI_PORTS][IA_CSS_MIPI_SIZE_CHECK_MAX_NOF_ENTRIES_PER_PORT];
unsigned int mipi_frame_size[N_CSI_PORTS]; unsigned int mipi_frame_size[N_CSI_PORTS];
#endif
ia_css_ptr sp_bin_addr; ia_css_ptr sp_bin_addr;
hrt_data page_table_base_index; hrt_data page_table_base_index;
......
...@@ -25,23 +25,6 @@ ...@@ -25,23 +25,6 @@
* N.B. the 3 input formatters are of 2 different classess * N.B. the 3 input formatters are of 2 different classess
*/ */
#define HAS_MMU_VERSION_2
#define HAS_DMA_VERSION_2
#define HAS_GDC_VERSION_2
#define HAS_VAMEM_VERSION_2
#define HAS_HMEM_VERSION_1
#define HAS_BAMEM_VERSION_2
#define HAS_IRQ_VERSION_2
#define HAS_IRQ_MAP_VERSION_2
#define HAS_INPUT_FORMATTER_VERSION_2
#define HAS_INPUT_SYSTEM_VERSION_2
#define HAS_BUFFERED_SENSOR
#define HAS_FIFO_MONITORS_VERSION_2
#define HAS_GP_DEVICE_VERSION_2
#define HAS_GPIO_VERSION_1
#define HAS_TIMED_CTRL_VERSION_1
#define HAS_RX_VERSION_2
/* per-frame parameter handling support */ /* per-frame parameter handling support */
#define SH_CSS_ENABLE_PER_FRAME_PARAMS #define SH_CSS_ENABLE_PER_FRAME_PARAMS
...@@ -64,12 +47,6 @@ ...@@ -64,12 +47,6 @@
#define ISP2400_DMA_MAX_BURST_LENGTH 128 #define ISP2400_DMA_MAX_BURST_LENGTH 128
#define ISP2401_DMA_MAX_BURST_LENGTH 2 #define ISP2401_DMA_MAX_BURST_LENGTH 2
#ifdef ISP2401
# include "isp2401_system_global.h"
#else
# include "isp2400_system_global.h"
#endif
#include <hive_isp_css_defs.h> #include <hive_isp_css_defs.h>
#include <type_support.h> #include <type_support.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment