Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=120fad72401ebec2a126c16cc48f56c28f3eefe2
Commit:     120fad72401ebec2a126c16cc48f56c28f3eefe2
Parent:     7de6d3618b09c39fdaa6125e23fcf465a65bc266
Author:     Alan <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 13 13:26:26 2007 +0100
Committer:  Andi Kleen <[EMAIL PROTECTED]>
CommitDate: Tue Feb 13 13:26:26 2007 +0100

    [PATCH] i386: Fix Cyrix MediaGX detection
    
    The old Cyrix 5520 CPU detection code relied upon the PCI layer setup being
    done earlier than the CPU setup, which is no longer true.  Fortunately we
    know that if the processor is a MediaGX we can do type 1 pci config
    accesses to check the companion chip.  We thus do those directly and from
    this find the 5520 and implement the workarounds for the timer problem
    
    Original report from [EMAIL PROTECTED], I sent a proposed patch which
    Takara then corrected, tested and sent back to the list on 10th January.
    
    Submitting for merging as it seems to have been missed
    
    AK: Changed to use pci-direct.h and fix warning for !CONFIG_PCI (later
    AK: originally from akpm)
    
    Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
    Cc: Andi Kleen <[EMAIL PROTECTED]>
    Cc: <[EMAIL PROTECTED]>
    Cc: Jordan Crouse <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---
 arch/i386/kernel/cpu/cyrix.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/arch/i386/kernel/cpu/cyrix.c b/arch/i386/kernel/cpu/cyrix.c
index 408a74e..de27bd0 100644
--- a/arch/i386/kernel/cpu/cyrix.c
+++ b/arch/i386/kernel/cpu/cyrix.c
@@ -6,6 +6,7 @@
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/timer.h>
+#include <asm/pci-direct.h>
 
 #include "cpu.h"
 
@@ -183,14 +184,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 +251,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 +268,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))
+               if (vendor == PCI_VENDOR_ID_CYRIX &&
+        (device == PCI_DEVICE_ID_CYRIX_5510 || device == 
PCI_DEVICE_ID_CYRIX_5520))
                        pit_latch_buggy = 1;
+       }
 #endif
                c->x86_cache_size=16;   /* Yep 16K integrated cache thats it */
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to