diff options
Diffstat (limited to 'arch/mips/tx4938/toshiba_rbtx4938/irq.c')
-rw-r--r-- | arch/mips/tx4938/toshiba_rbtx4938/irq.c | 46 |
1 files changed, 10 insertions, 36 deletions
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/irq.c b/arch/mips/tx4938/toshiba_rbtx4938/irq.c index f00185017e80..4d6a8dc46c76 100644 --- a/arch/mips/tx4938/toshiba_rbtx4938/irq.c +++ b/arch/mips/tx4938/toshiba_rbtx4938/irq.c | |||
@@ -67,24 +67,7 @@ IRQ Device | |||
67 | 63 RBTX4938-IOC/07 SWINT | 67 | 63 RBTX4938-IOC/07 SWINT |
68 | */ | 68 | */ |
69 | #include <linux/init.h> | 69 | #include <linux/init.h> |
70 | #include <linux/kernel.h> | ||
71 | #include <linux/types.h> | ||
72 | #include <linux/mm.h> | ||
73 | #include <linux/swap.h> | ||
74 | #include <linux/ioport.h> | ||
75 | #include <linux/sched.h> | ||
76 | #include <linux/interrupt.h> | 70 | #include <linux/interrupt.h> |
77 | #include <linux/pci.h> | ||
78 | #include <linux/timex.h> | ||
79 | #include <asm/bootinfo.h> | ||
80 | #include <asm/page.h> | ||
81 | #include <asm/io.h> | ||
82 | #include <asm/irq.h> | ||
83 | #include <asm/processor.h> | ||
84 | #include <asm/reboot.h> | ||
85 | #include <asm/time.h> | ||
86 | #include <asm/wbflush.h> | ||
87 | #include <linux/bootmem.h> | ||
88 | #include <asm/tx4938/rbtx4938.h> | 71 | #include <asm/tx4938/rbtx4938.h> |
89 | 72 | ||
90 | static void toshiba_rbtx4938_irq_ioc_enable(unsigned int irq); | 73 | static void toshiba_rbtx4938_irq_ioc_enable(unsigned int irq); |
@@ -99,21 +82,16 @@ static struct irq_chip toshiba_rbtx4938_irq_ioc_type = { | |||
99 | .unmask = toshiba_rbtx4938_irq_ioc_enable, | 82 | .unmask = toshiba_rbtx4938_irq_ioc_enable, |
100 | }; | 83 | }; |
101 | 84 | ||
102 | #define TOSHIBA_RBTX4938_IOC_INTR_ENAB 0xb7f02000 | ||
103 | #define TOSHIBA_RBTX4938_IOC_INTR_STAT 0xb7f0200a | ||
104 | |||
105 | int | 85 | int |
106 | toshiba_rbtx4938_irq_nested(int sw_irq) | 86 | toshiba_rbtx4938_irq_nested(int sw_irq) |
107 | { | 87 | { |
108 | u8 level3; | 88 | u8 level3; |
109 | 89 | ||
110 | level3 = reg_rd08(TOSHIBA_RBTX4938_IOC_INTR_STAT) & 0xff; | 90 | level3 = readb(rbtx4938_imstat_addr); |
111 | if (level3) { | 91 | if (level3) |
112 | /* must use fls so onboard ATA has priority */ | 92 | /* must use fls so onboard ATA has priority */ |
113 | sw_irq = TOSHIBA_RBTX4938_IRQ_IOC_BEG + fls(level3) - 1; | 93 | sw_irq = TOSHIBA_RBTX4938_IRQ_IOC_BEG + fls(level3) - 1; |
114 | } | ||
115 | 94 | ||
116 | wbflush(); | ||
117 | return sw_irq; | 95 | return sw_irq; |
118 | } | 96 | } |
119 | 97 | ||
@@ -144,25 +122,23 @@ toshiba_rbtx4938_irq_ioc_init(void) | |||
144 | static void | 122 | static void |
145 | toshiba_rbtx4938_irq_ioc_enable(unsigned int irq) | 123 | toshiba_rbtx4938_irq_ioc_enable(unsigned int irq) |
146 | { | 124 | { |
147 | volatile unsigned char v; | 125 | unsigned char v; |
148 | 126 | ||
149 | v = TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB); | 127 | v = readb(rbtx4938_imask_addr); |
150 | v |= (1 << (irq - TOSHIBA_RBTX4938_IRQ_IOC_BEG)); | 128 | v |= (1 << (irq - TOSHIBA_RBTX4938_IRQ_IOC_BEG)); |
151 | TX4938_WR08(TOSHIBA_RBTX4938_IOC_INTR_ENAB, v); | 129 | writeb(v, rbtx4938_imask_addr); |
152 | mmiowb(); | 130 | mmiowb(); |
153 | TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB); | ||
154 | } | 131 | } |
155 | 132 | ||
156 | static void | 133 | static void |
157 | toshiba_rbtx4938_irq_ioc_disable(unsigned int irq) | 134 | toshiba_rbtx4938_irq_ioc_disable(unsigned int irq) |
158 | { | 135 | { |
159 | volatile unsigned char v; | 136 | unsigned char v; |
160 | 137 | ||
161 | v = TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB); | 138 | v = readb(rbtx4938_imask_addr); |
162 | v &= ~(1 << (irq - TOSHIBA_RBTX4938_IRQ_IOC_BEG)); | 139 | v &= ~(1 << (irq - TOSHIBA_RBTX4938_IRQ_IOC_BEG)); |
163 | TX4938_WR08(TOSHIBA_RBTX4938_IOC_INTR_ENAB, v); | 140 | writeb(v, rbtx4938_imask_addr); |
164 | mmiowb(); | 141 | mmiowb(); |
165 | TX4938_RD08(TOSHIBA_RBTX4938_IOC_INTR_ENAB); | ||
166 | } | 142 | } |
167 | 143 | ||
168 | void __init arch_init_irq(void) | 144 | void __init arch_init_irq(void) |
@@ -174,14 +150,12 @@ void __init arch_init_irq(void) | |||
174 | /* all IRC interrupt mode are Low Active. */ | 150 | /* all IRC interrupt mode are Low Active. */ |
175 | 151 | ||
176 | /* mask all IOC interrupts */ | 152 | /* mask all IOC interrupts */ |
177 | *rbtx4938_imask_ptr = 0; | 153 | writeb(0, rbtx4938_imask_addr); |
178 | 154 | ||
179 | /* clear SoftInt interrupts */ | 155 | /* clear SoftInt interrupts */ |
180 | *rbtx4938_softint_ptr = 0; | 156 | writeb(0, rbtx4938_softint_addr); |
181 | tx4938_irq_init(); | 157 | tx4938_irq_init(); |
182 | toshiba_rbtx4938_irq_ioc_init(); | 158 | toshiba_rbtx4938_irq_ioc_init(); |
183 | /* Onboard 10M Ether: High Active */ | 159 | /* Onboard 10M Ether: High Active */ |
184 | set_irq_type(RBTX4938_IRQ_ETHER, IRQF_TRIGGER_HIGH); | 160 | set_irq_type(RBTX4938_IRQ_ETHER, IRQF_TRIGGER_HIGH); |
185 | |||
186 | wbflush(); | ||
187 | } | 161 | } |