LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Mikko Tiihonen <mikko.tiihonen@iki.fi>
To: nicolas.mailhot@laposte.net
Cc: linux-kernel@vger.kernel.org
Subject: RE: [PATCH 1/5] RT kernel: force detect HPET from PCI space
Date: Sat, 31 Mar 2007 01:09:00 +0300 (EEST)	[thread overview]
Message-ID: <Pine.OSF.4.64.0703310049090.412261@kosh.hut.fi> (raw)


> Anyone got the same thing for CK804? I had my hopes high, and then I saw
> the DECLARE_PCI_FIXUP_HEADER values [and the thread title was misleading]

I have an A8N-E motherboard with AthlonX2 and the ACPI definitions are 
missing the HPET (standard feature of Asus motherboards).

I too got interested to get my motherboard working. Luckily I found this 
http://lkml.org/lkml/2006/12/17/69 from which I generated the following patch:

--- arch/i386/kernel/quirks.c.orig	2007-03-30 23:43:06.000000000 +0300
+++ arch/i386/kernel/quirks.c	2007-03-30 23:26:47.000000000 +0300
@@ -101,5 +101,39 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_ICH7_1,     force_enable_hpet);
  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_ICH7_31,     force_enable_hpet);
  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_ICH8_1,     force_enable_hpet);
+
+static void __init force_enable_nvidia_hpet(struct pci_dev *dev)
+{
+        u8 enabled;
+	u32 addr;
+
+	if (hpet_address)
+		return;
+
+	pci_read_config_dword(dev, 0x44, &addr);
+	if (addr != 0xfefff000L) {
+		printk(KERN_INFO "Unsafe HPET address 0x%08x. Cannot force enable HPET\n", addr);
+		return;
+	}
+
+	pci_read_config_byte(dev, 0xA3, &enabled);
+	if ((enabled & 4) == 0) {
+	        if (enabled != 0xc1) {
+		  printk(KERN_INFO "Unsafe HPET enable 0x%02x. Cannot force enable HPET\n", enabled);
+		  return;
+		}
+		pci_write_config_byte(dev, 0xA3, enabled | 4);
+		pci_read_config_byte(dev, 0xA3, &enabled);
+		if ((enabled & 4) == 0) {
+			printk(KERN_INFO "Failed to force enable HPET\n");
+			return;
+		}
+	}
+
+	force_hpet_address = addr;
+	printk(KERN_INFO "Force enabled HPET. Base address 0x%08lx\n", force_hpet_address);
+}
+
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA,	0x0050,     force_enable_nvidia_hpet); // NForce4
  #endif

Now Linux seems to detect HPET and it passes at least the basic sanity checks:

Force enabled HPET. Base address 0xfefff000
HPET: hpet_period 40000000, hpet_tick 83333
Successfully registered HPET clocksource

Unfortunately the 2.6.20-mm2 kernel to which I tried to patch the patch series 
seems to hang few seconds later after half way in udev startup event 
processing.

It could either be something totally different in 2.6.20-mm2 that just happens 
to fail or more likely some interrupt setup that still needs to be done.

I have no idea how to continue from here.

-Mikko

             reply	other threads:[~2007-03-30 22:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-30 22:09 Mikko Tiihonen [this message]
2007-03-30 22:38 ` [PATCH 1/5] RT kernel: force detect HPET from PCI space Nicolas Mailhot
2007-03-31  8:00   ` Mikko Tiihonen
2007-03-31 10:37   ` Krzysztof Halasa
2007-03-31 11:36     ` Nicolas Mailhot
2007-03-31 15:00       ` Mikko Tiihonen
  -- strict thread matches above, loose matches on Subject: below --
2007-03-30 16:50 Nicolas Mailhot
2007-03-30 16:59 ` Venki Pallipadi
2007-03-30 17:22   ` Nicolas Mailhot
2007-02-23  1:06 Venkatesh Pallipadi
2007-03-30  9:46 ` Ingo Molnar
2007-03-30 13:36   ` Pallipadi, Venkatesh

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=Pine.OSF.4.64.0703310049090.412261@kosh.hut.fi \
    --to=mikko.tiihonen@iki.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.mailhot@laposte.net \
    /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).