From owner-freebsd-hardware@FreeBSD.ORG Tue Nov 20 09:26:59 2007 Return-Path: Delivered-To: freebsd-hardware@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C13916A469; Tue, 20 Nov 2007 09:26:59 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:610:652::211]) by mx1.freebsd.org (Postfix) with ESMTP id EC48613C4C5; Tue, 20 Nov 2007 09:26:58 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 482051CCC6; Tue, 20 Nov 2007 10:26:58 +0100 (CET) Date: Tue, 20 Nov 2007 10:26:58 +0100 From: Ed Schouten To: Rui Paulo Message-ID: <20071120092658.GE17028@hoeg.nl> References: <4A5A9C78-22AC-4480-BDEB-A72F6CF472DB@fnop.net> <200711121351.58616.jhb@freebsd.org> <200711121611.37781.jhb@freebsd.org> <20071118182623.GX17028@hoeg.nl> <20071118201519.GY17028@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kyLY//NQyQkWxTQC" Content-Disposition: inline In-Reply-To: <20071118201519.GY17028@hoeg.nl> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: FreeBSD Current , freebsd-i386@freebsd.org, freebsd-hardware@freebsd.org Subject: Re: MacBook users: possible fix for the SMP problem X-BeenThere: freebsd-hardware@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General discussion of FreeBSD hardware List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2007 09:26:59 -0000 --kyLY//NQyQkWxTQC Content-Type: multipart/mixed; boundary="9Z5hYcGq4mWDMhAr" Content-Disposition: inline --9Z5hYcGq4mWDMhAr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ed Schouten wrote: > * Ed Schouten wrote: > > I just merged the patch on AMD64 and I'm currently compiling a new > > install CD to test it. I'll let you know whether it works. Thanks a lot! >=20 > It does. Please commit this patch on AMD64 as well. To make it easier for our fellow readers, I've attached the patch that I'm using on FreeBSD/amd64 to boot my Macbook3,1. Yours, --=20 Ed Schouten WWW: http://g-rave.nl/ --9Z5hYcGq4mWDMhAr Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="machdep.patch" Content-Transfer-Encoding: quoted-printable --- src/sys/amd64/amd64/machdep.c 2007-11-15 23:00:57.000000000 +0100 +++ src/sys/amd64/amd64/machdep.c 2007-11-20 09:44:24.000000000 +0100 @@ -155,6 +155,9 @@ extern vm_offset_t ksym_start, ksym_end; #endif =20 +/* Intel ICH register */ +#define ICH_PMBASE 0x400 + int _udatasel, _ucodesel, _ucode32sel; =20 int cold =3D 1; @@ -192,6 +195,27 @@ cpu_startup(dummy) void *dummy; { + char *ichenv, *sysenv; +=09 + /* + * 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 =3D getenv("hw.ich.disable_legacy_usb"); + sysenv =3D getenv("smbios.system.product"); + if ((ichenv !=3D NULL) || (sysenv !=3D NULL && + strncmp(sysenv, "MacBook", 7) =3D=3D 0)) { + if (bootverbose) + printf("Disabling LEGACY_USB_EN bit on Intel ICH.\n"); + outl(ICH_PMBASE + 0x30, inl(ICH_PMBASE + 0x30) & ~0x8); + } + if (ichenv) + freeenv(ichenv); + if (sysenv) + freeenv(sysenv); + /* * Good {morning,afternoon,evening,night}. */ --9Z5hYcGq4mWDMhAr-- --kyLY//NQyQkWxTQC Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFHQqhi52SDGA2eCwURAlXaAJ45tlJ8u25nZx2eoQOCHiJv1w12oQCfURgR alTpl7zZTTMT+1MYmv9fGsQ= =FG+m -----END PGP SIGNATURE----- --kyLY//NQyQkWxTQC--