Commit 3c0538fb authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: atomisp: get rid of most checks for ISP2401 version

There are lots of places inside this driver checking for
ISP2400/ISP2401 verison. Get rid of most of those, while
keep building for both.

Most of stuff in this patch is trivial to solve.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent f0648058
......@@ -4797,10 +4797,8 @@ static void __atomisp_update_stream_env(struct atomisp_sub_device *asd,
{
int i;
#if defined(ISP2401_NEW_INPUT_SYSTEM)
/* assign virtual channel id return from sensor driver query */
asd->stream_env[stream_index].ch_id = stream_info->ch_id;
#endif
asd->stream_env[stream_index].isys_configs = stream_info->isys_configs;
for (i = 0; i < stream_info->isys_configs; i++) {
asd->stream_env[stream_index].isys_info[i].input_format =
......
......@@ -196,9 +196,7 @@ bool ia_css_refcount_decrement(s32 id, hrt_vaddress ptr)
id, ptr, entry, entry->id, entry->count);
else
IA_CSS_ERROR("entry NULL\n");
#ifdef ISP2401
assert(false);
#endif
return false;
}
......@@ -246,14 +244,13 @@ void ia_css_refcount_clear(s32 id, clear_func clear_func_ptr)
"ia_css_refcount_clear: using hmm_free: no clear_func\n");
hmm_free(entry->data);
}
#ifndef ISP2401
#else
assert(entry->count == 0);
#endif
if (entry->count != 0) {
IA_CSS_WARNING("Ref count for entry %x is not zero!", entry->id);
}
assert(entry->count == 0);
entry->data = mmgr_NULL;
entry->count = 0;
entry->id = 0;
......
......@@ -57,10 +57,8 @@ static void pipe_binarydesc_get_offline(
descr->enable_dz = true;
descr->enable_xnr = false;
descr->enable_dpc = false;
#ifdef ISP2401
descr->enable_luma_only = false;
descr->enable_tnr = false;
#endif
descr->enable_capture_pp_bli = false;
descr->enable_fractional_ds = false;
descr->dvs_env.width = 0;
......@@ -391,12 +389,10 @@ enum ia_css_err ia_css_pipe_get_video_binarydesc(
pipe->extra_config.enable_fractional_ds;
video_descr->enable_dpc =
pipe->config.enable_dpc;
#ifdef ISP2401
video_descr->enable_luma_only =
pipe->config.enable_luma_only;
video_descr->enable_tnr =
pipe->config.enable_tnr;
#endif
if (pipe->extra_config.enable_raw_binning) {
if (pipe->config.bayer_ds_out_res.width != 0 &&
......@@ -603,27 +599,24 @@ void ia_css_pipe_get_primary_binarydesc(
prim_descr->isp_pipe_version = pipe->config.isp_pipe_version;
prim_descr->enable_fractional_ds =
pipe->extra_config.enable_fractional_ds;
#ifdef ISP2401
prim_descr->enable_luma_only =
pipe->config.enable_luma_only;
#endif
/* We have both striped and non-striped primary binaries,
* if continuous viewfinder is required, then we must select
* a striped one. Otherwise we prefer to use a non-striped
* since it has better performance. */
if (pipe_version == IA_CSS_PIPE_VERSION_2_6_1)
prim_descr->striped = false;
else
#ifndef ISP2401
else if (!atomisp_hw_is_isp2401) {
prim_descr->striped = prim_descr->continuous &&
(!pipe->stream->stop_copy_preview || !pipe->stream->disable_cont_vf);
#else
} else {
prim_descr->striped = prim_descr->continuous && !pipe->stream->disable_cont_vf;
if ((pipe->config.default_capture_config.enable_xnr != 0) &&
(pipe->extra_config.enable_dvs_6axis == true))
prim_descr->enable_xnr = true;
#endif
if ((pipe->config.default_capture_config.enable_xnr != 0) &&
(pipe->extra_config.enable_dvs_6axis == true))
prim_descr->enable_xnr = true;
}
}
IA_CSS_LEAVE_PRIVATE("");
}
......@@ -855,14 +848,15 @@ void ia_css_pipe_get_ldc_binarydesc(
assert(out_info);
IA_CSS_ENTER_PRIVATE("");
#ifndef ISP2401
*in_info = *out_info;
#else
if (pipe->out_yuv_ds_input_info.res.width)
*in_info = pipe->out_yuv_ds_input_info;
else
if (!atomisp_hw_is_isp2401) {
*in_info = *out_info;
#endif
} else {
if (pipe->out_yuv_ds_input_info.res.width)
*in_info = pipe->out_yuv_ds_input_info;
else
*in_info = *out_info;
}
in_info->format = IA_CSS_FRAME_FORMAT_YUV420;
in_info->raw_bit_depth = 0;
ia_css_frame_info_set_width(in_info, in_info->res.width, 0);
......
......@@ -210,11 +210,9 @@ enum ia_css_err ia_css_util_check_input(
if (!stream_config)
return IA_CSS_ERR_INVALID_ARGUMENTS;
#ifdef IS_ISP_2400_SYSTEM
if (stream_config->input_config.effective_res.width == 0 ||
stream_config->input_config.effective_res.height == 0)
return IA_CSS_ERR_INVALID_ARGUMENTS;
#endif
if (must_be_raw &&
!ia_css_util_is_input_format_raw(stream_config->input_config.format))
return IA_CSS_ERR_INVALID_ARGUMENTS;
......
......@@ -19,7 +19,6 @@
#include "ia_css_dp.host.h"
#ifdef ISP2401
/* We use a different set of DPC configuration parameters when
* DPC is used before OBC and NORM. Currently these parameters
* are used in usecases which selects both BDS and DPC.
......@@ -32,7 +31,7 @@ const struct ia_css_dp_config default_dp_10bpp_config = {
32768,
32768
};
#endif
const struct ia_css_dp_config default_dp_config = {
8192,
2048,
......
......@@ -66,9 +66,6 @@ convert_coords_to_ispparams(
unsigned int uv_flag)
{
unsigned int i, j;
#ifndef ISP2401
/* Coverity CID 298073 - initialize */
#endif
gdc_warp_param_mem_t s = { 0 };
unsigned int x00, x01, x10, x11,
y00, y01, y10, y11;
......
#ifdef ISP2401
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 2015, Intel Corporation.
......@@ -92,4 +91,3 @@ ia_css_yuv444_io_config(
#endif
}
}
#endif
......@@ -16,12 +16,9 @@
#include "sh_css_defs.h"
#include "ia_css_debug.h"
#include "assert_support.h"
#ifdef ISP2401
#include "math_support.h" /* min() */
#define IA_CSS_INCLUDE_CONFIGURATIONS
#include "ia_css_isp_configs.h"
#endif
#include "ia_css_sc.host.h"
......@@ -46,7 +43,7 @@ ia_css_sc_dump(
"sc_gain_shift", sc->gain_shift);
}
#ifdef ISP2401
/* ISP2401 */
void
ia_css_sc_config(
struct sh_css_isp_sc_isp_config *to,
......@@ -70,6 +67,7 @@ ia_css_sc_config(
to->internal_frame_origin_y_bqs_on_sctbl = internal_org_y_bqs;
}
/* ISP2401 */
void
ia_css_sc_configure(
const struct ia_css_binary *binary,
......@@ -84,7 +82,6 @@ ia_css_sc_configure(
ia_css_configure_sc(binary, &config);
}
#endif
/* ------ deprecated(bz675) : from ------ */
/* It looks like @parameter{} (in *.pipe) is used to generate the process/get/set functions,
for parameters which should be used in the isp kernels.
......
......@@ -16,9 +16,7 @@
#include "math_support.h"
#include "sh_css_defs.h"
#include "ia_css_types.h"
#ifdef ISP2401
#include "assert_support.h"
#endif
#include "ia_css_xnr3.host.h"
/* Maximum value for alpha on ISP interface */
......@@ -30,7 +28,6 @@
#define XNR_MIN_SIGMA (IA_CSS_XNR3_SIGMA_SCALE / 100)
/*
#ifdef ISP2401
* division look-up table
* Refers to XNR3.0.5
*/
......@@ -79,27 +76,12 @@ static int32_t
compute_alpha(int sigma)
{
s32 alpha;
#if defined(XNR_ATE_ROUNDING_BUG)
s32 alpha_unscaled;
#else
int offset = sigma / 2;
#endif
if (sigma < XNR_MIN_SIGMA) {
alpha = XNR_MAX_ALPHA;
} else {
#if defined(XNR_ATE_ROUNDING_BUG)
/* The scale factor for alpha must be the same as on the ISP,
* For sigma, it must match the public interface. The code
* below mimics the rounding and unintended loss of precision
* of the ATE reference code. It computes an unscaled alpha,
* rounds down, and then scales it to get the required fixed
* point representation. It would have been more precise to
* round after scaling. */
alpha_unscaled = IA_CSS_XNR3_SIGMA_SCALE / sigma;
alpha = alpha_unscaled * XNR_ALPHA_SCALE_FACTOR;
#else
alpha = ((IA_CSS_XNR3_SIGMA_SCALE * XNR_ALPHA_SCALE_FACTOR) + offset) / sigma;
#endif
if (alpha > XNR_MAX_ALPHA)
alpha = XNR_MAX_ALPHA;
......@@ -200,7 +182,7 @@ ia_css_xnr3_encode(
to->blending.strength = blending;
}
#ifdef ISP2401
/* ISP2401 */
/* (void) = ia_css_xnr3_vmem_encode(*to, *from)
* -----------------------------------------------
* VMEM Encode Function to translate UV parameters from userspace into ISP space
......@@ -256,7 +238,6 @@ ia_css_xnr3_vmem_encode(
}
}
#endif
/* Dummy Function added as the tool expects it*/
void
ia_css_xnr3_debug_dtrace(
......
......@@ -46,7 +46,6 @@
* N.B. the 3 input formatters are of 2 different classess
*/
#define IS_ISP_2400_SYSTEM
/*
* Since this file is visible everywhere and the system definition
* macros are not, detect the separate definitions for {host, SP, ISP}
......
......@@ -52,7 +52,6 @@
#define USE_INPUT_SYSTEM_VERSION_2401
#define IS_ISP_2400_SYSTEM
/*
* Since this file is visible everywhere and the system definition
* macros are not, detect the separate definitions for {host, SP, ISP}
......
......@@ -27,13 +27,9 @@
#include "sh_css_legacy.h"
#include "vf/vf_1.0/ia_css_vf.host.h"
#ifdef ISP2401
#include "sc/sc_1.0/ia_css_sc.host.h"
#endif
#include "sdis/sdis_1.0/ia_css_sdis.host.h"
#ifdef ISP2401
#include "fixedbds/fixedbds_1.0/ia_css_fixedbds_param.h" /* FRAC_ACC */
#endif
#include "camera/pipe/interface/ia_css_pipe_binarydesc.h"
......@@ -108,7 +104,7 @@ ia_css_binary_internal_res(const struct ia_css_frame_info *in_info,
binary_dvs_env.height);
}
#ifndef ISP2401
/* ISP2400 */
/* Computation results of the origin coordinate of bayer on the shading table. */
struct sh_css_shading_table_bayer_origin_compute_results {
u32 bayer_scale_hor_ratio_in; /* Horizontal ratio (in) of bayer scaling. */
......@@ -117,7 +113,9 @@ struct sh_css_shading_table_bayer_origin_compute_results {
u32 bayer_scale_ver_ratio_out; /* Vertical ratio (out) of bayer scaling. */
u32 sc_bayer_origin_x_bqs_on_shading_table; /* X coordinate (in bqs) of bayer origin on shading table. */
u32 sc_bayer_origin_y_bqs_on_shading_table; /* Y coordinate (in bqs) of bayer origin on shading table. */
#else
};
/* ISP2401 */
/* Requirements for the shading correction. */
struct sh_css_binary_sc_requirements {
/* Bayer scaling factor, for the scaling which is applied before shading correction. */
......@@ -131,7 +129,6 @@ struct sh_css_binary_sc_requirements {
at shading correction. */
u32 sensor_data_origin_y_bqs_on_internal; /* Y origin (in bqs) of sensor data on internal frame
at shading correction. */
#endif
};
/* Get the requirements for the shading correction. */
......
......@@ -33,8 +33,6 @@ static char prefix[BUFQ_DUMP_FILE_NAME_PREFIX_SIZE] = {0};
/* Global Queue objects used by CSS */
/*********************************************************/
#ifndef ISP2401
struct sh_css_queues {
/* Host2SP buffer queue */
ia_css_queue_t host2sp_buffer_queue_handles
......@@ -60,36 +58,6 @@ struct sh_css_queues {
ia_css_queue_t host2sp_tag_cmd_queue_handle;
};
#else
struct sh_css_queues {
/* Host2SP buffer queue */
ia_css_queue_t host2sp_buffer_queue_handles
[SH_CSS_MAX_SP_THREADS][SH_CSS_MAX_NUM_QUEUES];
/* SP2Host buffer queue */
ia_css_queue_t sp2host_buffer_queue_handles
[SH_CSS_MAX_NUM_QUEUES];
/* Host2SP event queue */
ia_css_queue_t host2sp_psys_event_queue_handle;
/* SP2Host event queue */
ia_css_queue_t sp2host_psys_event_queue_handle;
#if !defined(HAS_NO_INPUT_SYSTEM)
/* Host2SP ISYS event queue */
ia_css_queue_t host2sp_isys_event_queue_handle;
/* SP2Host ISYS event queue */
ia_css_queue_t sp2host_isys_event_queue_handle;
/* Tagger command queue */
ia_css_queue_t host2sp_tag_cmd_queue_handle;
#endif
};
#endif
/*******************************************************
*** Static variables
********************************************************/
......
......@@ -39,9 +39,8 @@
#include "ia_css_isp_param.h"
#include "sh_css_params.h"
#include "ia_css_bufq.h"
#ifdef ISP2401
/* ISP2401 */
#include "ia_css_queue.h"
#endif
#include "ia_css_isp_params.h"
......@@ -3100,10 +3099,11 @@ ia_css_debug_dump_pipe_config(
ia_css_debug_dump_resolution(&config->capt_pp_in_res,
"capt_pp_in_res");
ia_css_debug_dump_resolution(&config->vf_pp_in_res, "vf_pp_in_res");
#ifdef ISP2401
ia_css_debug_dump_resolution(&config->output_system_in_res,
"output_system_in_res");
#endif
if (atomisp_hw_is_isp2401) {
ia_css_debug_dump_resolution(&config->output_system_in_res,
"output_system_in_res");
}
ia_css_debug_dump_resolution(&config->dvs_crop_out_res,
"dvs_crop_out_res");
for (i = 0; i < IA_CSS_PIPE_MAX_OUTPUT_STAGE; i++) {
......@@ -3295,10 +3295,8 @@ static void debug_dump_one_trace(enum TRACE_CORE_ID proc_id)
int i, j, max_trace_points, point_num, limit = -1;
/* using a static buffer here as the driver has issues allocating memory */
static u32 trace_read_buf[TRACE_BUFF_SIZE] = {0};
#ifdef ISP2401
static struct trace_header_t header;
u8 *header_arr;
#endif
/* read the header and parse it */
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "~~~ Tracer ");
......@@ -3329,27 +3327,27 @@ static void debug_dump_one_trace(enum TRACE_CORE_ID proc_id)
"\t\ttraces are not supported for this processor ID - exiting\n");
return;
}
#ifndef ISP2401
tmp = ia_css_device_load_uint32(start_addr);
point_num = (tmp >> 16) & 0xFFFF;
#endif
#ifndef ISP2401
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, " ver %d %d points\n", tmp & 0xFF,
point_num);
if ((tmp & 0xFF) != TRACER_VER) {
#else
/* Loading byte-by-byte as using the master routine had issues */
header_arr = (uint8_t *)&header;
for (i = 0; i < (int)sizeof(struct trace_header_t); i++)
header_arr[i] = ia_css_device_load_uint8(start_addr + (i));
if (!atomisp_hw_is_isp2401) {
tmp = ia_css_device_load_uint32(start_addr);
point_num = (tmp >> 16) & 0xFFFF;
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, " ver %d %d points\n", tmp & 0xFF,
point_num);
} else {
/* Loading byte-by-byte as using the master routine had issues */
header_arr = (uint8_t *)&header;
for (i = 0; i < (int)sizeof(struct trace_header_t); i++)
header_arr[i] = ia_css_device_load_uint8(start_addr + (i));
point_num = header.max_tracer_points;
point_num = header.max_tracer_points;
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, " ver %d %d points\n", header.version,
point_num);
if ((header.version & 0xFF) != TRACER_VER) {
#endif
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, " ver %d %d points\n", header.version,
point_num);
tmp = header.version;
}
if ((tmp & 0xFF) != TRACER_VER) {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "\t\tUnknown version - exiting\n");
return;
}
......@@ -3364,21 +3362,20 @@ static void debug_dump_one_trace(enum TRACE_CORE_ID proc_id)
if ((limit == (-1)) && (trace_read_buf[i] == 0))
limit = i;
}
#ifdef ISP2401
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "Status:\n");
for (i = 0; i < SH_CSS_MAX_SP_THREADS; i++)
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
"\tT%d: %3d (%02x) %6d (%04x) %10d (%08x)\n", i,
header.thr_status_byte[i], header.thr_status_byte[i],
header.thr_status_word[i], header.thr_status_word[i],
header.thr_status_dword[i], header.thr_status_dword[i]);
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "Scratch:\n");
for (i = 0; i < MAX_SCRATCH_DATA; i++)
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "%10d (%08x) ",
header.scratch_debug[i], header.scratch_debug[i]);
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "\n");
#endif
if (atomisp_hw_is_isp2401) {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "Status:\n");
for (i = 0; i < SH_CSS_MAX_SP_THREADS; i++)
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
"\tT%d: %3d (%02x) %6d (%04x) %10d (%08x)\n", i,
header.thr_status_byte[i], header.thr_status_byte[i],
header.thr_status_word[i], header.thr_status_word[i],
header.thr_status_dword[i], header.thr_status_dword[i]);
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "Scratch:\n");
for (i = 0; i < MAX_SCRATCH_DATA; i++)
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "%10d (%08x) ",
header.scratch_debug[i], header.scratch_debug[i]);
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "\n");
}
/* two 0s in the beginning: empty buffer */
if ((trace_read_buf[0] == 0) && (trace_read_buf[1] == 0)) {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "\t\tEmpty tracer - exiting\n");
......@@ -3398,114 +3395,83 @@ static void debug_dump_one_trace(enum TRACE_CORE_ID proc_id)
for (i = 0; i < point_num; i++) {
j = (limit + i) % point_num;
if (trace_read_buf[j]) {
#ifndef ISP2401
TRACE_DUMP_FORMAT dump_format = FIELD_FORMAT_UNPACK(trace_read_buf[j]);
#else
tid_val = FIELD_TID_UNPACK(trace_read_buf[j]);
dump_format = TRACE_DUMP_FORMAT_POINT;
/*
* When tid value is 111b, the data will be interpreted differently:
* tid val is ignored, major field contains 2 bits (msb) for format type
*/
if (tid_val == FIELD_TID_SEL_FORMAT_PAT) {
dump_format = FIELD_FORMAT_UNPACK(trace_read_buf[j]);
if (!atomisp_hw_is_isp2401) {
TRACE_DUMP_FORMAT dump_format = FIELD_FORMAT_UNPACK(trace_read_buf[j]);
} else {
tid_val = FIELD_TID_UNPACK(trace_read_buf[j]);
dump_format = TRACE_DUMP_FORMAT_POINT;
/*
* When tid value is 111b, the data will be interpreted differently:
* tid val is ignored, major field contains 2 bits (msb) for format type
*/
if (tid_val == FIELD_TID_SEL_FORMAT_PAT) {
dump_format = FIELD_FORMAT_UNPACK(trace_read_buf[j]);
}
}
#endif
switch (dump_format) {
case TRACE_DUMP_FORMAT_POINT:
ia_css_debug_dtrace(
#ifndef ISP2401
IA_CSS_DEBUG_TRACE, "\t\t%d %d:%d value - %d\n",
j, FIELD_MAJOR_UNPACK(trace_read_buf[j]),
#else
IA_CSS_DEBUG_TRACE, "\t\t%d T%d %d:%d value - %x (%d)\n",
j,
tid_val,
FIELD_MAJOR_UNPACK(trace_read_buf[j]),
#endif
FIELD_MINOR_UNPACK(trace_read_buf[j]),
#ifdef ISP2401
FIELD_VALUE_UNPACK(trace_read_buf[j]),
#endif
FIELD_VALUE_UNPACK(trace_read_buf[j]));
break;
#ifndef ISP2401
/* ISP2400 */
case TRACE_DUMP_FORMAT_VALUE24_HEX:
#else
case TRACE_DUMP_FORMAT_POINT_NO_TID:
#endif
ia_css_debug_dtrace(
#ifndef ISP2401
IA_CSS_DEBUG_TRACE, "\t\t%d, %d, 24bit value %x H\n",
#else
IA_CSS_DEBUG_TRACE, "\t\t%d %d:%d value - %x (%d)\n",
#endif
j,
#ifndef ISP2401
FIELD_MAJOR_UNPACK(trace_read_buf[j]),
FIELD_VALUE_24_UNPACK(trace_read_buf[j]));
#else
break;
/* ISP2400 */
case TRACE_DUMP_FORMAT_VALUE24_DEC:
ia_css_debug_dtrace(
IA_CSS_DEBUG_TRACE, "\t\t%d, %d, 24bit value %d D\n",
j,
FIELD_MAJOR_UNPACK(trace_read_buf[j]),
FIELD_VALUE_24_UNPACK(trace_read_buf[j]));
break;
/* ISP2401 */
case TRACE_DUMP_FORMAT_POINT_NO_TID:
ia_css_debug_dtrace(
IA_CSS_DEBUG_TRACE, "\t\t%d %d:%d value - %x (%d)\n",
j,
FIELD_MAJOR_W_FMT_UNPACK(trace_read_buf[j]),
FIELD_MINOR_UNPACK(trace_read_buf[j]),
FIELD_VALUE_UNPACK(trace_read_buf[j]),
FIELD_VALUE_UNPACK(trace_read_buf[j]));
#endif
break;
#ifndef ISP2401
case TRACE_DUMP_FORMAT_VALUE24_DEC:
#else
/* ISP2401 */
case TRACE_DUMP_FORMAT_VALUE24:
#endif
ia_css_debug_dtrace(
#ifndef ISP2401
IA_CSS_DEBUG_TRACE, "\t\t%d, %d, 24bit value %d D\n",
#else
IA_CSS_DEBUG_TRACE, "\t\t%d, %d, 24bit value %x (%d)\n",
#endif
j,
FIELD_MAJOR_UNPACK(trace_read_buf[j]),
#ifdef ISP2401
FIELD_MAJOR_W_FMT_UNPACK(trace_read_buf[j]),
FIELD_VALUE_24_UNPACK(trace_read_buf[j]),
#endif
FIELD_VALUE_24_UNPACK(trace_read_buf[j]));
break;
#ifdef ISP2401
#endif
case TRACE_DUMP_FORMAT_VALUE24_TIMING:
ia_css_debug_dtrace(
IA_CSS_DEBUG_TRACE, "\t\t%d, %d, timing %x\n",
j,
#ifndef ISP2401
FIELD_MAJOR_UNPACK(trace_read_buf[j]),
#else
FIELD_MAJOR_W_FMT_UNPACK(trace_read_buf[j]),
#endif
FIELD_VALUE_24_UNPACK(trace_read_buf[j]));
break;
case TRACE_DUMP_FORMAT_VALUE24_TIMING_DELTA:
ia_css_debug_dtrace(
IA_CSS_DEBUG_TRACE, "\t\t%d, %d, timing delta %x\n",
j,
#ifndef ISP2401
FIELD_MAJOR_UNPACK(trace_read_buf[j]),
#else
FIELD_MAJOR_W_FMT_UNPACK(trace_read_buf[j]),
#endif
FIELD_VALUE_24_UNPACK(trace_read_buf[j]));
break;
default:
ia_css_debug_dtrace(
IA_CSS_DEBUG_TRACE,
"no such trace dump format %d",
#ifndef ISP2401
FIELD_FORMAT_UNPACK(trace_read_buf[j]));
#else
dump_format);
#endif
break;
}
}
......@@ -3557,7 +3523,7 @@ void ia_css_debug_tagger_state(void)
}
#endif /* defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401) */
#ifdef ISP2401
/* ISP2401 */
void ia_css_debug_pc_dump(sp_ID_t id, unsigned int num_of_dumps)
{
unsigned int pc;
......@@ -3572,7 +3538,6 @@ void ia_css_debug_pc_dump(sp_ID_t id, unsigned int num_of_dumps)
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "SP%-1d PC: 0x%X\n", id, pc);
}
}
#endif
#if defined(HRT_SCHED) || defined(SH_CSS_DEBUG_SPMEM_DUMP_SUPPORT)
#include "spmem_dump.c"
......
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
* Copyright (c) 2010 - 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,
......@@ -12,21 +11,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/
#endif
#include "sh_css_sp.h"
......
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
......@@ -12,21 +11,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/
#endif
#include "ia_css_frame.h"
#include <math_support.h>
......@@ -146,21 +130,12 @@ enum ia_css_err ia_css_frame_allocate(struct ia_css_frame **frame,
return IA_CSS_ERR_INVALID_ARGUMENTS;
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
#ifndef ISP2401
"ia_css_frame_allocate() enter: width=%d, height=%d, format=%d\n",
width, height, format);
#else
"ia_css_frame_allocate() enter: width=%d, height=%d, format=%d, padded_width=%d, raw_bit_depth=%d\n",
width, height, format, padded_width, raw_bit_depth);
#endif
err = frame_allocate_with_data(frame, width, height, format,
padded_width, raw_bit_depth, false);
#ifndef ISP2401
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
"ia_css_frame_allocate() leave: frame=%p\n", *frame);
#else
if ((*frame) && err == IA_CSS_SUCCESS)
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
"ia_css_frame_allocate() leave: frame=%p, data(DDR address)=0x%x\n", *frame,
......@@ -169,7 +144,6 @@ enum ia_css_err ia_css_frame_allocate(struct ia_css_frame **frame,
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
"ia_css_frame_allocate() leave: frame=%p, data(DDR address)=0x%x\n",
(void *)-1, (unsigned int)-1);
#endif
return err;
}
......@@ -202,11 +176,7 @@ enum ia_css_err ia_css_frame_map(struct ia_css_frame **frame,
if (err != IA_CSS_SUCCESS) {
sh_css_free(me);
#ifndef ISP2401
return err;
#else
me = NULL;
#endif
}
*frame = me;
......@@ -243,25 +213,17 @@ enum ia_css_err ia_css_frame_create_from_info(struct ia_css_frame **frame,
err = ia_css_frame_init_planes(me);
#ifndef ISP2401
if (err == IA_CSS_SUCCESS)
*frame = me;
else
#else
if (err != IA_CSS_SUCCESS) {
#endif
sh_css_free(me);
#ifdef ISP2401
me = NULL;
}
me = NULL;
}
*frame = me;
#endif
*frame = me;
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
"ia_css_frame_create_from_info() leave:\n");
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
"ia_css_frame_create_from_info() leave:\n");
return err;
return err;
}
enum ia_css_err ia_css_frame_set_data(struct ia_css_frame *frame,
......@@ -306,13 +268,8 @@ enum ia_css_err ia_css_frame_allocate_contiguous(struct ia_css_frame **frame,
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
"ia_css_frame_allocate_contiguous() "
#ifndef ISP2401
"enter: width=%d, height=%d, format=%d\n",
width, height, format);
#else
"enter: width=%d, height=%d, format=%d, padded_width=%d, raw_bit_depth=%d\n",
width, height, format, padded_width, raw_bit_depth);
#endif
err = frame_allocate_with_data(frame, width, height, format,
padded_width, raw_bit_depth, true);
......@@ -581,11 +538,7 @@ enum ia_css_err ia_css_frame_allocate_with_buffer_size(
if (err != IA_CSS_SUCCESS) {
sh_css_free(me);
#ifndef ISP2401
return err;
#else
me = NULL;
#endif
}
*frame = me;
......@@ -965,8 +918,7 @@ void ia_css_resolution_to_sp_resolution(
to->height = (uint16_t)from->height;
}
#ifdef ISP2401
/* ISP2401 */
enum ia_css_err
ia_css_frame_find_crop_resolution(const struct ia_css_resolution *in_res,
const struct ia_css_resolution *out_res,
......@@ -1035,4 +987,3 @@ ia_css_frame_find_crop_resolution(const struct ia_css_resolution *in_res,
crop_res->height, out_res->width, out_res->height);
return IA_CSS_SUCCESS;
}
#endif
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
* Copyright (c) 2010 - 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,
......@@ -12,21 +11,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/
#endif
#include "system_global.h"
#include <linux/kernel.h>
......@@ -492,10 +476,6 @@ static void ifmtr_set_if_blocking_mode(
assert(N_INPUT_FORMATTER_ID <= (ARRAY_SIZE(block)));
#if !defined(IS_ISP_2400_SYSTEM)
#error "ifmtr_set_if_blocking_mode: ISP_SYSTEM must be one of {IS_ISP_2400_SYSTEM}"
#endif
block[INPUT_FORMATTER0_ID] = (bool)config_a->block_no_reqs;
if (config_b)
block[INPUT_FORMATTER1_ID] = (bool)config_b->block_no_reqs;
......
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
* Copyright (c) 2010 - 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,
......@@ -12,21 +11,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/
#endif
#include "platform_support.h"
......@@ -195,38 +179,6 @@ static void inputfifo_send_eof(void)
return;
}
#ifdef __ON__
static void inputfifo_send_ch_id(
/* static inline void inputfifo_send_ch_id( */
unsigned int ch_id)
{
hrt_data token;
inputfifo_curr_ch_id = ch_id & _HIVE_ISP_CH_ID_MASK;
/* we send an zero marker, this will wrap the ch_id and
* fmt_type automatically.
*/
token = inputfifo_wrap_marker(0);
_sh_css_fifo_snd(token);
return;
}
static void inputfifo_send_fmt_type(
/* static inline void inputfifo_send_fmt_type( */
unsigned int fmt_type)
{
hrt_data token;
inputfifo_curr_fmt_type = fmt_type & _HIVE_ISP_FMT_TYPE_MASK;
/* we send an zero marker, this will wrap the ch_id and
* fmt_type automatically.
*/
token = inputfifo_wrap_marker(0);
_sh_css_fifo_snd(token);
return;
}
#endif /* __ON__ */
static void inputfifo_send_ch_id_and_fmt_type(
/* static inline
void inputfifo_send_ch_id_and_fmt_type( */
......
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
* Copyright (c) 2010 - 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,
......@@ -12,21 +11,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/
#endif
#include "memory_access.h"
#include "ia_css_pipeline.h"
......
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
* Copyright (c) 2010 - 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,
......@@ -12,21 +11,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/
#endif
#include "system_global.h"
......
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
......@@ -12,26 +11,9 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2010 - 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.
*/
#endif
#include "system_global.h"
#ifdef USE_INPUT_SYSTEM_VERSION_2401
#include "assert_support.h"
#include "platform_support.h"
#include "ia_css_isys.h"
......@@ -137,4 +119,3 @@ void ia_css_isys_ibuf_rmgr_release(
}
}
}
#endif
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
* Copyright (c) 2010 - 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,
......@@ -12,21 +11,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/
#endif
#include "system_global.h"
......
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
* Copyright (c) 2010 - 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,
......@@ -12,21 +11,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/
#endif
#include "input_system.h"
......
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
* Copyright (c) 2010 - 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,
......@@ -12,21 +11,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/
#endif
#include "system_global.h"
......
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
* Copyright (c) 2010 - 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,
......@@ -12,21 +11,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/
#endif
#define __INLINE_INPUT_SYSTEM__
#include "input_system.h"
......
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
......@@ -12,21 +11,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/
#endif
#include "system_global.h"
......@@ -45,9 +29,7 @@ more details.
* Forwarded Declaration
*
*************************************************/
#ifndef ISP2401
#endif
static bool create_input_system_channel(
input_system_cfg_t *cfg,
bool metadata,
......
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
* Copyright (c) 2010 - 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,
......@@ -12,21 +11,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/
#endif
#include "ia_css_debug.h"
#include "sw_event_global.h" /* encode_sw_event */
......
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
* Copyright (c) 2010 - 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,
......@@ -12,21 +11,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/
#endif
#include "type_support.h"
#include "queue_access.h"
......
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
* Copyright (c) 2010 - 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,
......@@ -12,21 +11,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/
#endif
#include "ia_css_rmgr.h"
......
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
* Copyright (c) 2010 - 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,
......@@ -12,21 +11,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/
#endif
#include "ia_css_types.h"
#define __INLINE_SP__
......@@ -115,7 +99,7 @@ enum ia_css_err ia_css_spctrl_load_fw(sp_ID_t sp_id,
return IA_CSS_SUCCESS;
}
#ifdef ISP2401
/* ISP2401 */
/* reload pre-loaded FW */
void sh_css_spctrl_reload_fw(sp_ID_t sp_id)
{
......@@ -127,7 +111,6 @@ void sh_css_spctrl_reload_fw(sp_ID_t sp_id)
sp_ctrl_setbit(sp_id, SP_ICACHE_INV_REG, SP_ICACHE_INV_BIT);
spctrl_loaded[sp_id] = true;
}
#endif
hrt_vaddress get_sp_code_addr(sp_ID_t sp_id)
{
......
#ifndef ISP2401
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
......@@ -12,21 +11,6 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/
#else
/*
Support for Intel Camera Imaging ISP subsystem.
Copyright (c) 2010 - 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.
*/
#endif
#include <type_support.h> /* for uint32_t */
#include "ia_css_timer.h" /*struct ia_css_clock_tick */
......
......@@ -580,13 +580,11 @@ sh_css_config_input_network(struct ia_css_stream *stream) {
vblank_cycles = vblank_lines * (width + hblank_cycles);
sh_css_sp_configure_sync_gen(width, height, hblank_cycles,
vblank_cycles);
#if defined(IS_ISP_2400_SYSTEM)
if (pipe->stream->config.mode == IA_CSS_INPUT_MODE_TPG) {
/* TODO: move define to proper file in tools */
#define GP_ISEL_TPG_MODE 0x90058
ia_css_device_store_uint32(GP_ISEL_TPG_MODE, 0);
}
#endif
}
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
"sh_css_config_input_network() leave:\n");
......
......@@ -52,12 +52,8 @@ static struct firmware_header *firmware_header;
/* The string STR is a place holder
* which will be replaced with the actual RELEASE_VERSION
* during package generation. Please do not modify */
#ifndef ISP2401
static const char *release_version = STR(
irci_stable_candrpv_0415_20150521_0458);
#else
static const char *release_version = STR(irci_ecr - master_20150911_0724);
#endif
static const char *isp2400_release_version = STR(irci_stable_candrpv_0415_20150521_0458);
static const char *isp2401_release_version = STR(irci_ecr - master_20150911_0724);
#define MAX_FW_REL_VER_NAME 300
static char FW_rel_ver_name[MAX_FW_REL_VER_NAME] = "---";
......@@ -189,6 +185,13 @@ sh_css_check_firmware_version(const char *fw_data)
{
struct sh_css_fw_bi_file_h *file_header;
const char *release_version;
if (!atomisp_hw_is_isp2401)
release_version = isp2400_release_version;
else
release_version = isp2401_release_version;
firmware_header = (struct firmware_header *)fw_data;
file_header = &firmware_header->file_header;
......@@ -207,21 +210,23 @@ sh_css_load_firmware(const char *fw_data,
struct ia_css_fw_info *binaries;
struct sh_css_fw_bi_file_h *file_header;
bool valid_firmware = false;
const char *release_version;
if (!atomisp_hw_is_isp2401)
release_version = isp2400_release_version;
else
release_version = isp2401_release_version;
firmware_header = (struct firmware_header *)fw_data;
file_header = &firmware_header->file_header;
binaries = &firmware_header->binary_header;
strncpy(FW_rel_ver_name, file_header->version, min(sizeof(FW_rel_ver_name), sizeof(file_header->version)) - 1);
valid_firmware = sh_css_check_firmware_version(fw_data);
if (!valid_firmware)
{
#if !defined(HRT_RTL)
if (!valid_firmware) {
IA_CSS_ERROR("CSS code version (%s) and firmware version (%s) mismatch!",
file_header->version, release_version);
return IA_CSS_ERR_VERSION_MISMATCH;
#endif
} else
{
} else {
IA_CSS_LOG("successfully load firmware version %s", release_version);
}
......@@ -241,8 +246,7 @@ sh_css_load_firmware(const char *fw_data,
sizeof(*sh_css_blob_info), GFP_KERNEL);
if (!sh_css_blob_info)
return IA_CSS_ERR_CANNOT_ALLOCATE_MEMORY;
} else
{
} else {
sh_css_blob_info = NULL;
}
......
......@@ -45,8 +45,6 @@ ia_css_mipi_frame_specify(const unsigned int size_mem_words,
return err;
}
#ifdef ISP2401
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
/*
* Check if a source port or TPG/PRBS ID is valid
*/
......@@ -87,9 +85,7 @@ static bool ia_css_mipi_is_source_port_valid(struct ia_css_pipe *pipe,
return ret;
}
#endif
#endif
/* Assumptions:
* - A line is multiple of 4 bytes = 1 word.
* - Each frame has SOF and EOF (each 1 word).
......@@ -317,10 +313,8 @@ calculate_mipi_buff_size(
enum ia_css_err err = IA_CSS_SUCCESS;
/**
#ifndef ISP2401
* zhengjie.lu@intel.com
*
#endif
* NOTE
* - In the struct "ia_css_stream_config", there
* are two members: "input_config" and "isys_config".
......@@ -336,10 +330,8 @@ calculate_mipi_buff_size(
/* end of NOTE */
/**
#ifndef ISP2401
* zhengjie.lu@intel.com
*
#endif
* NOTE
* - The following code is derived from the
* existing code "ia_css_mipi_frame_calculate_size()".
......@@ -396,16 +388,29 @@ calculate_mipi_buff_size(
return err;
}
static bool buffers_needed(struct ia_css_pipe *pipe)
{
if (!atomisp_hw_is_isp2401) {
if (pipe->stream->config.mode == IA_CSS_INPUT_MODE_BUFFERED_SENSOR)
return false;
else
return true;
}
if (pipe->stream->config.mode == IA_CSS_INPUT_MODE_BUFFERED_SENSOR ||
pipe->stream->config.mode == IA_CSS_INPUT_MODE_TPG ||
pipe->stream->config.mode == IA_CSS_INPUT_MODE_PRBS)
return false;
return true;
}
enum ia_css_err
allocate_mipi_frames(struct ia_css_pipe *pipe,
struct ia_css_stream_info *info) {
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
enum ia_css_err err = IA_CSS_ERR_INTERNAL_ERROR;
#ifndef ISP2401
unsigned int port;
#else
unsigned int port = 0;
#endif
struct ia_css_frame_info mipi_intermediate_info;
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
......@@ -431,30 +436,22 @@ allocate_mipi_frames(struct ia_css_pipe *pipe,
}
#endif
#ifndef ISP2401
if (pipe->stream->config.mode != IA_CSS_INPUT_MODE_BUFFERED_SENSOR)
{
#else
if (!(pipe->stream->config.mode == IA_CSS_INPUT_MODE_BUFFERED_SENSOR ||
pipe->stream->config.mode == IA_CSS_INPUT_MODE_TPG ||
pipe->stream->config.mode == IA_CSS_INPUT_MODE_PRBS))
{
#endif
if (!buffers_needed(pipe)) {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
"allocate_mipi_frames(%p) exit: no buffers needed for pipe mode.\n",
pipe);
return IA_CSS_SUCCESS; /* AM TODO: Check */
}
#ifndef ISP2401
port = (unsigned int)pipe->stream->config.source.port.port;
if (!atomisp_hw_is_isp2401)
port = (unsigned int)pipe->stream->config.source.port.port;
else
err = ia_css_mipi_is_source_port_valid(pipe, &port);
assert(port < N_CSI_PORTS);
if (port >= N_CSI_PORTS)
{
#else
if (!ia_css_mipi_is_source_port_valid(pipe, &port))
{
#endif
if (port >= N_CSI_PORTS || err) {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
"allocate_mipi_frames(%p) exit: error: port is not correct (port=%d).\n",
pipe, port);
......@@ -573,11 +570,8 @@ enum ia_css_err
free_mipi_frames(struct ia_css_pipe *pipe) {
#if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401)
enum ia_css_err err = IA_CSS_ERR_INTERNAL_ERROR;
#ifndef ISP2401
unsigned int port;
#else
unsigned int port = 0;
#endif
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
"free_mipi_frames(%p) enter:\n", pipe);
......@@ -592,38 +586,27 @@ free_mipi_frames(struct ia_css_pipe *pipe) {
return IA_CSS_ERR_INVALID_ARGUMENTS;
}
#ifndef ISP2401
if (pipe->stream->config.mode != IA_CSS_INPUT_MODE_BUFFERED_SENSOR) {
#else
if (!(pipe->stream->config.mode == IA_CSS_INPUT_MODE_BUFFERED_SENSOR ||
pipe->stream->config.mode == IA_CSS_INPUT_MODE_TPG ||
pipe->stream->config.mode == IA_CSS_INPUT_MODE_PRBS)) {
#endif
if (!buffers_needed(pipe)) {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
"free_mipi_frames(%p) exit: error: wrong mode.\n",
pipe);
return err;
}
#ifndef ISP2401
port = (unsigned int)pipe->stream->config.source.port.port;
if (!atomisp_hw_is_isp2401)
port = (unsigned int)pipe->stream->config.source.port.port;
else
err = ia_css_mipi_is_source_port_valid(pipe, &port);
assert(port < N_CSI_PORTS);
if (port >= N_CSI_PORTS) {
#else
if (!ia_css_mipi_is_source_port_valid(pipe, &port)) {
#endif
if (port >= N_CSI_PORTS || err) {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
#ifndef ISP2401
"free_mipi_frames(%p, %d) exit: error: pipe port is not correct.\n",
#else
"free_mipi_frames(%p) exit: error: pipe port is not correct (port=%d).\n",
#endif
pipe, port);
return err;
}
#ifdef ISP2401
#endif
if (ref_count_mipi_allocation[port] > 0) {
#if defined(USE_INPUT_SYSTEM_VERSION_2)
assert(ref_count_mipi_allocation[port] == 1);
......@@ -720,32 +703,22 @@ send_mipi_frames(struct ia_css_pipe *pipe) {
/* multi stream video needs mipi buffers */
/* nothing to be done in other cases. */
#ifndef ISP2401
if (pipe->stream->config.mode != IA_CSS_INPUT_MODE_BUFFERED_SENSOR)
{
#else
if (!(pipe->stream->config.mode == IA_CSS_INPUT_MODE_BUFFERED_SENSOR ||
pipe->stream->config.mode == IA_CSS_INPUT_MODE_TPG ||
pipe->stream->config.mode == IA_CSS_INPUT_MODE_PRBS))
{
#endif
if (!buffers_needed(pipe)) {
IA_CSS_LOG("nothing to be done for this mode");
return IA_CSS_SUCCESS;
/* TODO: AM: maybe this should be returning an error. */
}
#ifndef ISP2401
port = (unsigned int)pipe->stream->config.source.port.port;
if (!atomisp_hw_is_isp2401)
port = (unsigned int)pipe->stream->config.source.port.port;
else
err = ia_css_mipi_is_source_port_valid(pipe, &port);
assert(port < N_CSI_PORTS);
if (port >= N_CSI_PORTS)
{
IA_CSS_ERROR("invalid port specified (%d)", port);
#else
if (!ia_css_mipi_is_source_port_valid(pipe, &port))
{
if (port >= N_CSI_PORTS || err) {
IA_CSS_ERROR("send_mipi_frames(%p) exit: invalid port specified (port=%d).\n",
pipe, port);
#endif
return err;
}
......
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