/[VMELinux]/driver/ca91c042.c
ViewVC logotype

Diff of /driver/ca91c042.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

*** ca91c042.c	2001/10/27 03:50:07	1.5
--- ca91c042.c	2002/02/11 20:10:23	1.6
***************
*** 11,21 ****
  //  Purpose: Provide a Kernel Driver to Linux for the Universe I and II 
  //           Universe model number ca91c042
  //  Docs:                                  
! //    This driver supports both the Universe and Universe II chips                                     
  //------------------------------------------------------------------------------  
  // RCS:
! // $Id: ca91c042.c,v 1.5 2001/10/27 03:50:07 jhuggins Exp $
  // $Log: ca91c042.c,v $
  // Revision 1.5  2001/10/27 03:50:07  jhuggins
  // These changes add support for the extra images offered by the Universe II.
  // CVS : ----------------------------------------------------------------------
--- 11,28 ----
  //  Purpose: Provide a Kernel Driver to Linux for the Universe I and II 
  //           Universe model number ca91c042
  //  Docs:                                  
! //    This driver supports:
! //      Universe
! //      Universe II
! //      Universe II B
! //      Universe II D                                     
  //------------------------------------------------------------------------------  
  // RCS:
! // $Id: ca91c042.c,v 1.6 2002/02/11 20:10:23 wyrick Exp $
  // $Log: ca91c042.c,v $
+ // Revision 1.6  2002/02/11 20:10:23  wyrick
+ // Added Universe Chip Type detection
+ //
  // Revision 1.5  2001/10/27 03:50:07  jhuggins
  // These changes add support for the extra images offered by the Universe II.
  // CVS : ----------------------------------------------------------------------
***************
*** 27,33 ****
  //-----------------------------------------------------------------------------
  #define MODULE
  
! static char Version[] = "1.2 2001Oct17";
  
  #include <linux/config.h>
  #include <linux/version.h>
--- 34,40 ----
  //-----------------------------------------------------------------------------
  #define MODULE
  
! static char Version[] = "1.3.0 2002Feb11";
  
  #include <linux/config.h>
  #include <linux/version.h>
***************
*** 104,109 ****
--- 111,123 ----
  #define DMATYPE_SINGLE  1
  #define DMATYPE_LLIST   2
  
+ #define UNIVERSEI       0
+ #define UNIVERSEII      1
+ #define UNIVERSEIIB     2
+ #define UNIVERSEUNK     5
+ #define UNIVERSEIIFUNC ((ChipType == UNIVERSEII) || (ChipType == UNIVERSEIIB))
+ static  int ChipType = UNIVERSEUNK;
+ 
  static int OkToWrite[MAX_MINOR + 1];        // Can I write to the Hardware
  
  static int opened[MAX_MINOR + 1];
***************
*** 147,153 ****
    unsigned int temp1,temp2,x;
  
    p = buf;
!   p += sprintf(p,"Universe driver %s\n",Version);
  
    p += sprintf(p,"  baseaddr = %08X\n",(int)baseaddr);
    p += sprintf(p,"  Stats  reads = %i  writes = %i  ioctls = %i\n",
--- 161,173 ----
    unsigned int temp1,temp2,x;
  
    p = buf;
!   p += sprintf(p,"Universe driver %s, ChipType ",Version);
!   switch (ChipType) {
!     case UNIVERSEI   : p+= sprintf(p,"Universe I\n"); break;
!     case UNIVERSEII  : p+= sprintf(p,"Universe II\n"); break;
!     case UNIVERSEIIB : p+= sprintf(p,"Universe II B/D\n"); break;
!     default:           p+= sprintf(p,"Unknown Universe\n"); break;
!   }      
  
    p += sprintf(p,"  baseaddr = %08X\n",(int)baseaddr);
    p += sprintf(p,"  Stats  reads = %i  writes = %i  ioctls = %i\n",
***************
*** 927,933 ****
  
    sprintf(vstr,"Tundra Universe PCI-VME Bridge Driver %s\n",Version);
    printk(vstr);
!   printk("  Copyright 1997-2001, Michael J. Wyrick\n");
  
    if ((uni_pci_dev = pci_find_device(PCI_VENDOR_ID_TUNDRA,
                                       PCI_DEVICE_ID_TUNDRA_CA91C042, 
--- 947,953 ----
  
    sprintf(vstr,"Tundra Universe PCI-VME Bridge Driver %s\n",Version);
    printk(vstr);
!   printk("  Copyright 1997-2002, Michael J. Wyrick\n");
  
    if ((uni_pci_dev = pci_find_device(PCI_VENDOR_ID_TUNDRA,
                                       PCI_DEVICE_ID_TUNDRA_CA91C042, 
***************
*** 941,950 ****
      pci_read_config_dword(uni_pci_dev, PCI_CSR, &status);
      printk("  Vendor = %04X  Device = %04X  Status = %08X\n",
             uni_pci_dev->vendor,uni_pci_dev->device,status);
-     printk("  Class = %08X\n",uni_pci_dev->class);
- 
-     pci_read_config_dword(uni_pci_dev, PCI_MISC0, &temp);
-     printk("  Misc0 = %08X\n",temp);      
  
      // Setup Universe Config Space
      // This is a 4k wide memory area that need to be mapped into the kernel
--- 961,966 ----
***************
*** 964,970 ****
        printk("  Universe Chip Failed to Return PCI_ID in Memory Map.\n");
        return 1;
      }
! 
      // OK, Every this is ok so lets turn off the windows
      writel(0x00800000,baseaddr+LSI0_CTL);     
      writel(0x00800000,baseaddr+LSI1_CTL);     
--- 980,999 ----
        printk("  Universe Chip Failed to Return PCI_ID in Memory Map.\n");
        return 1;
      }
!  
!     printk("  Class = %08X\n",readl(baseaddr+PCI_CLASS));
!     printk("  Misc0 = %08X\n",readl(baseaddr+PCI_MISC0));
!     
!     // Determine What Chip We have
!     temp = readl(baseaddr + PCI_CLASS);
!     ChipType = temp & 0x000000FF;
!     switch (ChipType) {
!       case UNIVERSEI   : printk("  Found Universe I\n"); break;
!       case UNIVERSEII  : printk("  Found Universe II\n"); break;      
!       case UNIVERSEIIB : printk("  Found Universe IIB/D\n"); break;
!       default          : printk("  Unknown Universe\n"); break;
!     }
!   
      // OK, Every this is ok so lets turn off the windows
      writel(0x00800000,baseaddr+LSI0_CTL);     
      writel(0x00800000,baseaddr+LSI1_CTL);     
***************
*** 977,982 ****
--- 1006,1015 ----
      //   DTACK Enable
      writel(0x15060000,baseaddr+MISC_CTL);     
  
+     if (UNIVERSEIIFUNC) {
+       printk("   U2SPEC = %08X\n", readl(baseaddr+U2SPEC));
+     }
+ 
      // Lets turn off interrupts
      writel(0x00000000,baseaddr+LINT_EN);   // Disable interrupts in the Universe first
      writel(0x0000FFFF,baseaddr+LINT_STAT); // Clear Any Pending Interrupts

 

  ViewVC Help
Powered by ViewVC 1.2-dev