media: atomisp: make all file names unique at atomisp driver
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 29 Apr 2020 19:55:48 +0000 (21:55 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 20 May 2020 10:32:19 +0000 (12:32 +0200)
The *system_*.h files contain ISP-specific definitions, and are
used everywhere.

While the best would be to get rid of those in favor of some
ISP-specific structs, a change like that would require lots
of changes.

So, instead, let's rename those files replacing them by new
ones with ISP ifdefs on it, in order to select between the
two different versions.

We shall later convert this to some abrstraction layer,
but this change should help to be able to build support for
either ISP2400 or ISP2401.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
28 files changed:
drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/host/input_system_local.h [deleted file]
drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/host/input_system_private.h [deleted file]
drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/host/system_local.h [deleted file]
drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/input_system_global.h [deleted file]
drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/system_global.h [deleted file]
drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system_local.h [deleted file]
drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system_private.h [deleted file]
drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/system_local.h [deleted file]
drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_system_global.h [deleted file]
drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/system_global.h [deleted file]
drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/input_system_public.h [deleted file]
drivers/staging/media/atomisp/pci/atomisp2/css2400/input_system_global.h [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp2/css2400/input_system_local.h [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp2/css2400/input_system_private.h [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp2/css2400/input_system_public.h [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2400_input_system_local.h [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2400_input_system_private.h [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2400_input_system_public.h [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2400_system_global.h [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2400_system_local.h [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2401_input_system_global.h [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2401_input_system_local.h [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2401_input_system_private.h [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2401_system_global.h [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2401_system_local.h [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp2/css2400/system_global.h [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp2/css2400/system_local.h [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp2/isp2400_input_system_global.h [new file with mode: 0644]

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/host/input_system_local.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/host/input_system_local.h
deleted file mode 100644 (file)
index f199423..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Support for Intel Camera Imaging ISP subsystem.
- * Copyright (c) 2015, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- */
-
-#ifndef __INPUT_SYSTEM_LOCAL_H_INCLUDED__
-#define __INPUT_SYSTEM_LOCAL_H_INCLUDED__
-
-#include "type_support.h"
-#include "input_system_global.h"
-
-#include "ibuf_ctrl.h"
-#include "csi_rx.h"
-#include "pixelgen.h"
-#include "isys_stream2mmio.h"
-#include "isys_irq.h"
-
-typedef input_system_err_t input_system_error_t;
-
-typedef enum {
-       MIPI_FORMAT_SHORT1 = 0x08,
-       MIPI_FORMAT_SHORT2,
-       MIPI_FORMAT_SHORT3,
-       MIPI_FORMAT_SHORT4,
-       MIPI_FORMAT_SHORT5,
-       MIPI_FORMAT_SHORT6,
-       MIPI_FORMAT_SHORT7,
-       MIPI_FORMAT_SHORT8,
-       MIPI_FORMAT_EMBEDDED = 0x12,
-       MIPI_FORMAT_YUV420_8 = 0x18,
-       MIPI_FORMAT_YUV420_10,
-       MIPI_FORMAT_YUV420_8_LEGACY,
-       MIPI_FORMAT_YUV420_8_SHIFT = 0x1C,
-       MIPI_FORMAT_YUV420_10_SHIFT,
-       MIPI_FORMAT_YUV422_8 = 0x1E,
-       MIPI_FORMAT_YUV422_10,
-       MIPI_FORMAT_RGB444 = 0x20,
-       MIPI_FORMAT_RGB555,
-       MIPI_FORMAT_RGB565,
-       MIPI_FORMAT_RGB666,
-       MIPI_FORMAT_RGB888,
-       MIPI_FORMAT_RAW6 = 0x28,
-       MIPI_FORMAT_RAW7,
-       MIPI_FORMAT_RAW8,
-       MIPI_FORMAT_RAW10,
-       MIPI_FORMAT_RAW12,
-       MIPI_FORMAT_RAW14,
-       MIPI_FORMAT_CUSTOM0 = 0x30,
-       MIPI_FORMAT_CUSTOM1,
-       MIPI_FORMAT_CUSTOM2,
-       MIPI_FORMAT_CUSTOM3,
-       MIPI_FORMAT_CUSTOM4,
-       MIPI_FORMAT_CUSTOM5,
-       MIPI_FORMAT_CUSTOM6,
-       MIPI_FORMAT_CUSTOM7,
-       //MIPI_FORMAT_RAW16, /*not supported by 2401*/
-       //MIPI_FORMAT_RAW18,
-       N_MIPI_FORMAT
-} mipi_format_t;
-
-#define N_MIPI_FORMAT_CUSTOM   8
-
-/* The number of stores for compressed format types */
-#define        N_MIPI_COMPRESSOR_CONTEXT       (N_RX_CHANNEL_ID * N_MIPI_FORMAT_CUSTOM)
-#define UNCOMPRESSED_BITS_PER_PIXEL_10 10
-#define UNCOMPRESSED_BITS_PER_PIXEL_12 12
-#define COMPRESSED_BITS_PER_PIXEL_6    6
-#define COMPRESSED_BITS_PER_PIXEL_7    7
-#define COMPRESSED_BITS_PER_PIXEL_8    8
-enum mipi_compressor {
-       MIPI_COMPRESSOR_NONE = 0,
-       MIPI_COMPRESSOR_10_6_10,
-       MIPI_COMPRESSOR_10_7_10,
-       MIPI_COMPRESSOR_10_8_10,
-       MIPI_COMPRESSOR_12_6_12,
-       MIPI_COMPRESSOR_12_7_12,
-       MIPI_COMPRESSOR_12_8_12,
-       N_MIPI_COMPRESSOR_METHODS
-};
-
-typedef enum {
-       MIPI_PREDICTOR_NONE = 0,
-       MIPI_PREDICTOR_TYPE1,
-       MIPI_PREDICTOR_TYPE2,
-       N_MIPI_PREDICTOR_TYPES
-} mipi_predictor_t;
-
-typedef struct input_system_state_s    input_system_state_t;
-struct input_system_state_s {
-       ibuf_ctrl_state_t       ibuf_ctrl_state[N_IBUF_CTRL_ID];
-       csi_rx_fe_ctrl_state_t  csi_rx_fe_ctrl_state[N_CSI_RX_FRONTEND_ID];
-       csi_rx_be_ctrl_state_t  csi_rx_be_ctrl_state[N_CSI_RX_BACKEND_ID];
-       pixelgen_ctrl_state_t   pixelgen_ctrl_state[N_PIXELGEN_ID];
-       stream2mmio_state_t     stream2mmio_state[N_STREAM2MMIO_ID];
-       isys_irqc_state_t       isys_irqc_state[N_ISYS_IRQ_ID];
-};
-#endif /* __INPUT_SYSTEM_LOCAL_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/host/input_system_private.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/host/input_system_private.h
deleted file mode 100644 (file)
index 3f60f59..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Support for Intel Camera Imaging ISP subsystem.
- * Copyright (c) 2015, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- */
-
-#ifndef __INPUT_SYSTEM_PRIVATE_H_INCLUDED__
-#define __INPUT_SYSTEM_PRIVATE_H_INCLUDED__
-
-#include "input_system_public.h"
-
-STORAGE_CLASS_INPUT_SYSTEM_C input_system_err_t input_system_get_state(
-    const input_system_ID_t    ID,
-    input_system_state_t *state)
-{
-       u32 i;
-
-       (void)(ID);
-
-       /*  get the states of all CSI RX frontend devices */
-       for (i = 0; i < N_CSI_RX_FRONTEND_ID; i++) {
-               csi_rx_fe_ctrl_get_state(
-                   (csi_rx_frontend_ID_t)i,
-                   &state->csi_rx_fe_ctrl_state[i]);
-       }
-
-       /*  get the states of all CIS RX backend devices */
-       for (i = 0; i < N_CSI_RX_BACKEND_ID; i++) {
-               csi_rx_be_ctrl_get_state(
-                   (csi_rx_backend_ID_t)i,
-                   &state->csi_rx_be_ctrl_state[i]);
-       }
-
-       /* get the states of all pixelgen devices */
-       for (i = 0; i < N_PIXELGEN_ID; i++) {
-               pixelgen_ctrl_get_state(
-                   (pixelgen_ID_t)i,
-                   &state->pixelgen_ctrl_state[i]);
-       }
-
-       /* get the states of all stream2mmio devices */
-       for (i = 0; i < N_STREAM2MMIO_ID; i++) {
-               stream2mmio_get_state(
-                   (stream2mmio_ID_t)i,
-                   &state->stream2mmio_state[i]);
-       }
-
-       /* get the states of all ibuf-controller devices */
-       for (i = 0; i < N_IBUF_CTRL_ID; i++) {
-               ibuf_ctrl_get_state(
-                   (ibuf_ctrl_ID_t)i,
-                   &state->ibuf_ctrl_state[i]);
-       }
-
-       /* get the states of all isys irq controllers */
-       for (i = 0; i < N_ISYS_IRQ_ID; i++) {
-               isys_irqc_state_get((isys_irq_ID_t)i, &state->isys_irqc_state[i]);
-       }
-
-       /* TODO: get the states of all ISYS2401 DMA devices  */
-       for (i = 0; i < N_ISYS2401_DMA_ID; i++) {
-       }
-
-       return INPUT_SYSTEM_ERR_NO_ERROR;
-}
-
-STORAGE_CLASS_INPUT_SYSTEM_C void input_system_dump_state(
-    const input_system_ID_t    ID,
-    input_system_state_t *state)
-{
-       u32 i;
-
-       (void)(ID);
-
-       /*  dump the states of all CSI RX frontend devices */
-       for (i = 0; i < N_CSI_RX_FRONTEND_ID; i++) {
-               csi_rx_fe_ctrl_dump_state(
-                   (csi_rx_frontend_ID_t)i,
-                   &state->csi_rx_fe_ctrl_state[i]);
-       }
-
-       /*  dump the states of all CIS RX backend devices */
-       for (i = 0; i < N_CSI_RX_BACKEND_ID; i++) {
-               csi_rx_be_ctrl_dump_state(
-                   (csi_rx_backend_ID_t)i,
-                   &state->csi_rx_be_ctrl_state[i]);
-       }
-
-       /* dump the states of all pixelgen devices */
-       for (i = 0; i < N_PIXELGEN_ID; i++) {
-               pixelgen_ctrl_dump_state(
-                   (pixelgen_ID_t)i,
-                   &state->pixelgen_ctrl_state[i]);
-       }
-
-       /* dump the states of all st2mmio devices */
-       for (i = 0; i < N_STREAM2MMIO_ID; i++) {
-               stream2mmio_dump_state(
-                   (stream2mmio_ID_t)i,
-                   &state->stream2mmio_state[i]);
-       }
-
-       /* dump the states of all ibuf-controller devices */
-       for (i = 0; i < N_IBUF_CTRL_ID; i++) {
-               ibuf_ctrl_dump_state(
-                   (ibuf_ctrl_ID_t)i,
-                   &state->ibuf_ctrl_state[i]);
-       }
-
-       /* dump the states of all isys irq controllers */
-       for (i = 0; i < N_ISYS_IRQ_ID; i++) {
-               isys_irqc_state_dump((isys_irq_ID_t)i, &state->isys_irqc_state[i]);
-       }
-
-       /* TODO: dump the states of all ISYS2401 DMA devices  */
-       for (i = 0; i < N_ISYS2401_DMA_ID; i++) {
-       }
-
-       return;
-}
-#endif /* __INPUT_SYSTEM_PRIVATE_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/host/system_local.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/host/system_local.h
deleted file mode 100644 (file)
index 4bd95b8..0000000
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
- * Support for Intel Camera Imaging ISP subsystem.
- * Copyright (c) 2015, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- */
-
-#ifndef __SYSTEM_LOCAL_H_INCLUDED__
-#define __SYSTEM_LOCAL_H_INCLUDED__
-
-#ifdef HRT_ISP_CSS_CUSTOM_HOST
-#ifndef HRT_USE_VIR_ADDRS
-#define HRT_USE_VIR_ADDRS
-#endif
-/* This interface is deprecated */
-/*#include "hive_isp_css_custom_host_hrt.h"*/
-#endif
-
-#include "system_global.h"
-
-#define HRT_ADDRESS_WIDTH      64              /* Surprise, this is a local property */
-
-/* This interface is deprecated */
-#include "hive_types.h"
-
-/*
- * Cell specific address maps
- */
-#if HRT_ADDRESS_WIDTH == 64
-
-#define GP_FIFO_BASE   ((hrt_address)0x0000000000090104)               /* This is NOT a base address */
-
-/* DDR */
-static const hrt_address DDR_BASE[N_DDR_ID] = {
-       0x0000000120000000ULL
-};
-
-/* ISP */
-static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
-       0x0000000000020000ULL
-};
-
-static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
-       0x0000000000200000ULL
-};
-
-static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
-       0x0000000000100000ULL
-};
-
-static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
-       0x00000000001C0000ULL,
-       0x00000000001D0000ULL,
-       0x00000000001E0000ULL
-};
-
-static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
-       0x00000000001F0000ULL
-};
-
-/* SP */
-static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
-       0x0000000000010000ULL
-};
-
-static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
-       0x0000000000300000ULL
-};
-
-/* MMU */
-#if defined(IS_ISP_2400_MAMOIADA_SYSTEM) || defined(IS_ISP_2401_MAMOIADA_SYSTEM)
-/*
- * MMU0_ID: The data MMU
- * MMU1_ID: The icache MMU
- */
-static const hrt_address MMU_BASE[N_MMU_ID] = {
-       0x0000000000070000ULL,
-       0x00000000000A0000ULL
-};
-#else
-#error "system_local.h: SYSTEM must be one of {2400, 2401 }"
-#endif
-
-/* DMA */
-static const hrt_address DMA_BASE[N_DMA_ID] = {
-       0x0000000000040000ULL
-};
-
-static const hrt_address ISYS2401_DMA_BASE[N_ISYS2401_DMA_ID] = {
-       0x00000000000CA000ULL
-};
-
-/* IRQ */
-static const hrt_address IRQ_BASE[N_IRQ_ID] = {
-       0x0000000000000500ULL,
-       0x0000000000030A00ULL,
-       0x000000000008C000ULL,
-       0x0000000000090200ULL
-};
-/*
-       0x0000000000000500ULL};
- */
-
-/* GDC */
-static const hrt_address GDC_BASE[N_GDC_ID] = {
-       0x0000000000050000ULL,
-       0x0000000000060000ULL
-};
-
-/* FIFO_MONITOR (not a subset of GP_DEVICE) */
-static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
-       0x0000000000000000ULL
-};
-
-/*
-static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
-       0x0000000000000000ULL};
-
-static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
-       0x0000000000090000ULL};
-*/
-
-/* GP_DEVICE (single base for all separate GP_REG instances) */
-static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
-       0x0000000000000000ULL
-};
-
-/*GP TIMER , all timer registers are inter-twined,
- * so, having multiple base addresses for
- * different timers does not help*/
-static const hrt_address GP_TIMER_BASE =
-    (hrt_address)0x0000000000000600ULL;
-
-/* GPIO */
-static const hrt_address GPIO_BASE[N_GPIO_ID] = {
-       0x0000000000000400ULL
-};
-
-/* TIMED_CTRL */
-static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
-       0x0000000000000100ULL
-};
-
-/* INPUT_FORMATTER */
-static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
-       0x0000000000030000ULL,
-       0x0000000000030200ULL,
-       0x0000000000030400ULL,
-       0x0000000000030600ULL
-}; /* memcpy() */
-
-/* INPUT_SYSTEM */
-static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
-       0x0000000000080000ULL
-};
-/*     0x0000000000081000ULL, */ /* capture A */
-/*     0x0000000000082000ULL, */ /* capture B */
-/*     0x0000000000083000ULL, */ /* capture C */
-/*     0x0000000000084000ULL, */ /* Acquisition */
-/*     0x0000000000085000ULL, */ /* DMA */
-/*     0x0000000000089000ULL, */ /* ctrl */
-/*     0x000000000008A000ULL, */ /* GP regs */
-/*     0x000000000008B000ULL, */ /* FIFO */
-/*     0x000000000008C000ULL, */ /* IRQ */
-
-/* RX, the MIPI lane control regs start at offset 0 */
-static const hrt_address RX_BASE[N_RX_ID] = {
-       0x0000000000080100ULL
-};
-
-/* IBUF_CTRL, part of the Input System 2401 */
-static const hrt_address IBUF_CTRL_BASE[N_IBUF_CTRL_ID] = {
-       0x00000000000C1800ULL,  /* ibuf controller A */
-       0x00000000000C3800ULL,  /* ibuf controller B */
-       0x00000000000C5800ULL   /* ibuf controller C */
-};
-
-/* ISYS IRQ Controllers, part of the Input System 2401 */
-static const hrt_address ISYS_IRQ_BASE[N_ISYS_IRQ_ID] = {
-       0x00000000000C1400ULL,  /* port a */
-       0x00000000000C3400ULL,  /* port b */
-       0x00000000000C5400ULL   /* port c */
-};
-
-/* CSI FE, part of the Input System 2401 */
-static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_FRONTEND_ID] = {
-       0x00000000000C0400ULL,  /* csi fe controller A */
-       0x00000000000C2400ULL,  /* csi fe controller B */
-       0x00000000000C4400ULL   /* csi fe controller C */
-};
-
-/* CSI BE, part of the Input System 2401 */
-static const hrt_address CSI_RX_BE_CTRL_BASE[N_CSI_RX_BACKEND_ID] = {
-       0x00000000000C0800ULL,  /* csi be controller A */
-       0x00000000000C2800ULL,  /* csi be controller B */
-       0x00000000000C4800ULL   /* csi be controller C */
-};
-
-/* PIXEL Generator, part of the Input System 2401 */
-static const hrt_address PIXELGEN_CTRL_BASE[N_PIXELGEN_ID] = {
-       0x00000000000C1000ULL,  /* pixel gen controller A */
-       0x00000000000C3000ULL,  /* pixel gen controller B */
-       0x00000000000C5000ULL   /* pixel gen controller C */
-};
-
-/* Stream2MMIO, part of the Input System 2401 */
-static const hrt_address STREAM2MMIO_CTRL_BASE[N_STREAM2MMIO_ID] = {
-       0x00000000000C0C00ULL,  /* stream2mmio controller A */
-       0x00000000000C2C00ULL,  /* stream2mmio controller B */
-       0x00000000000C4C00ULL   /* stream2mmio controller C */
-};
-#elif HRT_ADDRESS_WIDTH == 32
-
-#define GP_FIFO_BASE   ((hrt_address)0x00090104)               /* This is NOT a base address */
-
-/* DDR : Attention, this value not defined in 32-bit */
-static const hrt_address DDR_BASE[N_DDR_ID] = {
-       0x00000000UL
-};
-
-/* ISP */
-static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
-       0x00020000UL
-};
-
-static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
-       0xffffffffUL
-};
-
-static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
-       0xffffffffUL
-};
-
-static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
-       0xffffffffUL,
-       0xffffffffUL,
-       0xffffffffUL
-};
-
-static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
-       0xffffffffUL
-};
-
-/* SP */
-static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
-       0x00010000UL
-};
-
-static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
-       0x00300000UL
-};
-
-/* MMU */
-#if defined(IS_ISP_2400_MAMOIADA_SYSTEM) || defined(IS_ISP_2401_MAMOIADA_SYSTEM)
-/*
- * MMU0_ID: The data MMU
- * MMU1_ID: The icache MMU
- */
-static const hrt_address MMU_BASE[N_MMU_ID] = {
-       0x00070000UL,
-       0x000A0000UL
-};
-#else
-#error "system_local.h: SYSTEM must be one of {2400, 2401 }"
-#endif
-
-/* DMA */
-static const hrt_address DMA_BASE[N_DMA_ID] = {
-       0x00040000UL
-};
-
-static const hrt_address ISYS2401_DMA_BASE[N_ISYS2401_DMA_ID] = {
-       0x000CA000UL
-};
-
-/* IRQ */
-static const hrt_address IRQ_BASE[N_IRQ_ID] = {
-       0x00000500UL,
-       0x00030A00UL,
-       0x0008C000UL,
-       0x00090200UL
-};
-/*
-       0x00000500UL};
- */
-
-/* GDC */
-static const hrt_address GDC_BASE[N_GDC_ID] = {
-       0x00050000UL,
-       0x00060000UL
-};
-
-/* FIFO_MONITOR (not a subset of GP_DEVICE) */
-static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
-       0x00000000UL
-};
-
-/*
-static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
-       0x00000000UL};
-
-static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
-       0x00090000UL};
-*/
-
-/* GP_DEVICE (single base for all separate GP_REG instances) */
-static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
-       0x00000000UL
-};
-
-/*GP TIMER , all timer registers are inter-twined,
- * so, having multiple base addresses for
- * different timers does not help*/
-static const hrt_address GP_TIMER_BASE =
-    (hrt_address)0x00000600UL;
-/* GPIO */
-static const hrt_address GPIO_BASE[N_GPIO_ID] = {
-       0x00000400UL
-};
-
-/* TIMED_CTRL */
-static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
-       0x00000100UL
-};
-
-/* INPUT_FORMATTER */
-static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
-       0x00030000UL,
-       0x00030200UL,
-       0x00030400UL
-};
-/*     0x00030600UL, */ /* memcpy() */
-
-/* INPUT_SYSTEM */
-static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
-       0x00080000UL
-};
-/*     0x00081000UL, */ /* capture A */
-/*     0x00082000UL, */ /* capture B */
-/*     0x00083000UL, */ /* capture C */
-/*     0x00084000UL, */ /* Acquisition */
-/*     0x00085000UL, */ /* DMA */
-/*     0x00089000UL, */ /* ctrl */
-/*     0x0008A000UL, */ /* GP regs */
-/*     0x0008B000UL, */ /* FIFO */
-/*     0x0008C000UL, */ /* IRQ */
-
-/* RX, the MIPI lane control regs start at offset 0 */
-static const hrt_address RX_BASE[N_RX_ID] = {
-       0x00080100UL
-};
-
-/* IBUF_CTRL, part of the Input System 2401 */
-static const hrt_address IBUF_CTRL_BASE[N_IBUF_CTRL_ID] = {
-       0x000C1800UL,   /* ibuf controller A */
-       0x000C3800UL,   /* ibuf controller B */
-       0x000C5800UL    /* ibuf controller C */
-};
-
-/* ISYS IRQ Controllers, part of the Input System 2401 */
-static const hrt_address ISYS_IRQ_BASE[N_ISYS_IRQ_ID] = {
-       0x000C1400ULL,  /* port a */
-       0x000C3400ULL,  /* port b */
-       0x000C5400ULL   /* port c */
-};
-
-/* CSI FE, part of the Input System 2401 */
-static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_FRONTEND_ID] = {
-       0x000C0400UL,   /* csi fe controller A */
-       0x000C2400UL,   /* csi fe controller B */
-       0x000C4400UL    /* csi fe controller C */
-};
-
-/* CSI BE, part of the Input System 2401 */
-static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_BACKEND_ID] = {
-       0x000C0800UL,   /* csi be controller A */
-       0x000C2800UL,   /* csi be controller B */
-       0x000C4800UL    /* csi be controller C */
-};
-
-/* PIXEL Generator, part of the Input System 2401 */
-static const hrt_address PIXELGEN_CTRL_BASE[N_PIXELGEN_ID] = {
-       0x000C1000UL,   /* pixel gen controller A */
-       0x000C3000UL,   /* pixel gen controller B */
-       0x000C5000UL    /* pixel gen controller C */
-};
-
-/* Stream2MMIO, part of the Input System 2401 */
-static const hrt_address STREAM2MMIO_CTRL_BASE[N_STREAM2MMIO_ID] = {
-       0x000C0C00UL,   /* stream2mmio controller A */
-       0x000C2C00UL,   /* stream2mmio controller B */
-       0x000C4C00UL    /* stream2mmio controller C */
-};
-
-#else
-#error "system_local.h: HRT_ADDRESS_WIDTH must be one of {32,64}"
-#endif
-
-#endif /* __SYSTEM_LOCAL_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/input_system_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/input_system_global.h
deleted file mode 100644 (file)
index 9c882fe..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Support for Intel Camera Imaging ISP subsystem.
- * Copyright (c) 2015, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- */
-
-#ifndef __INPUT_SYSTEM_GLOBAL_H_INCLUDED__
-#define __INPUT_SYSTEM_GLOBAL_H_INCLUDED__
-
-#define IS_INPUT_SYSTEM_VERSION_VERSION_2401
-
-/* CSI reveiver has 3 ports. */
-#define                N_CSI_PORTS (3)
-
-#include "isys_dma.h"          /*      isys2401_dma_channel,
-                                *      isys2401_dma_cfg_t
-                                */
-
-#include "ibuf_ctrl.h"         /*      ibuf_cfg_t,
-                                *      ibuf_ctrl_cfg_t
-                                */
-
-#include "isys_stream2mmio.h"  /*      stream2mmio_cfg_t */
-
-#include "csi_rx.h"            /*      csi_rx_frontend_cfg_t,
-                                *      csi_rx_backend_cfg_t,
-                                *      csi_rx_backend_lut_entry_t
-                                */
-#include "pixelgen.h"
-
-#define INPUT_SYSTEM_N_STREAM_ID  6    /* maximum number of simultaneous
-                                       virtual channels supported*/
-
-typedef enum {
-       INPUT_SYSTEM_ERR_NO_ERROR = 0,
-       INPUT_SYSTEM_ERR_CREATE_CHANNEL_FAIL,
-       INPUT_SYSTEM_ERR_CONFIGURE_CHANNEL_FAIL,
-       INPUT_SYSTEM_ERR_OPEN_CHANNEL_FAIL,
-       INPUT_SYSTEM_ERR_TRANSFER_FAIL,
-       INPUT_SYSTEM_ERR_CREATE_INPUT_PORT_FAIL,
-       INPUT_SYSTEM_ERR_CONFIGURE_INPUT_PORT_FAIL,
-       INPUT_SYSTEM_ERR_OPEN_INPUT_PORT_FAIL,
-       N_INPUT_SYSTEM_ERR
-} input_system_err_t;
-
-typedef enum {
-       INPUT_SYSTEM_SOURCE_TYPE_UNDEFINED = 0,
-       INPUT_SYSTEM_SOURCE_TYPE_SENSOR,
-       INPUT_SYSTEM_SOURCE_TYPE_TPG,
-       INPUT_SYSTEM_SOURCE_TYPE_PRBS,
-       N_INPUT_SYSTEM_SOURCE_TYPE
-} input_system_source_type_t;
-
-typedef enum {
-       INPUT_SYSTEM_POLL_ON_WAIT_FOR_FRAME,
-       INPUT_SYSTEM_POLL_ON_CAPTURE_REQUEST,
-} input_system_polling_mode_t;
-
-typedef struct input_system_channel_s input_system_channel_t;
-struct input_system_channel_s {
-       stream2mmio_ID_t        stream2mmio_id;
-       stream2mmio_sid_ID_t    stream2mmio_sid_id;
-
-       ibuf_ctrl_ID_t          ibuf_ctrl_id;
-       ib_buffer_t             ib_buffer;
-
-       isys2401_dma_ID_t       dma_id;
-       isys2401_dma_channel    dma_channel;
-};
-
-typedef struct input_system_channel_cfg_s input_system_channel_cfg_t;
-struct input_system_channel_cfg_s {
-       stream2mmio_cfg_t       stream2mmio_cfg;
-       ibuf_ctrl_cfg_t         ibuf_ctrl_cfg;
-       isys2401_dma_cfg_t      dma_cfg;
-       isys2401_dma_port_cfg_t dma_src_port_cfg;
-       isys2401_dma_port_cfg_t dma_dest_port_cfg;
-};
-
-typedef struct input_system_input_port_s input_system_input_port_t;
-struct input_system_input_port_s {
-       input_system_source_type_t      source_type;
-
-       struct {
-               csi_rx_frontend_ID_t            frontend_id;
-               csi_rx_backend_ID_t             backend_id;
-               csi_mipi_packet_type_t          packet_type;
-               csi_rx_backend_lut_entry_t      backend_lut_entry;
-       } csi_rx;
-
-       struct {
-               csi_mipi_packet_type_t          packet_type;
-               csi_rx_backend_lut_entry_t      backend_lut_entry;
-       } metadata;
-
-       struct {
-               pixelgen_ID_t                   pixelgen_id;
-       } pixelgen;
-};
-
-typedef struct input_system_input_port_cfg_s input_system_input_port_cfg_t;
-struct input_system_input_port_cfg_s {
-       struct {
-               csi_rx_frontend_cfg_t   frontend_cfg;
-               csi_rx_backend_cfg_t    backend_cfg;
-               csi_rx_backend_cfg_t    md_backend_cfg;
-       } csi_rx_cfg;
-
-       struct {
-               pixelgen_tpg_cfg_t      tpg_cfg;
-               pixelgen_prbs_cfg_t     prbs_cfg;
-       } pixelgen_cfg;
-};
-
-typedef struct input_system_cfg_s input_system_cfg_t;
-struct input_system_cfg_s {
-       input_system_input_port_ID_t    input_port_id;
-
-       input_system_source_type_t      mode;
-
-       /* ISP2401 */
-       input_system_polling_mode_t     polling_mode;
-
-       bool online;
-       bool raw_packed;
-       s8 linked_isys_stream_id;
-
-       struct {
-               bool    comp_enable;
-               s32     active_lanes;
-               s32     fmt_type;
-               s32     ch_id;
-               s32 comp_predictor;
-               s32 comp_scheme;
-       } csi_port_attr;
-
-       pixelgen_tpg_cfg_t      tpg_port_attr;
-
-       pixelgen_prbs_cfg_t prbs_port_attr;
-
-       struct {
-               s32 align_req_in_bytes;
-               s32 bits_per_pixel;
-               s32 pixels_per_line;
-               s32 lines_per_frame;
-       } input_port_resolution;
-
-       struct {
-               s32 left_padding;
-               s32 max_isp_input_width;
-       } output_port_attr;
-
-       struct {
-               bool    enable;
-               s32 fmt_type;
-               s32 align_req_in_bytes;
-               s32 bits_per_pixel;
-               s32 pixels_per_line;
-               s32 lines_per_frame;
-       } metadata;
-};
-
-typedef struct virtual_input_system_stream_s virtual_input_system_stream_t;
-struct virtual_input_system_stream_s {
-       u32 id;                         /*Used when multiple MIPI data types and/or virtual channels are used.
-                                                               Must be unique within one CSI RX
-                                                               and lower than SH_CSS_MAX_ISYS_CHANNEL_NODES */
-       u8 enable_metadata;
-       input_system_input_port_t       input_port;
-       input_system_channel_t          channel;
-       input_system_channel_t          md_channel; /* metadata channel */
-       u8 online;
-       s8 linked_isys_stream_id;
-       u8 valid;
-
-       /* ISP2401 */
-       input_system_polling_mode_t     polling_mode;
-       s32 subscr_index;
-};
-
-typedef struct virtual_input_system_stream_cfg_s
-       virtual_input_system_stream_cfg_t;
-struct virtual_input_system_stream_cfg_s {
-       u8 enable_metadata;
-       input_system_input_port_cfg_t   input_port_cfg;
-       input_system_channel_cfg_t      channel_cfg;
-       input_system_channel_cfg_t      md_channel_cfg;
-       u8 valid;
-};
-
-#define ISP_INPUT_BUF_START_ADDR       0
-#define NUM_OF_INPUT_BUF               2
-#define NUM_OF_LINES_PER_BUF           2
-#define LINES_OF_ISP_INPUT_BUF         (NUM_OF_INPUT_BUF * NUM_OF_LINES_PER_BUF)
-#define ISP_INPUT_BUF_STRIDE           SH_CSS_MAX_SENSOR_WIDTH
-
-#endif /* __INPUT_SYSTEM_GLOBAL_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/system_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/system_global.h
deleted file mode 100644 (file)
index 9c948cc..0000000
+++ /dev/null
@@ -1,458 +0,0 @@
-/*
- * Support for Intel Camera Imaging ISP subsystem.
- * Copyright (c) 2015, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- */
-
-#ifndef __SYSTEM_GLOBAL_H_INCLUDED__
-#define __SYSTEM_GLOBAL_H_INCLUDED__
-
-#include <hive_isp_css_defs.h>
-#include <type_support.h>
-
-/*
- * The longest allowed (uninteruptible) bus transfer, does not
- * take stalling into account
- */
-#define HIVE_ISP_MAX_BURST_LENGTH      1024
-
-/*
- * Maximum allowed burst length in words for the ISP DMA
- * This value is set to 2 to prevent the ISP DMA from blocking
- * the bus for too long; as the input system can only buffer
- * 2 lines on Moorefield and Cherrytrail, the input system buffers
- * may overflow if blocked for too long (BZ 2726).
- */
-#define ISP_DMA_MAX_BURST_LENGTH       2
-
-/*
- * Create a list of HAS and IS properties that defines the system
- *
- * The configuration assumes the following
- * - The system is hetereogeneous; Multiple cells and devices classes
- * - The cell and device instances are homogeneous, each device type
- *   belongs to the same class
- * - Device instances supporting a subset of the class capabilities are
- *   allowed
- *
- * We could manage different device classes through the enumerated
- * lists (C) or the use of classes (C++), but that is presently not
- * fully supported
- *
- * N.B. the 3 input formatters are of 2 different classess
- */
-
-#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}
- *
- * The 2401 system has the nice property that it uses a vanilla 2400 SP
- * so the SP will believe it is a 2400 system rather than 2401...
- */
-/* #if defined(SYSTEM_hive_isp_css_2401_system) || defined(__isp2401_mamoiada) || defined(__scalar_processor_2401) */
-#if defined(SYSTEM_hive_isp_css_2401_system) || defined(__isp2401_mamoiada)
-#define IS_ISP_2401_MAMOIADA_SYSTEM
-#define HAS_ISP_2401_MAMOIADA
-#define HAS_SP_2400
-/* #elif defined(SYSTEM_hive_isp_css_2400_system) || defined(__isp2400_mamoiada) || defined(__scalar_processor_2400)*/
-#elif defined(SYSTEM_hive_isp_css_2400_system) || defined(__isp2400_mamoiada)
-#define IS_ISP_2400_MAMOIADA_SYSTEM
-#define HAS_ISP_2400_MAMOIADA
-#define HAS_SP_2400
-#else
-#error "system_global.h: 2400_SYSTEM must be one of {2400, 2401 }"
-#endif
-
-#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
-/* 2401: HAS_INPUT_SYSTEM_VERSION_3 */
-/* 2400: HAS_INPUT_SYSTEM_VERSION_2 */
-#define HAS_INPUT_SYSTEM_VERSION_2
-#define HAS_INPUT_SYSTEM_VERSION_2401
-#define HAS_BUFFERED_SENSOR
-#define HAS_FIFO_MONITORS_VERSION_2
-/* #define HAS_GP_REGS_VERSION_2 */
-#define HAS_GP_DEVICE_VERSION_2
-#define HAS_GPIO_VERSION_1
-#define HAS_TIMED_CTRL_VERSION_1
-#define HAS_RX_VERSION_2
-#define HAS_NO_INPUT_FORMATTER
-/*#define HAS_NO_PACKED_RAW_PIXELS*/
-/*#define HAS_NO_DVS_6AXIS_CONFIG_UPDATE*/
-
-#define DMA_DDR_TO_VAMEM_WORKAROUND
-#define DMA_DDR_TO_HMEM_WORKAROUND
-
-/*
- * Semi global. "HRT" is accessible from SP, but
- * the HRT types do not fully apply
- */
-#define HRT_VADDRESS_WIDTH     32
-/* Surprise, this is a local property*/
-/*#define HRT_ADDRESS_WIDTH    64 */
-#define HRT_DATA_WIDTH         32
-
-#define SIZEOF_HRT_REG         (HRT_DATA_WIDTH >> 3)
-#define HIVE_ISP_CTRL_DATA_BYTES (HIVE_ISP_CTRL_DATA_WIDTH / 8)
-
-/* The main bus connecting all devices */
-#define HRT_BUS_WIDTH          HIVE_ISP_CTRL_DATA_WIDTH
-#define HRT_BUS_BYTES          HIVE_ISP_CTRL_DATA_BYTES
-
-#define CSI2P_DISABLE_ISYS2401_ONLINE_MODE
-
-/* per-frame parameter handling support */
-#define SH_CSS_ENABLE_PER_FRAME_PARAMS
-
-typedef u32                    hrt_bus_align_t;
-
-/*
- * Enumerate the devices, device access through the API is by ID,
- * through the DLI by address. The enumerator terminators are used
- * to size the wiring arrays and as an exception value.
- */
-typedef enum {
-       DDR0_ID = 0,
-       N_DDR_ID
-} ddr_ID_t;
-
-typedef enum {
-       ISP0_ID = 0,
-       N_ISP_ID
-} isp_ID_t;
-
-typedef enum {
-       SP0_ID = 0,
-       N_SP_ID
-} sp_ID_t;
-
-#if defined(IS_ISP_2401_MAMOIADA_SYSTEM)
-typedef enum {
-       MMU0_ID = 0,
-       MMU1_ID,
-       N_MMU_ID
-} mmu_ID_t;
-#elif defined(IS_ISP_2400_MAMOIADA_SYSTEM)
-typedef enum {
-       MMU0_ID = 0,
-       MMU1_ID,
-       N_MMU_ID
-} mmu_ID_t;
-#else
-#error "system_global.h: SYSTEM must be one of {2400, 2401}"
-#endif
-
-typedef enum {
-       DMA0_ID = 0,
-       N_DMA_ID
-} dma_ID_t;
-
-typedef enum {
-       GDC0_ID = 0,
-       GDC1_ID,
-       N_GDC_ID
-} gdc_ID_t;
-
-/* this extra define is needed because we want to use it also
-   in the preprocessor, and that doesn't work with enums.
- */
-#define N_GDC_ID_CPP 2
-
-typedef enum {
-       VAMEM0_ID = 0,
-       VAMEM1_ID,
-       VAMEM2_ID,
-       N_VAMEM_ID
-} vamem_ID_t;
-
-typedef enum {
-       BAMEM0_ID = 0,
-       N_BAMEM_ID
-} bamem_ID_t;
-
-typedef enum {
-       HMEM0_ID = 0,
-       N_HMEM_ID
-} hmem_ID_t;
-
-typedef enum {
-       ISYS_IRQ0_ID = 0,       /* port a */
-       ISYS_IRQ1_ID,   /* port b */
-       ISYS_IRQ2_ID,   /* port c */
-       N_ISYS_IRQ_ID
-} isys_irq_ID_t;
-
-typedef enum {
-       IRQ0_ID = 0,    /* GP IRQ block */
-       IRQ1_ID,        /* Input formatter */
-       IRQ2_ID,        /* input system */
-       IRQ3_ID,        /* input selector */
-       N_IRQ_ID
-} irq_ID_t;
-
-typedef enum {
-       FIFO_MONITOR0_ID = 0,
-       N_FIFO_MONITOR_ID
-} fifo_monitor_ID_t;
-
-/*
- * Deprecated: Since all gp_reg instances are different
- * and put in the address maps of other devices we cannot
- * enumerate them as that assumes the instrances are the
- * same.
- *
- * We define a single GP_DEVICE containing all gp_regs
- * w.r.t. a single base address
- *
-typedef enum {
-       GP_REGS0_ID = 0,
-       N_GP_REGS_ID
-} gp_regs_ID_t;
- */
-typedef enum {
-       GP_DEVICE0_ID = 0,
-       N_GP_DEVICE_ID
-} gp_device_ID_t;
-
-typedef enum {
-       GP_TIMER0_ID = 0,
-       GP_TIMER1_ID,
-       GP_TIMER2_ID,
-       GP_TIMER3_ID,
-       GP_TIMER4_ID,
-       GP_TIMER5_ID,
-       GP_TIMER6_ID,
-       GP_TIMER7_ID,
-       N_GP_TIMER_ID
-} gp_timer_ID_t;
-
-typedef enum {
-       GPIO0_ID = 0,
-       N_GPIO_ID
-} gpio_ID_t;
-
-typedef enum {
-       TIMED_CTRL0_ID = 0,
-       N_TIMED_CTRL_ID
-} timed_ctrl_ID_t;
-
-typedef enum {
-       INPUT_FORMATTER0_ID = 0,
-       INPUT_FORMATTER1_ID,
-       INPUT_FORMATTER2_ID,
-       INPUT_FORMATTER3_ID,
-       N_INPUT_FORMATTER_ID
-} input_formatter_ID_t;
-
-/* The IF RST is outside the IF */
-#define INPUT_FORMATTER0_SRST_OFFSET   0x0824
-#define INPUT_FORMATTER1_SRST_OFFSET   0x0624
-#define INPUT_FORMATTER2_SRST_OFFSET   0x0424
-#define INPUT_FORMATTER3_SRST_OFFSET   0x0224
-
-#define INPUT_FORMATTER0_SRST_MASK             0x0001
-#define INPUT_FORMATTER1_SRST_MASK             0x0002
-#define INPUT_FORMATTER2_SRST_MASK             0x0004
-#define INPUT_FORMATTER3_SRST_MASK             0x0008
-
-typedef enum {
-       INPUT_SYSTEM0_ID = 0,
-       N_INPUT_SYSTEM_ID
-} input_system_ID_t;
-
-typedef enum {
-       RX0_ID = 0,
-       N_RX_ID
-} rx_ID_t;
-
-enum mipi_port_id {
-       MIPI_PORT0_ID = 0,
-       MIPI_PORT1_ID,
-       MIPI_PORT2_ID,
-       N_MIPI_PORT_ID
-};
-
-#define        N_RX_CHANNEL_ID         4
-
-/* Generic port enumeration with an internal port type ID */
-typedef enum {
-       CSI_PORT0_ID = 0,
-       CSI_PORT1_ID,
-       CSI_PORT2_ID,
-       TPG_PORT0_ID,
-       PRBS_PORT0_ID,
-       FIFO_PORT0_ID,
-       MEMORY_PORT0_ID,
-       N_INPUT_PORT_ID
-} input_port_ID_t;
-
-typedef enum {
-       CAPTURE_UNIT0_ID = 0,
-       CAPTURE_UNIT1_ID,
-       CAPTURE_UNIT2_ID,
-       ACQUISITION_UNIT0_ID,
-       DMA_UNIT0_ID,
-       CTRL_UNIT0_ID,
-       GPREGS_UNIT0_ID,
-       FIFO_UNIT0_ID,
-       IRQ_UNIT0_ID,
-       N_SUB_SYSTEM_ID
-} sub_system_ID_t;
-
-#define        N_CAPTURE_UNIT_ID               3
-#define        N_ACQUISITION_UNIT_ID   1
-#define        N_CTRL_UNIT_ID                  1
-
-/*
- * Input-buffer Controller.
- */
-typedef enum {
-       IBUF_CTRL0_ID = 0,      /* map to ISYS2401_IBUF_CNTRL_A */
-       IBUF_CTRL1_ID,          /* map to ISYS2401_IBUF_CNTRL_B */
-       IBUF_CTRL2_ID,          /* map ISYS2401_IBUF_CNTRL_C */
-       N_IBUF_CTRL_ID
-} ibuf_ctrl_ID_t;
-/* end of Input-buffer Controller */
-
-/*
- * Stream2MMIO.
- */
-typedef enum {
-       STREAM2MMIO0_ID = 0,    /* map to ISYS2401_S2M_A */
-       STREAM2MMIO1_ID,        /* map to ISYS2401_S2M_B */
-       STREAM2MMIO2_ID,        /* map to ISYS2401_S2M_C */
-       N_STREAM2MMIO_ID
-} stream2mmio_ID_t;
-
-typedef enum {
-       /*
-        * Stream2MMIO 0 has 8 SIDs that are indexed by
-        * [STREAM2MMIO_SID0_ID...STREAM2MMIO_SID7_ID].
-        *
-        * Stream2MMIO 1 has 4 SIDs that are indexed by
-        * [STREAM2MMIO_SID0_ID...TREAM2MMIO_SID3_ID].
-        *
-        * Stream2MMIO 2 has 4 SIDs that are indexed by
-        * [STREAM2MMIO_SID0_ID...STREAM2MMIO_SID3_ID].
-        */
-       STREAM2MMIO_SID0_ID = 0,
-       STREAM2MMIO_SID1_ID,
-       STREAM2MMIO_SID2_ID,
-       STREAM2MMIO_SID3_ID,
-       STREAM2MMIO_SID4_ID,
-       STREAM2MMIO_SID5_ID,
-       STREAM2MMIO_SID6_ID,
-       STREAM2MMIO_SID7_ID,
-       N_STREAM2MMIO_SID_ID
-} stream2mmio_sid_ID_t;
-/* end of Stream2MMIO */
-
-/**
- * Input System 2401: CSI-MIPI recevier.
- */
-typedef enum {
-       CSI_RX_BACKEND0_ID = 0, /* map to ISYS2401_MIPI_BE_A */
-       CSI_RX_BACKEND1_ID,             /* map to ISYS2401_MIPI_BE_B */
-       CSI_RX_BACKEND2_ID,             /* map to ISYS2401_MIPI_BE_C */
-       N_CSI_RX_BACKEND_ID
-} csi_rx_backend_ID_t;
-
-typedef enum {
-       CSI_RX_FRONTEND0_ID = 0,        /* map to ISYS2401_CSI_RX_A */
-       CSI_RX_FRONTEND1_ID,            /* map to ISYS2401_CSI_RX_B */
-       CSI_RX_FRONTEND2_ID,            /* map to ISYS2401_CSI_RX_C */
-#define N_CSI_RX_FRONTEND_ID (CSI_RX_FRONTEND2_ID + 1)
-} csi_rx_frontend_ID_t;
-
-typedef enum {
-       CSI_RX_DLANE0_ID = 0,           /* map to DLANE0 in CSI RX */
-       CSI_RX_DLANE1_ID,               /* map to DLANE1 in CSI RX */
-       CSI_RX_DLANE2_ID,               /* map to DLANE2 in CSI RX */
-       CSI_RX_DLANE3_ID,               /* map to DLANE3 in CSI RX */
-       N_CSI_RX_DLANE_ID
-} csi_rx_fe_dlane_ID_t;
-/* end of CSI-MIPI receiver */
-
-typedef enum {
-       ISYS2401_DMA0_ID = 0,
-       N_ISYS2401_DMA_ID
-} isys2401_dma_ID_t;
-
-/**
- * Pixel-generator. ("system_global.h")
- */
-typedef enum {
-       PIXELGEN0_ID = 0,
-       PIXELGEN1_ID,
-       PIXELGEN2_ID,
-       N_PIXELGEN_ID
-} pixelgen_ID_t;
-/* end of pixel-generator. ("system_global.h") */
-
-typedef enum {
-       INPUT_SYSTEM_CSI_PORT0_ID = 0,
-       INPUT_SYSTEM_CSI_PORT1_ID,
-       INPUT_SYSTEM_CSI_PORT2_ID,
-
-       INPUT_SYSTEM_PIXELGEN_PORT0_ID,
-       INPUT_SYSTEM_PIXELGEN_PORT1_ID,
-       INPUT_SYSTEM_PIXELGEN_PORT2_ID,
-
-       N_INPUT_SYSTEM_INPUT_PORT_ID
-} input_system_input_port_ID_t;
-
-#define N_INPUT_SYSTEM_CSI_PORT        3
-
-typedef enum {
-       ISYS2401_DMA_CHANNEL_0 = 0,
-       ISYS2401_DMA_CHANNEL_1,
-       ISYS2401_DMA_CHANNEL_2,
-       ISYS2401_DMA_CHANNEL_3,
-       ISYS2401_DMA_CHANNEL_4,
-       ISYS2401_DMA_CHANNEL_5,
-       ISYS2401_DMA_CHANNEL_6,
-       ISYS2401_DMA_CHANNEL_7,
-       ISYS2401_DMA_CHANNEL_8,
-       ISYS2401_DMA_CHANNEL_9,
-       ISYS2401_DMA_CHANNEL_10,
-       ISYS2401_DMA_CHANNEL_11,
-       N_ISYS2401_DMA_CHANNEL
-} isys2401_dma_channel;
-
-enum ia_css_isp_memories {
-       IA_CSS_ISP_PMEM0 = 0,
-       IA_CSS_ISP_DMEM0,
-       IA_CSS_ISP_VMEM0,
-       IA_CSS_ISP_VAMEM0,
-       IA_CSS_ISP_VAMEM1,
-       IA_CSS_ISP_VAMEM2,
-       IA_CSS_ISP_HMEM0,
-       IA_CSS_SP_DMEM0,
-       IA_CSS_DDR,
-       N_IA_CSS_MEMORIES
-};
-
-#define IA_CSS_NUM_MEMORIES 9
-/* For driver compatibility */
-#define N_IA_CSS_ISP_MEMORIES   IA_CSS_NUM_MEMORIES
-#define IA_CSS_NUM_ISP_MEMORIES IA_CSS_NUM_MEMORIES
-
-#endif /* __SYSTEM_GLOBAL_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system_local.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system_local.h
deleted file mode 100644 (file)
index 3c0e2ef..0000000
+++ /dev/null
@@ -1,539 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __INPUT_SYSTEM_LOCAL_H_INCLUDED__
-#define __INPUT_SYSTEM_LOCAL_H_INCLUDED__
-
-#include <type_support.h>
-
-#include "input_system_global.h"
-
-#include "input_system_defs.h"         /* HIVE_ISYS_GPREG_MULTICAST_A_IDX,... */
-#include "css_receiver_2400_defs.h"    /* _HRT_CSS_RECEIVER_2400_TWO_PIXEL_EN_REG_IDX, _HRT_CSS_RECEIVER_2400_CSI2_FUNC_PROG_REG_IDX,... */
-#if defined(IS_ISP_2400_MAMOIADA_SYSTEM)
-#include "isp_capture_defs.h"
-#elif defined(IS_ISP_2401_MAMOIADA_SYSTEM)
-/* Same name, but keep the distinction,it is a different device */
-#include "isp_capture_defs.h"
-#else
-#error "input_system_local.h: 2400_SYSTEM must be one of {2400, 2401 }"
-#endif
-#include "isp_acquisition_defs.h"
-#include "input_system_ctrl_defs.h"
-
-typedef enum {
-       INPUT_SYSTEM_ERR_NO_ERROR = 0,
-       INPUT_SYSTEM_ERR_GENERIC,
-       INPUT_SYSTEM_ERR_CHANNEL_ALREADY_SET,
-       INPUT_SYSTEM_ERR_CONFLICT_ON_RESOURCE,
-       INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED,
-       N_INPUT_SYSTEM_ERR
-} input_system_error_t;
-
-typedef enum {
-       INPUT_SYSTEM_PORT_A = 0,
-       INPUT_SYSTEM_PORT_B,
-       INPUT_SYSTEM_PORT_C,
-       N_INPUT_SYSTEM_PORTS
-} input_system_csi_port_t;
-
-typedef struct ctrl_unit_cfg_s                 ctrl_unit_cfg_t;
-typedef struct input_system_network_cfg_s      input_system_network_cfg_t;
-typedef struct target_cfg2400_s                target_cfg2400_t;
-typedef struct channel_cfg_s                   channel_cfg_t;
-typedef struct backend_channel_cfg_s           backend_channel_cfg_t;
-typedef struct input_system_cfg2400_s          input_system_cfg2400_t;
-typedef struct mipi_port_state_s               mipi_port_state_t;
-typedef struct rx_channel_state_s              rx_channel_state_t;
-typedef struct input_switch_cfg_channel_s      input_switch_cfg_channel_t;
-typedef struct input_switch_cfg_s              input_switch_cfg_t;
-
-struct ctrl_unit_cfg_s {
-       ib_buffer_t             buffer_mipi[N_CAPTURE_UNIT_ID];
-       ib_buffer_t             buffer_acquire[N_ACQUISITION_UNIT_ID];
-};
-
-struct input_system_network_cfg_s {
-       input_system_connection_t       multicast_cfg[N_CAPTURE_UNIT_ID];
-       input_system_multiplex_t        mux_cfg;
-       ctrl_unit_cfg_t                         ctrl_unit_cfg[N_CTRL_UNIT_ID];
-};
-
-typedef struct {
-// TBD.
-       u32     dummy_parameter;
-} target_isp_cfg_t;
-
-typedef struct {
-// TBD.
-       u32     dummy_parameter;
-} target_sp_cfg_t;
-
-typedef struct {
-// TBD.
-       u32     dummy_parameter;
-} target_strm2mem_cfg_t;
-
-struct input_switch_cfg_channel_s {
-       u32 hsync_data_reg[2];
-       u32 vsync_data_reg;
-};
-
-struct target_cfg2400_s {
-       input_switch_cfg_channel_t              input_switch_channel_cfg;
-       target_isp_cfg_t        target_isp_cfg;
-       target_sp_cfg_t         target_sp_cfg;
-       target_strm2mem_cfg_t   target_strm2mem_cfg;
-};
-
-struct backend_channel_cfg_s {
-       u32     fmt_control_word_1; // Format config.
-       u32     fmt_control_word_2;
-       u32     no_side_band;
-};
-
-typedef union  {
-       csi_cfg_t       csi_cfg;
-       tpg_cfg_t       tpg_cfg;
-       prbs_cfg_t      prbs_cfg;
-       gpfifo_cfg_t    gpfifo_cfg;
-} source_cfg_t;
-
-struct input_switch_cfg_s {
-       u32 hsync_data_reg[N_RX_CHANNEL_ID * 2];
-       u32 vsync_data_reg;
-};
-
-// Configuration of a channel.
-struct channel_cfg_s {
-       u32             ch_id;
-       backend_channel_cfg_t   backend_ch;
-       input_system_source_t   source_type;
-       source_cfg_t            source_cfg;
-       target_cfg2400_t        target_cfg;
-};
-
-// Complete configuration for input system.
-struct input_system_cfg2400_s {
-       input_system_source_t source_type;
-       input_system_config_flags_t     source_type_flags;
-       //channel_cfg_t         channel[N_CHANNELS];
-       input_system_config_flags_t     ch_flags[N_CHANNELS];
-       //  This is the place where the buffers' settings are collected, as given.
-       csi_cfg_t                       csi_value[N_CSI_PORTS];
-       input_system_config_flags_t     csi_flags[N_CSI_PORTS];
-
-       // Possible another struct for ib.
-       // This buffers set at the end, based on the all configurations.
-       ib_buffer_t                     csi_buffer[N_CSI_PORTS];
-       input_system_config_flags_t     csi_buffer_flags[N_CSI_PORTS];
-       ib_buffer_t                     acquisition_buffer_unique;
-       input_system_config_flags_t     acquisition_buffer_unique_flags;
-       u32                     unallocated_ib_mem_words; // Used for check.DEFAULT = IB_CAPACITY_IN_WORDS.
-       //uint32_t                      acq_allocated_ib_mem_words;
-
-       input_system_connection_t               multicast[N_CSI_PORTS];
-       input_system_multiplex_t                multiplexer;
-       input_system_config_flags_t             multiplexer_flags;
-
-       tpg_cfg_t                       tpg_value;
-       input_system_config_flags_t     tpg_flags;
-       prbs_cfg_t                      prbs_value;
-       input_system_config_flags_t     prbs_flags;
-       gpfifo_cfg_t            gpfifo_value;
-       input_system_config_flags_t     gpfifo_flags;
-
-       input_switch_cfg_t              input_switch_cfg;
-
-       target_isp_cfg_t                target_isp[N_CHANNELS];
-       input_system_config_flags_t     target_isp_flags[N_CHANNELS];
-       target_sp_cfg_t                 target_sp[N_CHANNELS];
-       input_system_config_flags_t     target_sp_flags[N_CHANNELS];
-       target_strm2mem_cfg_t   target_strm2mem[N_CHANNELS];
-       input_system_config_flags_t     target_strm2mem_flags[N_CHANNELS];
-
-       input_system_config_flags_t             session_flags;
-
-};
-
-/*
- * For each MIPI port
- */
-#define _HRT_CSS_RECEIVER_DEVICE_READY_REG_IDX                 _HRT_CSS_RECEIVER_2400_DEVICE_READY_REG_IDX
-#define _HRT_CSS_RECEIVER_IRQ_STATUS_REG_IDX                   _HRT_CSS_RECEIVER_2400_IRQ_STATUS_REG_IDX
-#define _HRT_CSS_RECEIVER_IRQ_ENABLE_REG_IDX                   _HRT_CSS_RECEIVER_2400_IRQ_ENABLE_REG_IDX
-#define _HRT_CSS_RECEIVER_TIMEOUT_COUNT_REG_IDX                    _HRT_CSS_RECEIVER_2400_CSI2_FUNC_PROG_REG_IDX
-#define _HRT_CSS_RECEIVER_INIT_COUNT_REG_IDX                   _HRT_CSS_RECEIVER_2400_INIT_COUNT_REG_IDX
-/* new regs for each MIPI port w.r.t. 2300 */
-#define _HRT_CSS_RECEIVER_RAW16_18_DATAID_REG_IDX       _HRT_CSS_RECEIVER_2400_RAW16_18_DATAID_REG_IDX
-#define _HRT_CSS_RECEIVER_SYNC_COUNT_REG_IDX            _HRT_CSS_RECEIVER_2400_SYNC_COUNT_REG_IDX
-#define _HRT_CSS_RECEIVER_RX_COUNT_REG_IDX              _HRT_CSS_RECEIVER_2400_RX_COUNT_REG_IDX
-
-/* _HRT_CSS_RECEIVER_2400_COMP_FORMAT_REG_IDX is not defined per MIPI port but per channel */
-/* _HRT_CSS_RECEIVER_2400_COMP_PREDICT_REG_IDX is not defined per MIPI port but per channel */
-#define _HRT_CSS_RECEIVER_FS_TO_LS_DELAY_REG_IDX        _HRT_CSS_RECEIVER_2400_FS_TO_LS_DELAY_REG_IDX
-#define _HRT_CSS_RECEIVER_LS_TO_DATA_DELAY_REG_IDX      _HRT_CSS_RECEIVER_2400_LS_TO_DATA_DELAY_REG_IDX
-#define _HRT_CSS_RECEIVER_DATA_TO_LE_DELAY_REG_IDX      _HRT_CSS_RECEIVER_2400_DATA_TO_LE_DELAY_REG_IDX
-#define _HRT_CSS_RECEIVER_LE_TO_FE_DELAY_REG_IDX        _HRT_CSS_RECEIVER_2400_LE_TO_FE_DELAY_REG_IDX
-#define _HRT_CSS_RECEIVER_FE_TO_FS_DELAY_REG_IDX        _HRT_CSS_RECEIVER_2400_FE_TO_FS_DELAY_REG_IDX
-#define _HRT_CSS_RECEIVER_LE_TO_LS_DELAY_REG_IDX        _HRT_CSS_RECEIVER_2400_LE_TO_LS_DELAY_REG_IDX
-#define _HRT_CSS_RECEIVER_TWO_PIXEL_EN_REG_IDX                 _HRT_CSS_RECEIVER_2400_TWO_PIXEL_EN_REG_IDX
-#define _HRT_CSS_RECEIVER_BACKEND_RST_REG_IDX           _HRT_CSS_RECEIVER_2400_BACKEND_RST_REG_IDX
-#define _HRT_CSS_RECEIVER_RAW18_REG_IDX                 _HRT_CSS_RECEIVER_2400_RAW18_REG_IDX
-#define _HRT_CSS_RECEIVER_FORCE_RAW8_REG_IDX            _HRT_CSS_RECEIVER_2400_FORCE_RAW8_REG_IDX
-#define _HRT_CSS_RECEIVER_RAW16_REG_IDX                 _HRT_CSS_RECEIVER_2400_RAW16_REG_IDX
-
-/* Previously MIPI port regs, now 2x2 logical channel regs */
-#define _HRT_CSS_RECEIVER_COMP_SCHEME_VC0_REG0_IDX             _HRT_CSS_RECEIVER_2400_COMP_SCHEME_VC0_REG0_IDX
-#define _HRT_CSS_RECEIVER_COMP_SCHEME_VC0_REG1_IDX             _HRT_CSS_RECEIVER_2400_COMP_SCHEME_VC0_REG1_IDX
-#define _HRT_CSS_RECEIVER_COMP_SCHEME_VC1_REG0_IDX             _HRT_CSS_RECEIVER_2400_COMP_SCHEME_VC1_REG0_IDX
-#define _HRT_CSS_RECEIVER_COMP_SCHEME_VC1_REG1_IDX             _HRT_CSS_RECEIVER_2400_COMP_SCHEME_VC1_REG1_IDX
-#define _HRT_CSS_RECEIVER_COMP_SCHEME_VC2_REG0_IDX             _HRT_CSS_RECEIVER_2400_COMP_SCHEME_VC2_REG0_IDX
-#define _HRT_CSS_RECEIVER_COMP_SCHEME_VC2_REG1_IDX             _HRT_CSS_RECEIVER_2400_COMP_SCHEME_VC2_REG1_IDX
-#define _HRT_CSS_RECEIVER_COMP_SCHEME_VC3_REG0_IDX             _HRT_CSS_RECEIVER_2400_COMP_SCHEME_VC3_REG0_IDX
-#define _HRT_CSS_RECEIVER_COMP_SCHEME_VC3_REG1_IDX             _HRT_CSS_RECEIVER_2400_COMP_SCHEME_VC3_REG1_IDX
-
-/* Second backend is at offset 0x0700 w.r.t. the first port at offset 0x0100 */
-#define _HRT_CSS_BE_OFFSET                              448
-#define _HRT_CSS_RECEIVER_BE_GSP_ACC_OVL_REG_IDX        (_HRT_CSS_RECEIVER_2400_BE_GSP_ACC_OVL_REG_IDX + _HRT_CSS_BE_OFFSET)
-#define _HRT_CSS_RECEIVER_BE_SRST_REG_IDX               (_HRT_CSS_RECEIVER_2400_BE_SRST_REG_IDX + _HRT_CSS_BE_OFFSET)
-#define _HRT_CSS_RECEIVER_BE_TWO_PPC_REG_IDX            (_HRT_CSS_RECEIVER_2400_BE_TWO_PPC_REG_IDX + _HRT_CSS_BE_OFFSET)
-#define _HRT_CSS_RECEIVER_BE_COMP_FORMAT_REG0_IDX       (_HRT_CSS_RECEIVER_2400_BE_COMP_FORMAT_REG0_IDX + _HRT_CSS_BE_OFFSET)
-#define _HRT_CSS_RECEIVER_BE_COMP_FORMAT_REG1_IDX       (_HRT_CSS_RECEIVER_2400_BE_COMP_FORMAT_REG1_IDX + _HRT_CSS_BE_OFFSET)
-#define _HRT_CSS_RECEIVER_BE_COMP_FORMAT_REG2_IDX       (_HRT_CSS_RECEIVER_2400_BE_COMP_FORMAT_REG2_IDX + _HRT_CSS_BE_OFFSET)
-#define _HRT_CSS_RECEIVER_BE_COMP_FORMAT_REG3_IDX       (_HRT_CSS_RECEIVER_2400_BE_COMP_FORMAT_REG3_IDX + _HRT_CSS_BE_OFFSET)
-#define _HRT_CSS_RECEIVER_BE_SEL_REG_IDX                (_HRT_CSS_RECEIVER_2400_BE_SEL_REG_IDX + _HRT_CSS_BE_OFFSET)
-#define _HRT_CSS_RECEIVER_BE_RAW16_CONFIG_REG_IDX       (_HRT_CSS_RECEIVER_2400_BE_RAW16_CONFIG_REG_IDX + _HRT_CSS_BE_OFFSET)
-#define _HRT_CSS_RECEIVER_BE_RAW18_CONFIG_REG_IDX       (_HRT_CSS_RECEIVER_2400_BE_RAW18_CONFIG_REG_IDX + _HRT_CSS_BE_OFFSET)
-#define _HRT_CSS_RECEIVER_BE_FORCE_RAW8_REG_IDX         (_HRT_CSS_RECEIVER_2400_BE_FORCE_RAW8_REG_IDX + _HRT_CSS_BE_OFFSET)
-#define _HRT_CSS_RECEIVER_BE_IRQ_STATUS_REG_IDX         (_HRT_CSS_RECEIVER_2400_BE_IRQ_STATUS_REG_IDX + _HRT_CSS_BE_OFFSET)
-#define _HRT_CSS_RECEIVER_BE_IRQ_CLEAR_REG_IDX          (_HRT_CSS_RECEIVER_2400_BE_IRQ_CLEAR_REG_IDX + _HRT_CSS_BE_OFFSET)
-
-#define _HRT_CSS_RECEIVER_IRQ_OVERRUN_BIT              _HRT_CSS_RECEIVER_2400_IRQ_OVERRUN_BIT
-#define _HRT_CSS_RECEIVER_IRQ_INIT_TIMEOUT_BIT         _HRT_CSS_RECEIVER_2400_IRQ_RESERVED_BIT
-#define _HRT_CSS_RECEIVER_IRQ_SLEEP_MODE_ENTRY_BIT     _HRT_CSS_RECEIVER_2400_IRQ_SLEEP_MODE_ENTRY_BIT
-#define _HRT_CSS_RECEIVER_IRQ_SLEEP_MODE_EXIT_BIT      _HRT_CSS_RECEIVER_2400_IRQ_SLEEP_MODE_EXIT_BIT
-#define _HRT_CSS_RECEIVER_IRQ_ERR_SOT_HS_BIT           _HRT_CSS_RECEIVER_2400_IRQ_ERR_SOT_HS_BIT
-#define _HRT_CSS_RECEIVER_IRQ_ERR_SOT_SYNC_HS_BIT      _HRT_CSS_RECEIVER_2400_IRQ_ERR_SOT_SYNC_HS_BIT
-#define _HRT_CSS_RECEIVER_IRQ_ERR_CONTROL_BIT          _HRT_CSS_RECEIVER_2400_IRQ_ERR_CONTROL_BIT
-#define _HRT_CSS_RECEIVER_IRQ_ERR_ECC_DOUBLE_BIT       _HRT_CSS_RECEIVER_2400_IRQ_ERR_ECC_DOUBLE_BIT
-#define _HRT_CSS_RECEIVER_IRQ_ERR_ECC_CORRECTED_BIT    _HRT_CSS_RECEIVER_2400_IRQ_ERR_ECC_CORRECTED_BIT
-#define _HRT_CSS_RECEIVER_IRQ_ERR_ECC_NO_CORRECTION_BIT        _HRT_CSS_RECEIVER_2400_IRQ_ERR_ECC_NO_CORRECTION_BIT
-#define _HRT_CSS_RECEIVER_IRQ_ERR_CRC_BIT              _HRT_CSS_RECEIVER_2400_IRQ_ERR_CRC_BIT
-#define _HRT_CSS_RECEIVER_IRQ_ERR_ID_BIT               _HRT_CSS_RECEIVER_2400_IRQ_ERR_ID_BIT
-#define _HRT_CSS_RECEIVER_IRQ_ERR_FRAME_SYNC_BIT       _HRT_CSS_RECEIVER_2400_IRQ_ERR_FRAME_SYNC_BIT
-#define _HRT_CSS_RECEIVER_IRQ_ERR_FRAME_DATA_BIT       _HRT_CSS_RECEIVER_2400_IRQ_ERR_FRAME_DATA_BIT
-#define _HRT_CSS_RECEIVER_IRQ_DATA_TIMEOUT_BIT         _HRT_CSS_RECEIVER_2400_IRQ_DATA_TIMEOUT_BIT
-#define _HRT_CSS_RECEIVER_IRQ_ERR_ESCAPE_BIT           _HRT_CSS_RECEIVER_2400_IRQ_ERR_ESCAPE_BIT
-#define _HRT_CSS_RECEIVER_IRQ_ERR_LINE_SYNC_BIT                _HRT_CSS_RECEIVER_2400_IRQ_ERR_LINE_SYNC_BIT
-
-#define _HRT_CSS_RECEIVER_FUNC_PROG_REG_IDX            _HRT_CSS_RECEIVER_2400_CSI2_FUNC_PROG_REG_IDX
-#define        _HRT_CSS_RECEIVER_DATA_TIMEOUT_IDX              _HRT_CSS_RECEIVER_2400_CSI2_DATA_TIMEOUT_IDX
-#define        _HRT_CSS_RECEIVER_DATA_TIMEOUT_BITS             _HRT_CSS_RECEIVER_2400_CSI2_DATA_TIMEOUT_BITS
-
-typedef struct capture_unit_state_s    capture_unit_state_t;
-typedef struct acquisition_unit_state_s        acquisition_unit_state_t;
-typedef struct ctrl_unit_state_s       ctrl_unit_state_t;
-
-/*
- * In 2300 ports can be configured independently and stream
- * formats need to be specified. In 2400, there are only 8
- * supported configurations but the HW is fused to support
- * only a single one.
- *
- * In 2300 the compressed format types are programmed by the
- * user. In 2400 all stream formats are encoded on the stream.
- *
- * Use the enum to check validity of a user configuration
- */
-typedef enum {
-       MONO_4L_1L_0L = 0,
-       MONO_3L_1L_0L,
-       MONO_2L_1L_0L,
-       MONO_1L_1L_0L,
-       STEREO_2L_1L_2L,
-       STEREO_3L_1L_1L,
-       STEREO_2L_1L_1L,
-       STEREO_1L_1L_1L,
-       N_RX_MODE
-} rx_mode_t;
-
-typedef enum {
-       MIPI_PREDICTOR_NONE = 0,
-       MIPI_PREDICTOR_TYPE1,
-       MIPI_PREDICTOR_TYPE2,
-       N_MIPI_PREDICTOR_TYPES
-} mipi_predictor_t;
-
-typedef enum {
-       MIPI_COMPRESSOR_NONE = 0,
-       MIPI_COMPRESSOR_10_6_10,
-       MIPI_COMPRESSOR_10_7_10,
-       MIPI_COMPRESSOR_10_8_10,
-       MIPI_COMPRESSOR_12_6_12,
-       MIPI_COMPRESSOR_12_7_12,
-       MIPI_COMPRESSOR_12_8_12,
-       N_MIPI_COMPRESSOR_METHODS
-} mipi_compressor_t;
-
-typedef enum {
-       MIPI_FORMAT_RGB888 = 0,
-       MIPI_FORMAT_RGB555,
-       MIPI_FORMAT_RGB444,
-       MIPI_FORMAT_RGB565,
-       MIPI_FORMAT_RGB666,
-       MIPI_FORMAT_RAW8,               /* 5 */
-       MIPI_FORMAT_RAW10,
-       MIPI_FORMAT_RAW6,
-       MIPI_FORMAT_RAW7,
-       MIPI_FORMAT_RAW12,
-       MIPI_FORMAT_RAW14,              /* 10 */
-       MIPI_FORMAT_YUV420_8,
-       MIPI_FORMAT_YUV420_10,
-       MIPI_FORMAT_YUV422_8,
-       MIPI_FORMAT_YUV422_10,
-       MIPI_FORMAT_CUSTOM0,    /* 15 */
-       MIPI_FORMAT_YUV420_8_LEGACY,
-       MIPI_FORMAT_EMBEDDED,
-       MIPI_FORMAT_CUSTOM1,
-       MIPI_FORMAT_CUSTOM2,
-       MIPI_FORMAT_CUSTOM3,    /* 20 */
-       MIPI_FORMAT_CUSTOM4,
-       MIPI_FORMAT_CUSTOM5,
-       MIPI_FORMAT_CUSTOM6,
-       MIPI_FORMAT_CUSTOM7,
-       MIPI_FORMAT_YUV420_8_SHIFT,     /* 25 */
-       MIPI_FORMAT_YUV420_10_SHIFT,
-       MIPI_FORMAT_RAW16,
-       MIPI_FORMAT_RAW18,
-       N_MIPI_FORMAT,
-} mipi_format_t;
-
-#define MIPI_FORMAT_JPEG               MIPI_FORMAT_CUSTOM0
-#define MIPI_FORMAT_BINARY_8   MIPI_FORMAT_CUSTOM0
-#define N_MIPI_FORMAT_CUSTOM   8
-
-/* The number of stores for compressed format types */
-#define        N_MIPI_COMPRESSOR_CONTEXT       (N_RX_CHANNEL_ID * N_MIPI_FORMAT_CUSTOM)
-
-typedef enum {
-       RX_IRQ_INFO_BUFFER_OVERRUN   = 1UL << _HRT_CSS_RECEIVER_IRQ_OVERRUN_BIT,
-       RX_IRQ_INFO_INIT_TIMEOUT     = 1UL << _HRT_CSS_RECEIVER_IRQ_INIT_TIMEOUT_BIT,
-       RX_IRQ_INFO_ENTER_SLEEP_MODE = 1UL << _HRT_CSS_RECEIVER_IRQ_SLEEP_MODE_ENTRY_BIT,
-       RX_IRQ_INFO_EXIT_SLEEP_MODE  = 1UL << _HRT_CSS_RECEIVER_IRQ_SLEEP_MODE_EXIT_BIT,
-       RX_IRQ_INFO_ECC_CORRECTED    = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_ECC_CORRECTED_BIT,
-       RX_IRQ_INFO_ERR_SOT          = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_SOT_HS_BIT,
-       RX_IRQ_INFO_ERR_SOT_SYNC     = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_SOT_SYNC_HS_BIT,
-       RX_IRQ_INFO_ERR_CONTROL      = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_CONTROL_BIT,
-       RX_IRQ_INFO_ERR_ECC_DOUBLE   = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_ECC_DOUBLE_BIT,
-       /*      RX_IRQ_INFO_NO_ERR           = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_ECC_NO_CORRECTION_BIT, */
-       RX_IRQ_INFO_ERR_CRC          = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_CRC_BIT,
-       RX_IRQ_INFO_ERR_UNKNOWN_ID   = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_ID_BIT,
-       RX_IRQ_INFO_ERR_FRAME_SYNC   = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_FRAME_SYNC_BIT,
-       RX_IRQ_INFO_ERR_FRAME_DATA   = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_FRAME_DATA_BIT,
-       RX_IRQ_INFO_ERR_DATA_TIMEOUT = 1UL << _HRT_CSS_RECEIVER_IRQ_DATA_TIMEOUT_BIT,
-       RX_IRQ_INFO_ERR_UNKNOWN_ESC  = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_ESCAPE_BIT,
-       RX_IRQ_INFO_ERR_LINE_SYNC    = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_LINE_SYNC_BIT,
-}  rx_irq_info_t;
-
-typedef struct rx_cfg_s                rx_cfg_t;
-
-/*
- * Applied per port
- */
-struct rx_cfg_s {
-       rx_mode_t                       mode;   /* The HW config */
-       enum mipi_port_id               port;   /* The port ID to apply the control on */
-       unsigned int            timeout;
-       unsigned int            initcount;
-       unsigned int            synccount;
-       unsigned int            rxcount;
-       mipi_predictor_t        comp;   /* Just for backward compatibility */
-       bool                is_two_ppc;
-};
-
-/* NOTE: The base has already an offset of 0x0100 */
-static const hrt_address MIPI_PORT_OFFSET[N_MIPI_PORT_ID] = {
-       0x00000000UL,
-       0x00000100UL,
-       0x00000200UL
-};
-
-static const mipi_lane_cfg_t MIPI_PORT_MAXLANES[N_MIPI_PORT_ID] = {
-       MIPI_4LANE_CFG,
-       MIPI_1LANE_CFG,
-       MIPI_2LANE_CFG
-};
-
-static const bool MIPI_PORT_ACTIVE[N_RX_MODE][N_MIPI_PORT_ID] = {
-       {true, true, false},
-       {true, true, false},
-       {true, true, false},
-       {true, true, false},
-       {true, true, true},
-       {true, true, true},
-       {true, true, true},
-       {true, true, true}
-};
-
-static const mipi_lane_cfg_t MIPI_PORT_LANES[N_RX_MODE][N_MIPI_PORT_ID] = {
-       {MIPI_4LANE_CFG, MIPI_1LANE_CFG, MIPI_0LANE_CFG},
-       {MIPI_3LANE_CFG, MIPI_1LANE_CFG, MIPI_0LANE_CFG},
-       {MIPI_2LANE_CFG, MIPI_1LANE_CFG, MIPI_0LANE_CFG},
-       {MIPI_1LANE_CFG, MIPI_1LANE_CFG, MIPI_0LANE_CFG},
-       {MIPI_2LANE_CFG, MIPI_1LANE_CFG, MIPI_2LANE_CFG},
-       {MIPI_3LANE_CFG, MIPI_1LANE_CFG, MIPI_1LANE_CFG},
-       {MIPI_2LANE_CFG, MIPI_1LANE_CFG, MIPI_1LANE_CFG},
-       {MIPI_1LANE_CFG, MIPI_1LANE_CFG, MIPI_1LANE_CFG}
-};
-
-static const hrt_address SUB_SYSTEM_OFFSET[N_SUB_SYSTEM_ID] = {
-       0x00001000UL,
-       0x00002000UL,
-       0x00003000UL,
-       0x00004000UL,
-       0x00005000UL,
-       0x00009000UL,
-       0x0000A000UL,
-       0x0000B000UL,
-       0x0000C000UL
-};
-
-struct capture_unit_state_s {
-       int     Packet_Length;
-       int     Received_Length;
-       int     Received_Short_Packets;
-       int     Received_Long_Packets;
-       int     Last_Command;
-       int     Next_Command;
-       int     Last_Acknowledge;
-       int     Next_Acknowledge;
-       int     FSM_State_Info;
-       int     StartMode;
-       int     Start_Addr;
-       int     Mem_Region_Size;
-       int     Num_Mem_Regions;
-       /*      int     Init;   write-only registers
-               int     Start;
-               int     Stop;      */
-};
-
-struct acquisition_unit_state_s {
-       /*      int     Init;   write-only register */
-       int     Received_Short_Packets;
-       int     Received_Long_Packets;
-       int     Last_Command;
-       int     Next_Command;
-       int     Last_Acknowledge;
-       int     Next_Acknowledge;
-       int     FSM_State_Info;
-       int     Int_Cntr_Info;
-       int     Start_Addr;
-       int     Mem_Region_Size;
-       int     Num_Mem_Regions;
-};
-
-struct ctrl_unit_state_s {
-       int     last_cmd;
-       int     next_cmd;
-       int     last_ack;
-       int     next_ack;
-       int     top_fsm_state;
-       int     captA_fsm_state;
-       int     captB_fsm_state;
-       int     captC_fsm_state;
-       int     acq_fsm_state;
-       int     captA_start_addr;
-       int     captB_start_addr;
-       int     captC_start_addr;
-       int     captA_mem_region_size;
-       int     captB_mem_region_size;
-       int     captC_mem_region_size;
-       int     captA_num_mem_regions;
-       int     captB_num_mem_regions;
-       int     captC_num_mem_regions;
-       int     acq_start_addr;
-       int     acq_mem_region_size;
-       int     acq_num_mem_regions;
-       /*      int     ctrl_init;  write only register */
-       int     capt_reserve_one_mem_region;
-};
-
-struct input_system_state_s {
-       int     str_multicastA_sel;
-       int     str_multicastB_sel;
-       int     str_multicastC_sel;
-       int     str_mux_sel;
-       int     str_mon_status;
-       int     str_mon_irq_cond;
-       int     str_mon_irq_en;
-       int     isys_srst;
-       int     isys_slv_reg_srst;
-       int     str_deint_portA_cnt;
-       int     str_deint_portB_cnt;
-       struct capture_unit_state_s             capture_unit[N_CAPTURE_UNIT_ID];
-       struct acquisition_unit_state_s acquisition_unit[N_ACQUISITION_UNIT_ID];
-       struct ctrl_unit_state_s                ctrl_unit_state[N_CTRL_UNIT_ID];
-};
-
-struct mipi_port_state_s {
-       int     device_ready;
-       int     irq_status;
-       int     irq_enable;
-       u32     timeout_count;
-       u16     init_count;
-       u16     raw16_18;
-       u32     sync_count;             /*4 x uint8_t */
-       u32     rx_count;               /*4 x uint8_t */
-       u8              lane_sync_count[MIPI_4LANE_CFG];
-       u8              lane_rx_count[MIPI_4LANE_CFG];
-};
-
-struct rx_channel_state_s {
-       u32     comp_scheme0;
-       u32     comp_scheme1;
-       mipi_predictor_t                pred[N_MIPI_FORMAT_CUSTOM];
-       mipi_compressor_t               comp[N_MIPI_FORMAT_CUSTOM];
-};
-
-struct receiver_state_s {
-       u8      fs_to_ls_delay;
-       u8      ls_to_data_delay;
-       u8      data_to_le_delay;
-       u8      le_to_fe_delay;
-       u8      fe_to_fs_delay;
-       u8      le_to_fs_delay;
-       bool    is_two_ppc;
-       int     backend_rst;
-       u16     raw18;
-       bool            force_raw8;
-       u16     raw16;
-       struct mipi_port_state_s        mipi_port_state[N_MIPI_PORT_ID];
-       struct rx_channel_state_s       rx_channel_state[N_RX_CHANNEL_ID];
-       int     be_gsp_acc_ovl;
-       int     be_srst;
-       int     be_is_two_ppc;
-       int     be_comp_format0;
-       int     be_comp_format1;
-       int     be_comp_format2;
-       int     be_comp_format3;
-       int     be_sel;
-       int     be_raw16_config;
-       int     be_raw18_config;
-       int     be_force_raw8;
-       int     be_irq_status;
-       int     be_irq_clear;
-};
-
-#endif /* __INPUT_SYSTEM_LOCAL_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system_private.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system_private.h
deleted file mode 100644 (file)
index 0ce9cbc..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __INPUT_SYSTEM_PRIVATE_H_INCLUDED__
-#define __INPUT_SYSTEM_PRIVATE_H_INCLUDED__
-
-#include "input_system_public.h"
-
-#include "device_access.h"
-
-#include "assert_support.h"
-
-STORAGE_CLASS_INPUT_SYSTEM_C void input_system_reg_store(
-    const input_system_ID_t                    ID,
-    const hrt_address                  reg,
-    const hrt_data                             value)
-{
-       assert(ID < N_INPUT_SYSTEM_ID);
-       assert(INPUT_SYSTEM_BASE[ID] != (hrt_address)-1);
-       ia_css_device_store_uint32(INPUT_SYSTEM_BASE[ID] + reg * sizeof(hrt_data),
-                                  value);
-       return;
-}
-
-STORAGE_CLASS_INPUT_SYSTEM_C hrt_data input_system_reg_load(
-    const input_system_ID_t                    ID,
-    const hrt_address                  reg)
-{
-       assert(ID < N_INPUT_SYSTEM_ID);
-       assert(INPUT_SYSTEM_BASE[ID] != (hrt_address)-1);
-       return ia_css_device_load_uint32(INPUT_SYSTEM_BASE[ID] + reg * sizeof(
-                                            hrt_data));
-}
-
-STORAGE_CLASS_INPUT_SYSTEM_C void receiver_reg_store(
-    const rx_ID_t                              ID,
-    const hrt_address                  reg,
-    const hrt_data                             value)
-{
-       assert(ID < N_RX_ID);
-       assert(RX_BASE[ID] != (hrt_address)-1);
-       ia_css_device_store_uint32(RX_BASE[ID] + reg * sizeof(hrt_data), value);
-       return;
-}
-
-STORAGE_CLASS_INPUT_SYSTEM_C hrt_data receiver_reg_load(
-    const rx_ID_t                              ID,
-    const hrt_address                  reg)
-{
-       assert(ID < N_RX_ID);
-       assert(RX_BASE[ID] != (hrt_address)-1);
-       return ia_css_device_load_uint32(RX_BASE[ID] + reg * sizeof(hrt_data));
-}
-
-STORAGE_CLASS_INPUT_SYSTEM_C void receiver_port_reg_store(
-    const rx_ID_t                              ID,
-    const enum mipi_port_id                    port_ID,
-    const hrt_address                  reg,
-    const hrt_data                             value)
-{
-       assert(ID < N_RX_ID);
-       assert(port_ID < N_MIPI_PORT_ID);
-       assert(RX_BASE[ID] != (hrt_address)-1);
-       assert(MIPI_PORT_OFFSET[port_ID] != (hrt_address)-1);
-       ia_css_device_store_uint32(RX_BASE[ID] + MIPI_PORT_OFFSET[port_ID] + reg *
-                                  sizeof(hrt_data), value);
-       return;
-}
-
-STORAGE_CLASS_INPUT_SYSTEM_C hrt_data receiver_port_reg_load(
-    const rx_ID_t                              ID,
-    const enum mipi_port_id                    port_ID,
-    const hrt_address                  reg)
-{
-       assert(ID < N_RX_ID);
-       assert(port_ID < N_MIPI_PORT_ID);
-       assert(RX_BASE[ID] != (hrt_address)-1);
-       assert(MIPI_PORT_OFFSET[port_ID] != (hrt_address)-1);
-       return ia_css_device_load_uint32(RX_BASE[ID] + MIPI_PORT_OFFSET[port_ID] + reg *
-                                        sizeof(hrt_data));
-}
-
-STORAGE_CLASS_INPUT_SYSTEM_C void input_system_sub_system_reg_store(
-    const input_system_ID_t                    ID,
-    const sub_system_ID_t                      sub_ID,
-    const hrt_address                  reg,
-    const hrt_data                             value)
-{
-       assert(ID < N_INPUT_SYSTEM_ID);
-       assert(sub_ID < N_SUB_SYSTEM_ID);
-       assert(INPUT_SYSTEM_BASE[ID] != (hrt_address)-1);
-       assert(SUB_SYSTEM_OFFSET[sub_ID] != (hrt_address)-1);
-       ia_css_device_store_uint32(INPUT_SYSTEM_BASE[ID] + SUB_SYSTEM_OFFSET[sub_ID] +
-                                  reg * sizeof(hrt_data), value);
-       return;
-}
-
-STORAGE_CLASS_INPUT_SYSTEM_C hrt_data input_system_sub_system_reg_load(
-    const input_system_ID_t                    ID,
-    const sub_system_ID_t                      sub_ID,
-    const hrt_address                  reg)
-{
-       assert(ID < N_INPUT_SYSTEM_ID);
-       assert(sub_ID < N_SUB_SYSTEM_ID);
-       assert(INPUT_SYSTEM_BASE[ID] != (hrt_address)-1);
-       assert(SUB_SYSTEM_OFFSET[sub_ID] != (hrt_address)-1);
-       return ia_css_device_load_uint32(INPUT_SYSTEM_BASE[ID] +
-                                        SUB_SYSTEM_OFFSET[sub_ID] + reg * sizeof(hrt_data));
-}
-
-#endif /* __INPUT_SYSTEM_PRIVATE_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/system_local.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/system_local.h
deleted file mode 100644 (file)
index ee38059..0000000
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef __SYSTEM_LOCAL_H_INCLUDED__
-#define __SYSTEM_LOCAL_H_INCLUDED__
-
-#ifdef HRT_ISP_CSS_CUSTOM_HOST
-#ifndef HRT_USE_VIR_ADDRS
-#define HRT_USE_VIR_ADDRS
-#endif
-/* This interface is deprecated */
-/*#include "hive_isp_css_custom_host_hrt.h"*/
-#endif
-
-#include "system_global.h"
-
-/* HRT assumes 32 by default (see Linux/include/hive_types.h), overrule it in case it is different */
-#undef HRT_ADDRESS_WIDTH
-#define HRT_ADDRESS_WIDTH      64              /* Surprise, this is a local property */
-
-/* This interface is deprecated */
-#include "hive_types.h"
-
-/*
- * Cell specific address maps
- */
-#if HRT_ADDRESS_WIDTH == 64
-
-#define GP_FIFO_BASE   ((hrt_address)0x0000000000090104)               /* This is NOT a base address */
-
-/* DDR */
-static const hrt_address DDR_BASE[N_DDR_ID] = {
-       (hrt_address)0x0000000120000000ULL
-};
-
-/* ISP */
-static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
-       (hrt_address)0x0000000000020000ULL
-};
-
-static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
-       (hrt_address)0x0000000000200000ULL
-};
-
-static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
-       (hrt_address)0x0000000000100000ULL
-};
-
-static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
-       (hrt_address)0x00000000001C0000ULL,
-       (hrt_address)0x00000000001D0000ULL,
-       (hrt_address)0x00000000001E0000ULL
-};
-
-static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
-       (hrt_address)0x00000000001F0000ULL
-};
-
-/* SP */
-static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
-       (hrt_address)0x0000000000010000ULL
-};
-
-static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
-       (hrt_address)0x0000000000300000ULL
-};
-
-static const hrt_address SP_PMEM_BASE[N_SP_ID] = {
-       (hrt_address)0x00000000000B0000ULL
-};
-
-/* MMU */
-#if defined(IS_ISP_2400_MAMOIADA_SYSTEM) || defined(IS_ISP_2401_MAMOIADA_SYSTEM)
-/*
- * MMU0_ID: The data MMU
- * MMU1_ID: The icache MMU
- */
-static const hrt_address MMU_BASE[N_MMU_ID] = {
-       (hrt_address)0x0000000000070000ULL,
-       (hrt_address)0x00000000000A0000ULL
-};
-#else
-#error "system_local.h: SYSTEM must be one of {2400, 2401 }"
-#endif
-
-/* DMA */
-static const hrt_address DMA_BASE[N_DMA_ID] = {
-       (hrt_address)0x0000000000040000ULL
-};
-
-/* IRQ */
-static const hrt_address IRQ_BASE[N_IRQ_ID] = {
-       (hrt_address)0x0000000000000500ULL,
-       (hrt_address)0x0000000000030A00ULL,
-       (hrt_address)0x000000000008C000ULL,
-       (hrt_address)0x0000000000090200ULL
-};
-/*
-       (hrt_address)0x0000000000000500ULL};
- */
-
-/* GDC */
-static const hrt_address GDC_BASE[N_GDC_ID] = {
-       (hrt_address)0x0000000000050000ULL,
-       (hrt_address)0x0000000000060000ULL
-};
-
-/* FIFO_MONITOR (not a subset of GP_DEVICE) */
-static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
-       (hrt_address)0x0000000000000000ULL
-};
-
-/*
-static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
-       (hrt_address)0x0000000000000000ULL};
-
-static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
-       (hrt_address)0x0000000000090000ULL};
-*/
-
-/* GP_DEVICE (single base for all separate GP_REG instances) */
-static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
-       (hrt_address)0x0000000000000000ULL
-};
-
-/*GP TIMER , all timer registers are inter-twined,
- * so, having multiple base addresses for
- * different timers does not help*/
-static const hrt_address GP_TIMER_BASE =
-    (hrt_address)0x0000000000000600ULL;
-/* GPIO */
-static const hrt_address GPIO_BASE[N_GPIO_ID] = {
-       (hrt_address)0x0000000000000400ULL
-};
-
-/* TIMED_CTRL */
-static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
-       (hrt_address)0x0000000000000100ULL
-};
-
-/* INPUT_FORMATTER */
-static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
-       (hrt_address)0x0000000000030000ULL,
-       (hrt_address)0x0000000000030200ULL,
-       (hrt_address)0x0000000000030400ULL,
-       (hrt_address)0x0000000000030600ULL
-}; /* memcpy() */
-
-/* INPUT_SYSTEM */
-static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
-       (hrt_address)0x0000000000080000ULL
-};
-/*     (hrt_address)0x0000000000081000ULL, */ /* capture A */
-/*     (hrt_address)0x0000000000082000ULL, */ /* capture B */
-/*     (hrt_address)0x0000000000083000ULL, */ /* capture C */
-/*     (hrt_address)0x0000000000084000ULL, */ /* Acquisition */
-/*     (hrt_address)0x0000000000085000ULL, */ /* DMA */
-/*     (hrt_address)0x0000000000089000ULL, */ /* ctrl */
-/*     (hrt_address)0x000000000008A000ULL, */ /* GP regs */
-/*     (hrt_address)0x000000000008B000ULL, */ /* FIFO */
-/*     (hrt_address)0x000000000008C000ULL, */ /* IRQ */
-
-/* RX, the MIPI lane control regs start at offset 0 */
-static const hrt_address RX_BASE[N_RX_ID] = {
-       (hrt_address)0x0000000000080100ULL
-};
-
-#elif HRT_ADDRESS_WIDTH == 32
-
-#define GP_FIFO_BASE   ((hrt_address)0x00090104)               /* This is NOT a base address */
-
-/* DDR : Attention, this value not defined in 32-bit */
-static const hrt_address DDR_BASE[N_DDR_ID] = {
-       (hrt_address)0x00000000UL
-};
-
-/* ISP */
-static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
-       (hrt_address)0x00020000UL
-};
-
-static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
-       (hrt_address)0x00200000UL
-};
-
-static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
-       (hrt_address)0x100000UL
-};
-
-static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
-       (hrt_address)0xffffffffUL,
-       (hrt_address)0xffffffffUL,
-       (hrt_address)0xffffffffUL
-};
-
-static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
-       (hrt_address)0xffffffffUL
-};
-
-/* SP */
-static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
-       (hrt_address)0x00010000UL
-};
-
-static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
-       (hrt_address)0x00300000UL
-};
-
-static const hrt_address SP_PMEM_BASE[N_SP_ID] = {
-       (hrt_address)0x000B0000UL
-};
-
-/* MMU */
-#if defined(IS_ISP_2400_MAMOIADA_SYSTEM) || defined(IS_ISP_2401_MAMOIADA_SYSTEM)
-/*
- * MMU0_ID: The data MMU
- * MMU1_ID: The icache MMU
- */
-static const hrt_address MMU_BASE[N_MMU_ID] = {
-       (hrt_address)0x00070000UL,
-       (hrt_address)0x000A0000UL
-};
-#else
-#error "system_local.h: SYSTEM must be one of {2400, 2401 }"
-#endif
-
-/* DMA */
-static const hrt_address DMA_BASE[N_DMA_ID] = {
-       (hrt_address)0x00040000UL
-};
-
-/* IRQ */
-static const hrt_address IRQ_BASE[N_IRQ_ID] = {
-       (hrt_address)0x00000500UL,
-       (hrt_address)0x00030A00UL,
-       (hrt_address)0x0008C000UL,
-       (hrt_address)0x00090200UL
-};
-/*
-       (hrt_address)0x00000500UL};
- */
-
-/* GDC */
-static const hrt_address GDC_BASE[N_GDC_ID] = {
-       (hrt_address)0x00050000UL,
-       (hrt_address)0x00060000UL
-};
-
-/* FIFO_MONITOR (not a subset of GP_DEVICE) */
-static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
-       (hrt_address)0x00000000UL
-};
-
-/*
-static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
-       (hrt_address)0x00000000UL};
-
-static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
-       (hrt_address)0x00090000UL};
-*/
-
-/* GP_DEVICE (single base for all separate GP_REG instances) */
-static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
-       (hrt_address)0x00000000UL
-};
-
-/*GP TIMER , all timer registers are inter-twined,
- * so, having multiple base addresses for
- * different timers does not help*/
-static const hrt_address GP_TIMER_BASE =
-    (hrt_address)0x00000600UL;
-
-/* GPIO */
-static const hrt_address GPIO_BASE[N_GPIO_ID] = {
-       (hrt_address)0x00000400UL
-};
-
-/* TIMED_CTRL */
-static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
-       (hrt_address)0x00000100UL
-};
-
-/* INPUT_FORMATTER */
-static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
-       (hrt_address)0x00030000UL,
-       (hrt_address)0x00030200UL,
-       (hrt_address)0x00030400UL
-};
-/*     (hrt_address)0x00030600UL, */ /* memcpy() */
-
-/* INPUT_SYSTEM */
-static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
-       (hrt_address)0x00080000UL
-};
-/*     (hrt_address)0x00081000UL, */ /* capture A */
-/*     (hrt_address)0x00082000UL, */ /* capture B */
-/*     (hrt_address)0x00083000UL, */ /* capture C */
-/*     (hrt_address)0x00084000UL, */ /* Acquisition */
-/*     (hrt_address)0x00085000UL, */ /* DMA */
-/*     (hrt_address)0x00089000UL, */ /* ctrl */
-/*     (hrt_address)0x0008A000UL, */ /* GP regs */
-/*     (hrt_address)0x0008B000UL, */ /* FIFO */
-/*     (hrt_address)0x0008C000UL, */ /* IRQ */
-
-/* RX, the MIPI lane control regs start at offset 0 */
-static const hrt_address RX_BASE[N_RX_ID] = {
-       (hrt_address)0x00080100UL
-};
-
-#else
-#error "system_local.h: HRT_ADDRESS_WIDTH must be one of {32,64}"
-#endif
-
-#endif /* __SYSTEM_LOCAL_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_system_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/input_system_global.h
deleted file mode 100644 (file)
index 759141c..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Support for Intel Camera Imaging ISP subsystem.
- * Copyright (c) 2015, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- */
-
-#ifndef __INPUT_SYSTEM_GLOBAL_H_INCLUDED__
-#define __INPUT_SYSTEM_GLOBAL_H_INCLUDED__
-
-#define IS_INPUT_SYSTEM_VERSION_2
-
-#include <type_support.h>
-
-//CSI reveiver has 3 ports.
-#define                N_CSI_PORTS (3)
-//AM: Use previous define for this.
-
-//MIPI allows upto 4 channels.
-#define                N_CHANNELS  (4)
-// 12KB = 256bit x 384 words
-#define                IB_CAPACITY_IN_WORDS (384)
-
-typedef enum {
-       MIPI_0LANE_CFG = 0,
-       MIPI_1LANE_CFG = 1,
-       MIPI_2LANE_CFG = 2,
-       MIPI_3LANE_CFG = 3,
-       MIPI_4LANE_CFG = 4
-} mipi_lane_cfg_t;
-
-typedef enum {
-       INPUT_SYSTEM_SOURCE_SENSOR = 0,
-       INPUT_SYSTEM_SOURCE_FIFO,
-       INPUT_SYSTEM_SOURCE_TPG,
-       INPUT_SYSTEM_SOURCE_PRBS,
-       INPUT_SYSTEM_SOURCE_MEMORY,
-       N_INPUT_SYSTEM_SOURCE
-} input_system_source_t;
-
-/* internal routing configuration */
-typedef enum {
-       INPUT_SYSTEM_DISCARD_ALL = 0,
-       INPUT_SYSTEM_CSI_BACKEND = 1,
-       INPUT_SYSTEM_INPUT_BUFFER = 2,
-       INPUT_SYSTEM_MULTICAST = 3,
-       N_INPUT_SYSTEM_CONNECTION
-} input_system_connection_t;
-
-typedef enum {
-       INPUT_SYSTEM_MIPI_PORT0,
-       INPUT_SYSTEM_MIPI_PORT1,
-       INPUT_SYSTEM_MIPI_PORT2,
-       INPUT_SYSTEM_ACQUISITION_UNIT,
-       N_INPUT_SYSTEM_MULTIPLEX
-} input_system_multiplex_t;
-
-typedef enum {
-       INPUT_SYSTEM_SINK_MEMORY = 0,
-       INPUT_SYSTEM_SINK_ISP,
-       INPUT_SYSTEM_SINK_SP,
-       N_INPUT_SYSTEM_SINK
-} input_system_sink_t;
-
-typedef enum {
-       INPUT_SYSTEM_FIFO_CAPTURE = 0,
-       INPUT_SYSTEM_FIFO_CAPTURE_WITH_COUNTING,
-       INPUT_SYSTEM_SRAM_BUFFERING,
-       INPUT_SYSTEM_XMEM_BUFFERING,
-       INPUT_SYSTEM_XMEM_CAPTURE,
-       INPUT_SYSTEM_XMEM_ACQUIRE,
-       N_INPUT_SYSTEM_BUFFERING_MODE
-} buffering_mode_t;
-
-typedef struct input_system_cfg_s      input_system_cfg_t;
-typedef struct sync_generator_cfg_s    sync_generator_cfg_t;
-typedef struct tpg_cfg_s                       tpg_cfg_t;
-typedef struct prbs_cfg_s                      prbs_cfg_t;
-
-/* MW: uint16_t should be sufficient */
-struct input_system_cfg_s {
-       u32     no_side_band;
-       u32     fmt_type;
-       u32     ch_id;
-       u32     input_mode;
-};
-
-struct sync_generator_cfg_s {
-       u32     width;
-       u32     height;
-       u32     hblank_cycles;
-       u32     vblank_cycles;
-};
-
-/* MW: tpg & prbs are exclusive */
-struct tpg_cfg_s {
-       u32     x_mask;
-       u32     y_mask;
-       u32     x_delta;
-       u32     y_delta;
-       u32     xy_mask;
-       sync_generator_cfg_t sync_gen_cfg;
-};
-
-struct prbs_cfg_s {
-       u32     seed;
-       sync_generator_cfg_t sync_gen_cfg;
-};
-
-struct gpfifo_cfg_s {
-// TBD.
-       sync_generator_cfg_t sync_gen_cfg;
-};
-
-typedef struct gpfifo_cfg_s            gpfifo_cfg_t;
-
-//ALX:Commented out to pass the compilation.
-//typedef struct input_system_cfg_s input_system_cfg_t;
-
-struct ib_buffer_s {
-       u32     mem_reg_size;
-       u32     nof_mem_regs;
-       u32     mem_reg_addr;
-};
-
-typedef struct ib_buffer_s     ib_buffer_t;
-
-struct csi_cfg_s {
-       u32                     csi_port;
-       buffering_mode_t        buffering_mode;
-       ib_buffer_t                     csi_buffer;
-       ib_buffer_t                     acquisition_buffer;
-       u32                     nof_xmem_buffers;
-};
-
-typedef struct csi_cfg_s        csi_cfg_t;
-
-typedef enum {
-       INPUT_SYSTEM_CFG_FLAG_RESET     = 0,
-       INPUT_SYSTEM_CFG_FLAG_SET               = 1U << 0,
-       INPUT_SYSTEM_CFG_FLAG_BLOCKED   = 1U << 1,
-       INPUT_SYSTEM_CFG_FLAG_REQUIRED  = 1U << 2,
-       INPUT_SYSTEM_CFG_FLAG_CONFLICT  = 1U << 3       // To mark a conflicting configuration.
-} input_system_cfg_flag_t;
-
-typedef u32 input_system_config_flags_t;
-
-#endif /* __INPUT_SYSTEM_GLOBAL_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/system_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/system_global.h
deleted file mode 100644 (file)
index 21938de..0000000
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * Support for Intel Camera Imaging ISP subsystem.
- * Copyright (c) 2015, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- */
-
-#ifndef __SYSTEM_GLOBAL_H_INCLUDED__
-#define __SYSTEM_GLOBAL_H_INCLUDED__
-
-#include <hive_isp_css_defs.h>
-#include <type_support.h>
-
-/*
- * The longest allowed (uninteruptible) bus transfer, does not
- * take stalling into account
- */
-#define HIVE_ISP_MAX_BURST_LENGTH      1024
-
-/*
- * Maximum allowed burst length in words for the ISP DMA
- */
-#define ISP_DMA_MAX_BURST_LENGTH       128
-
-/*
- * Create a list of HAS and IS properties that defines the system
- *
- * The configuration assumes the following
- * - The system is hetereogeneous; Multiple cells and devices classes
- * - The cell and device instances are homogeneous, each device type
- *   belongs to the same class
- * - Device instances supporting a subset of the class capabilities are
- *   allowed
- *
- * We could manage different device classes through the enumerated
- * lists (C) or the use of classes (C++), but that is presently not
- * fully supported
- *
- * 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}
- *
- * The 2401 system has the nice property that it uses a vanilla 2400 SP
- * so the SP will believe it is a 2400 system rather than 2401...
- */
-//#if defined(SYSTEM_hive_isp_css_2401_system) || defined(__isp2401_mamoiada) || defined(__scalar_processor_2401)
-#if defined(SYSTEM_hive_isp_css_2401_system) || defined(__isp2401_mamoiada)
-#define IS_ISP_2401_MAMOIADA_SYSTEM
-#define HAS_ISP_2401_MAMOIADA
-#define HAS_SP_2400
-//#elif defined(SYSTEM_hive_isp_css_2400_system) || defined(__isp2400_mamoiada) || defined(__scalar_processor_2400)
-#elif defined(SYSTEM_hive_isp_css_2400_system) || defined(__isp2400_mamoiada)
-#define IS_ISP_2400_MAMOIADA_SYSTEM
-#define HAS_ISP_2400_MAMOIADA
-#define HAS_SP_2400
-#else
-#error "system_global.h: 2400_SYSTEM must be one of {2400, 2401 }"
-#endif
-
-#define USE_INPUT_SYSTEM_VERSION_2
-
-#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
-/* 2401: HAS_INPUT_SYSTEM_VERSION_2401 */
-#define HAS_INPUT_SYSTEM_VERSION_2
-#define HAS_BUFFERED_SENSOR
-#define HAS_FIFO_MONITORS_VERSION_2
-/* #define HAS_GP_REGS_VERSION_2 */
-#define HAS_GP_DEVICE_VERSION_2
-#define HAS_GPIO_VERSION_1
-#define HAS_TIMED_CTRL_VERSION_1
-#define HAS_RX_VERSION_2
-
-#define DMA_DDR_TO_VAMEM_WORKAROUND
-#define DMA_DDR_TO_HMEM_WORKAROUND
-
-/*
- * Semi global. "HRT" is accessible from SP, but the HRT types do not fully apply
- */
-#define HRT_VADDRESS_WIDTH     32
-//#define HRT_ADDRESS_WIDTH    64              /* Surprise, this is a local property*/
-#define HRT_DATA_WIDTH         32
-
-#define SIZEOF_HRT_REG         (HRT_DATA_WIDTH >> 3)
-#define HIVE_ISP_CTRL_DATA_BYTES (HIVE_ISP_CTRL_DATA_WIDTH / 8)
-
-/* The main bus connecting all devices */
-#define HRT_BUS_WIDTH          HIVE_ISP_CTRL_DATA_WIDTH
-#define HRT_BUS_BYTES          HIVE_ISP_CTRL_DATA_BYTES
-
-/* per-frame parameter handling support */
-#define SH_CSS_ENABLE_PER_FRAME_PARAMS
-
-typedef u32                    hrt_bus_align_t;
-
-/*
- * Enumerate the devices, device access through the API is by ID, through the DLI by address
- * The enumerator terminators are used to size the wiring arrays and as an exception value.
- */
-typedef enum {
-       DDR0_ID = 0,
-       N_DDR_ID
-} ddr_ID_t;
-
-typedef enum {
-       ISP0_ID = 0,
-       N_ISP_ID
-} isp_ID_t;
-
-typedef enum {
-       SP0_ID = 0,
-       N_SP_ID
-} sp_ID_t;
-
-#if defined(IS_ISP_2401_MAMOIADA_SYSTEM)
-typedef enum {
-       MMU0_ID = 0,
-       MMU1_ID,
-       N_MMU_ID
-} mmu_ID_t;
-#elif defined(IS_ISP_2400_MAMOIADA_SYSTEM)
-typedef enum {
-       MMU0_ID = 0,
-       MMU1_ID,
-       N_MMU_ID
-} mmu_ID_t;
-#else
-#error "system_global.h: SYSTEM must be one of {2400, 2401}"
-#endif
-
-typedef enum {
-       DMA0_ID = 0,
-       N_DMA_ID
-} dma_ID_t;
-
-typedef enum {
-       GDC0_ID = 0,
-       GDC1_ID,
-       N_GDC_ID
-} gdc_ID_t;
-
-#define N_GDC_ID_CPP 2 // this extra define is needed because we want to use it also in the preprocessor, and that doesn't work with enums.
-
-typedef enum {
-       VAMEM0_ID = 0,
-       VAMEM1_ID,
-       VAMEM2_ID,
-       N_VAMEM_ID
-} vamem_ID_t;
-
-typedef enum {
-       BAMEM0_ID = 0,
-       N_BAMEM_ID
-} bamem_ID_t;
-
-typedef enum {
-       HMEM0_ID = 0,
-       N_HMEM_ID
-} hmem_ID_t;
-
-/*
-typedef enum {
-       IRQ0_ID = 0,
-       N_IRQ_ID
-} irq_ID_t;
-*/
-
-typedef enum {
-       IRQ0_ID = 0,    // GP IRQ block
-       IRQ1_ID,                // Input formatter
-       IRQ2_ID,                // input system
-       IRQ3_ID,                // input selector
-       N_IRQ_ID
-} irq_ID_t;
-
-typedef enum {
-       FIFO_MONITOR0_ID = 0,
-       N_FIFO_MONITOR_ID
-} fifo_monitor_ID_t;
-
-/*
- * Deprecated: Since all gp_reg instances are different
- * and put in the address maps of other devices we cannot
- * enumerate them as that assumes the instrances are the
- * same.
- *
- * We define a single GP_DEVICE containing all gp_regs
- * w.r.t. a single base address
- *
-typedef enum {
-       GP_REGS0_ID = 0,
-       N_GP_REGS_ID
-} gp_regs_ID_t;
- */
-typedef enum {
-       GP_DEVICE0_ID = 0,
-       N_GP_DEVICE_ID
-} gp_device_ID_t;
-
-typedef enum {
-       GP_TIMER0_ID = 0,
-       GP_TIMER1_ID,
-       GP_TIMER2_ID,
-       GP_TIMER3_ID,
-       GP_TIMER4_ID,
-       GP_TIMER5_ID,
-       GP_TIMER6_ID,
-       GP_TIMER7_ID,
-       N_GP_TIMER_ID
-} gp_timer_ID_t;
-
-typedef enum {
-       GPIO0_ID = 0,
-       N_GPIO_ID
-} gpio_ID_t;
-
-typedef enum {
-       TIMED_CTRL0_ID = 0,
-       N_TIMED_CTRL_ID
-} timed_ctrl_ID_t;
-
-typedef enum {
-       INPUT_FORMATTER0_ID = 0,
-       INPUT_FORMATTER1_ID,
-       INPUT_FORMATTER2_ID,
-       INPUT_FORMATTER3_ID,
-       N_INPUT_FORMATTER_ID
-} input_formatter_ID_t;
-
-/* The IF RST is outside the IF */
-#define INPUT_FORMATTER0_SRST_OFFSET   0x0824
-#define INPUT_FORMATTER1_SRST_OFFSET   0x0624
-#define INPUT_FORMATTER2_SRST_OFFSET   0x0424
-#define INPUT_FORMATTER3_SRST_OFFSET   0x0224
-
-#define INPUT_FORMATTER0_SRST_MASK             0x0001
-#define INPUT_FORMATTER1_SRST_MASK             0x0002
-#define INPUT_FORMATTER2_SRST_MASK             0x0004
-#define INPUT_FORMATTER3_SRST_MASK             0x0008
-
-typedef enum {
-       INPUT_SYSTEM0_ID = 0,
-       N_INPUT_SYSTEM_ID
-} input_system_ID_t;
-
-typedef enum {
-       RX0_ID = 0,
-       N_RX_ID
-} rx_ID_t;
-
-enum mipi_port_id {
-       MIPI_PORT0_ID = 0,
-       MIPI_PORT1_ID,
-       MIPI_PORT2_ID,
-       N_MIPI_PORT_ID
-};
-
-#define        N_RX_CHANNEL_ID         4
-
-/* Generic port enumeration with an internal port type ID */
-typedef enum {
-       CSI_PORT0_ID = 0,
-       CSI_PORT1_ID,
-       CSI_PORT2_ID,
-       TPG_PORT0_ID,
-       PRBS_PORT0_ID,
-       FIFO_PORT0_ID,
-       MEMORY_PORT0_ID,
-       N_INPUT_PORT_ID
-} input_port_ID_t;
-
-typedef enum {
-       CAPTURE_UNIT0_ID = 0,
-       CAPTURE_UNIT1_ID,
-       CAPTURE_UNIT2_ID,
-       ACQUISITION_UNIT0_ID,
-       DMA_UNIT0_ID,
-       CTRL_UNIT0_ID,
-       GPREGS_UNIT0_ID,
-       FIFO_UNIT0_ID,
-       IRQ_UNIT0_ID,
-       N_SUB_SYSTEM_ID
-} sub_system_ID_t;
-
-#define        N_CAPTURE_UNIT_ID               3
-#define        N_ACQUISITION_UNIT_ID   1
-#define        N_CTRL_UNIT_ID                  1
-
-enum ia_css_isp_memories {
-       IA_CSS_ISP_PMEM0 = 0,
-       IA_CSS_ISP_DMEM0,
-       IA_CSS_ISP_VMEM0,
-       IA_CSS_ISP_VAMEM0,
-       IA_CSS_ISP_VAMEM1,
-       IA_CSS_ISP_VAMEM2,
-       IA_CSS_ISP_HMEM0,
-       IA_CSS_SP_DMEM0,
-       IA_CSS_DDR,
-       N_IA_CSS_MEMORIES
-};
-
-#define IA_CSS_NUM_MEMORIES 9
-/* For driver compatibility */
-#define N_IA_CSS_ISP_MEMORIES   IA_CSS_NUM_MEMORIES
-#define IA_CSS_NUM_ISP_MEMORIES IA_CSS_NUM_MEMORIES
-
-#if 0
-typedef enum {
-       dev_chn, /* device channels, external resource */
-       ext_mem, /* external memories */
-       int_mem, /* internal memories */
-       int_chn  /* internal channels, user defined */
-} resource_type_t;
-
-/* if this enum is extended with other memory resources, pls also extend the function resource_to_memptr() */
-typedef enum {
-       vied_nci_dev_chn_dma_ext0,
-       int_mem_vmem0,
-       int_mem_dmem0
-} resource_id_t;
-
-/* enum listing the different memories within a program group.
-   This enum is used in the mem_ptr_t type */
-typedef enum {
-       buf_mem_invalid = 0,
-       buf_mem_vmem_prog0,
-       buf_mem_dmem_prog0
-} buf_mem_t;
-
-#endif
-#endif /* __SYSTEM_GLOBAL_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/input_system_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/input_system_public.h
deleted file mode 100644 (file)
index d0de27a..0000000
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- * Support for Intel Camera Imaging ISP subsystem.
- * Copyright (c) 2015, Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- */
-
-#ifndef __INPUT_SYSTEM_PUBLIC_H_INCLUDED__
-#define __INPUT_SYSTEM_PUBLIC_H_INCLUDED__
-
-#include <type_support.h>
-#ifdef USE_INPUT_SYSTEM_VERSION_2401
-#include "isys_public.h"
-#else
-
-typedef struct input_system_state_s            input_system_state_t;
-typedef struct receiver_state_s                        receiver_state_t;
-
-/*! Read the state of INPUT_SYSTEM[ID]
-
- \param        ID[in]                          INPUT_SYSTEM identifier
- \param        state[out]                      input system state structure
-
- \return none, state = INPUT_SYSTEM[ID].state
- */
-void input_system_get_state(
-    const input_system_ID_t            ID,
-    input_system_state_t               *state);
-
-/*! Read the state of RECEIVER[ID]
-
- \param        ID[in]                          RECEIVER identifier
- \param        state[out]                      receiver state structure
-
- \return none, state = RECEIVER[ID].state
- */
-void receiver_get_state(
-    const rx_ID_t                              ID,
-    receiver_state_t                   *state);
-
-/*! Flag whether a MIPI format is YUV420
-
- \param        mipi_format[in]         MIPI format
-
- \return mipi_format == YUV420
- */
-bool is_mipi_format_yuv420(
-    const mipi_format_t                        mipi_format);
-
-/*! Set compression parameters for cfg[cfg_ID] of RECEIVER[ID]
-
- \param        ID[in]                          RECEIVER identifier
- \param        cfg_ID[in]                      Configuration identifier
- \param        comp[in]                        Compression method
- \param        pred[in]                        Predictor method
-
- \NOTE: the storage of compression configuration is
-       implementation specific. The config can be
-       carried either on MIPI ports or on MIPI channels
-
- \return none, RECEIVER[ID].cfg[cfg_ID] = {comp, pred}
- */
-void receiver_set_compression(
-    const rx_ID_t                              ID,
-    const unsigned int                 cfg_ID,
-    const mipi_compressor_t            comp,
-    const mipi_predictor_t             pred);
-
-/*! Enable PORT[port_ID] of RECEIVER[ID]
-
- \param        ID[in]                          RECEIVER identifier
- \param        port_ID[in]                     mipi PORT identifier
- \param        cnd[in]                         irq predicate
-
- \return None, enable(RECEIVER[ID].PORT[port_ID])
- */
-void receiver_port_enable(
-    const rx_ID_t                              ID,
-    const enum mipi_port_id            port_ID,
-    const bool                                 cnd);
-
-/*! Flag if PORT[port_ID] of RECEIVER[ID] is enabled
-
- \param        ID[in]                          RECEIVER identifier
- \param        port_ID[in]                     mipi PORT identifier
-
- \return enable(RECEIVER[ID].PORT[port_ID]) == true
- */
-bool is_receiver_port_enabled(
-    const rx_ID_t                              ID,
-    const enum mipi_port_id            port_ID);
-
-/*! Enable the IRQ channels of PORT[port_ID] of RECEIVER[ID]
-
- \param        ID[in]                          RECEIVER identifier
- \param        port_ID[in]                     mipi PORT identifier
- \param        irq_info[in]            irq channels
-
- \return None, enable(RECEIVER[ID].PORT[port_ID].irq_info)
- */
-void receiver_irq_enable(
-    const rx_ID_t                              ID,
-    const enum mipi_port_id            port_ID,
-    const rx_irq_info_t                        irq_info);
-
-/*! Return the IRQ status of PORT[port_ID] of RECEIVER[ID]
-
- \param        ID[in]                          RECEIVER identifier
- \param        port_ID[in]                     mipi PORT identifier
-
- \return RECEIVER[ID].PORT[port_ID].irq_info
- */
-rx_irq_info_t receiver_get_irq_info(
-    const rx_ID_t                              ID,
-    const enum mipi_port_id            port_ID);
-
-/*! Clear the IRQ status of PORT[port_ID] of RECEIVER[ID]
-
- \param        ID[in]                          RECEIVER identifier
- \param        port_ID[in]                     mipi PORT identifier
- \param        irq_info[in]            irq status
-
- \return None, clear(RECEIVER[ID].PORT[port_ID].irq_info)
- */
-void receiver_irq_clear(
-    const rx_ID_t                              ID,
-    const enum mipi_port_id                    port_ID,
-    const rx_irq_info_t                        irq_info);
-
-/*! Write to a control register of INPUT_SYSTEM[ID]
-
- \param        ID[in]                          INPUT_SYSTEM identifier
- \param        reg[in]                         register index
- \param value[in]                      The data to be written
-
- \return none, INPUT_SYSTEM[ID].ctrl[reg] = value
- */
-STORAGE_CLASS_INPUT_SYSTEM_H void input_system_reg_store(
-    const input_system_ID_t                    ID,
-    const hrt_address                  reg,
-    const hrt_data                             value);
-
-/*! Read from a control register of INPUT_SYSTEM[ID]
-
- \param        ID[in]                          INPUT_SYSTEM identifier
- \param        reg[in]                         register index
- \param value[in]                      The data to be written
-
- \return INPUT_SYSTEM[ID].ctrl[reg]
- */
-STORAGE_CLASS_INPUT_SYSTEM_H hrt_data input_system_reg_load(
-    const input_system_ID_t                    ID,
-    const hrt_address                  reg);
-
-/*! Write to a control register of RECEIVER[ID]
-
- \param        ID[in]                          RECEIVER identifier
- \param        reg[in]                         register index
- \param value[in]                      The data to be written
-
- \return none, RECEIVER[ID].ctrl[reg] = value
- */
-STORAGE_CLASS_INPUT_SYSTEM_H void receiver_reg_store(
-    const rx_ID_t                              ID,
-    const hrt_address                  reg,
-    const hrt_data                             value);
-
-/*! Read from a control register of RECEIVER[ID]
-
- \param        ID[in]                          RECEIVER identifier
- \param        reg[in]                         register index
- \param value[in]                      The data to be written
-
- \return RECEIVER[ID].ctrl[reg]
- */
-STORAGE_CLASS_INPUT_SYSTEM_H hrt_data receiver_reg_load(
-    const rx_ID_t                              ID,
-    const hrt_address                  reg);
-
-/*! Write to a control register of PORT[port_ID] of RECEIVER[ID]
-
- \param        ID[in]                          RECEIVER identifier
- \param        port_ID[in]                     mipi PORT identifier
- \param        reg[in]                         register index
- \param value[in]                      The data to be written
-
- \return none, RECEIVER[ID].PORT[port_ID].ctrl[reg] = value
- */
-STORAGE_CLASS_INPUT_SYSTEM_H void receiver_port_reg_store(
-    const rx_ID_t                              ID,
-    const enum mipi_port_id                    port_ID,
-    const hrt_address                  reg,
-    const hrt_data                             value);
-
-/*! Read from a control register PORT[port_ID] of of RECEIVER[ID]
-
- \param        ID[in]                          RECEIVER identifier
- \param        port_ID[in]                     mipi PORT identifier
- \param        reg[in]                         register index
- \param value[in]                      The data to be written
-
- \return RECEIVER[ID].PORT[port_ID].ctrl[reg]
- */
-STORAGE_CLASS_INPUT_SYSTEM_H hrt_data receiver_port_reg_load(
-    const rx_ID_t                              ID,
-    const enum mipi_port_id            port_ID,
-    const hrt_address                  reg);
-
-/*! Write to a control register of SUB_SYSTEM[sub_ID] of INPUT_SYSTEM[ID]
-
- \param        ID[in]                          INPUT_SYSTEM identifier
- \param        port_ID[in]                     sub system identifier
- \param        reg[in]                         register index
- \param value[in]                      The data to be written
-
- \return none, INPUT_SYSTEM[ID].SUB_SYSTEM[sub_ID].ctrl[reg] = value
- */
-STORAGE_CLASS_INPUT_SYSTEM_H void input_system_sub_system_reg_store(
-    const input_system_ID_t                    ID,
-    const sub_system_ID_t                      sub_ID,
-    const hrt_address                  reg,
-    const hrt_data                             value);
-
-/*! Read from a control register SUB_SYSTEM[sub_ID] of INPUT_SYSTEM[ID]
-
- \param        ID[in]                          INPUT_SYSTEM identifier
- \param        port_ID[in]                     sub system identifier
- \param        reg[in]                         register index
- \param value[in]                      The data to be written
-
- \return INPUT_SYSTEM[ID].SUB_SYSTEM[sub_ID].ctrl[reg]
- */
-STORAGE_CLASS_INPUT_SYSTEM_H hrt_data input_system_sub_system_reg_load(
-    const input_system_ID_t            ID,
-    const sub_system_ID_t              sub_ID,
-    const hrt_address                  reg);
-
-///////////////////////////////////////////////////////////////////////////
-//
-//    Functions for configuration phase on input system.
-//
-///////////////////////////////////////////////////////////////////////////
-
-// Function that resets current configuration.
-// remove the argument since it should be private.
-input_system_error_t input_system_configuration_reset(void);
-
-// Function that commits current configuration.
-// remove the argument since it should be private.
-input_system_error_t input_system_configuration_commit(void);
-
-///////////////////////////////////////////////////////////////////////////
-//
-// User functions:
-//             (encoded generic function)
-//    - no checking
-//    - decoding name and agruments into the generic (channel) configuration
-//    function.
-//
-///////////////////////////////////////////////////////////////////////////
-
-// FIFO channel config function user
-
-input_system_error_t   input_system_csi_fifo_channel_cfg(
-    u32                                ch_id,
-    input_system_csi_port_t    port,
-    backend_channel_cfg_t      backend_ch,
-    target_cfg2400_t                   target
-);
-
-input_system_error_t   input_system_csi_fifo_channel_with_counting_cfg(
-    u32                                ch_id,
-    u32                                nof_frame,
-    input_system_csi_port_t    port,
-    backend_channel_cfg_t      backend_ch,
-    u32                                mem_region_size,
-    u32                                nof_mem_regions,
-    target_cfg2400_t                   target
-);
-
-// SRAM channel config function user
-
-input_system_error_t   input_system_csi_sram_channel_cfg(
-    u32                                ch_id,
-    input_system_csi_port_t    port,
-    backend_channel_cfg_t      backend_ch,
-    u32                                csi_mem_region_size,
-    u32                                csi_nof_mem_regions,
-    target_cfg2400_t                   target
-);
-
-//XMEM channel config function user
-
-input_system_error_t   input_system_csi_xmem_channel_cfg(
-    u32                                ch_id,
-    input_system_csi_port_t port,
-    backend_channel_cfg_t      backend_ch,
-    u32                                mem_region_size,
-    u32                                nof_mem_regions,
-    u32                                acq_mem_region_size,
-    u32                                acq_nof_mem_regions,
-    target_cfg2400_t                   target,
-    uint32_t                           nof_xmem_buffers
-);
-
-input_system_error_t   input_system_csi_xmem_capture_only_channel_cfg(
-    u32                                ch_id,
-    u32                                nof_frames,
-    input_system_csi_port_t port,
-    u32                                csi_mem_region_size,
-    u32                                csi_nof_mem_regions,
-    u32                                acq_mem_region_size,
-    u32                                acq_nof_mem_regions,
-    target_cfg2400_t                   target
-);
-
-input_system_error_t   input_system_csi_xmem_acquire_only_channel_cfg(
-    u32                                ch_id,
-    u32                                nof_frames,
-    input_system_csi_port_t port,
-    backend_channel_cfg_t      backend_ch,
-    u32                                acq_mem_region_size,
-    u32                                acq_nof_mem_regions,
-    target_cfg2400_t                   target
-);
-
-// Non - CSI channel config function user
-
-input_system_error_t   input_system_prbs_channel_cfg(
-    u32                ch_id,
-    u32                nof_frames,
-    u32                seed,
-    u32                sync_gen_width,
-    u32                sync_gen_height,
-    u32                sync_gen_hblank_cycles,
-    u32                sync_gen_vblank_cycles,
-    target_cfg2400_t   target
-);
-
-input_system_error_t   input_system_tpg_channel_cfg(
-    u32                ch_id,
-    u32                nof_frames,//not used yet
-    u32                x_mask,
-    u32                y_mask,
-    u32                x_delta,
-    u32                y_delta,
-    u32                xy_mask,
-    u32                sync_gen_width,
-    u32                sync_gen_height,
-    u32                sync_gen_hblank_cycles,
-    u32                sync_gen_vblank_cycles,
-    target_cfg2400_t   target
-);
-
-input_system_error_t   input_system_gpfifo_channel_cfg(
-    u32                ch_id,
-    u32                nof_frames,
-    target_cfg2400_t   target
-);
-#endif /* #ifdef USE_INPUT_SYSTEM_VERSION_2401 */
-
-#endif /* __INPUT_SYSTEM_PUBLIC_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/input_system_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/input_system_global.h
new file mode 100644 (file)
index 0000000..e75c2f2
--- /dev/null
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ *    (c) 2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+ */
+
+#ifdef ISP2401
+#  include "isp2401_input_system_global.h"
+#else
+#  include "isp2400_input_system_global.h"
+#endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/input_system_local.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/input_system_local.h
new file mode 100644 (file)
index 0000000..8533a1e
--- /dev/null
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ *    (c) 2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+ */
+
+#ifdef ISP2401
+#  include "isp2401_input_system_local.h"
+#else
+#  include "isp2400_input_system_local.h"
+#endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/input_system_private.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/input_system_private.h
new file mode 100644 (file)
index 0000000..69c63a7
--- /dev/null
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ *    (c) 2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+ */
+
+#ifdef ISP2401
+#  include "isp2401_input_system_private.h"
+#else
+#  include "isp2400_input_system_private.h"
+#endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/input_system_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/input_system_public.h
new file mode 100644 (file)
index 0000000..17682c8
--- /dev/null
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ *    (c) 2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+ */
+
+#ifndef ISP2401
+#  include "isp2400_input_system_public.h"
+#endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2400_input_system_local.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2400_input_system_local.h
new file mode 100644 (file)
index 0000000..3c0e2ef
--- /dev/null
@@ -0,0 +1,539 @@
+/*
+ * 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.
+ */
+
+#ifndef __INPUT_SYSTEM_LOCAL_H_INCLUDED__
+#define __INPUT_SYSTEM_LOCAL_H_INCLUDED__
+
+#include <type_support.h>
+
+#include "input_system_global.h"
+
+#include "input_system_defs.h"         /* HIVE_ISYS_GPREG_MULTICAST_A_IDX,... */
+#include "css_receiver_2400_defs.h"    /* _HRT_CSS_RECEIVER_2400_TWO_PIXEL_EN_REG_IDX, _HRT_CSS_RECEIVER_2400_CSI2_FUNC_PROG_REG_IDX,... */
+#if defined(IS_ISP_2400_MAMOIADA_SYSTEM)
+#include "isp_capture_defs.h"
+#elif defined(IS_ISP_2401_MAMOIADA_SYSTEM)
+/* Same name, but keep the distinction,it is a different device */
+#include "isp_capture_defs.h"
+#else
+#error "input_system_local.h: 2400_SYSTEM must be one of {2400, 2401 }"
+#endif
+#include "isp_acquisition_defs.h"
+#include "input_system_ctrl_defs.h"
+
+typedef enum {
+       INPUT_SYSTEM_ERR_NO_ERROR = 0,
+       INPUT_SYSTEM_ERR_GENERIC,
+       INPUT_SYSTEM_ERR_CHANNEL_ALREADY_SET,
+       INPUT_SYSTEM_ERR_CONFLICT_ON_RESOURCE,
+       INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED,
+       N_INPUT_SYSTEM_ERR
+} input_system_error_t;
+
+typedef enum {
+       INPUT_SYSTEM_PORT_A = 0,
+       INPUT_SYSTEM_PORT_B,
+       INPUT_SYSTEM_PORT_C,
+       N_INPUT_SYSTEM_PORTS
+} input_system_csi_port_t;
+
+typedef struct ctrl_unit_cfg_s                 ctrl_unit_cfg_t;
+typedef struct input_system_network_cfg_s      input_system_network_cfg_t;
+typedef struct target_cfg2400_s                target_cfg2400_t;
+typedef struct channel_cfg_s                   channel_cfg_t;
+typedef struct backend_channel_cfg_s           backend_channel_cfg_t;
+typedef struct input_system_cfg2400_s          input_system_cfg2400_t;
+typedef struct mipi_port_state_s               mipi_port_state_t;
+typedef struct rx_channel_state_s              rx_channel_state_t;
+typedef struct input_switch_cfg_channel_s      input_switch_cfg_channel_t;
+typedef struct input_switch_cfg_s              input_switch_cfg_t;
+
+struct ctrl_unit_cfg_s {
+       ib_buffer_t             buffer_mipi[N_CAPTURE_UNIT_ID];
+       ib_buffer_t             buffer_acquire[N_ACQUISITION_UNIT_ID];
+};
+
+struct input_system_network_cfg_s {
+       input_system_connection_t       multicast_cfg[N_CAPTURE_UNIT_ID];
+       input_system_multiplex_t        mux_cfg;
+       ctrl_unit_cfg_t                         ctrl_unit_cfg[N_CTRL_UNIT_ID];
+};
+
+typedef struct {
+// TBD.
+       u32     dummy_parameter;
+} target_isp_cfg_t;
+
+typedef struct {
+// TBD.
+       u32     dummy_parameter;
+} target_sp_cfg_t;
+
+typedef struct {
+// TBD.
+       u32     dummy_parameter;
+} target_strm2mem_cfg_t;
+
+struct input_switch_cfg_channel_s {
+       u32 hsync_data_reg[2];
+       u32 vsync_data_reg;
+};
+
+struct target_cfg2400_s {
+       input_switch_cfg_channel_t              input_switch_channel_cfg;
+       target_isp_cfg_t        target_isp_cfg;
+       target_sp_cfg_t         target_sp_cfg;
+       target_strm2mem_cfg_t   target_strm2mem_cfg;
+};
+
+struct backend_channel_cfg_s {
+       u32     fmt_control_word_1; // Format config.
+       u32     fmt_control_word_2;
+       u32     no_side_band;
+};
+
+typedef union  {
+       csi_cfg_t       csi_cfg;
+       tpg_cfg_t       tpg_cfg;
+       prbs_cfg_t      prbs_cfg;
+       gpfifo_cfg_t    gpfifo_cfg;
+} source_cfg_t;
+
+struct input_switch_cfg_s {
+       u32 hsync_data_reg[N_RX_CHANNEL_ID * 2];
+       u32 vsync_data_reg;
+};
+
+// Configuration of a channel.
+struct channel_cfg_s {
+       u32             ch_id;
+       backend_channel_cfg_t   backend_ch;
+       input_system_source_t   source_type;
+       source_cfg_t            source_cfg;
+       target_cfg2400_t        target_cfg;
+};
+
+// Complete configuration for input system.
+struct input_system_cfg2400_s {
+       input_system_source_t source_type;
+       input_system_config_flags_t     source_type_flags;
+       //channel_cfg_t         channel[N_CHANNELS];
+       input_system_config_flags_t     ch_flags[N_CHANNELS];
+       //  This is the place where the buffers' settings are collected, as given.
+       csi_cfg_t                       csi_value[N_CSI_PORTS];
+       input_system_config_flags_t     csi_flags[N_CSI_PORTS];
+
+       // Possible another struct for ib.
+       // This buffers set at the end, based on the all configurations.
+       ib_buffer_t                     csi_buffer[N_CSI_PORTS];
+       input_system_config_flags_t     csi_buffer_flags[N_CSI_PORTS];
+       ib_buffer_t                     acquisition_buffer_unique;
+       input_system_config_flags_t     acquisition_buffer_unique_flags;
+       u32                     unallocated_ib_mem_words; // Used for check.DEFAULT = IB_CAPACITY_IN_WORDS.
+       //uint32_t                      acq_allocated_ib_mem_words;
+
+       input_system_connection_t               multicast[N_CSI_PORTS];
+       input_system_multiplex_t                multiplexer;
+       input_system_config_flags_t             multiplexer_flags;
+
+       tpg_cfg_t                       tpg_value;
+       input_system_config_flags_t     tpg_flags;
+       prbs_cfg_t                      prbs_value;
+       input_system_config_flags_t     prbs_flags;
+       gpfifo_cfg_t            gpfifo_value;
+       input_system_config_flags_t     gpfifo_flags;
+
+       input_switch_cfg_t              input_switch_cfg;
+
+       target_isp_cfg_t                target_isp[N_CHANNELS];
+       input_system_config_flags_t     target_isp_flags[N_CHANNELS];
+       target_sp_cfg_t                 target_sp[N_CHANNELS];
+       input_system_config_flags_t     target_sp_flags[N_CHANNELS];
+       target_strm2mem_cfg_t   target_strm2mem[N_CHANNELS];
+       input_system_config_flags_t     target_strm2mem_flags[N_CHANNELS];
+
+       input_system_config_flags_t             session_flags;
+
+};
+
+/*
+ * For each MIPI port
+ */
+#define _HRT_CSS_RECEIVER_DEVICE_READY_REG_IDX                 _HRT_CSS_RECEIVER_2400_DEVICE_READY_REG_IDX
+#define _HRT_CSS_RECEIVER_IRQ_STATUS_REG_IDX                   _HRT_CSS_RECEIVER_2400_IRQ_STATUS_REG_IDX
+#define _HRT_CSS_RECEIVER_IRQ_ENABLE_REG_IDX                   _HRT_CSS_RECEIVER_2400_IRQ_ENABLE_REG_IDX
+#define _HRT_CSS_RECEIVER_TIMEOUT_COUNT_REG_IDX                    _HRT_CSS_RECEIVER_2400_CSI2_FUNC_PROG_REG_IDX
+#define _HRT_CSS_RECEIVER_INIT_COUNT_REG_IDX                   _HRT_CSS_RECEIVER_2400_INIT_COUNT_REG_IDX
+/* new regs for each MIPI port w.r.t. 2300 */
+#define _HRT_CSS_RECEIVER_RAW16_18_DATAID_REG_IDX       _HRT_CSS_RECEIVER_2400_RAW16_18_DATAID_REG_IDX
+#define _HRT_CSS_RECEIVER_SYNC_COUNT_REG_IDX            _HRT_CSS_RECEIVER_2400_SYNC_COUNT_REG_IDX
+#define _HRT_CSS_RECEIVER_RX_COUNT_REG_IDX              _HRT_CSS_RECEIVER_2400_RX_COUNT_REG_IDX
+
+/* _HRT_CSS_RECEIVER_2400_COMP_FORMAT_REG_IDX is not defined per MIPI port but per channel */
+/* _HRT_CSS_RECEIVER_2400_COMP_PREDICT_REG_IDX is not defined per MIPI port but per channel */
+#define _HRT_CSS_RECEIVER_FS_TO_LS_DELAY_REG_IDX        _HRT_CSS_RECEIVER_2400_FS_TO_LS_DELAY_REG_IDX
+#define _HRT_CSS_RECEIVER_LS_TO_DATA_DELAY_REG_IDX      _HRT_CSS_RECEIVER_2400_LS_TO_DATA_DELAY_REG_IDX
+#define _HRT_CSS_RECEIVER_DATA_TO_LE_DELAY_REG_IDX      _HRT_CSS_RECEIVER_2400_DATA_TO_LE_DELAY_REG_IDX
+#define _HRT_CSS_RECEIVER_LE_TO_FE_DELAY_REG_IDX        _HRT_CSS_RECEIVER_2400_LE_TO_FE_DELAY_REG_IDX
+#define _HRT_CSS_RECEIVER_FE_TO_FS_DELAY_REG_IDX        _HRT_CSS_RECEIVER_2400_FE_TO_FS_DELAY_REG_IDX
+#define _HRT_CSS_RECEIVER_LE_TO_LS_DELAY_REG_IDX        _HRT_CSS_RECEIVER_2400_LE_TO_LS_DELAY_REG_IDX
+#define _HRT_CSS_RECEIVER_TWO_PIXEL_EN_REG_IDX                 _HRT_CSS_RECEIVER_2400_TWO_PIXEL_EN_REG_IDX
+#define _HRT_CSS_RECEIVER_BACKEND_RST_REG_IDX           _HRT_CSS_RECEIVER_2400_BACKEND_RST_REG_IDX
+#define _HRT_CSS_RECEIVER_RAW18_REG_IDX                 _HRT_CSS_RECEIVER_2400_RAW18_REG_IDX
+#define _HRT_CSS_RECEIVER_FORCE_RAW8_REG_IDX            _HRT_CSS_RECEIVER_2400_FORCE_RAW8_REG_IDX
+#define _HRT_CSS_RECEIVER_RAW16_REG_IDX                 _HRT_CSS_RECEIVER_2400_RAW16_REG_IDX
+
+/* Previously MIPI port regs, now 2x2 logical channel regs */
+#define _HRT_CSS_RECEIVER_COMP_SCHEME_VC0_REG0_IDX             _HRT_CSS_RECEIVER_2400_COMP_SCHEME_VC0_REG0_IDX
+#define _HRT_CSS_RECEIVER_COMP_SCHEME_VC0_REG1_IDX             _HRT_CSS_RECEIVER_2400_COMP_SCHEME_VC0_REG1_IDX
+#define _HRT_CSS_RECEIVER_COMP_SCHEME_VC1_REG0_IDX             _HRT_CSS_RECEIVER_2400_COMP_SCHEME_VC1_REG0_IDX
+#define _HRT_CSS_RECEIVER_COMP_SCHEME_VC1_REG1_IDX             _HRT_CSS_RECEIVER_2400_COMP_SCHEME_VC1_REG1_IDX
+#define _HRT_CSS_RECEIVER_COMP_SCHEME_VC2_REG0_IDX             _HRT_CSS_RECEIVER_2400_COMP_SCHEME_VC2_REG0_IDX
+#define _HRT_CSS_RECEIVER_COMP_SCHEME_VC2_REG1_IDX             _HRT_CSS_RECEIVER_2400_COMP_SCHEME_VC2_REG1_IDX
+#define _HRT_CSS_RECEIVER_COMP_SCHEME_VC3_REG0_IDX             _HRT_CSS_RECEIVER_2400_COMP_SCHEME_VC3_REG0_IDX
+#define _HRT_CSS_RECEIVER_COMP_SCHEME_VC3_REG1_IDX             _HRT_CSS_RECEIVER_2400_COMP_SCHEME_VC3_REG1_IDX
+
+/* Second backend is at offset 0x0700 w.r.t. the first port at offset 0x0100 */
+#define _HRT_CSS_BE_OFFSET                              448
+#define _HRT_CSS_RECEIVER_BE_GSP_ACC_OVL_REG_IDX        (_HRT_CSS_RECEIVER_2400_BE_GSP_ACC_OVL_REG_IDX + _HRT_CSS_BE_OFFSET)
+#define _HRT_CSS_RECEIVER_BE_SRST_REG_IDX               (_HRT_CSS_RECEIVER_2400_BE_SRST_REG_IDX + _HRT_CSS_BE_OFFSET)
+#define _HRT_CSS_RECEIVER_BE_TWO_PPC_REG_IDX            (_HRT_CSS_RECEIVER_2400_BE_TWO_PPC_REG_IDX + _HRT_CSS_BE_OFFSET)
+#define _HRT_CSS_RECEIVER_BE_COMP_FORMAT_REG0_IDX       (_HRT_CSS_RECEIVER_2400_BE_COMP_FORMAT_REG0_IDX + _HRT_CSS_BE_OFFSET)
+#define _HRT_CSS_RECEIVER_BE_COMP_FORMAT_REG1_IDX       (_HRT_CSS_RECEIVER_2400_BE_COMP_FORMAT_REG1_IDX + _HRT_CSS_BE_OFFSET)
+#define _HRT_CSS_RECEIVER_BE_COMP_FORMAT_REG2_IDX       (_HRT_CSS_RECEIVER_2400_BE_COMP_FORMAT_REG2_IDX + _HRT_CSS_BE_OFFSET)
+#define _HRT_CSS_RECEIVER_BE_COMP_FORMAT_REG3_IDX       (_HRT_CSS_RECEIVER_2400_BE_COMP_FORMAT_REG3_IDX + _HRT_CSS_BE_OFFSET)
+#define _HRT_CSS_RECEIVER_BE_SEL_REG_IDX                (_HRT_CSS_RECEIVER_2400_BE_SEL_REG_IDX + _HRT_CSS_BE_OFFSET)
+#define _HRT_CSS_RECEIVER_BE_RAW16_CONFIG_REG_IDX       (_HRT_CSS_RECEIVER_2400_BE_RAW16_CONFIG_REG_IDX + _HRT_CSS_BE_OFFSET)
+#define _HRT_CSS_RECEIVER_BE_RAW18_CONFIG_REG_IDX       (_HRT_CSS_RECEIVER_2400_BE_RAW18_CONFIG_REG_IDX + _HRT_CSS_BE_OFFSET)
+#define _HRT_CSS_RECEIVER_BE_FORCE_RAW8_REG_IDX         (_HRT_CSS_RECEIVER_2400_BE_FORCE_RAW8_REG_IDX + _HRT_CSS_BE_OFFSET)
+#define _HRT_CSS_RECEIVER_BE_IRQ_STATUS_REG_IDX         (_HRT_CSS_RECEIVER_2400_BE_IRQ_STATUS_REG_IDX + _HRT_CSS_BE_OFFSET)
+#define _HRT_CSS_RECEIVER_BE_IRQ_CLEAR_REG_IDX          (_HRT_CSS_RECEIVER_2400_BE_IRQ_CLEAR_REG_IDX + _HRT_CSS_BE_OFFSET)
+
+#define _HRT_CSS_RECEIVER_IRQ_OVERRUN_BIT              _HRT_CSS_RECEIVER_2400_IRQ_OVERRUN_BIT
+#define _HRT_CSS_RECEIVER_IRQ_INIT_TIMEOUT_BIT         _HRT_CSS_RECEIVER_2400_IRQ_RESERVED_BIT
+#define _HRT_CSS_RECEIVER_IRQ_SLEEP_MODE_ENTRY_BIT     _HRT_CSS_RECEIVER_2400_IRQ_SLEEP_MODE_ENTRY_BIT
+#define _HRT_CSS_RECEIVER_IRQ_SLEEP_MODE_EXIT_BIT      _HRT_CSS_RECEIVER_2400_IRQ_SLEEP_MODE_EXIT_BIT
+#define _HRT_CSS_RECEIVER_IRQ_ERR_SOT_HS_BIT           _HRT_CSS_RECEIVER_2400_IRQ_ERR_SOT_HS_BIT
+#define _HRT_CSS_RECEIVER_IRQ_ERR_SOT_SYNC_HS_BIT      _HRT_CSS_RECEIVER_2400_IRQ_ERR_SOT_SYNC_HS_BIT
+#define _HRT_CSS_RECEIVER_IRQ_ERR_CONTROL_BIT          _HRT_CSS_RECEIVER_2400_IRQ_ERR_CONTROL_BIT
+#define _HRT_CSS_RECEIVER_IRQ_ERR_ECC_DOUBLE_BIT       _HRT_CSS_RECEIVER_2400_IRQ_ERR_ECC_DOUBLE_BIT
+#define _HRT_CSS_RECEIVER_IRQ_ERR_ECC_CORRECTED_BIT    _HRT_CSS_RECEIVER_2400_IRQ_ERR_ECC_CORRECTED_BIT
+#define _HRT_CSS_RECEIVER_IRQ_ERR_ECC_NO_CORRECTION_BIT        _HRT_CSS_RECEIVER_2400_IRQ_ERR_ECC_NO_CORRECTION_BIT
+#define _HRT_CSS_RECEIVER_IRQ_ERR_CRC_BIT              _HRT_CSS_RECEIVER_2400_IRQ_ERR_CRC_BIT
+#define _HRT_CSS_RECEIVER_IRQ_ERR_ID_BIT               _HRT_CSS_RECEIVER_2400_IRQ_ERR_ID_BIT
+#define _HRT_CSS_RECEIVER_IRQ_ERR_FRAME_SYNC_BIT       _HRT_CSS_RECEIVER_2400_IRQ_ERR_FRAME_SYNC_BIT
+#define _HRT_CSS_RECEIVER_IRQ_ERR_FRAME_DATA_BIT       _HRT_CSS_RECEIVER_2400_IRQ_ERR_FRAME_DATA_BIT
+#define _HRT_CSS_RECEIVER_IRQ_DATA_TIMEOUT_BIT         _HRT_CSS_RECEIVER_2400_IRQ_DATA_TIMEOUT_BIT
+#define _HRT_CSS_RECEIVER_IRQ_ERR_ESCAPE_BIT           _HRT_CSS_RECEIVER_2400_IRQ_ERR_ESCAPE_BIT
+#define _HRT_CSS_RECEIVER_IRQ_ERR_LINE_SYNC_BIT                _HRT_CSS_RECEIVER_2400_IRQ_ERR_LINE_SYNC_BIT
+
+#define _HRT_CSS_RECEIVER_FUNC_PROG_REG_IDX            _HRT_CSS_RECEIVER_2400_CSI2_FUNC_PROG_REG_IDX
+#define        _HRT_CSS_RECEIVER_DATA_TIMEOUT_IDX              _HRT_CSS_RECEIVER_2400_CSI2_DATA_TIMEOUT_IDX
+#define        _HRT_CSS_RECEIVER_DATA_TIMEOUT_BITS             _HRT_CSS_RECEIVER_2400_CSI2_DATA_TIMEOUT_BITS
+
+typedef struct capture_unit_state_s    capture_unit_state_t;
+typedef struct acquisition_unit_state_s        acquisition_unit_state_t;
+typedef struct ctrl_unit_state_s       ctrl_unit_state_t;
+
+/*
+ * In 2300 ports can be configured independently and stream
+ * formats need to be specified. In 2400, there are only 8
+ * supported configurations but the HW is fused to support
+ * only a single one.
+ *
+ * In 2300 the compressed format types are programmed by the
+ * user. In 2400 all stream formats are encoded on the stream.
+ *
+ * Use the enum to check validity of a user configuration
+ */
+typedef enum {
+       MONO_4L_1L_0L = 0,
+       MONO_3L_1L_0L,
+       MONO_2L_1L_0L,
+       MONO_1L_1L_0L,
+       STEREO_2L_1L_2L,
+       STEREO_3L_1L_1L,
+       STEREO_2L_1L_1L,
+       STEREO_1L_1L_1L,
+       N_RX_MODE
+} rx_mode_t;
+
+typedef enum {
+       MIPI_PREDICTOR_NONE = 0,
+       MIPI_PREDICTOR_TYPE1,
+       MIPI_PREDICTOR_TYPE2,
+       N_MIPI_PREDICTOR_TYPES
+} mipi_predictor_t;
+
+typedef enum {
+       MIPI_COMPRESSOR_NONE = 0,
+       MIPI_COMPRESSOR_10_6_10,
+       MIPI_COMPRESSOR_10_7_10,
+       MIPI_COMPRESSOR_10_8_10,
+       MIPI_COMPRESSOR_12_6_12,
+       MIPI_COMPRESSOR_12_7_12,
+       MIPI_COMPRESSOR_12_8_12,
+       N_MIPI_COMPRESSOR_METHODS
+} mipi_compressor_t;
+
+typedef enum {
+       MIPI_FORMAT_RGB888 = 0,
+       MIPI_FORMAT_RGB555,
+       MIPI_FORMAT_RGB444,
+       MIPI_FORMAT_RGB565,
+       MIPI_FORMAT_RGB666,
+       MIPI_FORMAT_RAW8,               /* 5 */
+       MIPI_FORMAT_RAW10,
+       MIPI_FORMAT_RAW6,
+       MIPI_FORMAT_RAW7,
+       MIPI_FORMAT_RAW12,
+       MIPI_FORMAT_RAW14,              /* 10 */
+       MIPI_FORMAT_YUV420_8,
+       MIPI_FORMAT_YUV420_10,
+       MIPI_FORMAT_YUV422_8,
+       MIPI_FORMAT_YUV422_10,
+       MIPI_FORMAT_CUSTOM0,    /* 15 */
+       MIPI_FORMAT_YUV420_8_LEGACY,
+       MIPI_FORMAT_EMBEDDED,
+       MIPI_FORMAT_CUSTOM1,
+       MIPI_FORMAT_CUSTOM2,
+       MIPI_FORMAT_CUSTOM3,    /* 20 */
+       MIPI_FORMAT_CUSTOM4,
+       MIPI_FORMAT_CUSTOM5,
+       MIPI_FORMAT_CUSTOM6,
+       MIPI_FORMAT_CUSTOM7,
+       MIPI_FORMAT_YUV420_8_SHIFT,     /* 25 */
+       MIPI_FORMAT_YUV420_10_SHIFT,
+       MIPI_FORMAT_RAW16,
+       MIPI_FORMAT_RAW18,
+       N_MIPI_FORMAT,
+} mipi_format_t;
+
+#define MIPI_FORMAT_JPEG               MIPI_FORMAT_CUSTOM0
+#define MIPI_FORMAT_BINARY_8   MIPI_FORMAT_CUSTOM0
+#define N_MIPI_FORMAT_CUSTOM   8
+
+/* The number of stores for compressed format types */
+#define        N_MIPI_COMPRESSOR_CONTEXT       (N_RX_CHANNEL_ID * N_MIPI_FORMAT_CUSTOM)
+
+typedef enum {
+       RX_IRQ_INFO_BUFFER_OVERRUN   = 1UL << _HRT_CSS_RECEIVER_IRQ_OVERRUN_BIT,
+       RX_IRQ_INFO_INIT_TIMEOUT     = 1UL << _HRT_CSS_RECEIVER_IRQ_INIT_TIMEOUT_BIT,
+       RX_IRQ_INFO_ENTER_SLEEP_MODE = 1UL << _HRT_CSS_RECEIVER_IRQ_SLEEP_MODE_ENTRY_BIT,
+       RX_IRQ_INFO_EXIT_SLEEP_MODE  = 1UL << _HRT_CSS_RECEIVER_IRQ_SLEEP_MODE_EXIT_BIT,
+       RX_IRQ_INFO_ECC_CORRECTED    = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_ECC_CORRECTED_BIT,
+       RX_IRQ_INFO_ERR_SOT          = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_SOT_HS_BIT,
+       RX_IRQ_INFO_ERR_SOT_SYNC     = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_SOT_SYNC_HS_BIT,
+       RX_IRQ_INFO_ERR_CONTROL      = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_CONTROL_BIT,
+       RX_IRQ_INFO_ERR_ECC_DOUBLE   = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_ECC_DOUBLE_BIT,
+       /*      RX_IRQ_INFO_NO_ERR           = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_ECC_NO_CORRECTION_BIT, */
+       RX_IRQ_INFO_ERR_CRC          = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_CRC_BIT,
+       RX_IRQ_INFO_ERR_UNKNOWN_ID   = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_ID_BIT,
+       RX_IRQ_INFO_ERR_FRAME_SYNC   = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_FRAME_SYNC_BIT,
+       RX_IRQ_INFO_ERR_FRAME_DATA   = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_FRAME_DATA_BIT,
+       RX_IRQ_INFO_ERR_DATA_TIMEOUT = 1UL << _HRT_CSS_RECEIVER_IRQ_DATA_TIMEOUT_BIT,
+       RX_IRQ_INFO_ERR_UNKNOWN_ESC  = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_ESCAPE_BIT,
+       RX_IRQ_INFO_ERR_LINE_SYNC    = 1UL << _HRT_CSS_RECEIVER_IRQ_ERR_LINE_SYNC_BIT,
+}  rx_irq_info_t;
+
+typedef struct rx_cfg_s                rx_cfg_t;
+
+/*
+ * Applied per port
+ */
+struct rx_cfg_s {
+       rx_mode_t                       mode;   /* The HW config */
+       enum mipi_port_id               port;   /* The port ID to apply the control on */
+       unsigned int            timeout;
+       unsigned int            initcount;
+       unsigned int            synccount;
+       unsigned int            rxcount;
+       mipi_predictor_t        comp;   /* Just for backward compatibility */
+       bool                is_two_ppc;
+};
+
+/* NOTE: The base has already an offset of 0x0100 */
+static const hrt_address MIPI_PORT_OFFSET[N_MIPI_PORT_ID] = {
+       0x00000000UL,
+       0x00000100UL,
+       0x00000200UL
+};
+
+static const mipi_lane_cfg_t MIPI_PORT_MAXLANES[N_MIPI_PORT_ID] = {
+       MIPI_4LANE_CFG,
+       MIPI_1LANE_CFG,
+       MIPI_2LANE_CFG
+};
+
+static const bool MIPI_PORT_ACTIVE[N_RX_MODE][N_MIPI_PORT_ID] = {
+       {true, true, false},
+       {true, true, false},
+       {true, true, false},
+       {true, true, false},
+       {true, true, true},
+       {true, true, true},
+       {true, true, true},
+       {true, true, true}
+};
+
+static const mipi_lane_cfg_t MIPI_PORT_LANES[N_RX_MODE][N_MIPI_PORT_ID] = {
+       {MIPI_4LANE_CFG, MIPI_1LANE_CFG, MIPI_0LANE_CFG},
+       {MIPI_3LANE_CFG, MIPI_1LANE_CFG, MIPI_0LANE_CFG},
+       {MIPI_2LANE_CFG, MIPI_1LANE_CFG, MIPI_0LANE_CFG},
+       {MIPI_1LANE_CFG, MIPI_1LANE_CFG, MIPI_0LANE_CFG},
+       {MIPI_2LANE_CFG, MIPI_1LANE_CFG, MIPI_2LANE_CFG},
+       {MIPI_3LANE_CFG, MIPI_1LANE_CFG, MIPI_1LANE_CFG},
+       {MIPI_2LANE_CFG, MIPI_1LANE_CFG, MIPI_1LANE_CFG},
+       {MIPI_1LANE_CFG, MIPI_1LANE_CFG, MIPI_1LANE_CFG}
+};
+
+static const hrt_address SUB_SYSTEM_OFFSET[N_SUB_SYSTEM_ID] = {
+       0x00001000UL,
+       0x00002000UL,
+       0x00003000UL,
+       0x00004000UL,
+       0x00005000UL,
+       0x00009000UL,
+       0x0000A000UL,
+       0x0000B000UL,
+       0x0000C000UL
+};
+
+struct capture_unit_state_s {
+       int     Packet_Length;
+       int     Received_Length;
+       int     Received_Short_Packets;
+       int     Received_Long_Packets;
+       int     Last_Command;
+       int     Next_Command;
+       int     Last_Acknowledge;
+       int     Next_Acknowledge;
+       int     FSM_State_Info;
+       int     StartMode;
+       int     Start_Addr;
+       int     Mem_Region_Size;
+       int     Num_Mem_Regions;
+       /*      int     Init;   write-only registers
+               int     Start;
+               int     Stop;      */
+};
+
+struct acquisition_unit_state_s {
+       /*      int     Init;   write-only register */
+       int     Received_Short_Packets;
+       int     Received_Long_Packets;
+       int     Last_Command;
+       int     Next_Command;
+       int     Last_Acknowledge;
+       int     Next_Acknowledge;
+       int     FSM_State_Info;
+       int     Int_Cntr_Info;
+       int     Start_Addr;
+       int     Mem_Region_Size;
+       int     Num_Mem_Regions;
+};
+
+struct ctrl_unit_state_s {
+       int     last_cmd;
+       int     next_cmd;
+       int     last_ack;
+       int     next_ack;
+       int     top_fsm_state;
+       int     captA_fsm_state;
+       int     captB_fsm_state;
+       int     captC_fsm_state;
+       int     acq_fsm_state;
+       int     captA_start_addr;
+       int     captB_start_addr;
+       int     captC_start_addr;
+       int     captA_mem_region_size;
+       int     captB_mem_region_size;
+       int     captC_mem_region_size;
+       int     captA_num_mem_regions;
+       int     captB_num_mem_regions;
+       int     captC_num_mem_regions;
+       int     acq_start_addr;
+       int     acq_mem_region_size;
+       int     acq_num_mem_regions;
+       /*      int     ctrl_init;  write only register */
+       int     capt_reserve_one_mem_region;
+};
+
+struct input_system_state_s {
+       int     str_multicastA_sel;
+       int     str_multicastB_sel;
+       int     str_multicastC_sel;
+       int     str_mux_sel;
+       int     str_mon_status;
+       int     str_mon_irq_cond;
+       int     str_mon_irq_en;
+       int     isys_srst;
+       int     isys_slv_reg_srst;
+       int     str_deint_portA_cnt;
+       int     str_deint_portB_cnt;
+       struct capture_unit_state_s             capture_unit[N_CAPTURE_UNIT_ID];
+       struct acquisition_unit_state_s acquisition_unit[N_ACQUISITION_UNIT_ID];
+       struct ctrl_unit_state_s                ctrl_unit_state[N_CTRL_UNIT_ID];
+};
+
+struct mipi_port_state_s {
+       int     device_ready;
+       int     irq_status;
+       int     irq_enable;
+       u32     timeout_count;
+       u16     init_count;
+       u16     raw16_18;
+       u32     sync_count;             /*4 x uint8_t */
+       u32     rx_count;               /*4 x uint8_t */
+       u8              lane_sync_count[MIPI_4LANE_CFG];
+       u8              lane_rx_count[MIPI_4LANE_CFG];
+};
+
+struct rx_channel_state_s {
+       u32     comp_scheme0;
+       u32     comp_scheme1;
+       mipi_predictor_t                pred[N_MIPI_FORMAT_CUSTOM];
+       mipi_compressor_t               comp[N_MIPI_FORMAT_CUSTOM];
+};
+
+struct receiver_state_s {
+       u8      fs_to_ls_delay;
+       u8      ls_to_data_delay;
+       u8      data_to_le_delay;
+       u8      le_to_fe_delay;
+       u8      fe_to_fs_delay;
+       u8      le_to_fs_delay;
+       bool    is_two_ppc;
+       int     backend_rst;
+       u16     raw18;
+       bool            force_raw8;
+       u16     raw16;
+       struct mipi_port_state_s        mipi_port_state[N_MIPI_PORT_ID];
+       struct rx_channel_state_s       rx_channel_state[N_RX_CHANNEL_ID];
+       int     be_gsp_acc_ovl;
+       int     be_srst;
+       int     be_is_two_ppc;
+       int     be_comp_format0;
+       int     be_comp_format1;
+       int     be_comp_format2;
+       int     be_comp_format3;
+       int     be_sel;
+       int     be_raw16_config;
+       int     be_raw18_config;
+       int     be_force_raw8;
+       int     be_irq_status;
+       int     be_irq_clear;
+};
+
+#endif /* __INPUT_SYSTEM_LOCAL_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2400_input_system_private.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2400_input_system_private.h
new file mode 100644 (file)
index 0000000..0ce9cbc
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * 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.
+ */
+
+#ifndef __INPUT_SYSTEM_PRIVATE_H_INCLUDED__
+#define __INPUT_SYSTEM_PRIVATE_H_INCLUDED__
+
+#include "input_system_public.h"
+
+#include "device_access.h"
+
+#include "assert_support.h"
+
+STORAGE_CLASS_INPUT_SYSTEM_C void input_system_reg_store(
+    const input_system_ID_t                    ID,
+    const hrt_address                  reg,
+    const hrt_data                             value)
+{
+       assert(ID < N_INPUT_SYSTEM_ID);
+       assert(INPUT_SYSTEM_BASE[ID] != (hrt_address)-1);
+       ia_css_device_store_uint32(INPUT_SYSTEM_BASE[ID] + reg * sizeof(hrt_data),
+                                  value);
+       return;
+}
+
+STORAGE_CLASS_INPUT_SYSTEM_C hrt_data input_system_reg_load(
+    const input_system_ID_t                    ID,
+    const hrt_address                  reg)
+{
+       assert(ID < N_INPUT_SYSTEM_ID);
+       assert(INPUT_SYSTEM_BASE[ID] != (hrt_address)-1);
+       return ia_css_device_load_uint32(INPUT_SYSTEM_BASE[ID] + reg * sizeof(
+                                            hrt_data));
+}
+
+STORAGE_CLASS_INPUT_SYSTEM_C void receiver_reg_store(
+    const rx_ID_t                              ID,
+    const hrt_address                  reg,
+    const hrt_data                             value)
+{
+       assert(ID < N_RX_ID);
+       assert(RX_BASE[ID] != (hrt_address)-1);
+       ia_css_device_store_uint32(RX_BASE[ID] + reg * sizeof(hrt_data), value);
+       return;
+}
+
+STORAGE_CLASS_INPUT_SYSTEM_C hrt_data receiver_reg_load(
+    const rx_ID_t                              ID,
+    const hrt_address                  reg)
+{
+       assert(ID < N_RX_ID);
+       assert(RX_BASE[ID] != (hrt_address)-1);
+       return ia_css_device_load_uint32(RX_BASE[ID] + reg * sizeof(hrt_data));
+}
+
+STORAGE_CLASS_INPUT_SYSTEM_C void receiver_port_reg_store(
+    const rx_ID_t                              ID,
+    const enum mipi_port_id                    port_ID,
+    const hrt_address                  reg,
+    const hrt_data                             value)
+{
+       assert(ID < N_RX_ID);
+       assert(port_ID < N_MIPI_PORT_ID);
+       assert(RX_BASE[ID] != (hrt_address)-1);
+       assert(MIPI_PORT_OFFSET[port_ID] != (hrt_address)-1);
+       ia_css_device_store_uint32(RX_BASE[ID] + MIPI_PORT_OFFSET[port_ID] + reg *
+                                  sizeof(hrt_data), value);
+       return;
+}
+
+STORAGE_CLASS_INPUT_SYSTEM_C hrt_data receiver_port_reg_load(
+    const rx_ID_t                              ID,
+    const enum mipi_port_id                    port_ID,
+    const hrt_address                  reg)
+{
+       assert(ID < N_RX_ID);
+       assert(port_ID < N_MIPI_PORT_ID);
+       assert(RX_BASE[ID] != (hrt_address)-1);
+       assert(MIPI_PORT_OFFSET[port_ID] != (hrt_address)-1);
+       return ia_css_device_load_uint32(RX_BASE[ID] + MIPI_PORT_OFFSET[port_ID] + reg *
+                                        sizeof(hrt_data));
+}
+
+STORAGE_CLASS_INPUT_SYSTEM_C void input_system_sub_system_reg_store(
+    const input_system_ID_t                    ID,
+    const sub_system_ID_t                      sub_ID,
+    const hrt_address                  reg,
+    const hrt_data                             value)
+{
+       assert(ID < N_INPUT_SYSTEM_ID);
+       assert(sub_ID < N_SUB_SYSTEM_ID);
+       assert(INPUT_SYSTEM_BASE[ID] != (hrt_address)-1);
+       assert(SUB_SYSTEM_OFFSET[sub_ID] != (hrt_address)-1);
+       ia_css_device_store_uint32(INPUT_SYSTEM_BASE[ID] + SUB_SYSTEM_OFFSET[sub_ID] +
+                                  reg * sizeof(hrt_data), value);
+       return;
+}
+
+STORAGE_CLASS_INPUT_SYSTEM_C hrt_data input_system_sub_system_reg_load(
+    const input_system_ID_t                    ID,
+    const sub_system_ID_t                      sub_ID,
+    const hrt_address                  reg)
+{
+       assert(ID < N_INPUT_SYSTEM_ID);
+       assert(sub_ID < N_SUB_SYSTEM_ID);
+       assert(INPUT_SYSTEM_BASE[ID] != (hrt_address)-1);
+       assert(SUB_SYSTEM_OFFSET[sub_ID] != (hrt_address)-1);
+       return ia_css_device_load_uint32(INPUT_SYSTEM_BASE[ID] +
+                                        SUB_SYSTEM_OFFSET[sub_ID] + reg * sizeof(hrt_data));
+}
+
+#endif /* __INPUT_SYSTEM_PRIVATE_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2400_input_system_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2400_input_system_public.h
new file mode 100644 (file)
index 0000000..d0de27a
--- /dev/null
@@ -0,0 +1,369 @@
+/*
+ * Support for Intel Camera Imaging ISP subsystem.
+ * Copyright (c) 2015, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef __INPUT_SYSTEM_PUBLIC_H_INCLUDED__
+#define __INPUT_SYSTEM_PUBLIC_H_INCLUDED__
+
+#include <type_support.h>
+#ifdef USE_INPUT_SYSTEM_VERSION_2401
+#include "isys_public.h"
+#else
+
+typedef struct input_system_state_s            input_system_state_t;
+typedef struct receiver_state_s                        receiver_state_t;
+
+/*! Read the state of INPUT_SYSTEM[ID]
+
+ \param        ID[in]                          INPUT_SYSTEM identifier
+ \param        state[out]                      input system state structure
+
+ \return none, state = INPUT_SYSTEM[ID].state
+ */
+void input_system_get_state(
+    const input_system_ID_t            ID,
+    input_system_state_t               *state);
+
+/*! Read the state of RECEIVER[ID]
+
+ \param        ID[in]                          RECEIVER identifier
+ \param        state[out]                      receiver state structure
+
+ \return none, state = RECEIVER[ID].state
+ */
+void receiver_get_state(
+    const rx_ID_t                              ID,
+    receiver_state_t                   *state);
+
+/*! Flag whether a MIPI format is YUV420
+
+ \param        mipi_format[in]         MIPI format
+
+ \return mipi_format == YUV420
+ */
+bool is_mipi_format_yuv420(
+    const mipi_format_t                        mipi_format);
+
+/*! Set compression parameters for cfg[cfg_ID] of RECEIVER[ID]
+
+ \param        ID[in]                          RECEIVER identifier
+ \param        cfg_ID[in]                      Configuration identifier
+ \param        comp[in]                        Compression method
+ \param        pred[in]                        Predictor method
+
+ \NOTE: the storage of compression configuration is
+       implementation specific. The config can be
+       carried either on MIPI ports or on MIPI channels
+
+ \return none, RECEIVER[ID].cfg[cfg_ID] = {comp, pred}
+ */
+void receiver_set_compression(
+    const rx_ID_t                              ID,
+    const unsigned int                 cfg_ID,
+    const mipi_compressor_t            comp,
+    const mipi_predictor_t             pred);
+
+/*! Enable PORT[port_ID] of RECEIVER[ID]
+
+ \param        ID[in]                          RECEIVER identifier
+ \param        port_ID[in]                     mipi PORT identifier
+ \param        cnd[in]                         irq predicate
+
+ \return None, enable(RECEIVER[ID].PORT[port_ID])
+ */
+void receiver_port_enable(
+    const rx_ID_t                              ID,
+    const enum mipi_port_id            port_ID,
+    const bool                                 cnd);
+
+/*! Flag if PORT[port_ID] of RECEIVER[ID] is enabled
+
+ \param        ID[in]                          RECEIVER identifier
+ \param        port_ID[in]                     mipi PORT identifier
+
+ \return enable(RECEIVER[ID].PORT[port_ID]) == true
+ */
+bool is_receiver_port_enabled(
+    const rx_ID_t                              ID,
+    const enum mipi_port_id            port_ID);
+
+/*! Enable the IRQ channels of PORT[port_ID] of RECEIVER[ID]
+
+ \param        ID[in]                          RECEIVER identifier
+ \param        port_ID[in]                     mipi PORT identifier
+ \param        irq_info[in]            irq channels
+
+ \return None, enable(RECEIVER[ID].PORT[port_ID].irq_info)
+ */
+void receiver_irq_enable(
+    const rx_ID_t                              ID,
+    const enum mipi_port_id            port_ID,
+    const rx_irq_info_t                        irq_info);
+
+/*! Return the IRQ status of PORT[port_ID] of RECEIVER[ID]
+
+ \param        ID[in]                          RECEIVER identifier
+ \param        port_ID[in]                     mipi PORT identifier
+
+ \return RECEIVER[ID].PORT[port_ID].irq_info
+ */
+rx_irq_info_t receiver_get_irq_info(
+    const rx_ID_t                              ID,
+    const enum mipi_port_id            port_ID);
+
+/*! Clear the IRQ status of PORT[port_ID] of RECEIVER[ID]
+
+ \param        ID[in]                          RECEIVER identifier
+ \param        port_ID[in]                     mipi PORT identifier
+ \param        irq_info[in]            irq status
+
+ \return None, clear(RECEIVER[ID].PORT[port_ID].irq_info)
+ */
+void receiver_irq_clear(
+    const rx_ID_t                              ID,
+    const enum mipi_port_id                    port_ID,
+    const rx_irq_info_t                        irq_info);
+
+/*! Write to a control register of INPUT_SYSTEM[ID]
+
+ \param        ID[in]                          INPUT_SYSTEM identifier
+ \param        reg[in]                         register index
+ \param value[in]                      The data to be written
+
+ \return none, INPUT_SYSTEM[ID].ctrl[reg] = value
+ */
+STORAGE_CLASS_INPUT_SYSTEM_H void input_system_reg_store(
+    const input_system_ID_t                    ID,
+    const hrt_address                  reg,
+    const hrt_data                             value);
+
+/*! Read from a control register of INPUT_SYSTEM[ID]
+
+ \param        ID[in]                          INPUT_SYSTEM identifier
+ \param        reg[in]                         register index
+ \param value[in]                      The data to be written
+
+ \return INPUT_SYSTEM[ID].ctrl[reg]
+ */
+STORAGE_CLASS_INPUT_SYSTEM_H hrt_data input_system_reg_load(
+    const input_system_ID_t                    ID,
+    const hrt_address                  reg);
+
+/*! Write to a control register of RECEIVER[ID]
+
+ \param        ID[in]                          RECEIVER identifier
+ \param        reg[in]                         register index
+ \param value[in]                      The data to be written
+
+ \return none, RECEIVER[ID].ctrl[reg] = value
+ */
+STORAGE_CLASS_INPUT_SYSTEM_H void receiver_reg_store(
+    const rx_ID_t                              ID,
+    const hrt_address                  reg,
+    const hrt_data                             value);
+
+/*! Read from a control register of RECEIVER[ID]
+
+ \param        ID[in]                          RECEIVER identifier
+ \param        reg[in]                         register index
+ \param value[in]                      The data to be written
+
+ \return RECEIVER[ID].ctrl[reg]
+ */
+STORAGE_CLASS_INPUT_SYSTEM_H hrt_data receiver_reg_load(
+    const rx_ID_t                              ID,
+    const hrt_address                  reg);
+
+/*! Write to a control register of PORT[port_ID] of RECEIVER[ID]
+
+ \param        ID[in]                          RECEIVER identifier
+ \param        port_ID[in]                     mipi PORT identifier
+ \param        reg[in]                         register index
+ \param value[in]                      The data to be written
+
+ \return none, RECEIVER[ID].PORT[port_ID].ctrl[reg] = value
+ */
+STORAGE_CLASS_INPUT_SYSTEM_H void receiver_port_reg_store(
+    const rx_ID_t                              ID,
+    const enum mipi_port_id                    port_ID,
+    const hrt_address                  reg,
+    const hrt_data                             value);
+
+/*! Read from a control register PORT[port_ID] of of RECEIVER[ID]
+
+ \param        ID[in]                          RECEIVER identifier
+ \param        port_ID[in]                     mipi PORT identifier
+ \param        reg[in]                         register index
+ \param value[in]                      The data to be written
+
+ \return RECEIVER[ID].PORT[port_ID].ctrl[reg]
+ */
+STORAGE_CLASS_INPUT_SYSTEM_H hrt_data receiver_port_reg_load(
+    const rx_ID_t                              ID,
+    const enum mipi_port_id            port_ID,
+    const hrt_address                  reg);
+
+/*! Write to a control register of SUB_SYSTEM[sub_ID] of INPUT_SYSTEM[ID]
+
+ \param        ID[in]                          INPUT_SYSTEM identifier
+ \param        port_ID[in]                     sub system identifier
+ \param        reg[in]                         register index
+ \param value[in]                      The data to be written
+
+ \return none, INPUT_SYSTEM[ID].SUB_SYSTEM[sub_ID].ctrl[reg] = value
+ */
+STORAGE_CLASS_INPUT_SYSTEM_H void input_system_sub_system_reg_store(
+    const input_system_ID_t                    ID,
+    const sub_system_ID_t                      sub_ID,
+    const hrt_address                  reg,
+    const hrt_data                             value);
+
+/*! Read from a control register SUB_SYSTEM[sub_ID] of INPUT_SYSTEM[ID]
+
+ \param        ID[in]                          INPUT_SYSTEM identifier
+ \param        port_ID[in]                     sub system identifier
+ \param        reg[in]                         register index
+ \param value[in]                      The data to be written
+
+ \return INPUT_SYSTEM[ID].SUB_SYSTEM[sub_ID].ctrl[reg]
+ */
+STORAGE_CLASS_INPUT_SYSTEM_H hrt_data input_system_sub_system_reg_load(
+    const input_system_ID_t            ID,
+    const sub_system_ID_t              sub_ID,
+    const hrt_address                  reg);
+
+///////////////////////////////////////////////////////////////////////////
+//
+//    Functions for configuration phase on input system.
+//
+///////////////////////////////////////////////////////////////////////////
+
+// Function that resets current configuration.
+// remove the argument since it should be private.
+input_system_error_t input_system_configuration_reset(void);
+
+// Function that commits current configuration.
+// remove the argument since it should be private.
+input_system_error_t input_system_configuration_commit(void);
+
+///////////////////////////////////////////////////////////////////////////
+//
+// User functions:
+//             (encoded generic function)
+//    - no checking
+//    - decoding name and agruments into the generic (channel) configuration
+//    function.
+//
+///////////////////////////////////////////////////////////////////////////
+
+// FIFO channel config function user
+
+input_system_error_t   input_system_csi_fifo_channel_cfg(
+    u32                                ch_id,
+    input_system_csi_port_t    port,
+    backend_channel_cfg_t      backend_ch,
+    target_cfg2400_t                   target
+);
+
+input_system_error_t   input_system_csi_fifo_channel_with_counting_cfg(
+    u32                                ch_id,
+    u32                                nof_frame,
+    input_system_csi_port_t    port,
+    backend_channel_cfg_t      backend_ch,
+    u32                                mem_region_size,
+    u32                                nof_mem_regions,
+    target_cfg2400_t                   target
+);
+
+// SRAM channel config function user
+
+input_system_error_t   input_system_csi_sram_channel_cfg(
+    u32                                ch_id,
+    input_system_csi_port_t    port,
+    backend_channel_cfg_t      backend_ch,
+    u32                                csi_mem_region_size,
+    u32                                csi_nof_mem_regions,
+    target_cfg2400_t                   target
+);
+
+//XMEM channel config function user
+
+input_system_error_t   input_system_csi_xmem_channel_cfg(
+    u32                                ch_id,
+    input_system_csi_port_t port,
+    backend_channel_cfg_t      backend_ch,
+    u32                                mem_region_size,
+    u32                                nof_mem_regions,
+    u32                                acq_mem_region_size,
+    u32                                acq_nof_mem_regions,
+    target_cfg2400_t                   target,
+    uint32_t                           nof_xmem_buffers
+);
+
+input_system_error_t   input_system_csi_xmem_capture_only_channel_cfg(
+    u32                                ch_id,
+    u32                                nof_frames,
+    input_system_csi_port_t port,
+    u32                                csi_mem_region_size,
+    u32                                csi_nof_mem_regions,
+    u32                                acq_mem_region_size,
+    u32                                acq_nof_mem_regions,
+    target_cfg2400_t                   target
+);
+
+input_system_error_t   input_system_csi_xmem_acquire_only_channel_cfg(
+    u32                                ch_id,
+    u32                                nof_frames,
+    input_system_csi_port_t port,
+    backend_channel_cfg_t      backend_ch,
+    u32                                acq_mem_region_size,
+    u32                                acq_nof_mem_regions,
+    target_cfg2400_t                   target
+);
+
+// Non - CSI channel config function user
+
+input_system_error_t   input_system_prbs_channel_cfg(
+    u32                ch_id,
+    u32                nof_frames,
+    u32                seed,
+    u32                sync_gen_width,
+    u32                sync_gen_height,
+    u32                sync_gen_hblank_cycles,
+    u32                sync_gen_vblank_cycles,
+    target_cfg2400_t   target
+);
+
+input_system_error_t   input_system_tpg_channel_cfg(
+    u32                ch_id,
+    u32                nof_frames,//not used yet
+    u32                x_mask,
+    u32                y_mask,
+    u32                x_delta,
+    u32                y_delta,
+    u32                xy_mask,
+    u32                sync_gen_width,
+    u32                sync_gen_height,
+    u32                sync_gen_hblank_cycles,
+    u32                sync_gen_vblank_cycles,
+    target_cfg2400_t   target
+);
+
+input_system_error_t   input_system_gpfifo_channel_cfg(
+    u32                ch_id,
+    u32                nof_frames,
+    target_cfg2400_t   target
+);
+#endif /* #ifdef USE_INPUT_SYSTEM_VERSION_2401 */
+
+#endif /* __INPUT_SYSTEM_PUBLIC_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2400_system_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2400_system_global.h
new file mode 100644 (file)
index 0000000..21938de
--- /dev/null
@@ -0,0 +1,349 @@
+/*
+ * Support for Intel Camera Imaging ISP subsystem.
+ * Copyright (c) 2015, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef __SYSTEM_GLOBAL_H_INCLUDED__
+#define __SYSTEM_GLOBAL_H_INCLUDED__
+
+#include <hive_isp_css_defs.h>
+#include <type_support.h>
+
+/*
+ * The longest allowed (uninteruptible) bus transfer, does not
+ * take stalling into account
+ */
+#define HIVE_ISP_MAX_BURST_LENGTH      1024
+
+/*
+ * Maximum allowed burst length in words for the ISP DMA
+ */
+#define ISP_DMA_MAX_BURST_LENGTH       128
+
+/*
+ * Create a list of HAS and IS properties that defines the system
+ *
+ * The configuration assumes the following
+ * - The system is hetereogeneous; Multiple cells and devices classes
+ * - The cell and device instances are homogeneous, each device type
+ *   belongs to the same class
+ * - Device instances supporting a subset of the class capabilities are
+ *   allowed
+ *
+ * We could manage different device classes through the enumerated
+ * lists (C) or the use of classes (C++), but that is presently not
+ * fully supported
+ *
+ * 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}
+ *
+ * The 2401 system has the nice property that it uses a vanilla 2400 SP
+ * so the SP will believe it is a 2400 system rather than 2401...
+ */
+//#if defined(SYSTEM_hive_isp_css_2401_system) || defined(__isp2401_mamoiada) || defined(__scalar_processor_2401)
+#if defined(SYSTEM_hive_isp_css_2401_system) || defined(__isp2401_mamoiada)
+#define IS_ISP_2401_MAMOIADA_SYSTEM
+#define HAS_ISP_2401_MAMOIADA
+#define HAS_SP_2400
+//#elif defined(SYSTEM_hive_isp_css_2400_system) || defined(__isp2400_mamoiada) || defined(__scalar_processor_2400)
+#elif defined(SYSTEM_hive_isp_css_2400_system) || defined(__isp2400_mamoiada)
+#define IS_ISP_2400_MAMOIADA_SYSTEM
+#define HAS_ISP_2400_MAMOIADA
+#define HAS_SP_2400
+#else
+#error "system_global.h: 2400_SYSTEM must be one of {2400, 2401 }"
+#endif
+
+#define USE_INPUT_SYSTEM_VERSION_2
+
+#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
+/* 2401: HAS_INPUT_SYSTEM_VERSION_2401 */
+#define HAS_INPUT_SYSTEM_VERSION_2
+#define HAS_BUFFERED_SENSOR
+#define HAS_FIFO_MONITORS_VERSION_2
+/* #define HAS_GP_REGS_VERSION_2 */
+#define HAS_GP_DEVICE_VERSION_2
+#define HAS_GPIO_VERSION_1
+#define HAS_TIMED_CTRL_VERSION_1
+#define HAS_RX_VERSION_2
+
+#define DMA_DDR_TO_VAMEM_WORKAROUND
+#define DMA_DDR_TO_HMEM_WORKAROUND
+
+/*
+ * Semi global. "HRT" is accessible from SP, but the HRT types do not fully apply
+ */
+#define HRT_VADDRESS_WIDTH     32
+//#define HRT_ADDRESS_WIDTH    64              /* Surprise, this is a local property*/
+#define HRT_DATA_WIDTH         32
+
+#define SIZEOF_HRT_REG         (HRT_DATA_WIDTH >> 3)
+#define HIVE_ISP_CTRL_DATA_BYTES (HIVE_ISP_CTRL_DATA_WIDTH / 8)
+
+/* The main bus connecting all devices */
+#define HRT_BUS_WIDTH          HIVE_ISP_CTRL_DATA_WIDTH
+#define HRT_BUS_BYTES          HIVE_ISP_CTRL_DATA_BYTES
+
+/* per-frame parameter handling support */
+#define SH_CSS_ENABLE_PER_FRAME_PARAMS
+
+typedef u32                    hrt_bus_align_t;
+
+/*
+ * Enumerate the devices, device access through the API is by ID, through the DLI by address
+ * The enumerator terminators are used to size the wiring arrays and as an exception value.
+ */
+typedef enum {
+       DDR0_ID = 0,
+       N_DDR_ID
+} ddr_ID_t;
+
+typedef enum {
+       ISP0_ID = 0,
+       N_ISP_ID
+} isp_ID_t;
+
+typedef enum {
+       SP0_ID = 0,
+       N_SP_ID
+} sp_ID_t;
+
+#if defined(IS_ISP_2401_MAMOIADA_SYSTEM)
+typedef enum {
+       MMU0_ID = 0,
+       MMU1_ID,
+       N_MMU_ID
+} mmu_ID_t;
+#elif defined(IS_ISP_2400_MAMOIADA_SYSTEM)
+typedef enum {
+       MMU0_ID = 0,
+       MMU1_ID,
+       N_MMU_ID
+} mmu_ID_t;
+#else
+#error "system_global.h: SYSTEM must be one of {2400, 2401}"
+#endif
+
+typedef enum {
+       DMA0_ID = 0,
+       N_DMA_ID
+} dma_ID_t;
+
+typedef enum {
+       GDC0_ID = 0,
+       GDC1_ID,
+       N_GDC_ID
+} gdc_ID_t;
+
+#define N_GDC_ID_CPP 2 // this extra define is needed because we want to use it also in the preprocessor, and that doesn't work with enums.
+
+typedef enum {
+       VAMEM0_ID = 0,
+       VAMEM1_ID,
+       VAMEM2_ID,
+       N_VAMEM_ID
+} vamem_ID_t;
+
+typedef enum {
+       BAMEM0_ID = 0,
+       N_BAMEM_ID
+} bamem_ID_t;
+
+typedef enum {
+       HMEM0_ID = 0,
+       N_HMEM_ID
+} hmem_ID_t;
+
+/*
+typedef enum {
+       IRQ0_ID = 0,
+       N_IRQ_ID
+} irq_ID_t;
+*/
+
+typedef enum {
+       IRQ0_ID = 0,    // GP IRQ block
+       IRQ1_ID,                // Input formatter
+       IRQ2_ID,                // input system
+       IRQ3_ID,                // input selector
+       N_IRQ_ID
+} irq_ID_t;
+
+typedef enum {
+       FIFO_MONITOR0_ID = 0,
+       N_FIFO_MONITOR_ID
+} fifo_monitor_ID_t;
+
+/*
+ * Deprecated: Since all gp_reg instances are different
+ * and put in the address maps of other devices we cannot
+ * enumerate them as that assumes the instrances are the
+ * same.
+ *
+ * We define a single GP_DEVICE containing all gp_regs
+ * w.r.t. a single base address
+ *
+typedef enum {
+       GP_REGS0_ID = 0,
+       N_GP_REGS_ID
+} gp_regs_ID_t;
+ */
+typedef enum {
+       GP_DEVICE0_ID = 0,
+       N_GP_DEVICE_ID
+} gp_device_ID_t;
+
+typedef enum {
+       GP_TIMER0_ID = 0,
+       GP_TIMER1_ID,
+       GP_TIMER2_ID,
+       GP_TIMER3_ID,
+       GP_TIMER4_ID,
+       GP_TIMER5_ID,
+       GP_TIMER6_ID,
+       GP_TIMER7_ID,
+       N_GP_TIMER_ID
+} gp_timer_ID_t;
+
+typedef enum {
+       GPIO0_ID = 0,
+       N_GPIO_ID
+} gpio_ID_t;
+
+typedef enum {
+       TIMED_CTRL0_ID = 0,
+       N_TIMED_CTRL_ID
+} timed_ctrl_ID_t;
+
+typedef enum {
+       INPUT_FORMATTER0_ID = 0,
+       INPUT_FORMATTER1_ID,
+       INPUT_FORMATTER2_ID,
+       INPUT_FORMATTER3_ID,
+       N_INPUT_FORMATTER_ID
+} input_formatter_ID_t;
+
+/* The IF RST is outside the IF */
+#define INPUT_FORMATTER0_SRST_OFFSET   0x0824
+#define INPUT_FORMATTER1_SRST_OFFSET   0x0624
+#define INPUT_FORMATTER2_SRST_OFFSET   0x0424
+#define INPUT_FORMATTER3_SRST_OFFSET   0x0224
+
+#define INPUT_FORMATTER0_SRST_MASK             0x0001
+#define INPUT_FORMATTER1_SRST_MASK             0x0002
+#define INPUT_FORMATTER2_SRST_MASK             0x0004
+#define INPUT_FORMATTER3_SRST_MASK             0x0008
+
+typedef enum {
+       INPUT_SYSTEM0_ID = 0,
+       N_INPUT_SYSTEM_ID
+} input_system_ID_t;
+
+typedef enum {
+       RX0_ID = 0,
+       N_RX_ID
+} rx_ID_t;
+
+enum mipi_port_id {
+       MIPI_PORT0_ID = 0,
+       MIPI_PORT1_ID,
+       MIPI_PORT2_ID,
+       N_MIPI_PORT_ID
+};
+
+#define        N_RX_CHANNEL_ID         4
+
+/* Generic port enumeration with an internal port type ID */
+typedef enum {
+       CSI_PORT0_ID = 0,
+       CSI_PORT1_ID,
+       CSI_PORT2_ID,
+       TPG_PORT0_ID,
+       PRBS_PORT0_ID,
+       FIFO_PORT0_ID,
+       MEMORY_PORT0_ID,
+       N_INPUT_PORT_ID
+} input_port_ID_t;
+
+typedef enum {
+       CAPTURE_UNIT0_ID = 0,
+       CAPTURE_UNIT1_ID,
+       CAPTURE_UNIT2_ID,
+       ACQUISITION_UNIT0_ID,
+       DMA_UNIT0_ID,
+       CTRL_UNIT0_ID,
+       GPREGS_UNIT0_ID,
+       FIFO_UNIT0_ID,
+       IRQ_UNIT0_ID,
+       N_SUB_SYSTEM_ID
+} sub_system_ID_t;
+
+#define        N_CAPTURE_UNIT_ID               3
+#define        N_ACQUISITION_UNIT_ID   1
+#define        N_CTRL_UNIT_ID                  1
+
+enum ia_css_isp_memories {
+       IA_CSS_ISP_PMEM0 = 0,
+       IA_CSS_ISP_DMEM0,
+       IA_CSS_ISP_VMEM0,
+       IA_CSS_ISP_VAMEM0,
+       IA_CSS_ISP_VAMEM1,
+       IA_CSS_ISP_VAMEM2,
+       IA_CSS_ISP_HMEM0,
+       IA_CSS_SP_DMEM0,
+       IA_CSS_DDR,
+       N_IA_CSS_MEMORIES
+};
+
+#define IA_CSS_NUM_MEMORIES 9
+/* For driver compatibility */
+#define N_IA_CSS_ISP_MEMORIES   IA_CSS_NUM_MEMORIES
+#define IA_CSS_NUM_ISP_MEMORIES IA_CSS_NUM_MEMORIES
+
+#if 0
+typedef enum {
+       dev_chn, /* device channels, external resource */
+       ext_mem, /* external memories */
+       int_mem, /* internal memories */
+       int_chn  /* internal channels, user defined */
+} resource_type_t;
+
+/* if this enum is extended with other memory resources, pls also extend the function resource_to_memptr() */
+typedef enum {
+       vied_nci_dev_chn_dma_ext0,
+       int_mem_vmem0,
+       int_mem_dmem0
+} resource_id_t;
+
+/* enum listing the different memories within a program group.
+   This enum is used in the mem_ptr_t type */
+typedef enum {
+       buf_mem_invalid = 0,
+       buf_mem_vmem_prog0,
+       buf_mem_dmem_prog0
+} buf_mem_t;
+
+#endif
+#endif /* __SYSTEM_GLOBAL_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2400_system_local.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2400_system_local.h
new file mode 100644 (file)
index 0000000..ee38059
--- /dev/null
@@ -0,0 +1,325 @@
+/*
+ * 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.
+ */
+
+#ifndef __SYSTEM_LOCAL_H_INCLUDED__
+#define __SYSTEM_LOCAL_H_INCLUDED__
+
+#ifdef HRT_ISP_CSS_CUSTOM_HOST
+#ifndef HRT_USE_VIR_ADDRS
+#define HRT_USE_VIR_ADDRS
+#endif
+/* This interface is deprecated */
+/*#include "hive_isp_css_custom_host_hrt.h"*/
+#endif
+
+#include "system_global.h"
+
+/* HRT assumes 32 by default (see Linux/include/hive_types.h), overrule it in case it is different */
+#undef HRT_ADDRESS_WIDTH
+#define HRT_ADDRESS_WIDTH      64              /* Surprise, this is a local property */
+
+/* This interface is deprecated */
+#include "hive_types.h"
+
+/*
+ * Cell specific address maps
+ */
+#if HRT_ADDRESS_WIDTH == 64
+
+#define GP_FIFO_BASE   ((hrt_address)0x0000000000090104)               /* This is NOT a base address */
+
+/* DDR */
+static const hrt_address DDR_BASE[N_DDR_ID] = {
+       (hrt_address)0x0000000120000000ULL
+};
+
+/* ISP */
+static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
+       (hrt_address)0x0000000000020000ULL
+};
+
+static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
+       (hrt_address)0x0000000000200000ULL
+};
+
+static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
+       (hrt_address)0x0000000000100000ULL
+};
+
+static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
+       (hrt_address)0x00000000001C0000ULL,
+       (hrt_address)0x00000000001D0000ULL,
+       (hrt_address)0x00000000001E0000ULL
+};
+
+static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
+       (hrt_address)0x00000000001F0000ULL
+};
+
+/* SP */
+static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
+       (hrt_address)0x0000000000010000ULL
+};
+
+static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
+       (hrt_address)0x0000000000300000ULL
+};
+
+static const hrt_address SP_PMEM_BASE[N_SP_ID] = {
+       (hrt_address)0x00000000000B0000ULL
+};
+
+/* MMU */
+#if defined(IS_ISP_2400_MAMOIADA_SYSTEM) || defined(IS_ISP_2401_MAMOIADA_SYSTEM)
+/*
+ * MMU0_ID: The data MMU
+ * MMU1_ID: The icache MMU
+ */
+static const hrt_address MMU_BASE[N_MMU_ID] = {
+       (hrt_address)0x0000000000070000ULL,
+       (hrt_address)0x00000000000A0000ULL
+};
+#else
+#error "system_local.h: SYSTEM must be one of {2400, 2401 }"
+#endif
+
+/* DMA */
+static const hrt_address DMA_BASE[N_DMA_ID] = {
+       (hrt_address)0x0000000000040000ULL
+};
+
+/* IRQ */
+static const hrt_address IRQ_BASE[N_IRQ_ID] = {
+       (hrt_address)0x0000000000000500ULL,
+       (hrt_address)0x0000000000030A00ULL,
+       (hrt_address)0x000000000008C000ULL,
+       (hrt_address)0x0000000000090200ULL
+};
+/*
+       (hrt_address)0x0000000000000500ULL};
+ */
+
+/* GDC */
+static const hrt_address GDC_BASE[N_GDC_ID] = {
+       (hrt_address)0x0000000000050000ULL,
+       (hrt_address)0x0000000000060000ULL
+};
+
+/* FIFO_MONITOR (not a subset of GP_DEVICE) */
+static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
+       (hrt_address)0x0000000000000000ULL
+};
+
+/*
+static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
+       (hrt_address)0x0000000000000000ULL};
+
+static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
+       (hrt_address)0x0000000000090000ULL};
+*/
+
+/* GP_DEVICE (single base for all separate GP_REG instances) */
+static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
+       (hrt_address)0x0000000000000000ULL
+};
+
+/*GP TIMER , all timer registers are inter-twined,
+ * so, having multiple base addresses for
+ * different timers does not help*/
+static const hrt_address GP_TIMER_BASE =
+    (hrt_address)0x0000000000000600ULL;
+/* GPIO */
+static const hrt_address GPIO_BASE[N_GPIO_ID] = {
+       (hrt_address)0x0000000000000400ULL
+};
+
+/* TIMED_CTRL */
+static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
+       (hrt_address)0x0000000000000100ULL
+};
+
+/* INPUT_FORMATTER */
+static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
+       (hrt_address)0x0000000000030000ULL,
+       (hrt_address)0x0000000000030200ULL,
+       (hrt_address)0x0000000000030400ULL,
+       (hrt_address)0x0000000000030600ULL
+}; /* memcpy() */
+
+/* INPUT_SYSTEM */
+static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
+       (hrt_address)0x0000000000080000ULL
+};
+/*     (hrt_address)0x0000000000081000ULL, */ /* capture A */
+/*     (hrt_address)0x0000000000082000ULL, */ /* capture B */
+/*     (hrt_address)0x0000000000083000ULL, */ /* capture C */
+/*     (hrt_address)0x0000000000084000ULL, */ /* Acquisition */
+/*     (hrt_address)0x0000000000085000ULL, */ /* DMA */
+/*     (hrt_address)0x0000000000089000ULL, */ /* ctrl */
+/*     (hrt_address)0x000000000008A000ULL, */ /* GP regs */
+/*     (hrt_address)0x000000000008B000ULL, */ /* FIFO */
+/*     (hrt_address)0x000000000008C000ULL, */ /* IRQ */
+
+/* RX, the MIPI lane control regs start at offset 0 */
+static const hrt_address RX_BASE[N_RX_ID] = {
+       (hrt_address)0x0000000000080100ULL
+};
+
+#elif HRT_ADDRESS_WIDTH == 32
+
+#define GP_FIFO_BASE   ((hrt_address)0x00090104)               /* This is NOT a base address */
+
+/* DDR : Attention, this value not defined in 32-bit */
+static const hrt_address DDR_BASE[N_DDR_ID] = {
+       (hrt_address)0x00000000UL
+};
+
+/* ISP */
+static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
+       (hrt_address)0x00020000UL
+};
+
+static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
+       (hrt_address)0x00200000UL
+};
+
+static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
+       (hrt_address)0x100000UL
+};
+
+static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
+       (hrt_address)0xffffffffUL,
+       (hrt_address)0xffffffffUL,
+       (hrt_address)0xffffffffUL
+};
+
+static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
+       (hrt_address)0xffffffffUL
+};
+
+/* SP */
+static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
+       (hrt_address)0x00010000UL
+};
+
+static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
+       (hrt_address)0x00300000UL
+};
+
+static const hrt_address SP_PMEM_BASE[N_SP_ID] = {
+       (hrt_address)0x000B0000UL
+};
+
+/* MMU */
+#if defined(IS_ISP_2400_MAMOIADA_SYSTEM) || defined(IS_ISP_2401_MAMOIADA_SYSTEM)
+/*
+ * MMU0_ID: The data MMU
+ * MMU1_ID: The icache MMU
+ */
+static const hrt_address MMU_BASE[N_MMU_ID] = {
+       (hrt_address)0x00070000UL,
+       (hrt_address)0x000A0000UL
+};
+#else
+#error "system_local.h: SYSTEM must be one of {2400, 2401 }"
+#endif
+
+/* DMA */
+static const hrt_address DMA_BASE[N_DMA_ID] = {
+       (hrt_address)0x00040000UL
+};
+
+/* IRQ */
+static const hrt_address IRQ_BASE[N_IRQ_ID] = {
+       (hrt_address)0x00000500UL,
+       (hrt_address)0x00030A00UL,
+       (hrt_address)0x0008C000UL,
+       (hrt_address)0x00090200UL
+};
+/*
+       (hrt_address)0x00000500UL};
+ */
+
+/* GDC */
+static const hrt_address GDC_BASE[N_GDC_ID] = {
+       (hrt_address)0x00050000UL,
+       (hrt_address)0x00060000UL
+};
+
+/* FIFO_MONITOR (not a subset of GP_DEVICE) */
+static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
+       (hrt_address)0x00000000UL
+};
+
+/*
+static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
+       (hrt_address)0x00000000UL};
+
+static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
+       (hrt_address)0x00090000UL};
+*/
+
+/* GP_DEVICE (single base for all separate GP_REG instances) */
+static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
+       (hrt_address)0x00000000UL
+};
+
+/*GP TIMER , all timer registers are inter-twined,
+ * so, having multiple base addresses for
+ * different timers does not help*/
+static const hrt_address GP_TIMER_BASE =
+    (hrt_address)0x00000600UL;
+
+/* GPIO */
+static const hrt_address GPIO_BASE[N_GPIO_ID] = {
+       (hrt_address)0x00000400UL
+};
+
+/* TIMED_CTRL */
+static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
+       (hrt_address)0x00000100UL
+};
+
+/* INPUT_FORMATTER */
+static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
+       (hrt_address)0x00030000UL,
+       (hrt_address)0x00030200UL,
+       (hrt_address)0x00030400UL
+};
+/*     (hrt_address)0x00030600UL, */ /* memcpy() */
+
+/* INPUT_SYSTEM */
+static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
+       (hrt_address)0x00080000UL
+};
+/*     (hrt_address)0x00081000UL, */ /* capture A */
+/*     (hrt_address)0x00082000UL, */ /* capture B */
+/*     (hrt_address)0x00083000UL, */ /* capture C */
+/*     (hrt_address)0x00084000UL, */ /* Acquisition */
+/*     (hrt_address)0x00085000UL, */ /* DMA */
+/*     (hrt_address)0x00089000UL, */ /* ctrl */
+/*     (hrt_address)0x0008A000UL, */ /* GP regs */
+/*     (hrt_address)0x0008B000UL, */ /* FIFO */
+/*     (hrt_address)0x0008C000UL, */ /* IRQ */
+
+/* RX, the MIPI lane control regs start at offset 0 */
+static const hrt_address RX_BASE[N_RX_ID] = {
+       (hrt_address)0x00080100UL
+};
+
+#else
+#error "system_local.h: HRT_ADDRESS_WIDTH must be one of {32,64}"
+#endif
+
+#endif /* __SYSTEM_LOCAL_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2401_input_system_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2401_input_system_global.h
new file mode 100644 (file)
index 0000000..9c882fe
--- /dev/null
@@ -0,0 +1,205 @@
+/*
+ * Support for Intel Camera Imaging ISP subsystem.
+ * Copyright (c) 2015, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef __INPUT_SYSTEM_GLOBAL_H_INCLUDED__
+#define __INPUT_SYSTEM_GLOBAL_H_INCLUDED__
+
+#define IS_INPUT_SYSTEM_VERSION_VERSION_2401
+
+/* CSI reveiver has 3 ports. */
+#define                N_CSI_PORTS (3)
+
+#include "isys_dma.h"          /*      isys2401_dma_channel,
+                                *      isys2401_dma_cfg_t
+                                */
+
+#include "ibuf_ctrl.h"         /*      ibuf_cfg_t,
+                                *      ibuf_ctrl_cfg_t
+                                */
+
+#include "isys_stream2mmio.h"  /*      stream2mmio_cfg_t */
+
+#include "csi_rx.h"            /*      csi_rx_frontend_cfg_t,
+                                *      csi_rx_backend_cfg_t,
+                                *      csi_rx_backend_lut_entry_t
+                                */
+#include "pixelgen.h"
+
+#define INPUT_SYSTEM_N_STREAM_ID  6    /* maximum number of simultaneous
+                                       virtual channels supported*/
+
+typedef enum {
+       INPUT_SYSTEM_ERR_NO_ERROR = 0,
+       INPUT_SYSTEM_ERR_CREATE_CHANNEL_FAIL,
+       INPUT_SYSTEM_ERR_CONFIGURE_CHANNEL_FAIL,
+       INPUT_SYSTEM_ERR_OPEN_CHANNEL_FAIL,
+       INPUT_SYSTEM_ERR_TRANSFER_FAIL,
+       INPUT_SYSTEM_ERR_CREATE_INPUT_PORT_FAIL,
+       INPUT_SYSTEM_ERR_CONFIGURE_INPUT_PORT_FAIL,
+       INPUT_SYSTEM_ERR_OPEN_INPUT_PORT_FAIL,
+       N_INPUT_SYSTEM_ERR
+} input_system_err_t;
+
+typedef enum {
+       INPUT_SYSTEM_SOURCE_TYPE_UNDEFINED = 0,
+       INPUT_SYSTEM_SOURCE_TYPE_SENSOR,
+       INPUT_SYSTEM_SOURCE_TYPE_TPG,
+       INPUT_SYSTEM_SOURCE_TYPE_PRBS,
+       N_INPUT_SYSTEM_SOURCE_TYPE
+} input_system_source_type_t;
+
+typedef enum {
+       INPUT_SYSTEM_POLL_ON_WAIT_FOR_FRAME,
+       INPUT_SYSTEM_POLL_ON_CAPTURE_REQUEST,
+} input_system_polling_mode_t;
+
+typedef struct input_system_channel_s input_system_channel_t;
+struct input_system_channel_s {
+       stream2mmio_ID_t        stream2mmio_id;
+       stream2mmio_sid_ID_t    stream2mmio_sid_id;
+
+       ibuf_ctrl_ID_t          ibuf_ctrl_id;
+       ib_buffer_t             ib_buffer;
+
+       isys2401_dma_ID_t       dma_id;
+       isys2401_dma_channel    dma_channel;
+};
+
+typedef struct input_system_channel_cfg_s input_system_channel_cfg_t;
+struct input_system_channel_cfg_s {
+       stream2mmio_cfg_t       stream2mmio_cfg;
+       ibuf_ctrl_cfg_t         ibuf_ctrl_cfg;
+       isys2401_dma_cfg_t      dma_cfg;
+       isys2401_dma_port_cfg_t dma_src_port_cfg;
+       isys2401_dma_port_cfg_t dma_dest_port_cfg;
+};
+
+typedef struct input_system_input_port_s input_system_input_port_t;
+struct input_system_input_port_s {
+       input_system_source_type_t      source_type;
+
+       struct {
+               csi_rx_frontend_ID_t            frontend_id;
+               csi_rx_backend_ID_t             backend_id;
+               csi_mipi_packet_type_t          packet_type;
+               csi_rx_backend_lut_entry_t      backend_lut_entry;
+       } csi_rx;
+
+       struct {
+               csi_mipi_packet_type_t          packet_type;
+               csi_rx_backend_lut_entry_t      backend_lut_entry;
+       } metadata;
+
+       struct {
+               pixelgen_ID_t                   pixelgen_id;
+       } pixelgen;
+};
+
+typedef struct input_system_input_port_cfg_s input_system_input_port_cfg_t;
+struct input_system_input_port_cfg_s {
+       struct {
+               csi_rx_frontend_cfg_t   frontend_cfg;
+               csi_rx_backend_cfg_t    backend_cfg;
+               csi_rx_backend_cfg_t    md_backend_cfg;
+       } csi_rx_cfg;
+
+       struct {
+               pixelgen_tpg_cfg_t      tpg_cfg;
+               pixelgen_prbs_cfg_t     prbs_cfg;
+       } pixelgen_cfg;
+};
+
+typedef struct input_system_cfg_s input_system_cfg_t;
+struct input_system_cfg_s {
+       input_system_input_port_ID_t    input_port_id;
+
+       input_system_source_type_t      mode;
+
+       /* ISP2401 */
+       input_system_polling_mode_t     polling_mode;
+
+       bool online;
+       bool raw_packed;
+       s8 linked_isys_stream_id;
+
+       struct {
+               bool    comp_enable;
+               s32     active_lanes;
+               s32     fmt_type;
+               s32     ch_id;
+               s32 comp_predictor;
+               s32 comp_scheme;
+       } csi_port_attr;
+
+       pixelgen_tpg_cfg_t      tpg_port_attr;
+
+       pixelgen_prbs_cfg_t prbs_port_attr;
+
+       struct {
+               s32 align_req_in_bytes;
+               s32 bits_per_pixel;
+               s32 pixels_per_line;
+               s32 lines_per_frame;
+       } input_port_resolution;
+
+       struct {
+               s32 left_padding;
+               s32 max_isp_input_width;
+       } output_port_attr;
+
+       struct {
+               bool    enable;
+               s32 fmt_type;
+               s32 align_req_in_bytes;
+               s32 bits_per_pixel;
+               s32 pixels_per_line;
+               s32 lines_per_frame;
+       } metadata;
+};
+
+typedef struct virtual_input_system_stream_s virtual_input_system_stream_t;
+struct virtual_input_system_stream_s {
+       u32 id;                         /*Used when multiple MIPI data types and/or virtual channels are used.
+                                                               Must be unique within one CSI RX
+                                                               and lower than SH_CSS_MAX_ISYS_CHANNEL_NODES */
+       u8 enable_metadata;
+       input_system_input_port_t       input_port;
+       input_system_channel_t          channel;
+       input_system_channel_t          md_channel; /* metadata channel */
+       u8 online;
+       s8 linked_isys_stream_id;
+       u8 valid;
+
+       /* ISP2401 */
+       input_system_polling_mode_t     polling_mode;
+       s32 subscr_index;
+};
+
+typedef struct virtual_input_system_stream_cfg_s
+       virtual_input_system_stream_cfg_t;
+struct virtual_input_system_stream_cfg_s {
+       u8 enable_metadata;
+       input_system_input_port_cfg_t   input_port_cfg;
+       input_system_channel_cfg_t      channel_cfg;
+       input_system_channel_cfg_t      md_channel_cfg;
+       u8 valid;
+};
+
+#define ISP_INPUT_BUF_START_ADDR       0
+#define NUM_OF_INPUT_BUF               2
+#define NUM_OF_LINES_PER_BUF           2
+#define LINES_OF_ISP_INPUT_BUF         (NUM_OF_INPUT_BUF * NUM_OF_LINES_PER_BUF)
+#define ISP_INPUT_BUF_STRIDE           SH_CSS_MAX_SENSOR_WIDTH
+
+#endif /* __INPUT_SYSTEM_GLOBAL_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2401_input_system_local.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2401_input_system_local.h
new file mode 100644 (file)
index 0000000..f199423
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Support for Intel Camera Imaging ISP subsystem.
+ * Copyright (c) 2015, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef __INPUT_SYSTEM_LOCAL_H_INCLUDED__
+#define __INPUT_SYSTEM_LOCAL_H_INCLUDED__
+
+#include "type_support.h"
+#include "input_system_global.h"
+
+#include "ibuf_ctrl.h"
+#include "csi_rx.h"
+#include "pixelgen.h"
+#include "isys_stream2mmio.h"
+#include "isys_irq.h"
+
+typedef input_system_err_t input_system_error_t;
+
+typedef enum {
+       MIPI_FORMAT_SHORT1 = 0x08,
+       MIPI_FORMAT_SHORT2,
+       MIPI_FORMAT_SHORT3,
+       MIPI_FORMAT_SHORT4,
+       MIPI_FORMAT_SHORT5,
+       MIPI_FORMAT_SHORT6,
+       MIPI_FORMAT_SHORT7,
+       MIPI_FORMAT_SHORT8,
+       MIPI_FORMAT_EMBEDDED = 0x12,
+       MIPI_FORMAT_YUV420_8 = 0x18,
+       MIPI_FORMAT_YUV420_10,
+       MIPI_FORMAT_YUV420_8_LEGACY,
+       MIPI_FORMAT_YUV420_8_SHIFT = 0x1C,
+       MIPI_FORMAT_YUV420_10_SHIFT,
+       MIPI_FORMAT_YUV422_8 = 0x1E,
+       MIPI_FORMAT_YUV422_10,
+       MIPI_FORMAT_RGB444 = 0x20,
+       MIPI_FORMAT_RGB555,
+       MIPI_FORMAT_RGB565,
+       MIPI_FORMAT_RGB666,
+       MIPI_FORMAT_RGB888,
+       MIPI_FORMAT_RAW6 = 0x28,
+       MIPI_FORMAT_RAW7,
+       MIPI_FORMAT_RAW8,
+       MIPI_FORMAT_RAW10,
+       MIPI_FORMAT_RAW12,
+       MIPI_FORMAT_RAW14,
+       MIPI_FORMAT_CUSTOM0 = 0x30,
+       MIPI_FORMAT_CUSTOM1,
+       MIPI_FORMAT_CUSTOM2,
+       MIPI_FORMAT_CUSTOM3,
+       MIPI_FORMAT_CUSTOM4,
+       MIPI_FORMAT_CUSTOM5,
+       MIPI_FORMAT_CUSTOM6,
+       MIPI_FORMAT_CUSTOM7,
+       //MIPI_FORMAT_RAW16, /*not supported by 2401*/
+       //MIPI_FORMAT_RAW18,
+       N_MIPI_FORMAT
+} mipi_format_t;
+
+#define N_MIPI_FORMAT_CUSTOM   8
+
+/* The number of stores for compressed format types */
+#define        N_MIPI_COMPRESSOR_CONTEXT       (N_RX_CHANNEL_ID * N_MIPI_FORMAT_CUSTOM)
+#define UNCOMPRESSED_BITS_PER_PIXEL_10 10
+#define UNCOMPRESSED_BITS_PER_PIXEL_12 12
+#define COMPRESSED_BITS_PER_PIXEL_6    6
+#define COMPRESSED_BITS_PER_PIXEL_7    7
+#define COMPRESSED_BITS_PER_PIXEL_8    8
+enum mipi_compressor {
+       MIPI_COMPRESSOR_NONE = 0,
+       MIPI_COMPRESSOR_10_6_10,
+       MIPI_COMPRESSOR_10_7_10,
+       MIPI_COMPRESSOR_10_8_10,
+       MIPI_COMPRESSOR_12_6_12,
+       MIPI_COMPRESSOR_12_7_12,
+       MIPI_COMPRESSOR_12_8_12,
+       N_MIPI_COMPRESSOR_METHODS
+};
+
+typedef enum {
+       MIPI_PREDICTOR_NONE = 0,
+       MIPI_PREDICTOR_TYPE1,
+       MIPI_PREDICTOR_TYPE2,
+       N_MIPI_PREDICTOR_TYPES
+} mipi_predictor_t;
+
+typedef struct input_system_state_s    input_system_state_t;
+struct input_system_state_s {
+       ibuf_ctrl_state_t       ibuf_ctrl_state[N_IBUF_CTRL_ID];
+       csi_rx_fe_ctrl_state_t  csi_rx_fe_ctrl_state[N_CSI_RX_FRONTEND_ID];
+       csi_rx_be_ctrl_state_t  csi_rx_be_ctrl_state[N_CSI_RX_BACKEND_ID];
+       pixelgen_ctrl_state_t   pixelgen_ctrl_state[N_PIXELGEN_ID];
+       stream2mmio_state_t     stream2mmio_state[N_STREAM2MMIO_ID];
+       isys_irqc_state_t       isys_irqc_state[N_ISYS_IRQ_ID];
+};
+#endif /* __INPUT_SYSTEM_LOCAL_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2401_input_system_private.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2401_input_system_private.h
new file mode 100644 (file)
index 0000000..3f60f59
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Support for Intel Camera Imaging ISP subsystem.
+ * Copyright (c) 2015, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef __INPUT_SYSTEM_PRIVATE_H_INCLUDED__
+#define __INPUT_SYSTEM_PRIVATE_H_INCLUDED__
+
+#include "input_system_public.h"
+
+STORAGE_CLASS_INPUT_SYSTEM_C input_system_err_t input_system_get_state(
+    const input_system_ID_t    ID,
+    input_system_state_t *state)
+{
+       u32 i;
+
+       (void)(ID);
+
+       /*  get the states of all CSI RX frontend devices */
+       for (i = 0; i < N_CSI_RX_FRONTEND_ID; i++) {
+               csi_rx_fe_ctrl_get_state(
+                   (csi_rx_frontend_ID_t)i,
+                   &state->csi_rx_fe_ctrl_state[i]);
+       }
+
+       /*  get the states of all CIS RX backend devices */
+       for (i = 0; i < N_CSI_RX_BACKEND_ID; i++) {
+               csi_rx_be_ctrl_get_state(
+                   (csi_rx_backend_ID_t)i,
+                   &state->csi_rx_be_ctrl_state[i]);
+       }
+
+       /* get the states of all pixelgen devices */
+       for (i = 0; i < N_PIXELGEN_ID; i++) {
+               pixelgen_ctrl_get_state(
+                   (pixelgen_ID_t)i,
+                   &state->pixelgen_ctrl_state[i]);
+       }
+
+       /* get the states of all stream2mmio devices */
+       for (i = 0; i < N_STREAM2MMIO_ID; i++) {
+               stream2mmio_get_state(
+                   (stream2mmio_ID_t)i,
+                   &state->stream2mmio_state[i]);
+       }
+
+       /* get the states of all ibuf-controller devices */
+       for (i = 0; i < N_IBUF_CTRL_ID; i++) {
+               ibuf_ctrl_get_state(
+                   (ibuf_ctrl_ID_t)i,
+                   &state->ibuf_ctrl_state[i]);
+       }
+
+       /* get the states of all isys irq controllers */
+       for (i = 0; i < N_ISYS_IRQ_ID; i++) {
+               isys_irqc_state_get((isys_irq_ID_t)i, &state->isys_irqc_state[i]);
+       }
+
+       /* TODO: get the states of all ISYS2401 DMA devices  */
+       for (i = 0; i < N_ISYS2401_DMA_ID; i++) {
+       }
+
+       return INPUT_SYSTEM_ERR_NO_ERROR;
+}
+
+STORAGE_CLASS_INPUT_SYSTEM_C void input_system_dump_state(
+    const input_system_ID_t    ID,
+    input_system_state_t *state)
+{
+       u32 i;
+
+       (void)(ID);
+
+       /*  dump the states of all CSI RX frontend devices */
+       for (i = 0; i < N_CSI_RX_FRONTEND_ID; i++) {
+               csi_rx_fe_ctrl_dump_state(
+                   (csi_rx_frontend_ID_t)i,
+                   &state->csi_rx_fe_ctrl_state[i]);
+       }
+
+       /*  dump the states of all CIS RX backend devices */
+       for (i = 0; i < N_CSI_RX_BACKEND_ID; i++) {
+               csi_rx_be_ctrl_dump_state(
+                   (csi_rx_backend_ID_t)i,
+                   &state->csi_rx_be_ctrl_state[i]);
+       }
+
+       /* dump the states of all pixelgen devices */
+       for (i = 0; i < N_PIXELGEN_ID; i++) {
+               pixelgen_ctrl_dump_state(
+                   (pixelgen_ID_t)i,
+                   &state->pixelgen_ctrl_state[i]);
+       }
+
+       /* dump the states of all st2mmio devices */
+       for (i = 0; i < N_STREAM2MMIO_ID; i++) {
+               stream2mmio_dump_state(
+                   (stream2mmio_ID_t)i,
+                   &state->stream2mmio_state[i]);
+       }
+
+       /* dump the states of all ibuf-controller devices */
+       for (i = 0; i < N_IBUF_CTRL_ID; i++) {
+               ibuf_ctrl_dump_state(
+                   (ibuf_ctrl_ID_t)i,
+                   &state->ibuf_ctrl_state[i]);
+       }
+
+       /* dump the states of all isys irq controllers */
+       for (i = 0; i < N_ISYS_IRQ_ID; i++) {
+               isys_irqc_state_dump((isys_irq_ID_t)i, &state->isys_irqc_state[i]);
+       }
+
+       /* TODO: dump the states of all ISYS2401 DMA devices  */
+       for (i = 0; i < N_ISYS2401_DMA_ID; i++) {
+       }
+
+       return;
+}
+#endif /* __INPUT_SYSTEM_PRIVATE_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2401_system_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2401_system_global.h
new file mode 100644 (file)
index 0000000..9c948cc
--- /dev/null
@@ -0,0 +1,458 @@
+/*
+ * Support for Intel Camera Imaging ISP subsystem.
+ * Copyright (c) 2015, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef __SYSTEM_GLOBAL_H_INCLUDED__
+#define __SYSTEM_GLOBAL_H_INCLUDED__
+
+#include <hive_isp_css_defs.h>
+#include <type_support.h>
+
+/*
+ * The longest allowed (uninteruptible) bus transfer, does not
+ * take stalling into account
+ */
+#define HIVE_ISP_MAX_BURST_LENGTH      1024
+
+/*
+ * Maximum allowed burst length in words for the ISP DMA
+ * This value is set to 2 to prevent the ISP DMA from blocking
+ * the bus for too long; as the input system can only buffer
+ * 2 lines on Moorefield and Cherrytrail, the input system buffers
+ * may overflow if blocked for too long (BZ 2726).
+ */
+#define ISP_DMA_MAX_BURST_LENGTH       2
+
+/*
+ * Create a list of HAS and IS properties that defines the system
+ *
+ * The configuration assumes the following
+ * - The system is hetereogeneous; Multiple cells and devices classes
+ * - The cell and device instances are homogeneous, each device type
+ *   belongs to the same class
+ * - Device instances supporting a subset of the class capabilities are
+ *   allowed
+ *
+ * We could manage different device classes through the enumerated
+ * lists (C) or the use of classes (C++), but that is presently not
+ * fully supported
+ *
+ * N.B. the 3 input formatters are of 2 different classess
+ */
+
+#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}
+ *
+ * The 2401 system has the nice property that it uses a vanilla 2400 SP
+ * so the SP will believe it is a 2400 system rather than 2401...
+ */
+/* #if defined(SYSTEM_hive_isp_css_2401_system) || defined(__isp2401_mamoiada) || defined(__scalar_processor_2401) */
+#if defined(SYSTEM_hive_isp_css_2401_system) || defined(__isp2401_mamoiada)
+#define IS_ISP_2401_MAMOIADA_SYSTEM
+#define HAS_ISP_2401_MAMOIADA
+#define HAS_SP_2400
+/* #elif defined(SYSTEM_hive_isp_css_2400_system) || defined(__isp2400_mamoiada) || defined(__scalar_processor_2400)*/
+#elif defined(SYSTEM_hive_isp_css_2400_system) || defined(__isp2400_mamoiada)
+#define IS_ISP_2400_MAMOIADA_SYSTEM
+#define HAS_ISP_2400_MAMOIADA
+#define HAS_SP_2400
+#else
+#error "system_global.h: 2400_SYSTEM must be one of {2400, 2401 }"
+#endif
+
+#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
+/* 2401: HAS_INPUT_SYSTEM_VERSION_3 */
+/* 2400: HAS_INPUT_SYSTEM_VERSION_2 */
+#define HAS_INPUT_SYSTEM_VERSION_2
+#define HAS_INPUT_SYSTEM_VERSION_2401
+#define HAS_BUFFERED_SENSOR
+#define HAS_FIFO_MONITORS_VERSION_2
+/* #define HAS_GP_REGS_VERSION_2 */
+#define HAS_GP_DEVICE_VERSION_2
+#define HAS_GPIO_VERSION_1
+#define HAS_TIMED_CTRL_VERSION_1
+#define HAS_RX_VERSION_2
+#define HAS_NO_INPUT_FORMATTER
+/*#define HAS_NO_PACKED_RAW_PIXELS*/
+/*#define HAS_NO_DVS_6AXIS_CONFIG_UPDATE*/
+
+#define DMA_DDR_TO_VAMEM_WORKAROUND
+#define DMA_DDR_TO_HMEM_WORKAROUND
+
+/*
+ * Semi global. "HRT" is accessible from SP, but
+ * the HRT types do not fully apply
+ */
+#define HRT_VADDRESS_WIDTH     32
+/* Surprise, this is a local property*/
+/*#define HRT_ADDRESS_WIDTH    64 */
+#define HRT_DATA_WIDTH         32
+
+#define SIZEOF_HRT_REG         (HRT_DATA_WIDTH >> 3)
+#define HIVE_ISP_CTRL_DATA_BYTES (HIVE_ISP_CTRL_DATA_WIDTH / 8)
+
+/* The main bus connecting all devices */
+#define HRT_BUS_WIDTH          HIVE_ISP_CTRL_DATA_WIDTH
+#define HRT_BUS_BYTES          HIVE_ISP_CTRL_DATA_BYTES
+
+#define CSI2P_DISABLE_ISYS2401_ONLINE_MODE
+
+/* per-frame parameter handling support */
+#define SH_CSS_ENABLE_PER_FRAME_PARAMS
+
+typedef u32                    hrt_bus_align_t;
+
+/*
+ * Enumerate the devices, device access through the API is by ID,
+ * through the DLI by address. The enumerator terminators are used
+ * to size the wiring arrays and as an exception value.
+ */
+typedef enum {
+       DDR0_ID = 0,
+       N_DDR_ID
+} ddr_ID_t;
+
+typedef enum {
+       ISP0_ID = 0,
+       N_ISP_ID
+} isp_ID_t;
+
+typedef enum {
+       SP0_ID = 0,
+       N_SP_ID
+} sp_ID_t;
+
+#if defined(IS_ISP_2401_MAMOIADA_SYSTEM)
+typedef enum {
+       MMU0_ID = 0,
+       MMU1_ID,
+       N_MMU_ID
+} mmu_ID_t;
+#elif defined(IS_ISP_2400_MAMOIADA_SYSTEM)
+typedef enum {
+       MMU0_ID = 0,
+       MMU1_ID,
+       N_MMU_ID
+} mmu_ID_t;
+#else
+#error "system_global.h: SYSTEM must be one of {2400, 2401}"
+#endif
+
+typedef enum {
+       DMA0_ID = 0,
+       N_DMA_ID
+} dma_ID_t;
+
+typedef enum {
+       GDC0_ID = 0,
+       GDC1_ID,
+       N_GDC_ID
+} gdc_ID_t;
+
+/* this extra define is needed because we want to use it also
+   in the preprocessor, and that doesn't work with enums.
+ */
+#define N_GDC_ID_CPP 2
+
+typedef enum {
+       VAMEM0_ID = 0,
+       VAMEM1_ID,
+       VAMEM2_ID,
+       N_VAMEM_ID
+} vamem_ID_t;
+
+typedef enum {
+       BAMEM0_ID = 0,
+       N_BAMEM_ID
+} bamem_ID_t;
+
+typedef enum {
+       HMEM0_ID = 0,
+       N_HMEM_ID
+} hmem_ID_t;
+
+typedef enum {
+       ISYS_IRQ0_ID = 0,       /* port a */
+       ISYS_IRQ1_ID,   /* port b */
+       ISYS_IRQ2_ID,   /* port c */
+       N_ISYS_IRQ_ID
+} isys_irq_ID_t;
+
+typedef enum {
+       IRQ0_ID = 0,    /* GP IRQ block */
+       IRQ1_ID,        /* Input formatter */
+       IRQ2_ID,        /* input system */
+       IRQ3_ID,        /* input selector */
+       N_IRQ_ID
+} irq_ID_t;
+
+typedef enum {
+       FIFO_MONITOR0_ID = 0,
+       N_FIFO_MONITOR_ID
+} fifo_monitor_ID_t;
+
+/*
+ * Deprecated: Since all gp_reg instances are different
+ * and put in the address maps of other devices we cannot
+ * enumerate them as that assumes the instrances are the
+ * same.
+ *
+ * We define a single GP_DEVICE containing all gp_regs
+ * w.r.t. a single base address
+ *
+typedef enum {
+       GP_REGS0_ID = 0,
+       N_GP_REGS_ID
+} gp_regs_ID_t;
+ */
+typedef enum {
+       GP_DEVICE0_ID = 0,
+       N_GP_DEVICE_ID
+} gp_device_ID_t;
+
+typedef enum {
+       GP_TIMER0_ID = 0,
+       GP_TIMER1_ID,
+       GP_TIMER2_ID,
+       GP_TIMER3_ID,
+       GP_TIMER4_ID,
+       GP_TIMER5_ID,
+       GP_TIMER6_ID,
+       GP_TIMER7_ID,
+       N_GP_TIMER_ID
+} gp_timer_ID_t;
+
+typedef enum {
+       GPIO0_ID = 0,
+       N_GPIO_ID
+} gpio_ID_t;
+
+typedef enum {
+       TIMED_CTRL0_ID = 0,
+       N_TIMED_CTRL_ID
+} timed_ctrl_ID_t;
+
+typedef enum {
+       INPUT_FORMATTER0_ID = 0,
+       INPUT_FORMATTER1_ID,
+       INPUT_FORMATTER2_ID,
+       INPUT_FORMATTER3_ID,
+       N_INPUT_FORMATTER_ID
+} input_formatter_ID_t;
+
+/* The IF RST is outside the IF */
+#define INPUT_FORMATTER0_SRST_OFFSET   0x0824
+#define INPUT_FORMATTER1_SRST_OFFSET   0x0624
+#define INPUT_FORMATTER2_SRST_OFFSET   0x0424
+#define INPUT_FORMATTER3_SRST_OFFSET   0x0224
+
+#define INPUT_FORMATTER0_SRST_MASK             0x0001
+#define INPUT_FORMATTER1_SRST_MASK             0x0002
+#define INPUT_FORMATTER2_SRST_MASK             0x0004
+#define INPUT_FORMATTER3_SRST_MASK             0x0008
+
+typedef enum {
+       INPUT_SYSTEM0_ID = 0,
+       N_INPUT_SYSTEM_ID
+} input_system_ID_t;
+
+typedef enum {
+       RX0_ID = 0,
+       N_RX_ID
+} rx_ID_t;
+
+enum mipi_port_id {
+       MIPI_PORT0_ID = 0,
+       MIPI_PORT1_ID,
+       MIPI_PORT2_ID,
+       N_MIPI_PORT_ID
+};
+
+#define        N_RX_CHANNEL_ID         4
+
+/* Generic port enumeration with an internal port type ID */
+typedef enum {
+       CSI_PORT0_ID = 0,
+       CSI_PORT1_ID,
+       CSI_PORT2_ID,
+       TPG_PORT0_ID,
+       PRBS_PORT0_ID,
+       FIFO_PORT0_ID,
+       MEMORY_PORT0_ID,
+       N_INPUT_PORT_ID
+} input_port_ID_t;
+
+typedef enum {
+       CAPTURE_UNIT0_ID = 0,
+       CAPTURE_UNIT1_ID,
+       CAPTURE_UNIT2_ID,
+       ACQUISITION_UNIT0_ID,
+       DMA_UNIT0_ID,
+       CTRL_UNIT0_ID,
+       GPREGS_UNIT0_ID,
+       FIFO_UNIT0_ID,
+       IRQ_UNIT0_ID,
+       N_SUB_SYSTEM_ID
+} sub_system_ID_t;
+
+#define        N_CAPTURE_UNIT_ID               3
+#define        N_ACQUISITION_UNIT_ID   1
+#define        N_CTRL_UNIT_ID                  1
+
+/*
+ * Input-buffer Controller.
+ */
+typedef enum {
+       IBUF_CTRL0_ID = 0,      /* map to ISYS2401_IBUF_CNTRL_A */
+       IBUF_CTRL1_ID,          /* map to ISYS2401_IBUF_CNTRL_B */
+       IBUF_CTRL2_ID,          /* map ISYS2401_IBUF_CNTRL_C */
+       N_IBUF_CTRL_ID
+} ibuf_ctrl_ID_t;
+/* end of Input-buffer Controller */
+
+/*
+ * Stream2MMIO.
+ */
+typedef enum {
+       STREAM2MMIO0_ID = 0,    /* map to ISYS2401_S2M_A */
+       STREAM2MMIO1_ID,        /* map to ISYS2401_S2M_B */
+       STREAM2MMIO2_ID,        /* map to ISYS2401_S2M_C */
+       N_STREAM2MMIO_ID
+} stream2mmio_ID_t;
+
+typedef enum {
+       /*
+        * Stream2MMIO 0 has 8 SIDs that are indexed by
+        * [STREAM2MMIO_SID0_ID...STREAM2MMIO_SID7_ID].
+        *
+        * Stream2MMIO 1 has 4 SIDs that are indexed by
+        * [STREAM2MMIO_SID0_ID...TREAM2MMIO_SID3_ID].
+        *
+        * Stream2MMIO 2 has 4 SIDs that are indexed by
+        * [STREAM2MMIO_SID0_ID...STREAM2MMIO_SID3_ID].
+        */
+       STREAM2MMIO_SID0_ID = 0,
+       STREAM2MMIO_SID1_ID,
+       STREAM2MMIO_SID2_ID,
+       STREAM2MMIO_SID3_ID,
+       STREAM2MMIO_SID4_ID,
+       STREAM2MMIO_SID5_ID,
+       STREAM2MMIO_SID6_ID,
+       STREAM2MMIO_SID7_ID,
+       N_STREAM2MMIO_SID_ID
+} stream2mmio_sid_ID_t;
+/* end of Stream2MMIO */
+
+/**
+ * Input System 2401: CSI-MIPI recevier.
+ */
+typedef enum {
+       CSI_RX_BACKEND0_ID = 0, /* map to ISYS2401_MIPI_BE_A */
+       CSI_RX_BACKEND1_ID,             /* map to ISYS2401_MIPI_BE_B */
+       CSI_RX_BACKEND2_ID,             /* map to ISYS2401_MIPI_BE_C */
+       N_CSI_RX_BACKEND_ID
+} csi_rx_backend_ID_t;
+
+typedef enum {
+       CSI_RX_FRONTEND0_ID = 0,        /* map to ISYS2401_CSI_RX_A */
+       CSI_RX_FRONTEND1_ID,            /* map to ISYS2401_CSI_RX_B */
+       CSI_RX_FRONTEND2_ID,            /* map to ISYS2401_CSI_RX_C */
+#define N_CSI_RX_FRONTEND_ID (CSI_RX_FRONTEND2_ID + 1)
+} csi_rx_frontend_ID_t;
+
+typedef enum {
+       CSI_RX_DLANE0_ID = 0,           /* map to DLANE0 in CSI RX */
+       CSI_RX_DLANE1_ID,               /* map to DLANE1 in CSI RX */
+       CSI_RX_DLANE2_ID,               /* map to DLANE2 in CSI RX */
+       CSI_RX_DLANE3_ID,               /* map to DLANE3 in CSI RX */
+       N_CSI_RX_DLANE_ID
+} csi_rx_fe_dlane_ID_t;
+/* end of CSI-MIPI receiver */
+
+typedef enum {
+       ISYS2401_DMA0_ID = 0,
+       N_ISYS2401_DMA_ID
+} isys2401_dma_ID_t;
+
+/**
+ * Pixel-generator. ("system_global.h")
+ */
+typedef enum {
+       PIXELGEN0_ID = 0,
+       PIXELGEN1_ID,
+       PIXELGEN2_ID,
+       N_PIXELGEN_ID
+} pixelgen_ID_t;
+/* end of pixel-generator. ("system_global.h") */
+
+typedef enum {
+       INPUT_SYSTEM_CSI_PORT0_ID = 0,
+       INPUT_SYSTEM_CSI_PORT1_ID,
+       INPUT_SYSTEM_CSI_PORT2_ID,
+
+       INPUT_SYSTEM_PIXELGEN_PORT0_ID,
+       INPUT_SYSTEM_PIXELGEN_PORT1_ID,
+       INPUT_SYSTEM_PIXELGEN_PORT2_ID,
+
+       N_INPUT_SYSTEM_INPUT_PORT_ID
+} input_system_input_port_ID_t;
+
+#define N_INPUT_SYSTEM_CSI_PORT        3
+
+typedef enum {
+       ISYS2401_DMA_CHANNEL_0 = 0,
+       ISYS2401_DMA_CHANNEL_1,
+       ISYS2401_DMA_CHANNEL_2,
+       ISYS2401_DMA_CHANNEL_3,
+       ISYS2401_DMA_CHANNEL_4,
+       ISYS2401_DMA_CHANNEL_5,
+       ISYS2401_DMA_CHANNEL_6,
+       ISYS2401_DMA_CHANNEL_7,
+       ISYS2401_DMA_CHANNEL_8,
+       ISYS2401_DMA_CHANNEL_9,
+       ISYS2401_DMA_CHANNEL_10,
+       ISYS2401_DMA_CHANNEL_11,
+       N_ISYS2401_DMA_CHANNEL
+} isys2401_dma_channel;
+
+enum ia_css_isp_memories {
+       IA_CSS_ISP_PMEM0 = 0,
+       IA_CSS_ISP_DMEM0,
+       IA_CSS_ISP_VMEM0,
+       IA_CSS_ISP_VAMEM0,
+       IA_CSS_ISP_VAMEM1,
+       IA_CSS_ISP_VAMEM2,
+       IA_CSS_ISP_HMEM0,
+       IA_CSS_SP_DMEM0,
+       IA_CSS_DDR,
+       N_IA_CSS_MEMORIES
+};
+
+#define IA_CSS_NUM_MEMORIES 9
+/* For driver compatibility */
+#define N_IA_CSS_ISP_MEMORIES   IA_CSS_NUM_MEMORIES
+#define IA_CSS_NUM_ISP_MEMORIES IA_CSS_NUM_MEMORIES
+
+#endif /* __SYSTEM_GLOBAL_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2401_system_local.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp2401_system_local.h
new file mode 100644 (file)
index 0000000..4bd95b8
--- /dev/null
@@ -0,0 +1,406 @@
+/*
+ * Support for Intel Camera Imaging ISP subsystem.
+ * Copyright (c) 2015, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef __SYSTEM_LOCAL_H_INCLUDED__
+#define __SYSTEM_LOCAL_H_INCLUDED__
+
+#ifdef HRT_ISP_CSS_CUSTOM_HOST
+#ifndef HRT_USE_VIR_ADDRS
+#define HRT_USE_VIR_ADDRS
+#endif
+/* This interface is deprecated */
+/*#include "hive_isp_css_custom_host_hrt.h"*/
+#endif
+
+#include "system_global.h"
+
+#define HRT_ADDRESS_WIDTH      64              /* Surprise, this is a local property */
+
+/* This interface is deprecated */
+#include "hive_types.h"
+
+/*
+ * Cell specific address maps
+ */
+#if HRT_ADDRESS_WIDTH == 64
+
+#define GP_FIFO_BASE   ((hrt_address)0x0000000000090104)               /* This is NOT a base address */
+
+/* DDR */
+static const hrt_address DDR_BASE[N_DDR_ID] = {
+       0x0000000120000000ULL
+};
+
+/* ISP */
+static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
+       0x0000000000020000ULL
+};
+
+static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
+       0x0000000000200000ULL
+};
+
+static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
+       0x0000000000100000ULL
+};
+
+static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
+       0x00000000001C0000ULL,
+       0x00000000001D0000ULL,
+       0x00000000001E0000ULL
+};
+
+static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
+       0x00000000001F0000ULL
+};
+
+/* SP */
+static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
+       0x0000000000010000ULL
+};
+
+static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
+       0x0000000000300000ULL
+};
+
+/* MMU */
+#if defined(IS_ISP_2400_MAMOIADA_SYSTEM) || defined(IS_ISP_2401_MAMOIADA_SYSTEM)
+/*
+ * MMU0_ID: The data MMU
+ * MMU1_ID: The icache MMU
+ */
+static const hrt_address MMU_BASE[N_MMU_ID] = {
+       0x0000000000070000ULL,
+       0x00000000000A0000ULL
+};
+#else
+#error "system_local.h: SYSTEM must be one of {2400, 2401 }"
+#endif
+
+/* DMA */
+static const hrt_address DMA_BASE[N_DMA_ID] = {
+       0x0000000000040000ULL
+};
+
+static const hrt_address ISYS2401_DMA_BASE[N_ISYS2401_DMA_ID] = {
+       0x00000000000CA000ULL
+};
+
+/* IRQ */
+static const hrt_address IRQ_BASE[N_IRQ_ID] = {
+       0x0000000000000500ULL,
+       0x0000000000030A00ULL,
+       0x000000000008C000ULL,
+       0x0000000000090200ULL
+};
+/*
+       0x0000000000000500ULL};
+ */
+
+/* GDC */
+static const hrt_address GDC_BASE[N_GDC_ID] = {
+       0x0000000000050000ULL,
+       0x0000000000060000ULL
+};
+
+/* FIFO_MONITOR (not a subset of GP_DEVICE) */
+static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
+       0x0000000000000000ULL
+};
+
+/*
+static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
+       0x0000000000000000ULL};
+
+static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
+       0x0000000000090000ULL};
+*/
+
+/* GP_DEVICE (single base for all separate GP_REG instances) */
+static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
+       0x0000000000000000ULL
+};
+
+/*GP TIMER , all timer registers are inter-twined,
+ * so, having multiple base addresses for
+ * different timers does not help*/
+static const hrt_address GP_TIMER_BASE =
+    (hrt_address)0x0000000000000600ULL;
+
+/* GPIO */
+static const hrt_address GPIO_BASE[N_GPIO_ID] = {
+       0x0000000000000400ULL
+};
+
+/* TIMED_CTRL */
+static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
+       0x0000000000000100ULL
+};
+
+/* INPUT_FORMATTER */
+static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
+       0x0000000000030000ULL,
+       0x0000000000030200ULL,
+       0x0000000000030400ULL,
+       0x0000000000030600ULL
+}; /* memcpy() */
+
+/* INPUT_SYSTEM */
+static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
+       0x0000000000080000ULL
+};
+/*     0x0000000000081000ULL, */ /* capture A */
+/*     0x0000000000082000ULL, */ /* capture B */
+/*     0x0000000000083000ULL, */ /* capture C */
+/*     0x0000000000084000ULL, */ /* Acquisition */
+/*     0x0000000000085000ULL, */ /* DMA */
+/*     0x0000000000089000ULL, */ /* ctrl */
+/*     0x000000000008A000ULL, */ /* GP regs */
+/*     0x000000000008B000ULL, */ /* FIFO */
+/*     0x000000000008C000ULL, */ /* IRQ */
+
+/* RX, the MIPI lane control regs start at offset 0 */
+static const hrt_address RX_BASE[N_RX_ID] = {
+       0x0000000000080100ULL
+};
+
+/* IBUF_CTRL, part of the Input System 2401 */
+static const hrt_address IBUF_CTRL_BASE[N_IBUF_CTRL_ID] = {
+       0x00000000000C1800ULL,  /* ibuf controller A */
+       0x00000000000C3800ULL,  /* ibuf controller B */
+       0x00000000000C5800ULL   /* ibuf controller C */
+};
+
+/* ISYS IRQ Controllers, part of the Input System 2401 */
+static const hrt_address ISYS_IRQ_BASE[N_ISYS_IRQ_ID] = {
+       0x00000000000C1400ULL,  /* port a */
+       0x00000000000C3400ULL,  /* port b */
+       0x00000000000C5400ULL   /* port c */
+};
+
+/* CSI FE, part of the Input System 2401 */
+static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_FRONTEND_ID] = {
+       0x00000000000C0400ULL,  /* csi fe controller A */
+       0x00000000000C2400ULL,  /* csi fe controller B */
+       0x00000000000C4400ULL   /* csi fe controller C */
+};
+
+/* CSI BE, part of the Input System 2401 */
+static const hrt_address CSI_RX_BE_CTRL_BASE[N_CSI_RX_BACKEND_ID] = {
+       0x00000000000C0800ULL,  /* csi be controller A */
+       0x00000000000C2800ULL,  /* csi be controller B */
+       0x00000000000C4800ULL   /* csi be controller C */
+};
+
+/* PIXEL Generator, part of the Input System 2401 */
+static const hrt_address PIXELGEN_CTRL_BASE[N_PIXELGEN_ID] = {
+       0x00000000000C1000ULL,  /* pixel gen controller A */
+       0x00000000000C3000ULL,  /* pixel gen controller B */
+       0x00000000000C5000ULL   /* pixel gen controller C */
+};
+
+/* Stream2MMIO, part of the Input System 2401 */
+static const hrt_address STREAM2MMIO_CTRL_BASE[N_STREAM2MMIO_ID] = {
+       0x00000000000C0C00ULL,  /* stream2mmio controller A */
+       0x00000000000C2C00ULL,  /* stream2mmio controller B */
+       0x00000000000C4C00ULL   /* stream2mmio controller C */
+};
+#elif HRT_ADDRESS_WIDTH == 32
+
+#define GP_FIFO_BASE   ((hrt_address)0x00090104)               /* This is NOT a base address */
+
+/* DDR : Attention, this value not defined in 32-bit */
+static const hrt_address DDR_BASE[N_DDR_ID] = {
+       0x00000000UL
+};
+
+/* ISP */
+static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
+       0x00020000UL
+};
+
+static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
+       0xffffffffUL
+};
+
+static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
+       0xffffffffUL
+};
+
+static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
+       0xffffffffUL,
+       0xffffffffUL,
+       0xffffffffUL
+};
+
+static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
+       0xffffffffUL
+};
+
+/* SP */
+static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
+       0x00010000UL
+};
+
+static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
+       0x00300000UL
+};
+
+/* MMU */
+#if defined(IS_ISP_2400_MAMOIADA_SYSTEM) || defined(IS_ISP_2401_MAMOIADA_SYSTEM)
+/*
+ * MMU0_ID: The data MMU
+ * MMU1_ID: The icache MMU
+ */
+static const hrt_address MMU_BASE[N_MMU_ID] = {
+       0x00070000UL,
+       0x000A0000UL
+};
+#else
+#error "system_local.h: SYSTEM must be one of {2400, 2401 }"
+#endif
+
+/* DMA */
+static const hrt_address DMA_BASE[N_DMA_ID] = {
+       0x00040000UL
+};
+
+static const hrt_address ISYS2401_DMA_BASE[N_ISYS2401_DMA_ID] = {
+       0x000CA000UL
+};
+
+/* IRQ */
+static const hrt_address IRQ_BASE[N_IRQ_ID] = {
+       0x00000500UL,
+       0x00030A00UL,
+       0x0008C000UL,
+       0x00090200UL
+};
+/*
+       0x00000500UL};
+ */
+
+/* GDC */
+static const hrt_address GDC_BASE[N_GDC_ID] = {
+       0x00050000UL,
+       0x00060000UL
+};
+
+/* FIFO_MONITOR (not a subset of GP_DEVICE) */
+static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
+       0x00000000UL
+};
+
+/*
+static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
+       0x00000000UL};
+
+static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
+       0x00090000UL};
+*/
+
+/* GP_DEVICE (single base for all separate GP_REG instances) */
+static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
+       0x00000000UL
+};
+
+/*GP TIMER , all timer registers are inter-twined,
+ * so, having multiple base addresses for
+ * different timers does not help*/
+static const hrt_address GP_TIMER_BASE =
+    (hrt_address)0x00000600UL;
+/* GPIO */
+static const hrt_address GPIO_BASE[N_GPIO_ID] = {
+       0x00000400UL
+};
+
+/* TIMED_CTRL */
+static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
+       0x00000100UL
+};
+
+/* INPUT_FORMATTER */
+static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
+       0x00030000UL,
+       0x00030200UL,
+       0x00030400UL
+};
+/*     0x00030600UL, */ /* memcpy() */
+
+/* INPUT_SYSTEM */
+static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
+       0x00080000UL
+};
+/*     0x00081000UL, */ /* capture A */
+/*     0x00082000UL, */ /* capture B */
+/*     0x00083000UL, */ /* capture C */
+/*     0x00084000UL, */ /* Acquisition */
+/*     0x00085000UL, */ /* DMA */
+/*     0x00089000UL, */ /* ctrl */
+/*     0x0008A000UL, */ /* GP regs */
+/*     0x0008B000UL, */ /* FIFO */
+/*     0x0008C000UL, */ /* IRQ */
+
+/* RX, the MIPI lane control regs start at offset 0 */
+static const hrt_address RX_BASE[N_RX_ID] = {
+       0x00080100UL
+};
+
+/* IBUF_CTRL, part of the Input System 2401 */
+static const hrt_address IBUF_CTRL_BASE[N_IBUF_CTRL_ID] = {
+       0x000C1800UL,   /* ibuf controller A */
+       0x000C3800UL,   /* ibuf controller B */
+       0x000C5800UL    /* ibuf controller C */
+};
+
+/* ISYS IRQ Controllers, part of the Input System 2401 */
+static const hrt_address ISYS_IRQ_BASE[N_ISYS_IRQ_ID] = {
+       0x000C1400ULL,  /* port a */
+       0x000C3400ULL,  /* port b */
+       0x000C5400ULL   /* port c */
+};
+
+/* CSI FE, part of the Input System 2401 */
+static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_FRONTEND_ID] = {
+       0x000C0400UL,   /* csi fe controller A */
+       0x000C2400UL,   /* csi fe controller B */
+       0x000C4400UL    /* csi fe controller C */
+};
+
+/* CSI BE, part of the Input System 2401 */
+static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_BACKEND_ID] = {
+       0x000C0800UL,   /* csi be controller A */
+       0x000C2800UL,   /* csi be controller B */
+       0x000C4800UL    /* csi be controller C */
+};
+
+/* PIXEL Generator, part of the Input System 2401 */
+static const hrt_address PIXELGEN_CTRL_BASE[N_PIXELGEN_ID] = {
+       0x000C1000UL,   /* pixel gen controller A */
+       0x000C3000UL,   /* pixel gen controller B */
+       0x000C5000UL    /* pixel gen controller C */
+};
+
+/* Stream2MMIO, part of the Input System 2401 */
+static const hrt_address STREAM2MMIO_CTRL_BASE[N_STREAM2MMIO_ID] = {
+       0x000C0C00UL,   /* stream2mmio controller A */
+       0x000C2C00UL,   /* stream2mmio controller B */
+       0x000C4C00UL    /* stream2mmio controller C */
+};
+
+#else
+#error "system_local.h: HRT_ADDRESS_WIDTH must be one of {32,64}"
+#endif
+
+#endif /* __SYSTEM_LOCAL_H_INCLUDED__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/system_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/system_global.h
new file mode 100644 (file)
index 0000000..7f833c1
--- /dev/null
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ *    (c) 2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+ */
+
+#ifdef ISP2401
+#  include "isp2401_system_global.h"
+#else
+#  include "isp2400_system_global.h"
+#endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/system_local.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/system_local.h
new file mode 100644 (file)
index 0000000..fbb5daa
--- /dev/null
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ *    (c) 2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+ */
+
+#ifdef ISP2401
+#  include "isp2401_system_local.h"
+#else
+#  include "isp2400_system_local.h"
+#endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/isp2400_input_system_global.h b/drivers/staging/media/atomisp/pci/atomisp2/isp2400_input_system_global.h
new file mode 100644 (file)
index 0000000..759141c
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+ * Support for Intel Camera Imaging ISP subsystem.
+ * Copyright (c) 2015, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef __INPUT_SYSTEM_GLOBAL_H_INCLUDED__
+#define __INPUT_SYSTEM_GLOBAL_H_INCLUDED__
+
+#define IS_INPUT_SYSTEM_VERSION_2
+
+#include <type_support.h>
+
+//CSI reveiver has 3 ports.
+#define                N_CSI_PORTS (3)
+//AM: Use previous define for this.
+
+//MIPI allows upto 4 channels.
+#define                N_CHANNELS  (4)
+// 12KB = 256bit x 384 words
+#define                IB_CAPACITY_IN_WORDS (384)
+
+typedef enum {
+       MIPI_0LANE_CFG = 0,
+       MIPI_1LANE_CFG = 1,
+       MIPI_2LANE_CFG = 2,
+       MIPI_3LANE_CFG = 3,
+       MIPI_4LANE_CFG = 4
+} mipi_lane_cfg_t;
+
+typedef enum {
+       INPUT_SYSTEM_SOURCE_SENSOR = 0,
+       INPUT_SYSTEM_SOURCE_FIFO,
+       INPUT_SYSTEM_SOURCE_TPG,
+       INPUT_SYSTEM_SOURCE_PRBS,
+       INPUT_SYSTEM_SOURCE_MEMORY,
+       N_INPUT_SYSTEM_SOURCE
+} input_system_source_t;
+
+/* internal routing configuration */
+typedef enum {
+       INPUT_SYSTEM_DISCARD_ALL = 0,
+       INPUT_SYSTEM_CSI_BACKEND = 1,
+       INPUT_SYSTEM_INPUT_BUFFER = 2,
+       INPUT_SYSTEM_MULTICAST = 3,
+       N_INPUT_SYSTEM_CONNECTION
+} input_system_connection_t;
+
+typedef enum {
+       INPUT_SYSTEM_MIPI_PORT0,
+       INPUT_SYSTEM_MIPI_PORT1,
+       INPUT_SYSTEM_MIPI_PORT2,
+       INPUT_SYSTEM_ACQUISITION_UNIT,
+       N_INPUT_SYSTEM_MULTIPLEX
+} input_system_multiplex_t;
+
+typedef enum {
+       INPUT_SYSTEM_SINK_MEMORY = 0,
+       INPUT_SYSTEM_SINK_ISP,
+       INPUT_SYSTEM_SINK_SP,
+       N_INPUT_SYSTEM_SINK
+} input_system_sink_t;
+
+typedef enum {
+       INPUT_SYSTEM_FIFO_CAPTURE = 0,
+       INPUT_SYSTEM_FIFO_CAPTURE_WITH_COUNTING,
+       INPUT_SYSTEM_SRAM_BUFFERING,
+       INPUT_SYSTEM_XMEM_BUFFERING,
+       INPUT_SYSTEM_XMEM_CAPTURE,
+       INPUT_SYSTEM_XMEM_ACQUIRE,
+       N_INPUT_SYSTEM_BUFFERING_MODE
+} buffering_mode_t;
+
+typedef struct input_system_cfg_s      input_system_cfg_t;
+typedef struct sync_generator_cfg_s    sync_generator_cfg_t;
+typedef struct tpg_cfg_s                       tpg_cfg_t;
+typedef struct prbs_cfg_s                      prbs_cfg_t;
+
+/* MW: uint16_t should be sufficient */
+struct input_system_cfg_s {
+       u32     no_side_band;
+       u32     fmt_type;
+       u32     ch_id;
+       u32     input_mode;
+};
+
+struct sync_generator_cfg_s {
+       u32     width;
+       u32     height;
+       u32     hblank_cycles;
+       u32     vblank_cycles;
+};
+
+/* MW: tpg & prbs are exclusive */
+struct tpg_cfg_s {
+       u32     x_mask;
+       u32     y_mask;
+       u32     x_delta;
+       u32     y_delta;
+       u32     xy_mask;
+       sync_generator_cfg_t sync_gen_cfg;
+};
+
+struct prbs_cfg_s {
+       u32     seed;
+       sync_generator_cfg_t sync_gen_cfg;
+};
+
+struct gpfifo_cfg_s {
+// TBD.
+       sync_generator_cfg_t sync_gen_cfg;
+};
+
+typedef struct gpfifo_cfg_s            gpfifo_cfg_t;
+
+//ALX:Commented out to pass the compilation.
+//typedef struct input_system_cfg_s input_system_cfg_t;
+
+struct ib_buffer_s {
+       u32     mem_reg_size;
+       u32     nof_mem_regs;
+       u32     mem_reg_addr;
+};
+
+typedef struct ib_buffer_s     ib_buffer_t;
+
+struct csi_cfg_s {
+       u32                     csi_port;
+       buffering_mode_t        buffering_mode;
+       ib_buffer_t                     csi_buffer;
+       ib_buffer_t                     acquisition_buffer;
+       u32                     nof_xmem_buffers;
+};
+
+typedef struct csi_cfg_s        csi_cfg_t;
+
+typedef enum {
+       INPUT_SYSTEM_CFG_FLAG_RESET     = 0,
+       INPUT_SYSTEM_CFG_FLAG_SET               = 1U << 0,
+       INPUT_SYSTEM_CFG_FLAG_BLOCKED   = 1U << 1,
+       INPUT_SYSTEM_CFG_FLAG_REQUIRED  = 1U << 2,
+       INPUT_SYSTEM_CFG_FLAG_CONFLICT  = 1U << 3       // To mark a conflicting configuration.
+} input_system_cfg_flag_t;
+
+typedef u32 input_system_config_flags_t;
+
+#endif /* __INPUT_SYSTEM_GLOBAL_H_INCLUDED__ */