This source file includes following definitions.
- toshiba_rbtx4938_irq_nested
- toshiba_rbtx4938_irq_ioc_enable
- toshiba_rbtx4938_irq_ioc_disable
- rbtx4938_irq_dispatch
- toshiba_rbtx4938_irq_ioc_init
- rbtx4938_irq_setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65 #include <linux/init.h>
66 #include <linux/interrupt.h>
67 #include <linux/irq.h>
68 #include <asm/mipsregs.h>
69 #include <asm/txx9/generic.h>
70 #include <asm/txx9/rbtx4938.h>
71
72 static int toshiba_rbtx4938_irq_nested(int sw_irq)
73 {
74 u8 level3;
75
76 level3 = readb(rbtx4938_imstat_addr);
77 if (unlikely(!level3))
78 return -1;
79
80 return RBTX4938_IRQ_IOC + __fls8(level3);
81 }
82
83 static void toshiba_rbtx4938_irq_ioc_enable(struct irq_data *d)
84 {
85 unsigned char v;
86
87 v = readb(rbtx4938_imask_addr);
88 v |= (1 << (d->irq - RBTX4938_IRQ_IOC));
89 writeb(v, rbtx4938_imask_addr);
90 mmiowb();
91 }
92
93 static void toshiba_rbtx4938_irq_ioc_disable(struct irq_data *d)
94 {
95 unsigned char v;
96
97 v = readb(rbtx4938_imask_addr);
98 v &= ~(1 << (d->irq - RBTX4938_IRQ_IOC));
99 writeb(v, rbtx4938_imask_addr);
100 mmiowb();
101 }
102
103 #define TOSHIBA_RBTX4938_IOC_NAME "RBTX4938-IOC"
104 static struct irq_chip toshiba_rbtx4938_irq_ioc_type = {
105 .name = TOSHIBA_RBTX4938_IOC_NAME,
106 .irq_mask = toshiba_rbtx4938_irq_ioc_disable,
107 .irq_unmask = toshiba_rbtx4938_irq_ioc_enable,
108 };
109
110 static int rbtx4938_irq_dispatch(int pending)
111 {
112 int irq;
113
114 if (pending & STATUSF_IP7)
115 irq = MIPS_CPU_IRQ_BASE + 7;
116 else if (pending & STATUSF_IP2) {
117 irq = txx9_irq();
118 if (irq == RBTX4938_IRQ_IOCINT)
119 irq = toshiba_rbtx4938_irq_nested(irq);
120 } else if (pending & STATUSF_IP1)
121 irq = MIPS_CPU_IRQ_BASE + 0;
122 else if (pending & STATUSF_IP0)
123 irq = MIPS_CPU_IRQ_BASE + 1;
124 else
125 irq = -1;
126 return irq;
127 }
128
129 static void __init toshiba_rbtx4938_irq_ioc_init(void)
130 {
131 int i;
132
133 for (i = RBTX4938_IRQ_IOC;
134 i < RBTX4938_IRQ_IOC + RBTX4938_NR_IRQ_IOC; i++)
135 irq_set_chip_and_handler(i, &toshiba_rbtx4938_irq_ioc_type,
136 handle_level_irq);
137
138 irq_set_chained_handler(RBTX4938_IRQ_IOCINT, handle_simple_irq);
139 }
140
141 void __init rbtx4938_irq_setup(void)
142 {
143 txx9_irq_dispatch = rbtx4938_irq_dispatch;
144
145
146
147
148
149 writeb(0, rbtx4938_imask_addr);
150
151
152 writeb(0, rbtx4938_softint_addr);
153 tx4938_irq_init();
154 toshiba_rbtx4938_irq_ioc_init();
155
156 irq_set_irq_type(RBTX4938_IRQ_ETHER, IRQF_TRIGGER_HIGH);
157 }