Index: i386/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v retrieving revision 1.660 diff -u -p -r1.660 machdep.c --- i386/machdep.c 5 Nov 2007 11:36:11 -0000 1.660 +++ i386/machdep.c 14 Nov 2007 09:57:09 -0000 @@ -174,6 +174,9 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, extern vm_offset_t ksym_start, ksym_end; #endif +/* Intel ICH register */ +#define ICH_PMBASE 0x400 + int _udatasel, _ucodesel; u_int basemem; @@ -219,6 +222,27 @@ static void cpu_startup(dummy) void *dummy; { + char *ichenv, *sysenv; + + /* + * 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"); + sysenv = getenv("smbios.system.product"); + if ((ichenv != NULL) || (sysenv != NULL && + strncmp(sysenv, "MacBook", 7) == 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}. */