Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[linux-2.6-microblaze.git] / drivers / staging / media / atomisp / pci / isp2401_system_local.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2015, Intel Corporation.
5  *
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.
9  *
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
13  * more details.
14  */
15
16 #ifndef __SYSTEM_LOCAL_H_INCLUDED__
17 #define __SYSTEM_LOCAL_H_INCLUDED__
18
19 #ifdef HRT_ISP_CSS_CUSTOM_HOST
20 #ifndef HRT_USE_VIR_ADDRS
21 #define HRT_USE_VIR_ADDRS
22 #endif
23 #endif
24
25 #include "system_global.h"
26
27 #define HRT_ADDRESS_WIDTH       64              /* Surprise, this is a local property */
28
29 /* This interface is deprecated */
30 #include "hive_types.h"
31
32 /*
33  * Cell specific address maps
34  */
35 #if HRT_ADDRESS_WIDTH == 64
36
37 #define GP_FIFO_BASE   ((hrt_address)0x0000000000090104)                /* This is NOT a base address */
38
39 /* DDR */
40 static const hrt_address DDR_BASE[N_DDR_ID] = {
41         0x0000000120000000ULL
42 };
43
44 /* ISP */
45 static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
46         0x0000000000020000ULL
47 };
48
49 static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
50         0x0000000000200000ULL
51 };
52
53 static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
54         0x0000000000100000ULL
55 };
56
57 static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
58         0x00000000001C0000ULL,
59         0x00000000001D0000ULL,
60         0x00000000001E0000ULL
61 };
62
63 static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
64         0x00000000001F0000ULL
65 };
66
67 /* SP */
68 static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
69         0x0000000000010000ULL
70 };
71
72 static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
73         0x0000000000300000ULL
74 };
75
76 /* MMU */
77 /*
78  * MMU0_ID: The data MMU
79  * MMU1_ID: The icache MMU
80  */
81 static const hrt_address MMU_BASE[N_MMU_ID] = {
82         0x0000000000070000ULL,
83         0x00000000000A0000ULL
84 };
85
86 /* DMA */
87 static const hrt_address DMA_BASE[N_DMA_ID] = {
88         0x0000000000040000ULL
89 };
90
91 static const hrt_address ISYS2401_DMA_BASE[N_ISYS2401_DMA_ID] = {
92         0x00000000000CA000ULL
93 };
94
95 /* IRQ */
96 static const hrt_address IRQ_BASE[N_IRQ_ID] = {
97         0x0000000000000500ULL,
98         0x0000000000030A00ULL,
99         0x000000000008C000ULL,
100         0x0000000000090200ULL
101 };
102
103 /*
104         0x0000000000000500ULL};
105  */
106
107 /* GDC */
108 static const hrt_address GDC_BASE[N_GDC_ID] = {
109         0x0000000000050000ULL,
110         0x0000000000060000ULL
111 };
112
113 /* FIFO_MONITOR (not a subset of GP_DEVICE) */
114 static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
115         0x0000000000000000ULL
116 };
117
118 /*
119 static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
120         0x0000000000000000ULL};
121
122 static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
123         0x0000000000090000ULL};
124 */
125
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
129 };
130
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;
136
137 /* GPIO */
138 static const hrt_address GPIO_BASE[N_GPIO_ID] = {
139         0x0000000000000400ULL
140 };
141
142 /* TIMED_CTRL */
143 static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
144         0x0000000000000100ULL
145 };
146
147 /* INPUT_FORMATTER */
148 static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
149         0x0000000000030000ULL,
150         0x0000000000030200ULL,
151         0x0000000000030400ULL,
152         0x0000000000030600ULL
153 }; /* memcpy() */
154
155 /* INPUT_SYSTEM */
156 static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
157         0x0000000000080000ULL
158 };
159
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 */
169
170 /* RX, the MIPI lane control regs start at offset 0 */
171 static const hrt_address RX_BASE[N_RX_ID] = {
172         0x0000000000080100ULL
173 };
174
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 */
180 };
181
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 */
187 };
188
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 */
194 };
195
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 */
201 };
202
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 */
208 };
209
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 */
215 };
216 #elif HRT_ADDRESS_WIDTH == 32
217
218 #define GP_FIFO_BASE   ((hrt_address)0x00090104)                /* This is NOT a base address */
219
220 /* DDR : Attention, this value not defined in 32-bit */
221 static const hrt_address DDR_BASE[N_DDR_ID] = {
222         0x00000000UL
223 };
224
225 /* ISP */
226 static const hrt_address ISP_CTRL_BASE[N_ISP_ID] = {
227         0x00020000UL
228 };
229
230 static const hrt_address ISP_DMEM_BASE[N_ISP_ID] = {
231         0xffffffffUL
232 };
233
234 static const hrt_address ISP_BAMEM_BASE[N_BAMEM_ID] = {
235         0xffffffffUL
236 };
237
238 static const hrt_address ISP_VAMEM_BASE[N_VAMEM_ID] = {
239         0xffffffffUL,
240         0xffffffffUL,
241         0xffffffffUL
242 };
243
244 static const hrt_address ISP_HMEM_BASE[N_HMEM_ID] = {
245         0xffffffffUL
246 };
247
248 /* SP */
249 static const hrt_address SP_CTRL_BASE[N_SP_ID] = {
250         0x00010000UL
251 };
252
253 static const hrt_address SP_DMEM_BASE[N_SP_ID] = {
254         0x00300000UL
255 };
256
257 /* MMU */
258 /*
259  * MMU0_ID: The data MMU
260  * MMU1_ID: The icache MMU
261  */
262 static const hrt_address MMU_BASE[N_MMU_ID] = {
263         0x00070000UL,
264         0x000A0000UL
265 };
266
267 /* DMA */
268 static const hrt_address DMA_BASE[N_DMA_ID] = {
269         0x00040000UL
270 };
271
272 static const hrt_address ISYS2401_DMA_BASE[N_ISYS2401_DMA_ID] = {
273         0x000CA000UL
274 };
275
276 /* IRQ */
277 static const hrt_address IRQ_BASE[N_IRQ_ID] = {
278         0x00000500UL,
279         0x00030A00UL,
280         0x0008C000UL,
281         0x00090200UL
282 };
283
284 /*
285         0x00000500UL};
286  */
287
288 /* GDC */
289 static const hrt_address GDC_BASE[N_GDC_ID] = {
290         0x00050000UL,
291         0x00060000UL
292 };
293
294 /* FIFO_MONITOR (not a subset of GP_DEVICE) */
295 static const hrt_address FIFO_MONITOR_BASE[N_FIFO_MONITOR_ID] = {
296         0x00000000UL
297 };
298
299 /*
300 static const hrt_address GP_REGS_BASE[N_GP_REGS_ID] = {
301         0x00000000UL};
302
303 static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
304         0x00090000UL};
305 */
306
307 /* GP_DEVICE (single base for all separate GP_REG instances) */
308 static const hrt_address GP_DEVICE_BASE[N_GP_DEVICE_ID] = {
309         0x00000000UL
310 };
311
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;
317 /* GPIO */
318 static const hrt_address GPIO_BASE[N_GPIO_ID] = {
319         0x00000400UL
320 };
321
322 /* TIMED_CTRL */
323 static const hrt_address TIMED_CTRL_BASE[N_TIMED_CTRL_ID] = {
324         0x00000100UL
325 };
326
327 /* INPUT_FORMATTER */
328 static const hrt_address INPUT_FORMATTER_BASE[N_INPUT_FORMATTER_ID] = {
329         0x00030000UL,
330         0x00030200UL,
331         0x00030400UL
332 };
333
334 /*      0x00030600UL, */ /* memcpy() */
335
336 /* INPUT_SYSTEM */
337 static const hrt_address INPUT_SYSTEM_BASE[N_INPUT_SYSTEM_ID] = {
338         0x00080000UL
339 };
340
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 */
350
351 /* RX, the MIPI lane control regs start at offset 0 */
352 static const hrt_address RX_BASE[N_RX_ID] = {
353         0x00080100UL
354 };
355
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 */
361 };
362
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 */
368 };
369
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 */
375 };
376
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 */
382 };
383
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 */
389 };
390
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 */
396 };
397
398 #else
399 #error "system_local.h: HRT_ADDRESS_WIDTH must be one of {32,64}"
400 #endif
401
402 #endif /* __SYSTEM_LOCAL_H_INCLUDED__ */