aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parisc/asp.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/parisc/asp.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/parisc/asp.c')
-rw-r--r--drivers/parisc/asp.c132
1 files changed, 132 insertions, 0 deletions
diff --git a/drivers/parisc/asp.c b/drivers/parisc/asp.c
new file mode 100644
index 000000000000..388609967133
--- /dev/null
+++ b/drivers/parisc/asp.c
@@ -0,0 +1,132 @@
1/*
2 * ASP Device Driver
3 *
4 * (c) Copyright 2000 The Puffin Group Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * by Helge Deller <deller@gmx.de>
12 */
13
14#include <linux/errno.h>
15#include <linux/init.h>
16#include <linux/interrupt.h>
17#include <linux/module.h>
18#include <linux/slab.h>
19#include <linux/types.h>
20#include <asm/io.h>
21#include <asm/led.h>
22
23#include "gsc.h"
24
25#define ASP_GSC_IRQ 3 /* hardcoded interrupt for GSC */
26
27#define ASP_VER_OFFSET 0x20 /* offset of ASP version */
28
29#define ASP_LED_ADDR 0xf0800020
30
31#define VIPER_INT_WORD 0xFFFBF088 /* addr of viper interrupt word */
32
33static struct gsc_asic asp;
34
35static void asp_choose_irq(struct parisc_device *dev, void *ctrl)
36{
37 int irq;
38
39 switch (dev->id.sversion) {
40 case 0x71: irq = 9; break; /* SCSI */
41 case 0x72: irq = 8; break; /* LAN */
42 case 0x73: irq = 1; break; /* HIL */
43 case 0x74: irq = 7; break; /* Centronics */
44 case 0x75: irq = (dev->hw_path == 4) ? 5 : 6; break; /* RS232 */
45 case 0x76: irq = 10; break; /* EISA BA */
46 case 0x77: irq = 11; break; /* Graphics1 */
47 case 0x7a: irq = 13; break; /* Audio (Bushmaster) */
48 case 0x7b: irq = 13; break; /* Audio (Scorpio) */
49 case 0x7c: irq = 3; break; /* FW SCSI */
50 case 0x7d: irq = 4; break; /* FDDI */
51 case 0x7f: irq = 13; break; /* Audio (Outfield) */
52 default: return; /* Unknown */
53 }
54
55 gsc_asic_assign_irq(ctrl, irq, &dev->irq);
56
57 switch (dev->id.sversion) {
58 case 0x73: irq = 2; break; /* i8042 High-priority */
59 case 0x76: irq = 0; break; /* EISA BA */
60 default: return; /* Other */
61 }
62
63 gsc_asic_assign_irq(ctrl, irq, &dev->aux_irq);
64}
65
66/* There are two register ranges we're interested in. Interrupt /
67 * Status / LED are at 0xf080xxxx and Asp special registers are at
68 * 0xf082fxxx. PDC only tells us that Asp is at 0xf082f000, so for
69 * the purposes of interrupt handling, we have to tell other bits of
70 * the kernel to look at the other registers.
71 */
72#define ASP_INTERRUPT_ADDR 0xf0800000
73
74int __init
75asp_init_chip(struct parisc_device *dev)
76{
77 struct gsc_irq gsc_irq;
78 int ret;
79
80 asp.version = gsc_readb(dev->hpa + ASP_VER_OFFSET) & 0xf;
81 asp.name = (asp.version == 1) ? "Asp" : "Cutoff";
82 asp.hpa = ASP_INTERRUPT_ADDR;
83
84 printk(KERN_INFO "%s version %d at 0x%lx found.\n",
85 asp.name, asp.version, dev->hpa);
86
87 /* the IRQ ASP should use */
88 ret = -EBUSY;
89 dev->irq = gsc_claim_irq(&gsc_irq, ASP_GSC_IRQ);
90 if (dev->irq < 0) {
91 printk(KERN_ERR "%s(): cannot get GSC irq\n", __FUNCTION__);
92 goto out;
93 }
94
95 asp.eim = ((u32) gsc_irq.txn_addr) | gsc_irq.txn_data;
96
97 ret = request_irq(gsc_irq.irq, gsc_asic_intr, 0, "asp", &asp);
98 if (ret < 0)
99 goto out;
100
101 /* Program VIPER to interrupt on the ASP irq */
102 gsc_writel((1 << (31 - ASP_GSC_IRQ)),VIPER_INT_WORD);
103
104 /* Done init'ing, register this driver */
105 ret = gsc_common_setup(dev, &asp);
106 if (ret)
107 goto out;
108
109 gsc_fixup_irqs(dev, &asp, asp_choose_irq);
110 /* Mongoose is a sibling of Asp, not a child... */
111 gsc_fixup_irqs(parisc_parent(dev), &asp, asp_choose_irq);
112
113 /* initialize the chassis LEDs */
114#ifdef CONFIG_CHASSIS_LCD_LED
115 register_led_driver(DISPLAY_MODEL_OLD_ASP, LED_CMD_REG_NONE,
116 ASP_LED_ADDR);
117#endif
118
119 out:
120 return ret;
121}
122
123static struct parisc_device_id asp_tbl[] = {
124 { HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00070 },
125 { 0, }
126};
127
128struct parisc_driver asp_driver = {
129 .name = "Asp",
130 .id_table = asp_tbl,
131 .probe = asp_init_chip,
132};