2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2015, Intel Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 #ifndef __SYSTEM_GLOBAL_H_INCLUDED__
16 #define __SYSTEM_GLOBAL_H_INCLUDED__
18 #include <hive_isp_css_defs.h>
19 #include <type_support.h>
22 * The longest allowed (uninteruptible) bus transfer, does not
23 * take stalling into account
25 #define HIVE_ISP_MAX_BURST_LENGTH 1024
28 * Maximum allowed burst length in words for the ISP DMA
30 #define ISP_DMA_MAX_BURST_LENGTH 128
33 * Create a list of HAS and IS properties that defines the system
35 * The configuration assumes the following
36 * - The system is hetereogeneous; Multiple cells and devices classes
37 * - The cell and device instances are homogeneous, each device type
38 * belongs to the same class
39 * - Device instances supporting a subset of the class capabilities are
42 * We could manage different device classes through the enumerated
43 * lists (C) or the use of classes (C++), but that is presently not
46 * N.B. the 3 input formatters are of 2 different classess
49 #define IS_ISP_2400_SYSTEM
51 * Since this file is visible everywhere and the system definition
52 * macros are not, detect the separate definitions for {host, SP, ISP}
54 * The 2401 system has the nice property that it uses a vanilla 2400 SP
55 * so the SP will believe it is a 2400 system rather than 2401...
57 //#if defined(SYSTEM_hive_isp_css_2401_system) || defined(__isp2401_mamoiada) || defined(__scalar_processor_2401)
58 #if defined(SYSTEM_hive_isp_css_2401_system) || defined(__isp2401_mamoiada)
59 #define IS_ISP_2401_MAMOIADA_SYSTEM
60 #define HAS_ISP_2401_MAMOIADA
62 //#elif defined(SYSTEM_hive_isp_css_2400_system) || defined(__isp2400_mamoiada) || defined(__scalar_processor_2400)
63 #elif defined(SYSTEM_hive_isp_css_2400_system) || defined(__isp2400_mamoiada)
64 #define IS_ISP_2400_MAMOIADA_SYSTEM
65 #define HAS_ISP_2400_MAMOIADA
68 #error "system_global.h: 2400_SYSTEM must be one of {2400, 2401 }"
71 #define USE_INPUT_SYSTEM_VERSION_2
73 #define HAS_MMU_VERSION_2
74 #define HAS_DMA_VERSION_2
75 #define HAS_GDC_VERSION_2
76 #define HAS_VAMEM_VERSION_2
77 #define HAS_HMEM_VERSION_1
78 #define HAS_BAMEM_VERSION_2
79 #define HAS_IRQ_VERSION_2
80 #define HAS_IRQ_MAP_VERSION_2
81 #define HAS_INPUT_FORMATTER_VERSION_2
82 /* 2401: HAS_INPUT_SYSTEM_VERSION_2401 */
83 #define HAS_INPUT_SYSTEM_VERSION_2
84 #define HAS_BUFFERED_SENSOR
85 #define HAS_FIFO_MONITORS_VERSION_2
86 /* #define HAS_GP_REGS_VERSION_2 */
87 #define HAS_GP_DEVICE_VERSION_2
88 #define HAS_GPIO_VERSION_1
89 #define HAS_TIMED_CTRL_VERSION_1
90 #define HAS_RX_VERSION_2
92 #define DMA_DDR_TO_VAMEM_WORKAROUND
93 #define DMA_DDR_TO_HMEM_WORKAROUND
96 * Semi global. "HRT" is accessible from SP, but the HRT types do not fully apply
98 #define HRT_VADDRESS_WIDTH 32
99 //#define HRT_ADDRESS_WIDTH 64 /* Surprise, this is a local property*/
100 #define HRT_DATA_WIDTH 32
102 #define SIZEOF_HRT_REG (HRT_DATA_WIDTH>>3)
103 #define HIVE_ISP_CTRL_DATA_BYTES (HIVE_ISP_CTRL_DATA_WIDTH/8)
105 /* The main bus connecting all devices */
106 #define HRT_BUS_WIDTH HIVE_ISP_CTRL_DATA_WIDTH
107 #define HRT_BUS_BYTES HIVE_ISP_CTRL_DATA_BYTES
109 /* per-frame parameter handling support */
110 #define SH_CSS_ENABLE_PER_FRAME_PARAMS
112 typedef uint32_t hrt_bus_align_t;
115 * Enumerate the devices, device access through the API is by ID, through the DLI by address
116 * The enumerator terminators are used to size the wiring arrays and as an exception value.
133 #if defined (IS_ISP_2401_MAMOIADA_SYSTEM)
139 #elif defined (IS_ISP_2400_MAMOIADA_SYSTEM)
146 #error "system_global.h: SYSTEM must be one of {2400, 2401}"
160 #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.
187 IRQ0_ID = 0, // GP IRQ block
188 IRQ1_ID, // Input formatter
189 IRQ2_ID, // input system
190 IRQ3_ID, // input selector
195 FIFO_MONITOR0_ID = 0,
200 * Deprecated: Since all gp_reg instances are different
201 * and put in the address maps of other devices we cannot
202 * enumerate them as that assumes the instrances are the
205 * We define a single GP_DEVICE containing all gp_regs
206 * w.r.t. a single base address
241 INPUT_FORMATTER0_ID = 0,
246 } input_formatter_ID_t;
248 /* The IF RST is outside the IF */
249 #define INPUT_FORMATTER0_SRST_OFFSET 0x0824
250 #define INPUT_FORMATTER1_SRST_OFFSET 0x0624
251 #define INPUT_FORMATTER2_SRST_OFFSET 0x0424
252 #define INPUT_FORMATTER3_SRST_OFFSET 0x0224
254 #define INPUT_FORMATTER0_SRST_MASK 0x0001
255 #define INPUT_FORMATTER1_SRST_MASK 0x0002
256 #define INPUT_FORMATTER2_SRST_MASK 0x0004
257 #define INPUT_FORMATTER3_SRST_MASK 0x0008
260 INPUT_SYSTEM0_ID = 0,
276 #define N_RX_CHANNEL_ID 4
278 /* Generic port enumeration with an internal port type ID */
291 CAPTURE_UNIT0_ID = 0,
294 ACQUISITION_UNIT0_ID,
303 #define N_CAPTURE_UNIT_ID 3
304 #define N_ACQUISITION_UNIT_ID 1
305 #define N_CTRL_UNIT_ID 1
307 enum ia_css_isp_memories {
308 IA_CSS_ISP_PMEM0 = 0,
319 #define IA_CSS_NUM_MEMORIES 9
320 /* For driver compatability */
321 #define N_IA_CSS_ISP_MEMORIES IA_CSS_NUM_MEMORIES
322 #define IA_CSS_NUM_ISP_MEMORIES IA_CSS_NUM_MEMORIES
326 dev_chn, /* device channels, external resource */
327 ext_mem, /* external memories */
328 int_mem, /* internal memories */
329 int_chn /* internal channels, user defined */
332 /* if this enum is extended with other memory resources, pls also extend the function resource_to_memptr() */
334 vied_nci_dev_chn_dma_ext0,
339 /* enum listing the different memories within a program group.
340 This enum is used in the mem_ptr_t type */
348 #endif /* __SYSTEM_GLOBAL_H_INCLUDED__ */