2 * cx18 System Control Block initialization
4 * Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl>
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.
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.
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., 59 Temple Place, Suite 330, Boston, MA
25 #include "cx18-mailbox.h"
27 /* NOTE: All ACK interrupts are in the SW2 register. All non-ACK interrupts
28 are in the SW1 register. */
30 #define IRQ_APU_TO_CPU 0x00000001
31 #define IRQ_CPU_TO_APU_ACK 0x00000001
32 #define IRQ_HPU_TO_CPU 0x00000002
33 #define IRQ_CPU_TO_HPU_ACK 0x00000002
34 #define IRQ_PPU_TO_CPU 0x00000004
35 #define IRQ_CPU_TO_PPU_ACK 0x00000004
36 #define IRQ_EPU_TO_CPU 0x00000008
37 #define IRQ_CPU_TO_EPU_ACK 0x00000008
39 #define IRQ_CPU_TO_APU 0x00000010
40 #define IRQ_APU_TO_CPU_ACK 0x00000010
41 #define IRQ_HPU_TO_APU 0x00000020
42 #define IRQ_APU_TO_HPU_ACK 0x00000020
43 #define IRQ_PPU_TO_APU 0x00000040
44 #define IRQ_APU_TO_PPU_ACK 0x00000040
45 #define IRQ_EPU_TO_APU 0x00000080
46 #define IRQ_APU_TO_EPU_ACK 0x00000080
48 #define IRQ_CPU_TO_HPU 0x00000100
49 #define IRQ_HPU_TO_CPU_ACK 0x00000100
50 #define IRQ_APU_TO_HPU 0x00000200
51 #define IRQ_HPU_TO_APU_ACK 0x00000200
52 #define IRQ_PPU_TO_HPU 0x00000400
53 #define IRQ_HPU_TO_PPU_ACK 0x00000400
54 #define IRQ_EPU_TO_HPU 0x00000800
55 #define IRQ_HPU_TO_EPU_ACK 0x00000800
57 #define IRQ_CPU_TO_PPU 0x00001000
58 #define IRQ_PPU_TO_CPU_ACK 0x00001000
59 #define IRQ_APU_TO_PPU 0x00002000
60 #define IRQ_PPU_TO_APU_ACK 0x00002000
61 #define IRQ_HPU_TO_PPU 0x00004000
62 #define IRQ_PPU_TO_HPU_ACK 0x00004000
63 #define IRQ_EPU_TO_PPU 0x00008000
64 #define IRQ_PPU_TO_EPU_ACK 0x00008000
66 #define IRQ_CPU_TO_EPU 0x00010000
67 #define IRQ_EPU_TO_CPU_ACK 0x00010000
68 #define IRQ_APU_TO_EPU 0x00020000
69 #define IRQ_EPU_TO_APU_ACK 0x00020000
70 #define IRQ_HPU_TO_EPU 0x00040000
71 #define IRQ_EPU_TO_HPU_ACK 0x00040000
72 #define IRQ_PPU_TO_EPU 0x00080000
73 #define IRQ_EPU_TO_PPU_ACK 0x00080000
75 #define SCB_OFFSET 0xDC0000
77 /* If Firmware uses fixed memory map, it shall not allocate the area
78 between SCB_OFFSET and SCB_OFFSET+SCB_RESERVED_SIZE-1 inclusive */
79 #define SCB_RESERVED_SIZE 0x10000
82 /* This structure is used by EPU to provide memory descriptors in its memory */
84 u32 paddr
; /* Physical address of a buffer segment */
85 u32 length
; /* Length of the buffer segment */
88 /* This structure is used by CPU to provide completed buffers information */
90 u32 id
; /* ID of a completed MDL */
91 u32 data_used
; /* Total data filled in the MDL for buffer 'id' */
95 /* These fields form the System Control Block which is used at boot time
96 for localizing the IPC data as well as the code positions for all
97 processors. The offsets are from the start of this struct. */
99 /* Offset where to find the Inter-Processor Communication data */
102 /* Offset where to find the start of the CPU code */
105 /* Offset where to find the start of the APU code */
108 /* Offset where to find the start of the HPU code */
111 /* Offset where to find the start of the PPU code */
115 /* These fields form Inter-Processor Communication data which is used
116 by all processors to locate the information needed for communicating
117 with other processors */
119 /* Fields for CPU: */
121 /* bit 0: 1/0 processor ready/not ready. Set other bits to 0. */
124 /* Offset to the mailbox used for sending commands from APU to CPU */
125 u32 apu2cpu_mb_offset
;
126 /* Value to write to register SW1 register set (0xC7003100) after the
129 /* Value to write to register SW2 register set (0xC7003140) after the
130 command is cleared */
134 u32 hpu2cpu_mb_offset
;
139 u32 ppu2cpu_mb_offset
;
144 u32 epu2cpu_mb_offset
;
150 /* Fields for APU: */
154 u32 cpu2apu_mb_offset
;
159 u32 hpu2apu_mb_offset
;
164 u32 ppu2apu_mb_offset
;
169 u32 epu2apu_mb_offset
;
175 /* Fields for HPU: */
179 u32 cpu2hpu_mb_offset
;
184 u32 apu2hpu_mb_offset
;
189 u32 ppu2hpu_mb_offset
;
194 u32 epu2hpu_mb_offset
;
200 /* Fields for PPU: */
204 u32 cpu2ppu_mb_offset
;
209 u32 apu2ppu_mb_offset
;
214 u32 hpu2ppu_mb_offset
;
219 u32 epu2ppu_mb_offset
;
225 /* Fields for EPU: */
229 u32 cpu2epu_mb_offset
;
234 u32 apu2epu_mb_offset
;
239 u32 hpu2epu_mb_offset
;
244 u32 ppu2epu_mb_offset
;
250 u32 semaphores
[8]; /* Semaphores */
252 u32 reserved50
[32]; /* Reserved for future use */
254 struct cx18_mailbox apu2cpu_mb
;
255 struct cx18_mailbox hpu2cpu_mb
;
256 struct cx18_mailbox ppu2cpu_mb
;
257 struct cx18_mailbox epu2cpu_mb
;
259 struct cx18_mailbox cpu2apu_mb
;
260 struct cx18_mailbox hpu2apu_mb
;
261 struct cx18_mailbox ppu2apu_mb
;
262 struct cx18_mailbox epu2apu_mb
;
264 struct cx18_mailbox cpu2hpu_mb
;
265 struct cx18_mailbox apu2hpu_mb
;
266 struct cx18_mailbox ppu2hpu_mb
;
267 struct cx18_mailbox epu2hpu_mb
;
269 struct cx18_mailbox cpu2ppu_mb
;
270 struct cx18_mailbox apu2ppu_mb
;
271 struct cx18_mailbox hpu2ppu_mb
;
272 struct cx18_mailbox epu2ppu_mb
;
274 struct cx18_mailbox cpu2epu_mb
;
275 struct cx18_mailbox apu2epu_mb
;
276 struct cx18_mailbox hpu2epu_mb
;
277 struct cx18_mailbox ppu2epu_mb
;
279 struct cx18_mdl_ack cpu_mdl_ack
[CX18_MAX_STREAMS
][2];
280 struct cx18_mdl cpu_mdl
[1];
283 void cx18_init_scb(struct cx18
*cx
);