]> err.no Git - linux-2.6/blobdiff - arch/i386/kernel/cpu/cyrix.c
Merge branch 'audit.b39' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit...
[linux-2.6] / arch / i386 / kernel / cpu / cyrix.c
index 408a74e5c4241730e6ca385a5bc4953c6ba6fa85..122d2d75aa9f9bbce77211038240686ebf2dc7e8 100644 (file)
@@ -4,8 +4,10 @@
 #include <linux/pci.h>
 #include <asm/dma.h>
 #include <asm/io.h>
-#include <asm/processor.h>
+#include <asm/processor-cyrix.h>
 #include <asm/timer.h>
+#include <asm/pci-direct.h>
+#include <asm/tsc.h>
 
 #include "cpu.h"
 
@@ -183,14 +185,6 @@ static void __cpuinit geode_configure(void)
 }
 
 
-#ifdef CONFIG_PCI
-static struct pci_device_id __cpuinitdata cyrix_55x0[] = {
-       { PCI_DEVICE(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5510) },
-       { PCI_DEVICE(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5520) },
-       { },
-};
-#endif
-
 static void __cpuinit init_cyrix(struct cpuinfo_x86 *c)
 {
        unsigned char dir0, dir0_msn, dir0_lsn, dir1 = 0;
@@ -258,6 +252,8 @@ static void __cpuinit init_cyrix(struct cpuinfo_x86 *c)
 
        case 4: /* MediaGX/GXm or Geode GXM/GXLV/GX1 */
 #ifdef CONFIG_PCI
+       {
+               u32 vendor, device;
                /* It isn't really a PCI quirk directly, but the cure is the
                   same. The MediaGX has deep magic SMM stuff that handles the
                   SB emulation. It thows away the fifo on disable_dma() which
@@ -273,12 +269,19 @@ static void __cpuinit init_cyrix(struct cpuinfo_x86 *c)
                printk(KERN_INFO "Working around Cyrix MediaGX virtual DMA bugs.\n");
                isa_dma_bridge_buggy = 2;
 
+               /* We do this before the PCI layer is running. However we
+                  are safe here as we know the bridge must be a Cyrix
+                  companion and must be present */
+               vendor = read_pci_config_16(0, 0, 0x12, PCI_VENDOR_ID);
+               device = read_pci_config_16(0, 0, 0x12, PCI_DEVICE_ID);
 
                /*
                 *  The 5510/5520 companion chips have a funky PIT.
                 */  
-               if (pci_dev_present(cyrix_55x0))
-                       pit_latch_buggy = 1;
+               if (vendor == PCI_VENDOR_ID_CYRIX &&
+        (device == PCI_DEVICE_ID_CYRIX_5510 || device == PCI_DEVICE_ID_CYRIX_5520))
+                       mark_tsc_unstable("cyrix 5510/5520 detected");
+       }
 #endif
                c->x86_cache_size=16;   /* Yep 16K integrated cache thats it */
 
@@ -446,16 +449,6 @@ int __init cyrix_init_cpu(void)
        return 0;
 }
 
-//early_arch_initcall(cyrix_init_cpu);
-
-static int __init cyrix_exit_cpu(void)
-{
-       cpu_devs[X86_VENDOR_CYRIX] = NULL;
-       return 0;
-}
-
-late_initcall(cyrix_exit_cpu);
-
 static struct cpu_dev nsc_cpu_dev __cpuinitdata = {
        .c_vendor       = "NSC",
        .c_ident        = { "Geode by NSC" },
@@ -468,12 +461,3 @@ int __init nsc_init_cpu(void)
        return 0;
 }
 
-//early_arch_initcall(nsc_init_cpu);
-
-static int __init nsc_exit_cpu(void)
-{
-       cpu_devs[X86_VENDOR_NSC] = NULL;
-       return 0;
-}
-
-late_initcall(nsc_exit_cpu);