Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/linville...
[pandora-kernel.git] / arch / mips / powertv / asic / prealloc-cronus.c
1 /*
2  * Memory pre-allocations for Cronus boxes.
3  *
4  * Copyright (C) 2005-2009 Scientific-Atlanta, Inc.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  * Author:       Ken Eppinett
21  *               David Schleef <ds@schleef.org>
22  */
23
24 #include <linux/init.h>
25 #include <asm/mach-powertv/asic.h>
26
27 /*
28  * DVR_CAPABLE CRONUS RESOURCES
29  */
30 struct resource dvr_cronus_resources[] __initdata =
31 {
32         /*
33          *
34          * VIDEO1 / LX1
35          *
36          */
37         {
38                 .name   = "ST231aImage",        /* Delta-Mu 1 image and ram */
39                 .start  = 0x24000000,
40                 .end    = 0x241FFFFF,           /* 2MiB */
41                 .flags  = IORESOURCE_MEM,
42         },
43         {
44                 .name   = "ST231aMonitor",      /* 8KiB block ST231a monitor */
45                 .start  = 0x24200000,
46                 .end    = 0x24201FFF,
47                 .flags  = IORESOURCE_MEM,
48         },
49         {
50                 .name   = "MediaMemory1",
51                 .start  = 0x24202000,
52                 .end    = 0x25FFFFFF, /*~29.9MiB (32MiB - (2MiB + 8KiB)) */
53                 .flags  = IORESOURCE_MEM,
54         },
55         /*
56          *
57          * VIDEO2 / LX2
58          *
59          */
60         {
61                 .name   = "ST231bImage",        /* Delta-Mu 2 image and ram */
62                 .start  = 0x60000000,
63                 .end    = 0x601FFFFF,           /* 2MiB */
64                 .flags  = IORESOURCE_IO,
65         },
66         {
67                 .name   = "ST231bMonitor",      /* 8KiB block ST231b monitor */
68                 .start  = 0x60200000,
69                 .end    = 0x60201FFF,
70                 .flags  = IORESOURCE_IO,
71         },
72         {
73                 .name   = "MediaMemory2",
74                 .start  = 0x60202000,
75                 .end    = 0x61FFFFFF, /*~29.9MiB (32MiB - (2MiB + 8KiB)) */
76                 .flags  = IORESOURCE_IO,
77         },
78         /*
79          *
80          * Sysaudio Driver
81          *
82          * This driver requires:
83          *
84          * Arbitrary Based Buffers:
85          *  DSP_Image_Buff - DSP code and data images (1MB)
86          *  ADSC_CPU_PCM_Buff - ADSC CPU PCM buffer (40KB)
87          *  ADSC_AUX_Buff - ADSC AUX buffer (16KB)
88          *  ADSC_Main_Buff - ADSC Main buffer (16KB)
89          *
90          */
91         {
92                 .name   = "DSP_Image_Buff",
93                 .start  = 0x00000000,
94                 .end    = 0x000FFFFF,
95                 .flags  = IORESOURCE_MEM,
96         },
97         {
98                 .name   = "ADSC_CPU_PCM_Buff",
99                 .start  = 0x00000000,
100                 .end    = 0x00009FFF,
101                 .flags  = IORESOURCE_MEM,
102         },
103         {
104                 .name   = "ADSC_AUX_Buff",
105                 .start  = 0x00000000,
106                 .end    = 0x00003FFF,
107                 .flags  = IORESOURCE_MEM,
108         },
109         {
110                 .name   = "ADSC_Main_Buff",
111                 .start  = 0x00000000,
112                 .end    = 0x00003FFF,
113                 .flags  = IORESOURCE_MEM,
114         },
115         /*
116          *
117          * STAVEM driver/STAPI
118          *
119          * This driver requires:
120          *
121          * Arbitrary Based Buffers:
122          *  This memory area is used for allocating buffers for Video decoding
123          *  purposes.  Allocation/De-allocation within this buffer is managed
124          *  by the STAVMEM driver of the STAPI.  They could be Decimated
125          *  Picture Buffers, Intermediate Buffers, as deemed necessary for
126          *  video decoding purposes, for any video decoders on Zeus.
127          *
128          */
129         {
130                 .name   = "AVMEMPartition0",
131                 .start  = 0x63580000,
132                 .end    = 0x64180000 - 1,  /* 12 MB total */
133                 .flags  = IORESOURCE_IO,
134         },
135         /*
136          *
137          * DOCSIS Subsystem
138          *
139          * This driver requires:
140          *
141          * Arbitrary Based Buffers:
142          *  Docsis -
143          *
144          */
145         {
146                 .name   = "Docsis",
147                 .start  = 0x62000000,
148                 .end    = 0x62700000 - 1,       /* 7 MB total */
149                 .flags  = IORESOURCE_IO,
150         },
151         /*
152          *
153          * GHW HAL Driver
154          *
155          * This driver requires:
156          *
157          * Arbitrary Based Buffers:
158          *  GraphicsHeap - PowerTV Graphics Heap
159          *
160          */
161         {
162                 .name   = "GraphicsHeap",
163                 .start  = 0x62700000,
164                 .end    = 0x63500000 - 1,       /* 14 MB total */
165                 .flags  = IORESOURCE_IO,
166         },
167         /*
168          *
169          * multi com buffer area
170          *
171          * This driver requires:
172          *
173          * Arbitrary Based Buffers:
174          *  Docsis -
175          *
176          */
177         {
178                 .name   = "MulticomSHM",
179                 .start  = 0x26000000,
180                 .end    = 0x26020000 - 1,
181                 .flags  = IORESOURCE_MEM,
182         },
183         /*
184          *
185          * DMA Ring buffer
186          *
187          * This driver requires:
188          *
189          * Arbitrary Based Buffers:
190          *  Docsis -
191          *
192          */
193         {
194                 .name   = "BMM_Buffer",
195                 .start  = 0x00000000,
196                 .end    = 0x00280000 - 1,
197                 .flags  = IORESOURCE_MEM,
198         },
199         /*
200          *
201          * Display bins buffer for unit0
202          *
203          * This driver requires:
204          *
205          * Arbitrary Based Buffers:
206          *  Display Bins for unit0
207          *
208          */
209         {
210                 .name   = "DisplayBins0",
211                 .start  = 0x00000000,
212                 .end    = 0x00000FFF,           /* 4 KB total */
213                 .flags  = IORESOURCE_MEM,
214         },
215         /*
216          *
217          * Display bins buffer
218          *
219          * This driver requires:
220          *
221          * Arbitrary Based Buffers:
222          *  Display Bins for unit1
223          *
224          */
225         {
226                 .name   = "DisplayBins1",
227                 .start  = 0x64AD4000,
228                 .end    = 0x64AD5000 - 1,  /* 4 KB total */
229                 .flags  = IORESOURCE_IO,
230         },
231         /*
232          *
233          * ITFS
234          *
235          * This driver requires:
236          *
237          * Arbitrary Based Buffers:
238          *  Docsis -
239          *
240          */
241         {
242                 .name   = "ITFS",
243                 .start  = 0x64180000,
244                 /* 815,104 bytes each for 2 ITFS partitions. */
245                 .end    = 0x6430DFFF,
246                 .flags  = IORESOURCE_IO,
247         },
248         /*
249          *
250          * AVFS
251          *
252          * This driver requires:
253          *
254          * Arbitrary Based Buffers:
255          *  Docsis -
256          *
257          */
258         {
259                 .name   = "AvfsDmaMem",
260                 .start  = 0x6430E000,
261                 /* (945K * 8) = (128K *3) 5 playbacks / 3 server */
262                 .end    = 0x64AD0000 - 1,
263                 .flags  = IORESOURCE_IO,
264         },
265         {
266                 .name   = "AvfsFileSys",
267                 .start  = 0x64AD0000,
268                 .end    = 0x64AD1000 - 1,  /* 4K */
269                 .flags  = IORESOURCE_IO,
270         },
271         /*
272          *
273          * PMEM
274          *
275          * This driver requires:
276          *
277          * Arbitrary Based Buffers:
278          *  Persistent memory for diagnostics.
279          *
280          */
281         {
282                 .name   = "DiagPersistentMemory",
283                 .start  = 0x00000000,
284                 .end    = 0x10000 - 1,
285                 .flags  = IORESOURCE_MEM,
286         },
287         /*
288          *
289          * Smartcard
290          *
291          * This driver requires:
292          *
293          * Arbitrary Based Buffers:
294          *  Read and write buffers for Internal/External cards
295          *
296          */
297         {
298                 .name   = "SmartCardInfo",
299                 .start  = 0x64AD1000,
300                 .end    = 0x64AD3800 - 1,
301                 .flags  = IORESOURCE_IO,
302         },
303         /*
304          *
305          * KAVNET
306          *    NP Reset Vector - must be of the form xxCxxxxx
307          *         NP Image - must be video bank 1
308          *         NP IPC - must be video bank 2
309          */
310         {
311                 .name   = "NP_Reset_Vector",
312                 .start  = 0x27c00000,
313                 .end    = 0x27c01000 - 1,
314                 .flags  = IORESOURCE_MEM,
315         },
316         {
317                 .name   = "NP_Image",
318                 .start  = 0x27020000,
319                 .end    = 0x27060000 - 1,
320                 .flags  = IORESOURCE_MEM,
321         },
322         {
323                 .name   = "NP_IPC",
324                 .start  = 0x63500000,
325                 .end    = 0x63580000 - 1,
326                 .flags  = IORESOURCE_IO,
327         },
328         /*
329          * Add other resources here
330          */
331         { },
332 };
333
334 /*
335  * NON_DVR_CAPABLE CRONUS RESOURCES
336  */
337 struct resource non_dvr_cronus_resources[] __initdata =
338 {
339         /*
340          *
341          * VIDEO1 / LX1
342          *
343          */
344         {
345                 .name   = "ST231aImage",        /* Delta-Mu 1 image and ram */
346                 .start  = 0x24000000,
347                 .end    = 0x241FFFFF,           /* 2MiB */
348                 .flags  = IORESOURCE_MEM,
349         },
350         {
351                 .name   = "ST231aMonitor",      /* 8KiB block ST231a monitor */
352                 .start  = 0x24200000,
353                 .end    = 0x24201FFF,
354                 .flags  = IORESOURCE_MEM,
355         },
356         {
357                 .name   = "MediaMemory1",
358                 .start  = 0x24202000,
359                 .end    = 0x25FFFFFF, /*~29.9MiB (32MiB - (2MiB + 8KiB)) */
360                 .flags  = IORESOURCE_MEM,
361         },
362         /*
363          *
364          * VIDEO2 / LX2
365          *
366          */
367         {
368                 .name   = "ST231bImage",        /* Delta-Mu 2 image and ram */
369                 .start  = 0x60000000,
370                 .end    = 0x601FFFFF,           /* 2MiB */
371                 .flags  = IORESOURCE_IO,
372         },
373         {
374                 .name   = "ST231bMonitor",      /* 8KiB block ST231b monitor */
375                 .start  = 0x60200000,
376                 .end    = 0x60201FFF,
377                 .flags  = IORESOURCE_IO,
378         },
379         {
380                 .name   = "MediaMemory2",
381                 .start  = 0x60202000,
382                 .end    = 0x61FFFFFF, /*~29.9MiB (32MiB - (2MiB + 8KiB)) */
383                 .flags  = IORESOURCE_IO,
384         },
385         /*
386          *
387          * Sysaudio Driver
388          *
389          * This driver requires:
390          *
391          * Arbitrary Based Buffers:
392          *  DSP_Image_Buff - DSP code and data images (1MB)
393          *  ADSC_CPU_PCM_Buff - ADSC CPU PCM buffer (40KB)
394          *  ADSC_AUX_Buff - ADSC AUX buffer (16KB)
395          *  ADSC_Main_Buff - ADSC Main buffer (16KB)
396          *
397          */
398         {
399                 .name   = "DSP_Image_Buff",
400                 .start  = 0x00000000,
401                 .end    = 0x000FFFFF,
402                 .flags  = IORESOURCE_MEM,
403         },
404         {
405                 .name   = "ADSC_CPU_PCM_Buff",
406                 .start  = 0x00000000,
407                 .end    = 0x00009FFF,
408                 .flags  = IORESOURCE_MEM,
409         },
410         {
411                 .name   = "ADSC_AUX_Buff",
412                 .start  = 0x00000000,
413                 .end    = 0x00003FFF,
414                 .flags  = IORESOURCE_MEM,
415         },
416         {
417                 .name   = "ADSC_Main_Buff",
418                 .start  = 0x00000000,
419                 .end    = 0x00003FFF,
420                 .flags  = IORESOURCE_MEM,
421         },
422         /*
423          *
424          * STAVEM driver/STAPI
425          *
426          * This driver requires:
427          *
428          * Arbitrary Based Buffers:
429          *  This memory area is used for allocating buffers for Video decoding
430          *  purposes.  Allocation/De-allocation within this buffer is managed
431          *  by the STAVMEM driver of the STAPI.  They could be Decimated
432          *  Picture Buffers, Intermediate Buffers, as deemed necessary for
433          *  video decoding purposes, for any video decoders on Zeus.
434          *
435          */
436         {
437                 .name   = "AVMEMPartition0",
438                 .start  = 0x63580000,
439                 .end    = 0x64180000 - 1,  /* 12 MB total */
440                 .flags  = IORESOURCE_IO,
441         },
442         /*
443          *
444          * DOCSIS Subsystem
445          *
446          * This driver requires:
447          *
448          * Arbitrary Based Buffers:
449          *  Docsis -
450          *
451          */
452         {
453                 .name   = "Docsis",
454                 .start  = 0x62000000,
455                 .end    = 0x62700000 - 1,       /* 7 MB total */
456                 .flags  = IORESOURCE_IO,
457         },
458         /*
459          *
460          * GHW HAL Driver
461          *
462          * This driver requires:
463          *
464          * Arbitrary Based Buffers:
465          *  GraphicsHeap - PowerTV Graphics Heap
466          *
467          */
468         {
469                 .name   = "GraphicsHeap",
470                 .start  = 0x62700000,
471                 .end    = 0x63500000 - 1,       /* 14 MB total */
472                 .flags  = IORESOURCE_IO,
473         },
474         /*
475          *
476          * multi com buffer area
477          *
478          * This driver requires:
479          *
480          * Arbitrary Based Buffers:
481          *  Docsis -
482          *
483          */
484         {
485                 .name   = "MulticomSHM",
486                 .start  = 0x26000000,
487                 .end    = 0x26020000 - 1,
488                 .flags  = IORESOURCE_MEM,
489         },
490         /*
491          *
492          * DMA Ring buffer
493          *
494          * This driver requires:
495          *
496          * Arbitrary Based Buffers:
497          *  Docsis -
498          *
499          */
500         {
501                 .name   = "BMM_Buffer",
502                 .start  = 0x00000000,
503                 .end    = 0x000AA000 - 1,
504                 .flags  = IORESOURCE_MEM,
505         },
506         /*
507          *
508          * Display bins buffer for unit0
509          *
510          * This driver requires:
511          *
512          * Arbitrary Based Buffers:
513          *  Display Bins for unit0
514          *
515          */
516         {
517                 .name   = "DisplayBins0",
518                 .start  = 0x00000000,
519                 .end    = 0x00000FFF,           /* 4 KB total */
520                 .flags  = IORESOURCE_MEM,
521         },
522         /*
523          *
524          * Display bins buffer
525          *
526          * This driver requires:
527          *
528          * Arbitrary Based Buffers:
529          *  Display Bins for unit1
530          *
531          */
532         {
533                 .name   = "DisplayBins1",
534                 .start  = 0x64AD4000,
535                 .end    = 0x64AD5000 - 1,  /* 4 KB total */
536                 .flags  = IORESOURCE_IO,
537         },
538         /*
539          *
540          * AVFS: player HAL memory
541          *
542          *
543          */
544         {
545                 .name   = "AvfsDmaMem",
546                 .start  = 0x6430E000,
547                 .end    = 0x645D2C00 - 1,  /* 945K * 3 for playback */
548                 .flags  = IORESOURCE_IO,
549         },
550         /*
551          *
552          * PMEM
553          *
554          * This driver requires:
555          *
556          * Arbitrary Based Buffers:
557          *  Persistent memory for diagnostics.
558          *
559          */
560         {
561                 .name   = "DiagPersistentMemory",
562                 .start  = 0x00000000,
563                 .end    = 0x10000 - 1,
564                 .flags  = IORESOURCE_MEM,
565         },
566         /*
567          *
568          * Smartcard
569          *
570          * This driver requires:
571          *
572          * Arbitrary Based Buffers:
573          *  Read and write buffers for Internal/External cards
574          *
575          */
576         {
577                 .name   = "SmartCardInfo",
578                 .start  = 0x64AD1000,
579                 .end    = 0x64AD3800 - 1,
580                 .flags  = IORESOURCE_IO,
581         },
582         /*
583          *
584          * KAVNET
585          *    NP Reset Vector - must be of the form xxCxxxxx
586          *         NP Image - must be video bank 1
587          *         NP IPC - must be video bank 2
588          */
589         {
590                 .name   = "NP_Reset_Vector",
591                 .start  = 0x27c00000,
592                 .end    = 0x27c01000 - 1,
593                 .flags  = IORESOURCE_MEM,
594         },
595         {
596                 .name   = "NP_Image",
597                 .start  = 0x27020000,
598                 .end    = 0x27060000 - 1,
599                 .flags  = IORESOURCE_MEM,
600         },
601         {
602                 .name   = "NP_IPC",
603                 .start  = 0x63500000,
604                 .end    = 0x63580000 - 1,
605                 .flags  = IORESOURCE_IO,
606         },
607         { },
608 };