linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tobias Diedrich <ranma@gmx.at>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: [patch] ite8330g pirq router support
Date: Sun, 10 Mar 2002 13:54:39 +0100	[thread overview]
Message-ID: <20020310125439.GA4825@router.ranmachan.dyndns.org> (raw)

This small patch adds support for the pirq router of the ITE8330G
chipset my notebook is using. The pirqmap is probably partly wrong though,
as the BIOS does a very bad job at setting up the irq routing table...

Against 2.4.19-pre2-ac4.

diff -urN linux-2.4.19-pre2-ac4/arch/i386/kernel/pci-irq.c linux-2.4.19-pre2-ac4-ite8330g/arch/i386/kernel/pci-irq.c
--- linux-2.4.19-pre2-ac4/arch/i386/kernel/pci-irq.c	Sun Mar 10 13:26:16 2002
+++ linux-2.4.19-pre2-ac4-ite8330g/arch/i386/kernel/pci-irq.c	Sun Mar 10 13:39:25 2002
@@ -208,6 +208,24 @@
 }
 
 /*
+ * 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
+ */
+static int pirq_ite_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
+{
+	static unsigned char pirqmap[4] = { 1, 0, 2, 3 };
+	return read_config_nybble(router,0x43, pirqmap[pirq-1]);
+}
+
+static int pirq_ite_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq)
+{
+	static unsigned char pirqmap[4] = { 1, 0, 2, 3 };
+	write_config_nybble(router, 0x43, pirqmap[pirq-1], irq);
+	return 1;
+}
+
+/*
  * OPTI: high four bits are nibble pointer..
  * I wonder what the low bits do?
  */
@@ -448,6 +466,8 @@
 	{ "PIIX", PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, pirq_piix_get, pirq_piix_set },
 
 	{ "ALI", PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, pirq_ali_get, pirq_ali_set },
+
+	{ "ITE", PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_IT8330G_0, pirq_ite_get, pirq_ite_set },
 
 	{ "VIA", PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_0, pirq_via_get, pirq_via_set },
 	{ "VIA", PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596, pirq_via_get, pirq_via_set },
diff -urN linux-2.4.19-pre2-ac4/include/linux/pci_ids.h linux-2.4.19-pre2-ac4-ite8330g/include/linux/pci_ids.h
--- linux-2.4.19-pre2-ac4/include/linux/pci_ids.h	Sun Mar 10 13:26:03 2002
+++ linux-2.4.19-pre2-ac4-ite8330g/include/linux/pci_ids.h	Sun Mar 10 13:38:48 2002
@@ -1291,7 +1291,7 @@
 #define PCI_DEVICE_ID_ITE_IT8172G	0x8172
 #define PCI_DEVICE_ID_ITE_IT8172G_AUDIO 0x0801
 #define PCI_DEVICE_ID_ITE_8872		0x8872
-
+#define PCI_DEVICE_ID_ITE_IT8330G_0	0xe886
 
 /* formerly Platform Tech */
 #define PCI_VENDOR_ID_ESS_OLD		0x1285

-- 
Tobias								PGP: 0x9AC7E0BC

                 reply	other threads:[~2002-03-10 12:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020310125439.GA4825@router.ranmachan.dyndns.org \
    --to=ranma@gmx.at \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).