From owner-freebsd-current@FreeBSD.ORG Wed Nov 7 17:34:28 2007 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D77D216A46D; Wed, 7 Nov 2007 17:34:28 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 68ED213C4C5; Wed, 7 Nov 2007 17:34:28 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.samsco.home (phobos.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.8/8.13.8) with ESMTP id lA7HYE8Y069812; Wed, 7 Nov 2007 10:34:15 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <4731F712.5000601@samsco.org> Date: Wed, 07 Nov 2007 10:34:10 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 MIME-Version: 1.0 To: Rui Paulo References: <4A5A9C78-22AC-4480-BDEB-A72F6CF472DB@fnop.net> <20071104231422.GA82337@rink.nu> <472F5E62.4080406@samsco.org> <60C64C73-A019-4C01-85E1-80DF4C76B1AF@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (pooker.samsco.org [168.103.85.57]); Wed, 07 Nov 2007 10:34:15 -0700 (MST) X-Spam-Status: No, score=-1.4 required=5.5 tests=ALL_TRUSTED autolearn=failed version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: freebsd-current@FreeBSD.org, Rink Springer , freebsd-i386@FreeBSD.org, freebsd-hardware@FreeBSD.org Subject: Re: MacBook users: possible fix for the SMP problem X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2007 17:34:28 -0000 We can probably do a hack early on to see the PCI ID of the chipset. If that's possible, then it can be turned on by default for that case. The problem with tunbles like this is that they are inherently obscure, especially for new users that are most likely to need them. Scott Rui Paulo wrote: > I'm requesting review for the following patch: > > Index: sys/i386/isa/clock.c > =================================================================== > RCS file: /home/ncvs/src/sys/i386/isa/clock.c,v > retrieving revision 1.240 > diff -u -p -r1.240 clock.c > --- sys/i386/isa/clock.c 26 Oct 2007 03:23:54 -0000 1.240 > +++ sys/i386/isa/clock.c 7 Nov 2007 15:27:21 -0000 > @@ -130,6 +130,9 @@ static u_char rtc_statusb = RTCSB_24HR; > #define ACQUIRED 2 > #define ACQUIRE_PENDING 3 > > +/* Intel ICH register */ > +#define ICH_PMBASE 0x400 > + > static u_char timer2_state; > > static unsigned i8254_get_timecount(struct timecounter *tc); > @@ -616,11 +619,26 @@ i8254_init(void) > void > startrtclock() > { > + char *ichenv; > u_int delta, freq; > > writertc(RTC_STATUSA, rtc_statusa); > writertc(RTC_STATUSB, RTCSB_24HR); > > + /* > + * On some systems, namely MacBooks, we need to disallow the > + * legacy USB circuit to generate an SMI# because this can > + * cause several problems, namely: incorrect CPU frequency > + * detection and failure to start the APs. > + */ > + ichenv = getenv("hw.ich.disable_legacy_usb"); > + if (ichenv != NULL) { > + if (bootverbose) > + printf("Disabling LEGACY_USB_EN bit on Intel ICH.\n"); > + outl(ICH_PMBASE + 0x30, inl(ICH_PMBASE + 0x30) & ~0x8); > + freeenv(ichsmi); > + } > + > freq = calibrate_clocks(); > #ifdef CLK_CALIBRATION_LOOP > if (bootverbose) { > > > If you have a MacBook, you now need to set hw.ich.disable_legacy_usb on > the boot loader prompt or in loader.conf. I decided to go this route > because it seems safer. Imagine the case where there's a port at the > same IO address that has nothing to do with the ICH7. If we tried to > issue the outl() on every system, something bad could happen. > > Comments? > > Regards. > -- > Rui Paulo >