summaryrefslogtreecommitdiffstats
path: root/arch/i386/pci
diff options
context:
space:
mode:
authorAleksey Gorelov <Aleksey_Gorelov@Phoenix.com>2005-06-23 00:08:29 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-23 09:45:11 -0700
commit80bb82afea9eeb94ae3bfed418d079930da5d3b3 (patch)
treebc02d1f85c2c3c227b9cfbef51d708f988b71156 /arch/i386/pci
parentc434b7a6aedfe428ad17cd61b21b125a7b7a29ce (diff)
downloadop-kernel-dev-80bb82afea9eeb94ae3bfed418d079930da5d3b3.zip
op-kernel-dev-80bb82afea9eeb94ae3bfed418d079930da5d3b3.tar.gz
[PATCH] VIA 82C586B IRQ routing fix
According to the VIA 82C586B datasheet (still available from http://gkernel.sourceforge.net/specs/via/586b.pdf.bz2) this chip need a special PIRQ mapping. Signed-off-by: Karsten Keil <kkeil@suse.de> Signed-off-by: Aleksey Gorelov <aleksey_gorelov@phoenix.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/pci')
-rw-r--r--arch/i386/pci/irq.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index da21b1d..83458f8 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -227,6 +227,24 @@ static int pirq_via_set(struct pci_dev *router, struct pci_dev *dev, int pirq, i
}
/*
+ * The VIA pirq rules are nibble-based, like ALI,
+ * but without the ugly irq number munging.
+ * However, for 82C586, nibble map is different .
+ */
+static int pirq_via586_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
+{
+ static unsigned int pirqmap[4] = { 3, 2, 5, 1 };
+ return read_config_nybble(router, 0x55, pirqmap[pirq-1]);
+}
+
+static int pirq_via586_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq)
+{
+ static unsigned int pirqmap[4] = { 3, 2, 5, 1 };
+ write_config_nybble(router, 0x55, pirqmap[pirq-1], irq);
+ return 1;
+}
+
+/*
* ITE 8330G pirq rules are nibble-based
* FIXME: pirqmap may be { 1, 0, 3, 2 },
* 2+3 are both mapped to irq 9 on my system
@@ -512,6 +530,10 @@ static __init int via_router_probe(struct irq_router *r, struct pci_dev *router,
switch(device)
{
case PCI_DEVICE_ID_VIA_82C586_0:
+ r->name = "VIA";
+ r->get = pirq_via586_get;
+ r->set = pirq_via586_set;
+ return 1;
case PCI_DEVICE_ID_VIA_82C596:
case PCI_DEVICE_ID_VIA_82C686:
case PCI_DEVICE_ID_VIA_8231:
OpenPOWER on IntegriCloud