diff options
Diffstat (limited to 'arch/powerpc/platforms/cell/interrupt.h')
-rw-r--r-- | arch/powerpc/platforms/cell/interrupt.h | 97 |
1 files changed, 62 insertions, 35 deletions
diff --git a/arch/powerpc/platforms/cell/interrupt.h b/arch/powerpc/platforms/cell/interrupt.h index 5560a92ec3ab..9ba1d3c17b4b 100644 --- a/arch/powerpc/platforms/cell/interrupt.h +++ b/arch/powerpc/platforms/cell/interrupt.h | |||
@@ -2,48 +2,76 @@ | |||
2 | #define ASM_CELL_PIC_H | 2 | #define ASM_CELL_PIC_H |
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | /* | 4 | /* |
5 | * Mapping of IIC pending bits into per-node | 5 | * Mapping of IIC pending bits into per-node interrupt numbers. |
6 | * interrupt numbers. | ||
7 | * | 6 | * |
8 | * IRQ FF CC SS PP FF CC SS PP Description | 7 | * Interrupt numbers are in the range 0...0x1ff where the top bit |
8 | * (0x100) represent the source node. Only 2 nodes are supported with | ||
9 | * the current code though it's trivial to extend that if necessary using | ||
10 | * higher level bits | ||
9 | * | 11 | * |
10 | * 00-3f 80 02 +0 00 - 80 02 +0 3f South Bridge | 12 | * The bottom 8 bits are split into 2 type bits and 6 data bits that |
11 | * 00-3f 80 02 +b 00 - 80 02 +b 3f South Bridge | 13 | * depend on the type: |
12 | * 41-4a 80 00 +1 ** - 80 00 +a ** SPU Class 0 | ||
13 | * 51-5a 80 01 +1 ** - 80 01 +a ** SPU Class 1 | ||
14 | * 61-6a 80 02 +1 ** - 80 02 +a ** SPU Class 2 | ||
15 | * 70-7f C0 ** ** 00 - C0 ** ** 0f IPI | ||
16 | * | 14 | * |
17 | * F flags | 15 | * 00 (0x00 | data) : normal interrupt. data is (class << 4) | source |
18 | * C class | 16 | * 01 (0x40 | data) : IO exception. data is the exception number as |
19 | * S source | 17 | * defined by bit numbers in IIC_SR |
20 | * P Priority | 18 | * 10 (0x80 | data) : IPI. data is the IPI number (obtained from the priority) |
21 | * + node number | 19 | * and node is always 0 (IPIs are per-cpu, their source is |
22 | * * don't care | 20 | * not relevant) |
21 | * 11 (0xc0 | data) : reserved | ||
23 | * | 22 | * |
24 | * A node consists of a Cell Broadband Engine and an optional | 23 | * In addition, interrupt number 0x80000000 is defined as always invalid |
25 | * south bridge device providing a maximum of 64 IRQs. | 24 | * (that is the node field is expected to never extend to move than 23 bits) |
26 | * The south bridge may be connected to either IOIF0 | ||
27 | * or IOIF1. | ||
28 | * Each SPE is represented as three IRQ lines, one per | ||
29 | * interrupt class. | ||
30 | * 16 IRQ numbers are reserved for inter processor | ||
31 | * interruptions, although these are only used in the | ||
32 | * range of the first node. | ||
33 | * | 25 | * |
34 | * This scheme needs 128 IRQ numbers per BIF node ID, | ||
35 | * which means that with the total of 512 lines | ||
36 | * available, we can have a maximum of four nodes. | ||
37 | */ | 26 | */ |
38 | 27 | ||
39 | enum { | 28 | enum { |
40 | IIC_IRQ_INVALID = 0xff, | 29 | IIC_IRQ_INVALID = 0x80000000u, |
41 | IIC_IRQ_MAX = 0x3f, | 30 | IIC_IRQ_NODE_MASK = 0x100, |
42 | IIC_IRQ_EXT_IOIF0 = 0x20, | 31 | IIC_IRQ_NODE_SHIFT = 8, |
43 | IIC_IRQ_EXT_IOIF1 = 0x2b, | 32 | IIC_IRQ_MAX = 0x1ff, |
44 | IIC_IRQ_IPI0 = 0x40, | 33 | IIC_IRQ_TYPE_MASK = 0xc0, |
45 | IIC_NUM_IPIS = 0x10, /* IRQs reserved for IPI */ | 34 | IIC_IRQ_TYPE_NORMAL = 0x00, |
46 | IIC_SOURCE_COUNT = 0x50, | 35 | IIC_IRQ_TYPE_IOEXC = 0x40, |
36 | IIC_IRQ_TYPE_IPI = 0x80, | ||
37 | IIC_IRQ_CLASS_SHIFT = 4, | ||
38 | IIC_IRQ_CLASS_0 = 0x00, | ||
39 | IIC_IRQ_CLASS_1 = 0x10, | ||
40 | IIC_IRQ_CLASS_2 = 0x20, | ||
41 | IIC_SOURCE_COUNT = 0x200, | ||
42 | |||
43 | /* Here are defined the various source/dest units. Avoid using those | ||
44 | * definitions if you can, they are mostly here for reference | ||
45 | */ | ||
46 | IIC_UNIT_SPU_0 = 0x4, | ||
47 | IIC_UNIT_SPU_1 = 0x7, | ||
48 | IIC_UNIT_SPU_2 = 0x3, | ||
49 | IIC_UNIT_SPU_3 = 0x8, | ||
50 | IIC_UNIT_SPU_4 = 0x2, | ||
51 | IIC_UNIT_SPU_5 = 0x9, | ||
52 | IIC_UNIT_SPU_6 = 0x1, | ||
53 | IIC_UNIT_SPU_7 = 0xa, | ||
54 | IIC_UNIT_IOC_0 = 0x0, | ||
55 | IIC_UNIT_IOC_1 = 0xb, | ||
56 | IIC_UNIT_THREAD_0 = 0xe, /* target only */ | ||
57 | IIC_UNIT_THREAD_1 = 0xf, /* target only */ | ||
58 | IIC_UNIT_IIC = 0xe, /* source only (IO exceptions) */ | ||
59 | |||
60 | /* Base numbers for the external interrupts */ | ||
61 | IIC_IRQ_EXT_IOIF0 = | ||
62 | IIC_IRQ_TYPE_NORMAL | IIC_IRQ_CLASS_2 | IIC_UNIT_IOC_0, | ||
63 | IIC_IRQ_EXT_IOIF1 = | ||
64 | IIC_IRQ_TYPE_NORMAL | IIC_IRQ_CLASS_2 | IIC_UNIT_IOC_1, | ||
65 | |||
66 | /* Base numbers for the IIC_ISR interrupts */ | ||
67 | IIC_IRQ_IOEX_TMI = IIC_IRQ_TYPE_IOEXC | IIC_IRQ_CLASS_1 | 63, | ||
68 | IIC_IRQ_IOEX_PMI = IIC_IRQ_TYPE_IOEXC | IIC_IRQ_CLASS_1 | 62, | ||
69 | IIC_IRQ_IOEX_ATI = IIC_IRQ_TYPE_IOEXC | IIC_IRQ_CLASS_1 | 61, | ||
70 | IIC_IRQ_IOEX_MATBFI = IIC_IRQ_TYPE_IOEXC | IIC_IRQ_CLASS_1 | 60, | ||
71 | IIC_IRQ_IOEX_ELDI = IIC_IRQ_TYPE_IOEXC | IIC_IRQ_CLASS_1 | 59, | ||
72 | |||
73 | /* Which bits in IIC_ISR are edge sensitive */ | ||
74 | IIC_ISR_EDGE_MASK = 0x4ul, | ||
47 | }; | 75 | }; |
48 | 76 | ||
49 | extern void iic_init_IRQ(void); | 77 | extern void iic_init_IRQ(void); |
@@ -52,7 +80,6 @@ extern void iic_request_IPIs(void); | |||
52 | extern void iic_setup_cpu(void); | 80 | extern void iic_setup_cpu(void); |
53 | 81 | ||
54 | extern u8 iic_get_target_id(int cpu); | 82 | extern u8 iic_get_target_id(int cpu); |
55 | extern struct irq_host *iic_get_irq_host(int node); | ||
56 | 83 | ||
57 | extern void spider_init_IRQ(void); | 84 | extern void spider_init_IRQ(void); |
58 | 85 | ||