Subject: Re: apic timing/clock problem in 4.0_RC3, MacBook 2x2.0
To: Marco Trillo <marcotrillo@gmail.com>
From: Juan RP <juan@xtrarom.org>
List: port-i386
Date: 11/10/2007 12:23:32
On Sat, 10 Nov 2007 11:30:16 +0100
"Marco Trillo" <marcotrillo@gmail.com> wrote:

> Hi,
> 
> On 11/3/07, Marco Trillo <marcotrillo@gmail.com> wrote:
> > I have collected more information about the issue: I found a Linux
> > bugreport of a similar problem (APIC timing calibration problem)
> > which contained a possible cause: some feature of the Intel ICH7
> > called "LEGACY_USB" which "causes legacy USB circuit to cause SMI";
> > apparently such SMIs in the middle of the calibration process botch
> > it.
> >
> > Based on such report, I have added a quirk at the start of the
> > initrtclock() function in src/sys/arch/x86/isa/clock.c to disable
> > the LEGACY_USB SMI bit:
> >
> > outl(0x430, inl(0x430) & ~8);
> >
> > Indeed, the quirk appears to be working:
> 
> More news about the issue: as I reported before, that patch indeed
> appears to resolve all the issues (thanks to Ryan Lortie for finding
> the cause of the problem).
> The problem is that adding this line to a generic kernel is quirky and
> may affect negatively to other (non-MacBook) systems.
> 
> There was some discussion on FreeBSD lists about how to implement this
> in a portable and clean way. It seems that the MacBook can be detected
> using a SMBIOS 'system product' string:
> <http://lists.freebsd.org/pipermail/freebsd-current/2007-November/079643.html>.
> 
> What do you think of applying a similar patch to NetBSD?
> 
> By the way, I sent a PR describing the issue and the fix as
> "port-i386/37305".

Clearly SMBIOS is the way to go. I think you can use smbios_find_table()
and smbios_get_string() for this (I haven't used SMBIOS yet), they are
defined in x86/include/smbiosvar.h.

-- 
Juan Romero Pardines 	- The NetBSD Project
http://plog.xtrarom.org 	- NetBSD/pkgsrc news in Spanish