* nVidia HPET force enable - merge requirements? (resend) @ 2007-10-19 3:23 Carlos Corbacho 2007-10-19 6:50 ` Thomas Gleixner 0 siblings, 1 reply; 9+ messages in thread From: Carlos Corbacho @ 2007-10-19 3:23 UTC (permalink / raw) To: linux-kernel; +Cc: Mikko Tiihonen, Thomas Gleixner, Venkatesh Pallipadi (Resend with CC's fixed) Back in April, Mikko posted a patch to force enable the HPET on some nVidia chipsets: v2: http://lkml.org/lkml/2007/4/16/46 v3: http://lkml.org/lkml/2007/4/17/354 What would need to be done to this patch to get it into x86 now (besides i386/ x86_64 -> x86 conversion), given that: A) There is now a force_hpet boot parameter in the x86 tree (mm branch) (rather than relying on the solution in the earlier patches of a config option). B) On the other hand, the force-quirk's are going into quirks.c, whilst Mikko's patch requires PCI scanning in early_quirks.c (could the PCI scanning be done in early_quirks.c and the actual HPET enabling handled in quirks.c later - or if not, could this early quirk play be made to obey the force_hpet boot option)? -Carlos -- E-Mail: cathectic@gmail.com Web: strangeworlds.co.uk GPG Key ID: 0x23EE722D ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nVidia HPET force enable - merge requirements? (resend) 2007-10-19 3:23 nVidia HPET force enable - merge requirements? (resend) Carlos Corbacho @ 2007-10-19 6:50 ` Thomas Gleixner 2007-10-19 15:29 ` Carlos Corbacho 0 siblings, 1 reply; 9+ messages in thread From: Thomas Gleixner @ 2007-10-19 6:50 UTC (permalink / raw) To: Carlos Corbacho; +Cc: linux-kernel, Mikko Tiihonen, Venkatesh Pallipadi On Fri, 19 Oct 2007, Carlos Corbacho wrote: > Back in April, Mikko posted a patch to force enable the HPET on some nVidia > chipsets: > > A) There is now a force_hpet boot parameter in the x86 tree (mm branch) > (rather than relying on the solution in the earlier patches of a config > option). There is still a config option for hpet. the hpet=force boot param is there to allow force enable hpet for not documented chip set features. > B) On the other hand, the force-quirk's are going into quirks.c, whilst > Mikko's patch requires PCI scanning in early_quirks.c (could the PCI scanning > be done in early_quirks.c and the actual HPET enabling handled in quirks.c > later - or if not, could this early quirk play be made to obey the force_hpet > boot option)? It's not necessary to scan in early_quirks.c at all. The force hpet code handles the late DECLARE_PCI_FIXUP_HEADER() based detection just fine. So if there are working quirks, please refactor them analogous to the existing ones in quirks.c. All undocumented chipset poking needs to be protected by the hpet=force boot option, so the default is not to do scan for it. Thanks, tglx ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nVidia HPET force enable - merge requirements? (resend) 2007-10-19 6:50 ` Thomas Gleixner @ 2007-10-19 15:29 ` Carlos Corbacho 2007-10-19 16:19 ` Thomas Gleixner 0 siblings, 1 reply; 9+ messages in thread From: Carlos Corbacho @ 2007-10-19 15:29 UTC (permalink / raw) To: Thomas Gleixner; +Cc: linux-kernel, Mikko Tiihonen, Venkatesh Pallipadi Thomas, On Friday 19 October 2007 07:50:08 Thomas Gleixner wrote: > So if there are working quirks, please refactor them analogous to the > existing ones in quirks.c. > > All undocumented chipset poking needs to be protected by the > hpet=force boot option, so the default is not to do scan for it. Would the following patch be more acceptable then? I've limited the device id's to just the nForce 4 chipset, because that's the only one I have here to test with at the moment - it appears to work fine: hpet clockevent registered hpet0: at MMIO 0xfefff000, IRQs 2, 8, 31 hpet0: 3 32-bit timers, 25000000 Hz Time: hpet clocksource has been installed. Switched to high resolution mode on CPU 0 Switched to high resolution mode on CPU 1 At the moment, I'm not clear on how to detect if the HPET has not been enabled by the BIOS (but given that this is hidden behind hpet=force, would this be acceptable, since the user would have to explicitly call hpet=force, and then it either works or doesn't?) -Carlos diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c index a4ce191..7c772bf 100644 --- a/arch/x86/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c @@ -321,6 +321,26 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, vt8237_force_enable_hpet); +static void nvidia_force_enable_hpet(struct pci_dev *dev) +{ + u32 uninitialized_var(val); + + if (!hpet_force_user || hpet_address || force_hpet_address) + return; + + pci_read_config_dword(dev, 0x44, &val); + force_hpet_address = val; + printk(KERN_DEBUG "Force enabled HPET at base address 0x%lx\n", + force_hpet_address); + cached_dev = dev; + return; +} + +/* ISA Bridge */ +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0050, + nvidia_force_enable_hpet); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0051, + nvidia_force_enable_hpet); void force_hpet_resume(void) { ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nVidia HPET force enable - merge requirements? (resend) 2007-10-19 15:29 ` Carlos Corbacho @ 2007-10-19 16:19 ` Thomas Gleixner 2007-10-19 17:51 ` [PATCH] x86: Force enable HPET for CK804 (nForce 4) chipsets Carlos Corbacho 0 siblings, 1 reply; 9+ messages in thread From: Thomas Gleixner @ 2007-10-19 16:19 UTC (permalink / raw) To: Carlos Corbacho; +Cc: linux-kernel, Mikko Tiihonen, Venkatesh Pallipadi On Fri, 19 Oct 2007, Carlos Corbacho wrote: > Would the following patch be more acceptable then? I've limited the device > id's to just the nForce 4 chipset, because that's the only one I have here > to test with at the moment - it appears to work fine: Yes, looks good. It is just missing the resume part, which is necessary to reenable the hpet after suspend/resume. > hpet clockevent registered > hpet0: at MMIO 0xfefff000, IRQs 2, 8, 31 > hpet0: 3 32-bit timers, 25000000 Hz > Time: hpet clocksource has been installed. > Switched to high resolution mode on CPU 0 > Switched to high resolution mode on CPU 1 > > At the moment, I'm not clear on how to detect if the HPET has not been > enabled by the BIOS (but given that this is hidden behind hpet=force, > would this be acceptable, since the user would have to explicitly call > hpet=force, and then it either works or doesn't?) Don't worry. If HPET is enabled in the BIOS, then we have an hpet_address already before we come into the force enable quirk. That's why we check for hpet_address in the quirk code. tglx ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] x86: Force enable HPET for CK804 (nForce 4) chipsets 2007-10-19 16:19 ` Thomas Gleixner @ 2007-10-19 17:51 ` Carlos Corbacho 2007-10-19 17:58 ` Thomas Gleixner 0 siblings, 1 reply; 9+ messages in thread From: Carlos Corbacho @ 2007-10-19 17:51 UTC (permalink / raw) To: Thomas Gleixner; +Cc: linux-kernel, Mikko Tiihonen, Venkatesh Pallipadi From: Carlos Corbacho <cathectic@gmail.com> This patch adds a quirk from LinuxBIOS to force enable HPET on the nVidia CK804 (nForce 4) chipset. This quirk can very likely support more than just nForce 4 (LinuxBIOS use the same code for nForce 5), and possibly nForce 3, but I don't have those chipsets, so cannot add and test them. Tested on an Abit KN9 (CK804). Signed-off-by: Carlos Corbacho <cathectic@gmail.com> --- Thomas, I've rewritten the code based on what LinuxBIOS does, since they have a better idea of how to drive the HPET than I do. I've tested this code, and it's also working fine here on my system. Documentation/kernel-parameters.txt | 3 +- arch/x86/kernel/quirks.c | 36 ++++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 983f631..8abbfe6 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -434,7 +434,8 @@ and is between 256 and 4096 characters. It is defined in the file hpet= [X86-32,HPET] option to control HPET usage Format: { enable (default) | disable | force } disable: disable HPET and use PIT instead - force: allow force enabled of undocumented chips (ICH4, VIA) + force: allow force enabled of undocumented chips (ICH4, + VIA, nVidia) com20020= [HW,NET] ARCnet - COM20020 chipset Format: diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c index a4ce191..cb21bcb 100644 --- a/arch/x86/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c @@ -60,7 +60,8 @@ static enum { NONE_FORCE_HPET_RESUME, OLD_ICH_FORCE_HPET_RESUME, ICH_FORCE_HPET_RESUME, - VT8237_FORCE_HPET_RESUME + VT8237_FORCE_HPET_RESUME, + NVIDIA_FORCE_HPET_RESUME, } force_hpet_resume_type; static void __iomem *rcba_base; @@ -321,6 +322,36 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, vt8237_force_enable_hpet); +/* + * Undocumented chipset feature taken from LinuxBIOS. + */ +static void nvidia_force_hpet_resume(void) +{ + pci_write_config_dword(cached_dev, 0x44, 0xfed00001); + printk(KERN_DEBUG "Force enabled HPET at resume\n"); +} + +static void nvidia_force_enable_hpet(struct pci_dev *dev) +{ + u32 uninitialized_var(val); + + if (!hpet_force_user || hpet_address || force_hpet_address) + return; + + pci_write_config_dword(dev, 0x44, 0xfed00001); + pci_read_config_dword(dev, 0x44, &val); + force_hpet_address = val & 0xfffffffe; + printk(KERN_DEBUG "Force enabled HPET at base address 0x%lx\n", + force_hpet_address); + cached_dev = dev; + return; +} + +/* ISA Bridges */ +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0050, + nvidia_force_enable_hpet); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0051, + nvidia_force_enable_hpet); void force_hpet_resume(void) { @@ -334,6 +365,9 @@ void force_hpet_resume(void) case VT8237_FORCE_HPET_RESUME: return vt8237_force_hpet_resume(); + case NVIDIA_FORCE_HPET_RESUME: + return nvidia_force_hpet_resume(); + default: break; } -- 1.5.2.2 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] x86: Force enable HPET for CK804 (nForce 4) chipsets 2007-10-19 17:51 ` [PATCH] x86: Force enable HPET for CK804 (nForce 4) chipsets Carlos Corbacho @ 2007-10-19 17:58 ` Thomas Gleixner 2007-10-19 18:07 ` [PATCH] x86: Fix resume for nVidia and force_hpet Carlos Corbacho 0 siblings, 1 reply; 9+ messages in thread From: Thomas Gleixner @ 2007-10-19 17:58 UTC (permalink / raw) To: Carlos Corbacho; +Cc: linux-kernel, Mikko Tiihonen, Venkatesh Pallipadi On Fri, 19 Oct 2007, Carlos Corbacho wrote: > From: Carlos Corbacho <cathectic@gmail.com> > > This patch adds a quirk from LinuxBIOS to force enable HPET on > the nVidia CK804 (nForce 4) chipset. > > This quirk can very likely support more than just nForce 4 > (LinuxBIOS use the same code for nForce 5), and possibly nForce 3, > but I don't have those chipsets, so cannot add and test them. > > Tested on an Abit KN9 (CK804). > > Signed-off-by: Carlos Corbacho <cathectic@gmail.com> Applied. Thanks, tglx ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] x86: Fix resume for nVidia and force_hpet 2007-10-19 17:58 ` Thomas Gleixner @ 2007-10-19 18:07 ` Carlos Corbacho 2007-10-19 18:15 ` Thomas Gleixner 0 siblings, 1 reply; 9+ messages in thread From: Carlos Corbacho @ 2007-10-19 18:07 UTC (permalink / raw) To: Thomas Gleixner; +Cc: linux-kernel, Mikko Tiihonen, Venkatesh Pallipadi From: Carlos Corbacho <cathectic@gmail.com> Actually set force_hpet_resume_type. --- Whoops, just noticed I forgot to re-add this to the patch before submitting it. arch/x86/kernel/quirks.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c index cb21bcb..df01a1e 100644 --- a/arch/x86/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c @@ -344,6 +344,7 @@ static void nvidia_force_enable_hpet(struct pci_dev *dev) printk(KERN_DEBUG "Force enabled HPET at base address 0x%lx\n", force_hpet_address); cached_dev = dev; + force_hpet_resume_type = NVIDIA_FORCE_HPET_RESUME; return; } -- 1.5.2.2 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] x86: Fix resume for nVidia and force_hpet 2007-10-19 18:07 ` [PATCH] x86: Fix resume for nVidia and force_hpet Carlos Corbacho @ 2007-10-19 18:15 ` Thomas Gleixner 2007-10-19 18:34 ` x86: Add HPET force support for MCP55 (nForce 5) chipsets Carlos Corbacho 0 siblings, 1 reply; 9+ messages in thread From: Thomas Gleixner @ 2007-10-19 18:15 UTC (permalink / raw) To: Carlos Corbacho; +Cc: linux-kernel, Mikko Tiihonen, Venkatesh Pallipadi On Fri, 19 Oct 2007, Carlos Corbacho wrote: > From: Carlos Corbacho <cathectic@gmail.com> > > Actually set force_hpet_resume_type. > --- > Whoops, just noticed I forgot to re-add this to the patch before submitting it. > > arch/x86/kernel/quirks.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c > index cb21bcb..df01a1e 100644 > --- a/arch/x86/kernel/quirks.c > +++ b/arch/x86/kernel/quirks.c > @@ -344,6 +344,7 @@ static void nvidia_force_enable_hpet(struct pci_dev *dev) > printk(KERN_DEBUG "Force enabled HPET at base address 0x%lx\n", > force_hpet_address); > cached_dev = dev; > + force_hpet_resume_type = NVIDIA_FORCE_HPET_RESUME; > return; > } Yep, noticed it when I pushed it into the queue. Fixed it up already. Please be more careful next time. Btw, I'm happy to take a follow up patch for platforms which you can not test and stick them into -mm for a while. Thanks, tglx ^ permalink raw reply [flat|nested] 9+ messages in thread
* x86: Add HPET force support for MCP55 (nForce 5) chipsets 2007-10-19 18:15 ` Thomas Gleixner @ 2007-10-19 18:34 ` Carlos Corbacho 0 siblings, 0 replies; 9+ messages in thread From: Carlos Corbacho @ 2007-10-19 18:34 UTC (permalink / raw) To: Thomas Gleixner, Venkatesh Pallipadi; +Cc: linux-kernel, Mikko Tiihonen From: Carlos Corbacho <cathectic@gmail.com> Add support to force_hpet for all known MCP55 (nForce 5) chipset LPC bridges. --- These are the untested nForce 5 chips (taken from Mikko's original patch, and checked against pci.ids). arch/x86/kernel/quirks.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c index df01a1e..8f72148 100644 --- a/arch/x86/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c @@ -354,6 +354,24 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0050, DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0051, nvidia_force_enable_hpet); +/* LPC bridges */ +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0360, + nvidia_force_enable_hpet); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0361, + nvidia_force_enable_hpet); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0362, + nvidia_force_enable_hpet); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0363, + nvidia_force_enable_hpet); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0364, + nvidia_force_enable_hpet); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0365, + nvidia_force_enable_hpet); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0366, + nvidia_force_enable_hpet); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x0367, + nvidia_force_enable_hpet); + void force_hpet_resume(void) { switch (force_hpet_resume_type) { -- 1.5.2.2 ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-10-19 18:33 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2007-10-19 3:23 nVidia HPET force enable - merge requirements? (resend) Carlos Corbacho 2007-10-19 6:50 ` Thomas Gleixner 2007-10-19 15:29 ` Carlos Corbacho 2007-10-19 16:19 ` Thomas Gleixner 2007-10-19 17:51 ` [PATCH] x86: Force enable HPET for CK804 (nForce 4) chipsets Carlos Corbacho 2007-10-19 17:58 ` Thomas Gleixner 2007-10-19 18:07 ` [PATCH] x86: Fix resume for nVidia and force_hpet Carlos Corbacho 2007-10-19 18:15 ` Thomas Gleixner 2007-10-19 18:34 ` x86: Add HPET force support for MCP55 (nForce 5) chipsets Carlos Corbacho
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
Powered by JetHome