1 /* SPDX-License-Identifier: GPL-2.0 */
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
16 #ifndef __SYSTEM_LOCAL_H_INCLUDED__
17 #define __SYSTEM_LOCAL_H_INCLUDED__
19 #ifdef HRT_ISP_CSS_CUSTOM_HOST
20 #ifndef HRT_USE_VIR_ADDRS
21 #define HRT_USE_VIR_ADDRS
25 #include "system_global.h"
27 #define HRT_ADDRESS_WIDTH 64 /* Surprise, this is a local property */
29 /* This interface is deprecated */
30 #include "hive_types.h"
33 * Cell specific address maps
35 #if HRT_ADDRESS_WIDTH == 64
37 #define GP_FIFO_BASE ((hrt_address)0x0000000000090104) /* This is NOT a base address */
40 static const hrt_address DDR_BASE[N_DDR_ID] = {
45 static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
49 static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
53 static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
57 static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
58 0x00000000001C0000ULL,
59 0x00000000001D0000ULL,
63 static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
68 static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
72 static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
78 * MMU0_ID: The data MMU
79 * MMU1_ID: The icache MMU
81 static const hrt_address MMU_BASE[N_MMU_ID] = {
82 0x0000000000070000ULL,
87 static const hrt_address DMA_BASE[N_DMA_ID] = {
91 static const hrt_address ISYS2401_DMA_BASE[N_ISYS2401_DMA_ID] = {
96 static const hrt_address IRQ_BASE[N_IRQ_ID] = {
97 0x0000000000000500ULL,
98 0x0000000000030A00ULL,
99 0x000000000008C000ULL,
100 0x0000000000090200ULL
104 0x0000000000000500ULL};
108 static const hrt_address GDC_BASE[N_GDC_ID] = {
109 0x0000000000050000ULL,
110 0x0000000000060000ULL
113 /* FIFO_MONITOR (not a subset of GP_DEVICE) */
114 static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
115 0x0000000000000000ULL
119 static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
120 0x0000000000000000ULL};
122 static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
123 0x0000000000090000ULL};
126 /* GP_DEVICE (single base for all separate GP_REG instances) */
127 static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
128 0x0000000000000000ULL
131 /*GP TIMER , all timer registers are inter-twined,
132 * so, having multiple base addresses for
133 * different timers does not help*/
134 static const hrt_address GP_TIMER_BASE =
135 (hrt_address)0x0000000000000600ULL;
138 static const hrt_address GPIO_BASE[N_GPIO_ID] = {
139 0x0000000000000400ULL
143 static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
144 0x0000000000000100ULL
147 /* INPUT_FORMATTER */
148 static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
149 0x0000000000030000ULL,
150 0x0000000000030200ULL,
151 0x0000000000030400ULL,
152 0x0000000000030600ULL
156 static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
157 0x0000000000080000ULL
160 /* 0x0000000000081000ULL, */ /* capture A */
161 /* 0x0000000000082000ULL, */ /* capture B */
162 /* 0x0000000000083000ULL, */ /* capture C */
163 /* 0x0000000000084000ULL, */ /* Acquisition */
164 /* 0x0000000000085000ULL, */ /* DMA */
165 /* 0x0000000000089000ULL, */ /* ctrl */
166 /* 0x000000000008A000ULL, */ /* GP regs */
167 /* 0x000000000008B000ULL, */ /* FIFO */
168 /* 0x000000000008C000ULL, */ /* IRQ */
170 /* RX, the MIPI lane control regs start at offset 0 */
171 static const hrt_address RX_BASE[N_RX_ID] = {
172 0x0000000000080100ULL
175 /* IBUF_CTRL, part of the Input System 2401 */
176 static const hrt_address IBUF_CTRL_BASE[N_IBUF_CTRL_ID] = {
177 0x00000000000C1800ULL, /* ibuf controller A */
178 0x00000000000C3800ULL, /* ibuf controller B */
179 0x00000000000C5800ULL /* ibuf controller C */
182 /* ISYS IRQ Controllers, part of the Input System 2401 */
183 static const hrt_address ISYS_IRQ_BASE[N_ISYS_IRQ_ID] = {
184 0x00000000000C1400ULL, /* port a */
185 0x00000000000C3400ULL, /* port b */
186 0x00000000000C5400ULL /* port c */
189 /* CSI FE, part of the Input System 2401 */
190 static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_FRONTEND_ID] = {
191 0x00000000000C0400ULL, /* csi fe controller A */
192 0x00000000000C2400ULL, /* csi fe controller B */
193 0x00000000000C4400ULL /* csi fe controller C */
196 /* CSI BE, part of the Input System 2401 */
197 static const hrt_address CSI_RX_BE_CTRL_BASE[N_CSI_RX_BACKEND_ID] = {
198 0x00000000000C0800ULL, /* csi be controller A */
199 0x00000000000C2800ULL, /* csi be controller B */
200 0x00000000000C4800ULL /* csi be controller C */
203 /* PIXEL Generator, part of the Input System 2401 */
204 static const hrt_address PIXELGEN_CTRL_BASE[N_PIXELGEN_ID] = {
205 0x00000000000C1000ULL, /* pixel gen controller A */
206 0x00000000000C3000ULL, /* pixel gen controller B */
207 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] = {
226 static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
230 static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
234 static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
238 static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
244 static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
249 static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
253 static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
259 * MMU0_ID: The data MMU
260 * MMU1_ID: The icache MMU
262 static const hrt_address MMU_BASE[N_MMU_ID] = {
268 static const hrt_address DMA_BASE[N_DMA_ID] = {
272 static const hrt_address ISYS2401_DMA_BASE[N_ISYS2401_DMA_ID] = {
277 static const hrt_address IRQ_BASE[N_IRQ_ID] = {
289 static const hrt_address GDC_BASE[N_GDC_ID] = {
294 /* FIFO_MONITOR (not a subset of GP_DEVICE) */
295 static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
300 static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
303 static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
307 /* GP_DEVICE (single base for all separate GP_REG instances) */
308 static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
312 /*GP TIMER , all timer registers are inter-twined,
313 * so, having multiple base addresses for
314 * different timers does not help*/
315 static const hrt_address GP_TIMER_BASE =
316 (hrt_address)0x00000600UL;
318 static const hrt_address GPIO_BASE[N_GPIO_ID] = {
323 static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
327 /* INPUT_FORMATTER */
328 static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
334 /* 0x00030600UL, */ /* memcpy() */
337 static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
341 /* 0x00081000UL, */ /* capture A */
342 /* 0x00082000UL, */ /* capture B */
343 /* 0x00083000UL, */ /* capture C */
344 /* 0x00084000UL, */ /* Acquisition */
345 /* 0x00085000UL, */ /* DMA */
346 /* 0x00089000UL, */ /* ctrl */
347 /* 0x0008A000UL, */ /* GP regs */
348 /* 0x0008B000UL, */ /* FIFO */
349 /* 0x0008C000UL, */ /* IRQ */
351 /* RX, the MIPI lane control regs start at offset 0 */
352 static const hrt_address RX_BASE[N_RX_ID] = {
356 /* IBUF_CTRL, part of the Input System 2401 */
357 static const hrt_address IBUF_CTRL_BASE[N_IBUF_CTRL_ID] = {
358 0x000C1800UL, /* ibuf controller A */
359 0x000C3800UL, /* ibuf controller B */
360 0x000C5800UL /* ibuf controller C */
363 /* ISYS IRQ Controllers, part of the Input System 2401 */
364 static const hrt_address ISYS_IRQ_BASE[N_ISYS_IRQ_ID] = {
365 0x000C1400ULL, /* port a */
366 0x000C3400ULL, /* port b */
367 0x000C5400ULL /* port c */
370 /* CSI FE, part of the Input System 2401 */
371 static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_FRONTEND_ID] = {
372 0x000C0400UL, /* csi fe controller A */
373 0x000C2400UL, /* csi fe controller B */
374 0x000C4400UL /* csi fe controller C */
377 /* CSI BE, part of the Input System 2401 */
378 static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_BACKEND_ID] = {
379 0x000C0800UL, /* csi be controller A */
380 0x000C2800UL, /* csi be controller B */
381 0x000C4800UL /* csi be controller C */
384 /* PIXEL Generator, part of the Input System 2401 */
385 static const hrt_address PIXELGEN_CTRL_BASE[N_PIXELGEN_ID] = {
386 0x000C1000UL, /* pixel gen controller A */
387 0x000C3000UL, /* pixel gen controller B */
388 0x000C5000UL /* pixel gen controller C */
391 /* Stream2MMIO, part of the Input System 2401 */
392 static const hrt_address STREAM2MMIO_CTRL_BASE[N_STREAM2MMIO_ID] = {
393 0x000C0C00UL, /* stream2mmio controller A */
394 0x000C2C00UL, /* stream2mmio controller B */
395 0x000C4C00UL /* stream2mmio controller C */
399 #error "system_local.h: HRT_ADDRESS_WIDTH must be one of {32,64}"
402 #endif /* __SYSTEM_LOCAL_H_INCLUDED__ */