Path: blob/master/arch/powerpc/platforms/cell/interrupt.h
10818 views
#ifndef ASM_CELL_PIC_H1#define ASM_CELL_PIC_H2#ifdef __KERNEL__3/*4* Mapping of IIC pending bits into per-node interrupt numbers.5*6* Interrupt numbers are in the range 0...0x1ff where the top bit7* (0x100) represent the source node. Only 2 nodes are supported with8* the current code though it's trivial to extend that if necessary using9* higher level bits10*11* The bottom 8 bits are split into 2 type bits and 6 data bits that12* depend on the type:13*14* 00 (0x00 | data) : normal interrupt. data is (class << 4) | source15* 01 (0x40 | data) : IO exception. data is the exception number as16* defined by bit numbers in IIC_SR17* 10 (0x80 | data) : IPI. data is the IPI number (obtained from the priority)18* and node is always 0 (IPIs are per-cpu, their source is19* not relevant)20* 11 (0xc0 | data) : reserved21*22* In addition, interrupt number 0x80000000 is defined as always invalid23* (that is the node field is expected to never extend to move than 23 bits)24*25*/2627enum {28IIC_IRQ_INVALID = 0x80000000u,29IIC_IRQ_NODE_MASK = 0x100,30IIC_IRQ_NODE_SHIFT = 8,31IIC_IRQ_MAX = 0x1ff,32IIC_IRQ_TYPE_MASK = 0xc0,33IIC_IRQ_TYPE_NORMAL = 0x00,34IIC_IRQ_TYPE_IOEXC = 0x40,35IIC_IRQ_TYPE_IPI = 0x80,36IIC_IRQ_CLASS_SHIFT = 4,37IIC_IRQ_CLASS_0 = 0x00,38IIC_IRQ_CLASS_1 = 0x10,39IIC_IRQ_CLASS_2 = 0x20,40IIC_SOURCE_COUNT = 0x200,4142/* Here are defined the various source/dest units. Avoid using those43* definitions if you can, they are mostly here for reference44*/45IIC_UNIT_SPU_0 = 0x4,46IIC_UNIT_SPU_1 = 0x7,47IIC_UNIT_SPU_2 = 0x3,48IIC_UNIT_SPU_3 = 0x8,49IIC_UNIT_SPU_4 = 0x2,50IIC_UNIT_SPU_5 = 0x9,51IIC_UNIT_SPU_6 = 0x1,52IIC_UNIT_SPU_7 = 0xa,53IIC_UNIT_IOC_0 = 0x0,54IIC_UNIT_IOC_1 = 0xb,55IIC_UNIT_THREAD_0 = 0xe, /* target only */56IIC_UNIT_THREAD_1 = 0xf, /* target only */57IIC_UNIT_IIC = 0xe, /* source only (IO exceptions) */5859/* Base numbers for the external interrupts */60IIC_IRQ_EXT_IOIF0 =61IIC_IRQ_TYPE_NORMAL | IIC_IRQ_CLASS_2 | IIC_UNIT_IOC_0,62IIC_IRQ_EXT_IOIF1 =63IIC_IRQ_TYPE_NORMAL | IIC_IRQ_CLASS_2 | IIC_UNIT_IOC_1,6465/* Base numbers for the IIC_ISR interrupts */66IIC_IRQ_IOEX_TMI = IIC_IRQ_TYPE_IOEXC | IIC_IRQ_CLASS_1 | 63,67IIC_IRQ_IOEX_PMI = IIC_IRQ_TYPE_IOEXC | IIC_IRQ_CLASS_1 | 62,68IIC_IRQ_IOEX_ATI = IIC_IRQ_TYPE_IOEXC | IIC_IRQ_CLASS_1 | 61,69IIC_IRQ_IOEX_MATBFI = IIC_IRQ_TYPE_IOEXC | IIC_IRQ_CLASS_1 | 60,70IIC_IRQ_IOEX_ELDI = IIC_IRQ_TYPE_IOEXC | IIC_IRQ_CLASS_1 | 59,7172/* Which bits in IIC_ISR are edge sensitive */73IIC_ISR_EDGE_MASK = 0x4ul,74};7576extern void iic_init_IRQ(void);77extern void iic_message_pass(int cpu, int msg);78extern void iic_request_IPIs(void);79extern void iic_setup_cpu(void);8081extern u8 iic_get_target_id(int cpu);8283extern void spider_init_IRQ(void);8485extern void iic_set_interrupt_routing(int cpu, int thread, int priority);8687#endif88#endif /* ASM_CELL_PIC_H */899091