]>
Commit | Line | Data |
---|---|---|
1c1e45d1 HV |
1 | /* |
2 | * cx18 System Control Block initialization | |
3 | * | |
4 | * Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl> | |
6afdeaf8 | 5 | * Copyright (C) 2008 Andy Walls <awalls@md.metrocast.net> |
1c1e45d1 HV |
6 | * |
7 | * This program is free software; you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License as published by | |
9 | * the Free Software Foundation; either version 2 of the License, or | |
10 | * (at your option) any later version. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
1c1e45d1 HV |
16 | */ |
17 | ||
18 | #include "cx18-driver.h" | |
b1526421 | 19 | #include "cx18-io.h" |
1c1e45d1 HV |
20 | #include "cx18-scb.h" |
21 | ||
22 | void cx18_init_scb(struct cx18 *cx) | |
23 | { | |
b1526421 AW |
24 | cx18_setup_page(cx, SCB_OFFSET); |
25 | cx18_memset_io(cx, cx->scb, 0, 0x10000); | |
1c1e45d1 | 26 | |
b1526421 AW |
27 | cx18_writel(cx, IRQ_APU_TO_CPU, &cx->scb->apu2cpu_irq); |
28 | cx18_writel(cx, IRQ_CPU_TO_APU_ACK, &cx->scb->cpu2apu_irq_ack); | |
29 | cx18_writel(cx, IRQ_HPU_TO_CPU, &cx->scb->hpu2cpu_irq); | |
30 | cx18_writel(cx, IRQ_CPU_TO_HPU_ACK, &cx->scb->cpu2hpu_irq_ack); | |
31 | cx18_writel(cx, IRQ_PPU_TO_CPU, &cx->scb->ppu2cpu_irq); | |
32 | cx18_writel(cx, IRQ_CPU_TO_PPU_ACK, &cx->scb->cpu2ppu_irq_ack); | |
33 | cx18_writel(cx, IRQ_EPU_TO_CPU, &cx->scb->epu2cpu_irq); | |
34 | cx18_writel(cx, IRQ_CPU_TO_EPU_ACK, &cx->scb->cpu2epu_irq_ack); | |
1c1e45d1 | 35 | |
b1526421 AW |
36 | cx18_writel(cx, IRQ_CPU_TO_APU, &cx->scb->cpu2apu_irq); |
37 | cx18_writel(cx, IRQ_APU_TO_CPU_ACK, &cx->scb->apu2cpu_irq_ack); | |
38 | cx18_writel(cx, IRQ_HPU_TO_APU, &cx->scb->hpu2apu_irq); | |
39 | cx18_writel(cx, IRQ_APU_TO_HPU_ACK, &cx->scb->apu2hpu_irq_ack); | |
40 | cx18_writel(cx, IRQ_PPU_TO_APU, &cx->scb->ppu2apu_irq); | |
41 | cx18_writel(cx, IRQ_APU_TO_PPU_ACK, &cx->scb->apu2ppu_irq_ack); | |
42 | cx18_writel(cx, IRQ_EPU_TO_APU, &cx->scb->epu2apu_irq); | |
43 | cx18_writel(cx, IRQ_APU_TO_EPU_ACK, &cx->scb->apu2epu_irq_ack); | |
1c1e45d1 | 44 | |
b1526421 AW |
45 | cx18_writel(cx, IRQ_CPU_TO_HPU, &cx->scb->cpu2hpu_irq); |
46 | cx18_writel(cx, IRQ_HPU_TO_CPU_ACK, &cx->scb->hpu2cpu_irq_ack); | |
47 | cx18_writel(cx, IRQ_APU_TO_HPU, &cx->scb->apu2hpu_irq); | |
48 | cx18_writel(cx, IRQ_HPU_TO_APU_ACK, &cx->scb->hpu2apu_irq_ack); | |
49 | cx18_writel(cx, IRQ_PPU_TO_HPU, &cx->scb->ppu2hpu_irq); | |
50 | cx18_writel(cx, IRQ_HPU_TO_PPU_ACK, &cx->scb->hpu2ppu_irq_ack); | |
51 | cx18_writel(cx, IRQ_EPU_TO_HPU, &cx->scb->epu2hpu_irq); | |
52 | cx18_writel(cx, IRQ_HPU_TO_EPU_ACK, &cx->scb->hpu2epu_irq_ack); | |
1c1e45d1 | 53 | |
b1526421 AW |
54 | cx18_writel(cx, IRQ_CPU_TO_PPU, &cx->scb->cpu2ppu_irq); |
55 | cx18_writel(cx, IRQ_PPU_TO_CPU_ACK, &cx->scb->ppu2cpu_irq_ack); | |
56 | cx18_writel(cx, IRQ_APU_TO_PPU, &cx->scb->apu2ppu_irq); | |
57 | cx18_writel(cx, IRQ_PPU_TO_APU_ACK, &cx->scb->ppu2apu_irq_ack); | |
58 | cx18_writel(cx, IRQ_HPU_TO_PPU, &cx->scb->hpu2ppu_irq); | |
59 | cx18_writel(cx, IRQ_PPU_TO_HPU_ACK, &cx->scb->ppu2hpu_irq_ack); | |
60 | cx18_writel(cx, IRQ_EPU_TO_PPU, &cx->scb->epu2ppu_irq); | |
61 | cx18_writel(cx, IRQ_PPU_TO_EPU_ACK, &cx->scb->ppu2epu_irq_ack); | |
1c1e45d1 | 62 | |
b1526421 AW |
63 | cx18_writel(cx, IRQ_CPU_TO_EPU, &cx->scb->cpu2epu_irq); |
64 | cx18_writel(cx, IRQ_EPU_TO_CPU_ACK, &cx->scb->epu2cpu_irq_ack); | |
65 | cx18_writel(cx, IRQ_APU_TO_EPU, &cx->scb->apu2epu_irq); | |
66 | cx18_writel(cx, IRQ_EPU_TO_APU_ACK, &cx->scb->epu2apu_irq_ack); | |
67 | cx18_writel(cx, IRQ_HPU_TO_EPU, &cx->scb->hpu2epu_irq); | |
68 | cx18_writel(cx, IRQ_EPU_TO_HPU_ACK, &cx->scb->epu2hpu_irq_ack); | |
69 | cx18_writel(cx, IRQ_PPU_TO_EPU, &cx->scb->ppu2epu_irq); | |
70 | cx18_writel(cx, IRQ_EPU_TO_PPU_ACK, &cx->scb->epu2ppu_irq_ack); | |
1c1e45d1 | 71 | |
b1526421 | 72 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, apu2cpu_mb), |
1c1e45d1 | 73 | &cx->scb->apu2cpu_mb_offset); |
b1526421 | 74 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, hpu2cpu_mb), |
1c1e45d1 | 75 | &cx->scb->hpu2cpu_mb_offset); |
b1526421 | 76 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, ppu2cpu_mb), |
1c1e45d1 | 77 | &cx->scb->ppu2cpu_mb_offset); |
b1526421 | 78 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, epu2cpu_mb), |
1c1e45d1 | 79 | &cx->scb->epu2cpu_mb_offset); |
b1526421 | 80 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, cpu2apu_mb), |
1c1e45d1 | 81 | &cx->scb->cpu2apu_mb_offset); |
b1526421 | 82 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, hpu2apu_mb), |
1c1e45d1 | 83 | &cx->scb->hpu2apu_mb_offset); |
b1526421 | 84 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, ppu2apu_mb), |
1c1e45d1 | 85 | &cx->scb->ppu2apu_mb_offset); |
b1526421 | 86 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, epu2apu_mb), |
1c1e45d1 | 87 | &cx->scb->epu2apu_mb_offset); |
b1526421 | 88 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, cpu2hpu_mb), |
1c1e45d1 | 89 | &cx->scb->cpu2hpu_mb_offset); |
b1526421 | 90 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, apu2hpu_mb), |
1c1e45d1 | 91 | &cx->scb->apu2hpu_mb_offset); |
b1526421 | 92 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, ppu2hpu_mb), |
1c1e45d1 | 93 | &cx->scb->ppu2hpu_mb_offset); |
b1526421 | 94 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, epu2hpu_mb), |
1c1e45d1 | 95 | &cx->scb->epu2hpu_mb_offset); |
b1526421 | 96 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, cpu2ppu_mb), |
1c1e45d1 | 97 | &cx->scb->cpu2ppu_mb_offset); |
b1526421 | 98 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, apu2ppu_mb), |
1c1e45d1 | 99 | &cx->scb->apu2ppu_mb_offset); |
b1526421 | 100 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, hpu2ppu_mb), |
1c1e45d1 | 101 | &cx->scb->hpu2ppu_mb_offset); |
b1526421 | 102 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, epu2ppu_mb), |
1c1e45d1 | 103 | &cx->scb->epu2ppu_mb_offset); |
b1526421 | 104 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, cpu2epu_mb), |
1c1e45d1 | 105 | &cx->scb->cpu2epu_mb_offset); |
b1526421 | 106 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, apu2epu_mb), |
1c1e45d1 | 107 | &cx->scb->apu2epu_mb_offset); |
b1526421 | 108 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, hpu2epu_mb), |
1c1e45d1 | 109 | &cx->scb->hpu2epu_mb_offset); |
b1526421 | 110 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, ppu2epu_mb), |
1c1e45d1 HV |
111 | &cx->scb->ppu2epu_mb_offset); |
112 | ||
b1526421 | 113 | cx18_writel(cx, SCB_OFFSET + offsetof(struct cx18_scb, cpu_state), |
1c1e45d1 HV |
114 | &cx->scb->ipc_offset); |
115 | ||
b1526421 | 116 | cx18_writel(cx, 1, &cx->scb->epu_state); |
1c1e45d1 | 117 | } |