16 #include <linux/types.h>
17 #include <linux/kernel.h>
23 #include <asm/traps.h>
24 #include <asm/bootinfo.h>
38 static void psc_debug_dump(
void)
43 for (i = 0x30 ; i < 0x70 ; i += 0x10) {
44 printk(
"PSC #%d: IFR = 0x%02X IER = 0x%02X\n",
57 static void psc_dma_die_die_die(
void)
61 printk(
"Killing all PSC DMA channels...");
62 for (i = 0 ; i < 9 ; i++) {
98 psc_dma_die_die_die();
107 for (i = 0x30 ; i < 0x70 ; i += 0x10) {
117 static void psc_irq(
unsigned int irq,
struct irq_desc *
desc)
119 unsigned int offset = (
unsigned int)irq_desc_get_handler_data(desc);
123 unsigned char irq_bit,
events;
126 printk(
"psc_irq: irq %u pIFR = 0x%02X pIER = 0x%02X\n",
127 irq, (
int) psc_read_byte(pIFR), (
int) psc_read_byte(pIER));
130 events = psc_read_byte(pIFR) & psc_read_byte(pIER) & 0xF;
137 if (events & irq_bit) {
138 psc_write_byte(pIFR, irq_bit);
143 }
while (events >= irq_bit);
152 irq_set_chained_handler(IRQ_AUTO_3, psc_irq);
154 irq_set_chained_handler(IRQ_AUTO_4, psc_irq);
156 irq_set_chained_handler(IRQ_AUTO_5, psc_irq);
158 irq_set_chained_handler(IRQ_AUTO_6, psc_irq);
165 int pIER =
pIERbase + (irq_src << 4);
168 printk(
"psc_irq_enable(%d)\n", irq);
170 psc_write_byte(pIER, (1 << irq_idx) | 0x80);
176 int pIER =
pIERbase + (irq_src << 4);
179 printk(
"psc_irq_disable(%d)\n", irq);
181 psc_write_byte(pIER, 1 << irq_idx);