media: atomisp: do another round of coding style cleanup
[linux-2.6-microblaze.git] / drivers / staging / media / atomisp / pci / isp2401_system_local.h
1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 2015, Intel Corporation.
4  *
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.
8  *
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
12  * more details.
13  */
14
15 #ifndef __SYSTEM_LOCAL_H_INCLUDED__
16 #define __SYSTEM_LOCAL_H_INCLUDED__
17
18 #ifdef HRT_ISP_CSS_CUSTOM_HOST
19 #ifndef HRT_USE_VIR_ADDRS
20 #define HRT_USE_VIR_ADDRS
21 #endif
22 /* This interface is deprecated */
23 /*#include "hive_isp_css_custom_host_hrt.h"*/
24 #endif
25
26 #include "system_global.h"
27
28 #define HRT_ADDRESS_WIDTH       64              /* Surprise, this is a local property */
29
30 /* This interface is deprecated */
31 #include "hive_types.h"
32
33 /*
34  * Cell specific address maps
35  */
36 #if HRT_ADDRESS_WIDTH == 64
37
38 #define GP_FIFO_BASE   ((hrt_address)0x0000000000090104)                /* This is NOT a base address */
39
40 /* DDR */
41 static const hrt_address DDR_BASE[N_DDR_ID] = {
42         0x0000000120000000ULL
43 };
44
45 /* ISP */
46 static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
47         0x0000000000020000ULL
48 };
49
50 static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
51         0x0000000000200000ULL
52 };
53
54 static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
55         0x0000000000100000ULL
56 };
57
58 static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
59         0x00000000001C0000ULL,
60         0x00000000001D0000ULL,
61         0x00000000001E0000ULL
62 };
63
64 static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
65         0x00000000001F0000ULL
66 };
67
68 /* SP */
69 static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
70         0x0000000000010000ULL
71 };
72
73 static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
74         0x0000000000300000ULL
75 };
76
77 /* MMU */
78 #if defined(IS_ISP_2400_MAMOIADA_SYSTEM) || defined(IS_ISP_2401_MAMOIADA_SYSTEM)
79 /*
80  * MMU0_ID: The data MMU
81  * MMU1_ID: The icache MMU
82  */
83 static const hrt_address MMU_BASE[N_MMU_ID] = {
84         0x0000000000070000ULL,
85         0x00000000000A0000ULL
86 };
87 #else
88 #error "system_local.h: SYSTEM must be one of {2400, 2401 }"
89 #endif
90
91 /* DMA */
92 static const hrt_address DMA_BASE[N_DMA_ID] = {
93         0x0000000000040000ULL
94 };
95
96 static const hrt_address ISYS2401_DMA_BASE[N_ISYS2401_DMA_ID] = {
97         0x00000000000CA000ULL
98 };
99
100 /* IRQ */
101 static const hrt_address IRQ_BASE[N_IRQ_ID] = {
102         0x0000000000000500ULL,
103         0x0000000000030A00ULL,
104         0x000000000008C000ULL,
105         0x0000000000090200ULL
106 };
107
108 /*
109         0x0000000000000500ULL};
110  */
111
112 /* GDC */
113 static const hrt_address GDC_BASE[N_GDC_ID] = {
114         0x0000000000050000ULL,
115         0x0000000000060000ULL
116 };
117
118 /* FIFO_MONITOR (not a subset of GP_DEVICE) */
119 static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
120         0x0000000000000000ULL
121 };
122
123 /*
124 static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
125         0x0000000000000000ULL};
126
127 static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
128         0x0000000000090000ULL};
129 */
130
131 /* GP_DEVICE (single base for all separate GP_REG instances) */
132 static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
133         0x0000000000000000ULL
134 };
135
136 /*GP TIMER , all timer registers are inter-twined,
137  * so, having multiple base addresses for
138  * different timers does not help*/
139 static const hrt_address GP_TIMER_BASE =
140     (hrt_address)0x0000000000000600ULL;
141
142 /* GPIO */
143 static const hrt_address GPIO_BASE[N_GPIO_ID] = {
144         0x0000000000000400ULL
145 };
146
147 /* TIMED_CTRL */
148 static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
149         0x0000000000000100ULL
150 };
151
152 /* INPUT_FORMATTER */
153 static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
154         0x0000000000030000ULL,
155         0x0000000000030200ULL,
156         0x0000000000030400ULL,
157         0x0000000000030600ULL
158 }; /* memcpy() */
159
160 /* INPUT_SYSTEM */
161 static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
162         0x0000000000080000ULL
163 };
164
165 /*      0x0000000000081000ULL, */ /* capture A */
166 /*      0x0000000000082000ULL, */ /* capture B */
167 /*      0x0000000000083000ULL, */ /* capture C */
168 /*      0x0000000000084000ULL, */ /* Acquisition */
169 /*      0x0000000000085000ULL, */ /* DMA */
170 /*      0x0000000000089000ULL, */ /* ctrl */
171 /*      0x000000000008A000ULL, */ /* GP regs */
172 /*      0x000000000008B000ULL, */ /* FIFO */
173 /*      0x000000000008C000ULL, */ /* IRQ */
174
175 /* RX, the MIPI lane control regs start at offset 0 */
176 static const hrt_address RX_BASE[N_RX_ID] = {
177         0x0000000000080100ULL
178 };
179
180 /* IBUF_CTRL, part of the Input System 2401 */
181 static const hrt_address IBUF_CTRL_BASE[N_IBUF_CTRL_ID] = {
182         0x00000000000C1800ULL,  /* ibuf controller A */
183         0x00000000000C3800ULL,  /* ibuf controller B */
184         0x00000000000C5800ULL   /* ibuf controller C */
185 };
186
187 /* ISYS IRQ Controllers, part of the Input System 2401 */
188 static const hrt_address ISYS_IRQ_BASE[N_ISYS_IRQ_ID] = {
189         0x00000000000C1400ULL,  /* port a */
190         0x00000000000C3400ULL,  /* port b */
191         0x00000000000C5400ULL   /* port c */
192 };
193
194 /* CSI FE, part of the Input System 2401 */
195 static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_FRONTEND_ID] = {
196         0x00000000000C0400ULL,  /* csi fe controller A */
197         0x00000000000C2400ULL,  /* csi fe controller B */
198         0x00000000000C4400ULL   /* csi fe controller C */
199 };
200
201 /* CSI BE, part of the Input System 2401 */
202 static const hrt_address CSI_RX_BE_CTRL_BASE[N_CSI_RX_BACKEND_ID] = {
203         0x00000000000C0800ULL,  /* csi be controller A */
204         0x00000000000C2800ULL,  /* csi be controller B */
205         0x00000000000C4800ULL   /* csi be controller C */
206 };
207
208 /* PIXEL Generator, part of the Input System 2401 */
209 static const hrt_address PIXELGEN_CTRL_BASE[N_PIXELGEN_ID] = {
210         0x00000000000C1000ULL,  /* pixel gen controller A */
211         0x00000000000C3000ULL,  /* pixel gen controller B */
212         0x00000000000C5000ULL   /* pixel gen controller C */
213 };
214
215 /* Stream2MMIO, part of the Input System 2401 */
216 static const hrt_address STREAM2MMIO_CTRL_BASE[N_STREAM2MMIO_ID] = {
217         0x00000000000C0C00ULL,  /* stream2mmio controller A */
218         0x00000000000C2C00ULL,  /* stream2mmio controller B */
219         0x00000000000C4C00ULL   /* stream2mmio controller C */
220 };
221 #elif HRT_ADDRESS_WIDTH == 32
222
223 #define GP_FIFO_BASE   ((hrt_address)0x00090104)                /* This is NOT a base address */
224
225 /* DDR : Attention, this value not defined in 32-bit */
226 static const hrt_address DDR_BASE[N_DDR_ID] = {
227         0x00000000UL
228 };
229
230 /* ISP */
231 static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
232         0x00020000UL
233 };
234
235 static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
236         0xffffffffUL
237 };
238
239 static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
240         0xffffffffUL
241 };
242
243 static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
244         0xffffffffUL,
245         0xffffffffUL,
246         0xffffffffUL
247 };
248
249 static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
250         0xffffffffUL
251 };
252
253 /* SP */
254 static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
255         0x00010000UL
256 };
257
258 static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
259         0x00300000UL
260 };
261
262 /* MMU */
263 #if defined(IS_ISP_2400_MAMOIADA_SYSTEM) || defined(IS_ISP_2401_MAMOIADA_SYSTEM)
264 /*
265  * MMU0_ID: The data MMU
266  * MMU1_ID: The icache MMU
267  */
268 static const hrt_address MMU_BASE[N_MMU_ID] = {
269         0x00070000UL,
270         0x000A0000UL
271 };
272 #else
273 #error "system_local.h: SYSTEM must be one of {2400, 2401 }"
274 #endif
275
276 /* DMA */
277 static const hrt_address DMA_BASE[N_DMA_ID] = {
278         0x00040000UL
279 };
280
281 static const hrt_address ISYS2401_DMA_BASE[N_ISYS2401_DMA_ID] = {
282         0x000CA000UL
283 };
284
285 /* IRQ */
286 static const hrt_address IRQ_BASE[N_IRQ_ID] = {
287         0x00000500UL,
288         0x00030A00UL,
289         0x0008C000UL,
290         0x00090200UL
291 };
292
293 /*
294         0x00000500UL};
295  */
296
297 /* GDC */
298 static const hrt_address GDC_BASE[N_GDC_ID] = {
299         0x00050000UL,
300         0x00060000UL
301 };
302
303 /* FIFO_MONITOR (not a subset of GP_DEVICE) */
304 static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
305         0x00000000UL
306 };
307
308 /*
309 static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
310         0x00000000UL};
311
312 static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
313         0x00090000UL};
314 */
315
316 /* GP_DEVICE (single base for all separate GP_REG instances) */
317 static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
318         0x00000000UL
319 };
320
321 /*GP TIMER , all timer registers are inter-twined,
322  * so, having multiple base addresses for
323  * different timers does not help*/
324 static const hrt_address GP_TIMER_BASE =
325     (hrt_address)0x00000600UL;
326 /* GPIO */
327 static const hrt_address GPIO_BASE[N_GPIO_ID] = {
328         0x00000400UL
329 };
330
331 /* TIMED_CTRL */
332 static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
333         0x00000100UL
334 };
335
336 /* INPUT_FORMATTER */
337 static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
338         0x00030000UL,
339         0x00030200UL,
340         0x00030400UL
341 };
342
343 /*      0x00030600UL, */ /* memcpy() */
344
345 /* INPUT_SYSTEM */
346 static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
347         0x00080000UL
348 };
349
350 /*      0x00081000UL, */ /* capture A */
351 /*      0x00082000UL, */ /* capture B */
352 /*      0x00083000UL, */ /* capture C */
353 /*      0x00084000UL, */ /* Acquisition */
354 /*      0x00085000UL, */ /* DMA */
355 /*      0x00089000UL, */ /* ctrl */
356 /*      0x0008A000UL, */ /* GP regs */
357 /*      0x0008B000UL, */ /* FIFO */
358 /*      0x0008C000UL, */ /* IRQ */
359
360 /* RX, the MIPI lane control regs start at offset 0 */
361 static const hrt_address RX_BASE[N_RX_ID] = {
362         0x00080100UL
363 };
364
365 /* IBUF_CTRL, part of the Input System 2401 */
366 static const hrt_address IBUF_CTRL_BASE[N_IBUF_CTRL_ID] = {
367         0x000C1800UL,   /* ibuf controller A */
368         0x000C3800UL,   /* ibuf controller B */
369         0x000C5800UL    /* ibuf controller C */
370 };
371
372 /* ISYS IRQ Controllers, part of the Input System 2401 */
373 static const hrt_address ISYS_IRQ_BASE[N_ISYS_IRQ_ID] = {
374         0x000C1400ULL,  /* port a */
375         0x000C3400ULL,  /* port b */
376         0x000C5400ULL   /* port c */
377 };
378
379 /* CSI FE, part of the Input System 2401 */
380 static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_FRONTEND_ID] = {
381         0x000C0400UL,   /* csi fe controller A */
382         0x000C2400UL,   /* csi fe controller B */
383         0x000C4400UL    /* csi fe controller C */
384 };
385
386 /* CSI BE, part of the Input System 2401 */
387 static const hrt_address CSI_RX_FE_CTRL_BASE[N_CSI_RX_BACKEND_ID] = {
388         0x000C0800UL,   /* csi be controller A */
389         0x000C2800UL,   /* csi be controller B */
390         0x000C4800UL    /* csi be controller C */
391 };
392
393 /* PIXEL Generator, part of the Input System 2401 */
394 static const hrt_address PIXELGEN_CTRL_BASE[N_PIXELGEN_ID] = {
395         0x000C1000UL,   /* pixel gen controller A */
396         0x000C3000UL,   /* pixel gen controller B */
397         0x000C5000UL    /* pixel gen controller C */
398 };
399
400 /* Stream2MMIO, part of the Input System 2401 */
401 static const hrt_address STREAM2MMIO_CTRL_BASE[N_STREAM2MMIO_ID] = {
402         0x000C0C00UL,   /* stream2mmio controller A */
403         0x000C2C00UL,   /* stream2mmio controller B */
404         0x000C4C00UL    /* stream2mmio controller C */
405 };
406
407 #else
408 #error "system_local.h: HRT_ADDRESS_WIDTH must be one of {32,64}"
409 #endif
410
411 #endif /* __SYSTEM_LOCAL_H_INCLUDED__ */