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_LOCAL_H_INCLUDED__
16 #define __SYSTEM_LOCAL_H_INCLUDED__
18 #ifdef HRT_ISP_CSS_CUSTOM_HOST
19 #ifndef HRT_USE_VIR_ADDRS
20 #define HRT_USE_VIR_ADDRS
22 /* This interface is deprecated */
23 /*#include "hive_isp_css_custom_host_hrt.h"*/
26 #include "system_global.h"
29 #define HRT_ADDRESS_WIDTH 32 /* Surprise, this is a local property and even differs per platform */
31 #define HRT_ADDRESS_WIDTH 64 /* Surprise, this is a local property */
34 #if !defined(__KERNEL__) || (1 == 1)
35 /* This interface is deprecated */
36 #include "hrt/hive_types.h"
37 #else /* __KERNEL__ */
38 #include <type_support.h>
40 #if HRT_ADDRESS_WIDTH == 64
41 typedef uint64_t hrt_address;
42 #elif HRT_ADDRESS_WIDTH == 32
43 typedef uint32_t hrt_address;
45 #error "system_local.h: HRT_ADDRESS_WIDTH must be one of {32,64}"
48 typedef uint32_t hrt_vaddress;
49 typedef uint32_t hrt_data;
50 #endif /* __KERNEL__ */
53 * Cell specific address maps
55 #if HRT_ADDRESS_WIDTH == 64
57 #define GP_FIFO_BASE ((hrt_address)0x0000000000090104) /* This is NOT a base address */
60 static const hrt_address DDR_BASE[N_DDR_ID] = {
61 0x0000000120000000ULL};
64 static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
65 0x0000000000020000ULL};
67 static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
68 0x0000000000200000ULL};
70 static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
71 0x0000000000100000ULL};
73 static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
74 0x00000000001C0000ULL,
75 0x00000000001D0000ULL,
76 0x00000000001E0000ULL};
78 static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
79 0x00000000001F0000ULL};
82 static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
83 0x0000000000010000ULL};
85 static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
86 0x0000000000300000ULL};
89 #if defined(IS_ISP_2400_MAMOIADA_SYSTEM) || defined(IS_ISP_2401_MAMOIADA_SYSTEM)
91 * MMU0_ID: The data MMU
92 * MMU1_ID: The icache MMU
94 static const hrt_address MMU_BASE[N_MMU_ID] = {
95 0x0000000000070000ULL,
96 0x00000000000A0000ULL};
98 #error "system_local.h: SYSTEM must be one of {2400, 2401 }"
102 static const hrt_address DMA_BASE[N_DMA_ID] = {
103 0x0000000000040000ULL};
105 static const hrt_address ISYS2401_DMA_BASE[N_ISYS2401_DMA_ID] = {
106 0x00000000000CA000ULL};
109 static const hrt_address IRQ_BASE[N_IRQ_ID] = {
110 0x0000000000000500ULL,
111 0x0000000000030A00ULL,
112 0x000000000008C000ULL,
113 0x0000000000090200ULL};
115 0x0000000000000500ULL};
119 static const hrt_address GDC_BASE[N_GDC_ID] = {
120 0x0000000000050000ULL,
121 0x0000000000060000ULL};
123 /* FIFO_MONITOR (not a subset of GP_DEVICE) */
124 static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
125 0x0000000000000000ULL};
128 static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
129 0x0000000000000000ULL};
131 static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
132 0x0000000000090000ULL};
135 /* GP_DEVICE (single base for all separate GP_REG instances) */
136 static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
137 0x0000000000000000ULL};
139 /*GP TIMER , all timer registers are inter-twined,
140 * so, having multiple base addresses for
141 * different timers does not help*/
142 static const hrt_address GP_TIMER_BASE =
143 (hrt_address)0x0000000000000600ULL;
146 static const hrt_address GPIO_BASE[N_GPIO_ID] = {
147 0x0000000000000400ULL};
150 static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
151 0x0000000000000100ULL};
154 /* INPUT_FORMATTER */
155 static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
156 0x0000000000030000ULL,
157 0x0000000000030200ULL,
158 0x0000000000030400ULL,
159 0x0000000000030600ULL}; /* memcpy() */
162 static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
163 0x0000000000080000ULL};
164 /* 0x0000000000081000ULL, */ /* capture A */
165 /* 0x0000000000082000ULL, */ /* capture B */
166 /* 0x0000000000083000ULL, */ /* capture C */
167 /* 0x0000000000084000ULL, */ /* Acquisition */
168 /* 0x0000000000085000ULL, */ /* DMA */
169 /* 0x0000000000089000ULL, */ /* ctrl */
170 /* 0x000000000008A000ULL, */ /* GP regs */
171 /* 0x000000000008B000ULL, */ /* FIFO */
172 /* 0x000000000008C000ULL, */ /* IRQ */
174 /* RX, the MIPI lane control regs start at offset 0 */
175 static const hrt_address RX_BASE[N_RX_ID] = {
176 0x0000000000080100ULL};
178 /* IBUF_CTRL, part of the Input System 2401 */
179 static const hrt_address IBUF_CTRL_BASE[N_IBUF_CTRL_ID] = {
180 0x00000000000C1800ULL, /* ibuf controller A */
181 0x00000000000C3800ULL, /* ibuf controller B */
182 0x00000000000C5800ULL /* ibuf controller C */
185 /* ISYS IRQ Controllers, part of the Input System 2401 */
186 static const hrt_address ISYS_IRQ_BASE[N_ISYS_IRQ_ID] = {
187 0x00000000000C1400ULL, /* port a */
188 0x00000000000C3400ULL, /* port b */
189 0x00000000000C5400ULL /* port c */
192 /* CSI FE, part of the Input System 2401 */
193 static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_FRONTEND_ID] = {
194 0x00000000000C0400ULL, /* csi fe controller A */
195 0x00000000000C2400ULL, /* csi fe controller B */
196 0x00000000000C4400ULL /* csi fe controller C */
198 /* CSI BE, part of the Input System 2401 */
199 static const hrt_address CSI_RX_BE_CTRL_BASE[N_CSI_RX_BACKEND_ID] = {
200 0x00000000000C0800ULL, /* csi be controller A */
201 0x00000000000C2800ULL, /* csi be controller B */
202 0x00000000000C4800ULL /* csi be controller C */
204 /* PIXEL Generator, part of the Input System 2401 */
205 static const hrt_address PIXELGEN_CTRL_BASE[N_PIXELGEN_ID] = {
206 0x00000000000C1000ULL, /* pixel gen controller A */
207 0x00000000000C3000ULL, /* pixel gen controller B */
208 0x00000000000C5000ULL /* pixel gen controller C */
210 /* Stream2MMIO, part of the Input System 2401 */
211 static const hrt_address STREAM2MMIO_CTRL_BASE[N_STREAM2MMIO_ID] = {
212 0x00000000000C0C00ULL, /* stream2mmio controller A */
213 0x00000000000C2C00ULL, /* stream2mmio controller B */
214 0x00000000000C4C00ULL /* stream2mmio controller C */
216 #elif HRT_ADDRESS_WIDTH == 32
218 #define GP_FIFO_BASE ((hrt_address)0x00090104) /* This is NOT a base address */
220 /* DDR : Attention, this value not defined in 32-bit */
221 static const hrt_address DDR_BASE[N_DDR_ID] = {
225 static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
228 static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
231 static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
234 static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
239 static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
243 static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
246 static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
250 #if defined(IS_ISP_2400_MAMOIADA_SYSTEM) || defined(IS_ISP_2401_MAMOIADA_SYSTEM)
252 * MMU0_ID: The data MMU
253 * MMU1_ID: The icache MMU
255 static const hrt_address MMU_BASE[N_MMU_ID] = {
259 #error "system_local.h: SYSTEM must be one of {2400, 2401 }"
263 static const hrt_address DMA_BASE[N_DMA_ID] = {
266 static const hrt_address ISYS2401_DMA_BASE[N_ISYS2401_DMA_ID] = {
270 static const hrt_address IRQ_BASE[N_IRQ_ID] = {
280 static const hrt_address GDC_BASE[N_GDC_ID] = {
284 /* FIFO_MONITOR (not a subset of GP_DEVICE) */
285 static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
289 static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
292 static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
296 /* GP_DEVICE (single base for all separate GP_REG instances) */
297 static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
300 /*GP TIMER , all timer registers are inter-twined,
301 * so, having multiple base addresses for
302 * different timers does not help*/
303 static const hrt_address GP_TIMER_BASE =
304 (hrt_address)0x00000600UL;
306 static const hrt_address GPIO_BASE[N_GPIO_ID] = {
310 static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
314 /* INPUT_FORMATTER */
315 static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
319 /* 0x00030600UL, */ /* memcpy() */
322 static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
324 /* 0x00081000UL, */ /* capture A */
325 /* 0x00082000UL, */ /* capture B */
326 /* 0x00083000UL, */ /* capture C */
327 /* 0x00084000UL, */ /* Acquisition */
328 /* 0x00085000UL, */ /* DMA */
329 /* 0x00089000UL, */ /* ctrl */
330 /* 0x0008A000UL, */ /* GP regs */
331 /* 0x0008B000UL, */ /* FIFO */
332 /* 0x0008C000UL, */ /* IRQ */
334 /* RX, the MIPI lane control regs start at offset 0 */
335 static const hrt_address RX_BASE[N_RX_ID] = {
338 /* IBUF_CTRL, part of the Input System 2401 */
339 static const hrt_address IBUF_CTRL_BASE[N_IBUF_CTRL_ID] = {
340 0x000C1800UL, /* ibuf controller A */
341 0x000C3800UL, /* ibuf controller B */
342 0x000C5800UL /* ibuf controller C */
345 /* ISYS IRQ Controllers, part of the Input System 2401 */
346 static const hrt_address ISYS_IRQ_BASE[N_ISYS_IRQ_ID] = {
347 0x000C1400ULL, /* port a */
348 0x000C3400ULL, /* port b */
349 0x000C5400ULL /* port c */
352 /* CSI FE, part of the Input System 2401 */
353 static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_FRONTEND_ID] = {
354 0x000C0400UL, /* csi fe controller A */
355 0x000C2400UL, /* csi fe controller B */
356 0x000C4400UL /* csi fe controller C */
358 /* CSI BE, part of the Input System 2401 */
359 static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_BACKEND_ID] = {
360 0x000C0800UL, /* csi be controller A */
361 0x000C2800UL, /* csi be controller B */
362 0x000C4800UL /* csi be controller C */
364 /* PIXEL Generator, part of the Input System 2401 */
365 static const hrt_address PIXELGEN_CTRL_BASE[N_PIXELGEN_ID] = {
366 0x000C1000UL, /* pixel gen controller A */
367 0x000C3000UL, /* pixel gen controller B */
368 0x000C5000UL /* pixel gen controller C */
370 /* Stream2MMIO, part of the Input System 2401 */
371 static const hrt_address STREAM2MMIO_CTRL_BASE[N_STREAM2MMIO_ID] = {
372 0x000C0C00UL, /* stream2mmio controller A */
373 0x000C2C00UL, /* stream2mmio controller B */
374 0x000C4C00UL /* stream2mmio controller C */
378 #error "system_local.h: HRT_ADDRESS_WIDTH must be one of {32,64}"
381 #endif /* __SYSTEM_LOCAL_H_INCLUDED__ */