All of lore.kernel.org
 help / color / mirror / Atom feed
From: r.marek@sh.cvut.cz (Rudolf Marek)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] Asus Z80V/M6V i2c support
Date: Fri, 23 Sep 2005 21:39:02 +0000	[thread overview]
Message-ID: <433459A7.3010605@sh.cvut.cz> (raw)
In-Reply-To: <318b1df00509211647a24cdec@mail.gmail.com>

Micha? Mleczko wrote:
> Hi,
> 
> thank you very much. I am using kernel 2.6.13. Could you give me some
> hints as to where to look for the configuration registers? I would be
> interested to find out more about this.

Hello,

As you pointed out you need to get to that enable register. This register is provided in PCI address space.
To access it you need to its base address. RCBA--Root Complex Base Address Register (page 361) Value in register
is 16KB aligned so it size is also 16KB. Then you just need to map it to address space of procesor. This
can be done via ioremap_nocache. Once mapped you just need to change right bit in right place.
Note that you can access to this register only in 32bit chunks.(so readl/writel should help).

Rest is simple. We will use PCI hostbridge vendor ID to idetify your notebook. When done, we will read
the RCBA base and do the stuff. Code I'm attaching is totally untested but I belive it should work.
Edit it to your taste and let us know if it works for you. If so I will prepare final patch and post it
to kernel. Also it seems we need the GPIO and ACPI iospace quirk too, but this can be done later.

Standard disclaimer: Do not blame us if you blow up your notebook.

Regards

Rudolf
-------------- next part --------------
diff -Naur a/drivers/pci/quirks.c b/drivers/pci/quirks.c
--- a/drivers/pci/quirks.c	2005-09-20 05:00:41.000000000 +0200
+++ b/drivers/pci/quirks.c	2005-09-23 21:36:12.649136000 +0200
@@ -847,6 +847,12 @@
 			case 0x186a: /* M6Ne notebook */
 				asus_hides_smbus = 1;
 			}
+		if (dev->device = PCI_DEVICE_ID_INTEL_82915GM_HB)
+			switch (dev->subsystem_device) {
+			case 0x1882: /* MV6V notebook */
+				asus_hides_smbus = 1;
+			}
+			
 	} else if (unlikely(dev->subsystem_vendor = PCI_VENDOR_ID_HP)) {
 		if (dev->device =  PCI_DEVICE_ID_INTEL_82855PM_HB)
 			switch(dev->subsystem_device) {
@@ -891,6 +897,7 @@
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_7205_0,	asus_hides_smbus_hostbridge );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82855PM_HB,	asus_hides_smbus_hostbridge );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82855GM_HB,	asus_hides_smbus_hostbridge );
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82915GM_HB,	asus_hides_smbus_hostbridge );
 
 static void __init asus_hides_smbus_lpc(struct pci_dev *dev)
 {
@@ -915,6 +922,27 @@
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82801DB_12,	asus_hides_smbus_lpc );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82801EB_0,	asus_hides_smbus_lpc );
 
+static void __init asus_hides_smbus_lpc_ich6(struct pci_dev *dev)
+{
+	u32 val;
+	u32 rcba;
+	void __iomem *base;
+
+	if (likely(!asus_hides_smbus))
+		return;
+	pci_read_config_dword(dev, 0xF0, &rcba);
+	base = ioremap_nocache(rcba,0x4000);
+	printk(KERN_INFO "PCI: Trying to enable ICH6 SMBus. RCBA base 0x%x relocated 0x%x \n",rcba,base);
+	if (base = NULL) return;
+	val=readl(base+0x3418);
+	val&=0xFFFFFFF7;
+	writel(val,base+0x3418);
+	iounmap(rcba);
+	printk(KERN_INFO "PCI: Done. I wrote: %x\n",val);
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_ICH6_1,	asus_hides_smbus_lpc_ich6 );
+
+
 /*
  * SiS 96x south bridge: BIOS typically hides SMBus device...
  */

  parent reply	other threads:[~2005-09-23 21:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-22  1:47 [lm-sensors] Asus Z80V/M6V i2c support Michał Mleczko
2005-09-22  8:12 ` Rudolf Marek
2005-09-22 10:35 ` Michał Mleczko
2005-09-23 21:39 ` Rudolf Marek [this message]
2005-09-24  1:48 ` Michał Mleczko
2005-09-24 12:53 ` Michał Mleczko
2005-09-24 20:40 ` Rudolf Marek
2005-09-24 20:45 ` Michał Mleczko
2005-09-24 21:48 ` Rudolf Marek
2005-09-24 23:19 ` Michał Mleczko
2005-09-25  0:07 ` Rudolf Marek
2005-09-27 15:24 ` Michał Mleczko
2005-09-27 23:34 ` Rudolf Marek

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=433459A7.3010605@sh.cvut.cz \
    --to=r.marek@sh.cvut.cz \
    --cc=lm-sensors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.