diff options
| author | Rui Paulo <rpaulo@FreeBSD.org> | 2007-12-19 21:05:43 +0000 |
|---|---|---|
| committer | Rui Paulo <rpaulo@FreeBSD.org> | 2007-12-19 21:05:43 +0000 |
| commit | edc309ced33b79c6b67b803dbb7730fc95460c28 (patch) | |
| tree | 5daece5d186c1af52ca13de71d074eca16dd918b | |
| parent | 6b2521f3b45bba94a57c9e2da1c9f2561397af96 (diff) | |
Notes
| -rw-r--r-- | sys/i386/i386/machdep.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 19568a987356..30584da72e8e 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -173,6 +173,10 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL) extern vm_offset_t ksym_start, ksym_end; #endif +/* Intel ICH registers */ +#define ICH_PMBASE 0x400 +#define ICH_SMI_EN ICH_PMBASE + 0x30 + int _udatasel, _ucodesel; u_int basemem; @@ -213,6 +217,27 @@ static void cpu_startup(dummy) void *dummy; { + char *sysenv; + + /* + * On 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. + * We do this by disabling a bit in the SMI_EN (SMI Control and + * Enable register) of the Intel ICH LPC Interface Bridge. + */ + sysenv = getenv("smbios.system.product"); + if (sysenv != NULL) { + if (strncmp(sysenv, "MacBook", 7) == 0) { + if (bootverbose) + printf("Disabling LEGACY_USB_EN bit on " + "Intel ICH.\n"); + outl(ICH_SMI_EN, inl(ICH_SMI_EN) & ~0x8); + } + freeenv(sysenv); + } + /* * Good {morning,afternoon,evening,night}. */ |
