1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * cx18 System Control Block initialization
5 * Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl>
6 * Copyright (C) 2008 Andy Walls <awalls@md.metrocast.net>
12 #include "cx18-mailbox.h"
14 /* NOTE: All ACK interrupts are in the SW2 register. All non-ACK interrupts
15 are in the SW1 register. */
17 #define IRQ_APU_TO_CPU 0x00000001
18 #define IRQ_CPU_TO_APU_ACK 0x00000001
19 #define IRQ_HPU_TO_CPU 0x00000002
20 #define IRQ_CPU_TO_HPU_ACK 0x00000002
21 #define IRQ_PPU_TO_CPU 0x00000004
22 #define IRQ_CPU_TO_PPU_ACK 0x00000004
23 #define IRQ_EPU_TO_CPU 0x00000008
24 #define IRQ_CPU_TO_EPU_ACK 0x00000008
26 #define IRQ_CPU_TO_APU 0x00000010
27 #define IRQ_APU_TO_CPU_ACK 0x00000010
28 #define IRQ_HPU_TO_APU 0x00000020
29 #define IRQ_APU_TO_HPU_ACK 0x00000020
30 #define IRQ_PPU_TO_APU 0x00000040
31 #define IRQ_APU_TO_PPU_ACK 0x00000040
32 #define IRQ_EPU_TO_APU 0x00000080
33 #define IRQ_APU_TO_EPU_ACK 0x00000080
35 #define IRQ_CPU_TO_HPU 0x00000100
36 #define IRQ_HPU_TO_CPU_ACK 0x00000100
37 #define IRQ_APU_TO_HPU 0x00000200
38 #define IRQ_HPU_TO_APU_ACK 0x00000200
39 #define IRQ_PPU_TO_HPU 0x00000400
40 #define IRQ_HPU_TO_PPU_ACK 0x00000400
41 #define IRQ_EPU_TO_HPU 0x00000800
42 #define IRQ_HPU_TO_EPU_ACK 0x00000800
44 #define IRQ_CPU_TO_PPU 0x00001000
45 #define IRQ_PPU_TO_CPU_ACK 0x00001000
46 #define IRQ_APU_TO_PPU 0x00002000
47 #define IRQ_PPU_TO_APU_ACK 0x00002000
48 #define IRQ_HPU_TO_PPU 0x00004000
49 #define IRQ_PPU_TO_HPU_ACK 0x00004000
50 #define IRQ_EPU_TO_PPU 0x00008000
51 #define IRQ_PPU_TO_EPU_ACK 0x00008000
53 #define IRQ_CPU_TO_EPU 0x00010000
54 #define IRQ_EPU_TO_CPU_ACK 0x00010000
55 #define IRQ_APU_TO_EPU 0x00020000
56 #define IRQ_EPU_TO_APU_ACK 0x00020000
57 #define IRQ_HPU_TO_EPU 0x00040000
58 #define IRQ_EPU_TO_HPU_ACK 0x00040000
59 #define IRQ_PPU_TO_EPU 0x00080000
60 #define IRQ_EPU_TO_PPU_ACK 0x00080000
62 #define SCB_OFFSET 0xDC0000
64 /* If Firmware uses fixed memory map, it shall not allocate the area
65 between SCB_OFFSET and SCB_OFFSET+SCB_RESERVED_SIZE-1 inclusive */
66 #define SCB_RESERVED_SIZE 0x10000
69 /* This structure is used by EPU to provide memory descriptors in its memory */
71 u32 paddr
; /* Physical address of a buffer segment */
72 u32 length
; /* Length of the buffer segment */
76 /* These fields form the System Control Block which is used at boot time
77 for localizing the IPC data as well as the code positions for all
78 processors. The offsets are from the start of this struct. */
80 /* Offset where to find the Inter-Processor Communication data */
83 /* Offset where to find the start of the CPU code */
86 /* Offset where to find the start of the APU code */
89 /* Offset where to find the start of the HPU code */
92 /* Offset where to find the start of the PPU code */
96 /* These fields form Inter-Processor Communication data which is used
97 by all processors to locate the information needed for communicating
98 with other processors */
100 /* Fields for CPU: */
102 /* bit 0: 1/0 processor ready/not ready. Set other bits to 0. */
105 /* Offset to the mailbox used for sending commands from APU to CPU */
106 u32 apu2cpu_mb_offset
;
107 /* Value to write to register SW1 register set (0xC7003100) after the
110 /* Value to write to register SW2 register set (0xC7003140) after the
111 command is cleared */
115 u32 hpu2cpu_mb_offset
;
120 u32 ppu2cpu_mb_offset
;
125 u32 epu2cpu_mb_offset
;
131 /* Fields for APU: */
135 u32 cpu2apu_mb_offset
;
140 u32 hpu2apu_mb_offset
;
145 u32 ppu2apu_mb_offset
;
150 u32 epu2apu_mb_offset
;
156 /* Fields for HPU: */
160 u32 cpu2hpu_mb_offset
;
165 u32 apu2hpu_mb_offset
;
170 u32 ppu2hpu_mb_offset
;
175 u32 epu2hpu_mb_offset
;
181 /* Fields for PPU: */
185 u32 cpu2ppu_mb_offset
;
190 u32 apu2ppu_mb_offset
;
195 u32 hpu2ppu_mb_offset
;
200 u32 epu2ppu_mb_offset
;
206 /* Fields for EPU: */
210 u32 cpu2epu_mb_offset
;
215 u32 apu2epu_mb_offset
;
220 u32 hpu2epu_mb_offset
;
225 u32 ppu2epu_mb_offset
;
231 u32 semaphores
[8]; /* Semaphores */
233 u32 reserved50
[32]; /* Reserved for future use */
235 struct cx18_mailbox apu2cpu_mb
;
236 struct cx18_mailbox hpu2cpu_mb
;
237 struct cx18_mailbox ppu2cpu_mb
;
238 struct cx18_mailbox epu2cpu_mb
;
240 struct cx18_mailbox cpu2apu_mb
;
241 struct cx18_mailbox hpu2apu_mb
;
242 struct cx18_mailbox ppu2apu_mb
;
243 struct cx18_mailbox epu2apu_mb
;
245 struct cx18_mailbox cpu2hpu_mb
;
246 struct cx18_mailbox apu2hpu_mb
;
247 struct cx18_mailbox ppu2hpu_mb
;
248 struct cx18_mailbox epu2hpu_mb
;
250 struct cx18_mailbox cpu2ppu_mb
;
251 struct cx18_mailbox apu2ppu_mb
;
252 struct cx18_mailbox hpu2ppu_mb
;
253 struct cx18_mailbox epu2ppu_mb
;
255 struct cx18_mailbox cpu2epu_mb
;
256 struct cx18_mailbox apu2epu_mb
;
257 struct cx18_mailbox hpu2epu_mb
;
258 struct cx18_mailbox ppu2epu_mb
;
260 struct cx18_mdl_ack cpu_mdl_ack
[CX18_MAX_STREAMS
][CX18_MAX_MDL_ACKS
];
261 struct cx18_mdl_ent cpu_mdl
[1];
264 void cx18_init_scb(struct cx18
*cx
);