Changeset 1188

Show
Ignore:
Timestamp:
09/19/01 17:56:20 (7 years ago)
Author:
mds
Message:

Add 440MX and Victory66 support to piix4. Implement a

'supported' table. i2c adapter name and io region will
always be piix4 now - too hard to do 5 different names.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/CHANGES

    r1183 r1188  
    20202.6.2 (2001????) 
    2121  Module fscpos: new (Fujitsu-Siemens Poseidon driver) 
     22  Module i2c-piix4: Add Intel 82443MX and SMSC Victory66 support 
    2223  Module via686a: Make limit initializations reliable 
    2324  Program sensors-detect: Add ALI1535 detection, 
     25                          add Intel 82443MX detection,                   
    2426                          add Via VT8233 detection (no driver yet) 
    2527 
  • lm-sensors/trunk/README

    r1179 r1188  
    3939  Intel PIIX4 (used in many Intel chipsets) 
    4040  Intel I810/I815 GMCH 
     41  Intel 82443MX (440MX) 
    4142  ServerWorks OSB4, CSB5 
    4243  SiS 5595 
     44  SMSC Victory66 
    4345  3Dfx Voodoo 3 and Banshee 
    44   VIA Technologies VT82C586B, VT82C596A/B, and VT82C686A 
     46  VIA Technologies VT82C586B, VT82C596A/B, and VT82C686A/B 
    4547 
    4648 
  • lm-sensors/trunk/doc/busses/i2c-piix4

    r1155 r1188  
    55Supported adapters: 
    66  * Intel 82371AB PIIX4 and PIIX4E 
     7  * Intel 824443MX (440MX) 
    78    Datasheet: Publicly available at the Intel website 
    89  * ServerWorks OSB4 and CSB5 southbridges 
    9     Datasheet: only available via NDA from ServerWorks 
     10    Datasheet: Only available via NDA from ServerWorks 
    1011 
    1112Author: Frodo Looijaard <frodol@dds.nl> and Philip Edelbrock 
     
    6162driver on those mainboards. 
    6263 
    63 The ServerWorks Southbridges are identical to the PIIX4 in I2C support. 
     64The ServerWorks Southbridges and the Intel 440MX are identical 
     65to the PIIX4 in I2C/SMBus support. 
  • lm-sensors/trunk/kernel/busses/i2c-piix4.c

    r1163 r1188  
    2222/* 
    2323   Supports: 
    24         Intel PIIX4 
     24        Intel PIIX4, 440MX 
    2525        Serverworks OSB4, CSB5 
     26        SMSC Victory66 
    2627 
    2728   Note: we assume there can only be one device, with one SMBus interface. 
     
    4142#include <linux/init.h> 
    4243 
    43 /* Note: Since the ServerWorks OSB4 SMBus host interface is identical 
    44          to the Intel PIIX4's, we only mention it during detection.   */ 
     44/* Note: We assume all devices are identical 
     45         to the Intel PIIX4; we only mention it during detection.   */ 
    4546 
    4647#ifndef PCI_DEVICE_ID_SERVERWORKS_OSB4 
     
    5657#endif 
    5758 
     59#ifndef PCI_DEVICE_ID_INTEL_82443MX_3 
     60#define PCI_DEVICE_ID_INTEL_82443MX_3   0x719b 
     61#endif 
     62 
     63#ifndef PCI_VENDOR_ID_EFAR 
     64#define PCI_VENDOR_ID_EFAR              0x1055 
     65#endif 
     66 
     67#ifndef PCI_DEVICE_ID_EFAR_SLC90E66_3 
     68#define PCI_DEVICE_ID_EFAR_SLC90E66_3   0x9463 
     69#endif 
     70 
     71struct sd { 
     72        const unsigned short mfr; 
     73        const unsigned short dev; 
     74        const unsigned char fn; 
     75        const char *name; 
     76}; 
     77 
     78static struct sd supported[] = { 
     79        {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, 3, "PIIX4"}, 
     80        {PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_OSB4, 0, "OSB4"}, 
     81        {PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5, 0, "CSB5"}, 
     82        {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_3, 3, "440MX"}, 
     83        {PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_3, 0, "Victory66"}, 
     84        {0, 0, 0, NULL} 
     85}; 
    5886 
    5987/* PIIX4 SMBus address offsets */ 
     
    152180static int __initdata piix4_initialized; 
    153181static unsigned short piix4_smba = 0; 
    154 static int kind = 0; 
    155182 
    156183/* Detect whether a PIIX4 can be found, and initialize it, where necessary. 
     
    162189        int error_return = 0; 
    163190        unsigned char temp; 
    164  
    165         struct pci_dev *PIIX4_dev; 
    166  
    167         /* First check whether we can access PCI at all */ 
     191        struct sd *num = supported; 
     192        struct pci_dev *PIIX4_dev = NULL; 
     193 
    168194        if (pci_present() == 0) { 
    169                 printk("i2c-piix4.o: Error: No PCI-bus found!\n"); 
    170195                error_return = -ENODEV; 
    171196                goto END; 
    172197        } 
    173198 
    174         /* Look for the PIIX4, function 3 or Serverworks PSB4 func 0          */ 
    175         /* Note: we keep on searching until we have found the proper function */ 
    176         PIIX4_dev = NULL; 
    177         PIIX4_dev = pci_find_device(PCI_VENDOR_ID_SERVERWORKS, 
    178                                     PCI_DEVICE_ID_SERVERWORKS_OSB4, 
    179                                     PIIX4_dev); 
    180         while (PIIX4_dev && (PCI_FUNC(PIIX4_dev->devfn) != 0)); 
    181         /* Check for a CSB5 */ 
     199        /* Look for a supported device/function */ 
     200        do { 
     201                if((PIIX4_dev = pci_find_device(num->mfr, num->dev, 
     202                                                PIIX4_dev))) { 
     203                        if(PCI_FUNC(PIIX4_dev->devfn) != num->fn) 
     204                                continue; 
     205                        break; 
     206                } 
     207                PIIX4_dev = NULL; 
     208                num++; 
     209        } while (num->mfr); 
     210 
    182211        if (PIIX4_dev == NULL) { 
    183                 PIIX4_dev = pci_find_device(PCI_VENDOR_ID_SERVERWORKS, 
    184                                     PCI_DEVICE_ID_SERVERWORKS_CSB5, 
    185                                     PIIX4_dev); 
    186                 while (PIIX4_dev && (PCI_FUNC(PIIX4_dev->devfn) != 0)); 
    187         } 
    188         if (PIIX4_dev == NULL) { 
    189                 PIIX4_dev = pci_find_device(PCI_VENDOR_ID_INTEL, 
    190                                             PCI_DEVICE_ID_INTEL_82371AB_3, 
    191                                             PIIX4_dev); 
    192                 while (PIIX4_dev && (PCI_FUNC(PIIX4_dev->devfn) != 3)); 
    193                 if (PIIX4_dev == NULL) { 
    194                  printk 
    195                   ("i2c-piix4.o: Error: Can't detect PIIX4 function 3 nor OSB4 function 0!\n"); 
     212                printk 
     213                  ("i2c-piix4.o: Error: Can't detect PIIX4 or compatible device!\n"); 
    196214                 error_return = -ENODEV; 
    197215                 goto END; 
    198                } else { kind=1; /* Intel PIIX4 found */
    199         } else { kind=2; /* Serverworks OSB4 found */ } 
     216       
     217        printk("i2c-piix4.o: Found %s device\n", num->name); 
    200218 
    201219 
     
    205223                force = 0; 
    206224        } else { 
    207  
    208225                pci_read_config_word(PIIX4_dev, SMBBA, &piix4_smba); 
    209226                piix4_smba &= 0xfff0; 
     
    212229        if (check_region(piix4_smba, 8)) { 
    213230                printk 
    214                     ("i2c-piix4.o: PIIX4_smb region 0x%x already in use!\n", 
     231                    ("i2c-piix4.o: SMB region 0x%x already in use!\n", 
    215232                     piix4_smba); 
    216233                error_return = -ENODEV; 
     
    226243                pci_write_config_byte(PIIX4_dev, SMBHSTCFG, temp | 0x01); 
    227244                printk 
    228                     ("i2c-piix4.o: WARNING: PIIX4 SMBus interface set to new " 
     245                    ("i2c-piix4.o: WARNING: SMBus interface set to new " 
    229246                     "address %04x!\n", piix4_smba); 
    230247        } else if ((temp & 1) == 0) { 
     
    239256                                              temp | 1); 
    240257                        printk 
    241                             ("i2c-piix4.o: WARNING: PIIX4 SMBus interface has been FORCEFULLY " 
     258                            ("i2c-piix4.o: WARNING: SMBus interface has been FORCEFULLY " 
    242259                             "ENABLED!\n"); 
    243260                } else { 
     
    250267 
    251268        /* Everything is happy, let's grab the memory and set things up. */ 
    252         request_region(piix4_smba, 8, kind==1?"piix4-smbus":"osb4-smbus"); 
     269        request_region(piix4_smba, 8, "piix4-smbus"); 
    253270 
    254271#ifdef DEBUG 
    255272        if ((temp & 0x0E) == 8) 
    256273                printk 
    257                     ("i2c-piix4.o: PIIX4 using Interrupt 9 for SMBus.\n"); 
     274                    ("i2c-piix4.o: Using Interrupt 9 for SMBus.\n"); 
    258275        else if ((temp & 0x0E) == 0) 
    259276                printk 
    260                     ("i2c-piix4.o: PIIX4 using Interrupt SMI# for SMBus.\n"); 
     277                    ("i2c-piix4.o: Using Interrupt SMI# for SMBus.\n"); 
    261278        else 
    262279                printk 
    263                     ("i2c-piix4.o: PIIX4: Illegal Interrupt configuration (or code out " 
     280                    ("i2c-piix4.o: Illegal Interrupt configuration (or code out " 
    264281                     "of date)!\n"); 
    265282 
    266283        pci_read_config_byte(PIIX4_dev, SMBREV, &temp); 
    267284        printk("i2c-piix4.o: SMBREV = 0x%X\n", temp); 
    268         printk("i2c-piix4.o: PIIX4_smba = 0x%X\n", piix4_smba); 
     285        printk("i2c-piix4.o: SMBA = 0x%X\n", piix4_smba); 
    269286#endif                          /* DEBUG */ 
    270287 
     
    323340        } while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT)); 
    324341 
     342#ifdef DEBUG 
    325343        /* If the SMBus is still busy, we give up */ 
    326344        if (timeout >= MAX_TIMEOUT) { 
    327 #ifdef DEBUG 
    328345                printk("i2c-piix4.o: SMBus Timeout!\n"); 
    329346                result = -1; 
    330 #endif 
    331         } 
     347        } 
     348#endif 
    332349 
    333350        if (temp & 0x10) { 
     
    356373                outb_p(inb(SMBHSTSTS), SMBHSTSTS); 
    357374 
     375#ifdef DEBUG 
    358376        if ((temp = inb_p(SMBHSTSTS)) != 0x00) { 
    359 #ifdef DEBUG 
    360377                printk 
    361378                    ("i2c-piix4.o: Failed reset at end of transaction (%02x)\n", 
    362379                     temp); 
    363 #endif 
    364         } 
    365 #ifdef DEBUG 
     380        } 
    366381        printk 
    367382            ("i2c-piix4.o: Transaction (post): CNT=%02x, CMD=%02x, ADD=%02x, " 
     
    495510        if ((res = piix4_setup())) { 
    496511                printk 
    497                     ("i2c-piix4.o: PIIX4 not detected, module not inserted.\n"); 
     512                    ("i2c-piix4.o: Device not detected, module not inserted.\n"); 
    498513                piix4_cleanup(); 
    499514                return res; 
    500515        } 
    501516        piix4_initialized++; 
    502         sprintf(piix4_adapter.name, kind==1?"SMBus PIIX4 adapter at %04x":"SMBus OSB4/CSB5 adapter at %04x", 
     517        sprintf(piix4_adapter.name, "SMBus PIIX4 adapter at %04x", 
    503518                piix4_smba); 
    504519        if ((res = i2c_add_adapter(&piix4_adapter))) { 
     
    509524        } 
    510525        piix4_initialized++; 
    511         printk("i2c-piix4.o: PIIX4 bus detected and initialized\n"); 
     526        printk("i2c-piix4.o: SMBus detected and initialized\n"); 
    512527        return 0; 
    513528}