3 * Support for Intel Camera Imaging ISP subsystem.
4 * Copyright (c) 2015, Intel Corporation.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 Support for Intel Camera Imaging ISP subsystem.
18 Copyright (c) 2010 - 2015, Intel Corporation.
20 This program is free software; you can redistribute it and/or modify it
21 under the terms and conditions of the GNU General Public License,
22 version 2, as published by the Free Software Foundation.
24 This program is distributed in the hope it will be useful, but WITHOUT
25 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
26 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
31 #include "input_system.h"
33 #ifdef HAS_INPUT_SYSTEM_VERSION_2
34 #include "ia_css_isys.h"
35 #include "platform_support.h"
37 #ifdef USE_INPUT_SYSTEM_VERSION_2401
38 #include "isys_dma.h" /* isys2401_dma_set_max_burst_size() */
42 #if defined(USE_INPUT_SYSTEM_VERSION_2)
43 input_system_error_t ia_css_isys_init(void)
45 backend_channel_cfg_t backend_ch0;
46 backend_channel_cfg_t backend_ch1;
47 target_cfg2400_t targetB;
48 target_cfg2400_t targetC;
49 uint32_t acq_mem_region_size = 24;
50 uint32_t acq_nof_mem_regions = 2;
51 input_system_error_t error = INPUT_SYSTEM_ERR_NO_ERROR;
53 memset(&backend_ch0, 0, sizeof(backend_channel_cfg_t));
54 memset(&backend_ch1, 0, sizeof(backend_channel_cfg_t));
55 memset(&targetB, 0, sizeof(targetB));
56 memset(&targetC, 0, sizeof(targetC));
58 error = input_system_configuration_reset();
59 if (error != INPUT_SYSTEM_ERR_NO_ERROR)
62 error = input_system_csi_xmem_channel_cfg(
64 INPUT_SYSTEM_PORT_A, /*port */
65 backend_ch0, /*backend_ch */
66 32, /*mem_region_size */
67 6, /*nof_mem_regions */
68 acq_mem_region_size, /*acq_mem_region_size */
69 acq_nof_mem_regions, /*acq_nof_mem_regions */
71 3); /*nof_xmem_buffers */
72 if (error != INPUT_SYSTEM_ERR_NO_ERROR)
75 error = input_system_csi_xmem_channel_cfg(
77 INPUT_SYSTEM_PORT_B, /*port */
78 backend_ch0, /*backend_ch */
79 16, /*mem_region_size */
80 3, /*nof_mem_regions */
81 acq_mem_region_size, /*acq_mem_region_size */
82 acq_nof_mem_regions, /*acq_nof_mem_regions */
84 3); /*nof_xmem_buffers */
85 if (error != INPUT_SYSTEM_ERR_NO_ERROR)
88 error = input_system_csi_xmem_channel_cfg(
90 INPUT_SYSTEM_PORT_C, /*port */
91 backend_ch1, /*backend_ch */
92 32, /*mem_region_size */
93 3, /*nof_mem_regions */
94 acq_mem_region_size, /*acq_mem_region_size */
95 acq_nof_mem_regions, /*acq_nof_mem_regions */
97 2); /*nof_xmem_buffers */
98 if (error != INPUT_SYSTEM_ERR_NO_ERROR)
101 error = input_system_configuration_commit();
105 #elif defined(USE_INPUT_SYSTEM_VERSION_2401)
106 input_system_error_t ia_css_isys_init(void)
108 input_system_error_t error = INPUT_SYSTEM_ERR_NO_ERROR;
110 ia_css_isys_csi_rx_lut_rmgr_init();
111 ia_css_isys_ibuf_rmgr_init();
112 ia_css_isys_dma_channel_rmgr_init();
113 ia_css_isys_stream2mmio_sid_rmgr_init();
115 isys2401_dma_set_max_burst_size(ISYS2401_DMA0_ID,
116 1 /* Non Burst DMA transactions */);
118 /* Enable 2401 input system IRQ status for driver to retrieve */
119 isys_irqc_status_enable(ISYS_IRQ0_ID);
120 isys_irqc_status_enable(ISYS_IRQ1_ID);
121 isys_irqc_status_enable(ISYS_IRQ2_ID);
127 #if defined(USE_INPUT_SYSTEM_VERSION_2)
128 void ia_css_isys_uninit(void)
131 #elif defined(USE_INPUT_SYSTEM_VERSION_2401)
132 void ia_css_isys_uninit(void)
134 ia_css_isys_csi_rx_lut_rmgr_uninit();
135 ia_css_isys_ibuf_rmgr_uninit();
136 ia_css_isys_dma_channel_rmgr_uninit();
137 ia_css_isys_stream2mmio_sid_rmgr_uninit();