]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86_64/kernel/setup.c
[PATCH] x86_64: make PC Speaker driver work
[linux-2.6-omap-h63xx.git] / arch / x86_64 / kernel / setup.c
index a57eec8311a79a5ac10bdc76622e2dc0627598e0..ebc3c33b1c6c9a940fe47feb78f7b425255393ec 100644 (file)
@@ -353,8 +353,10 @@ static __init void parse_cmdline_early (char ** cmdline_p)
                if (fullarg(from, "enable_timer_pin_1"))
                        disable_timer_pin_1 = -1;
 
-               if (fullarg(from, "nolapic") || fullarg(from, "disableapic"))
+               if (fullarg(from, "nolapic") || fullarg(from, "disableapic")) {
+                       clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);
                        disable_apic = 1;
+               }
 
                if (fullarg(from, "noapic"))
                        skip_ioapic_setup = 1;
@@ -540,7 +542,7 @@ void __init alternative_instructions(void)
 static int __init noreplacement_setup(char *s)
 { 
      no_replacement = 1; 
-     return 0; 
+     return 1;
 } 
 
 __setup("noreplacement", noreplacement_setup); 
@@ -928,6 +930,10 @@ static int __init init_amd(struct cpuinfo_x86 *c)
        if (c->x86 == 15 && ((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58))
                set_bit(X86_FEATURE_REP_GOOD, &c->x86_capability);
 
+       /* Enable workaround for FXSAVE leak */
+       if (c->x86 >= 6)
+               set_bit(X86_FEATURE_FXSAVE_LEAK, &c->x86_capability);
+
        r = get_model_name(c);
        if (!r) { 
                switch (c->x86) { 
@@ -962,7 +968,6 @@ static void __cpuinit detect_ht(struct cpuinfo_x86 *c)
 
        cpuid(1, &eax, &ebx, &ecx, &edx);
 
-       c->apicid = phys_pkg_id(0);
 
        if (!cpu_has(c, X86_FEATURE_HT) || cpu_has(c, X86_FEATURE_CMP_LEGACY))
                return;
@@ -1171,6 +1176,8 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
                        c->x86_capability[2] = cpuid_edx(0x80860001);
        }
 
+       c->apicid = phys_pkg_id(0);
+
        /*
         * Vendor-specific initialization.  In this section we
         * canonicalize the feature flags, meaning if there are
@@ -1419,3 +1426,22 @@ struct seq_operations cpuinfo_op = {
        .show = show_cpuinfo,
 };
 
+#ifdef CONFIG_INPUT_PCSPKR
+#include <linux/platform_device.h>
+static __init int add_pcspkr(void)
+{
+       struct platform_device *pd;
+       int ret;
+
+       pd = platform_device_alloc("pcspkr", -1);
+       if (!pd)
+               return -ENOMEM;
+
+       ret = platform_device_add(pd);
+       if (ret)
+               platform_device_put(pd);
+
+       return ret;
+}
+device_initcall(add_pcspkr);
+#endif