Date: Wed, 07 Nov 2007 11:50:55 -0800 From: Maxim Sobolev <sobomax@FreeBSD.org> To: Rui Paulo <rpaulo@FreeBSD.org> Cc: freebsd-current@FreeBSD.org, Rink Springer <rink@FreeBSD.org>, freebsd-i386@FreeBSD.org, freebsd-hardware@FreeBSD.org Subject: Re: MacBook users: possible fix for the SMP problem Message-ID: <4732171F.3010803@FreeBSD.org> In-Reply-To: <EABAF87E-087E-4E7D-AACA-0DDF8050D485@FreeBSD.org> References: <4A5A9C78-22AC-4480-BDEB-A72F6CF472DB@fnop.net> <20071104231422.GA82337@rink.nu> <e1309ba60711041555n72def9fn71de42fcf40bfaa1@mail.gmail.com> <472F5E62.4080406@samsco.org> <60C64C73-A019-4C01-85E1-80DF4C76B1AF@freebsd.org> <EABAF87E-087E-4E7D-AACA-0DDF8050D485@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
I don't really like the fact that it has to be turned on manually. Is it
possible to make this automatic based on BIOS Id or something like this?
-Maxim
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
>
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4732171F.3010803>
