Changeset 1188
- Timestamp:
- 09/19/01 17:56:20 (7 years ago)
- Files:
-
- lm-sensors/trunk/CHANGES (modified) (1 diff)
- lm-sensors/trunk/README (modified) (1 diff)
- lm-sensors/trunk/doc/busses/i2c-piix4 (modified) (2 diffs)
- lm-sensors/trunk/kernel/busses/i2c-piix4.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/trunk/CHANGES
r1183 r1188 20 20 2.6.2 (2001????) 21 21 Module fscpos: new (Fujitsu-Siemens Poseidon driver) 22 Module i2c-piix4: Add Intel 82443MX and SMSC Victory66 support 22 23 Module via686a: Make limit initializations reliable 23 24 Program sensors-detect: Add ALI1535 detection, 25 add Intel 82443MX detection, 24 26 add Via VT8233 detection (no driver yet) 25 27 lm-sensors/trunk/README
r1179 r1188 39 39 Intel PIIX4 (used in many Intel chipsets) 40 40 Intel I810/I815 GMCH 41 Intel 82443MX (440MX) 41 42 ServerWorks OSB4, CSB5 42 43 SiS 5595 44 SMSC Victory66 43 45 3Dfx Voodoo 3 and Banshee 44 VIA Technologies VT82C586B, VT82C596A/B, and VT82C686A 46 VIA Technologies VT82C586B, VT82C596A/B, and VT82C686A/B 45 47 46 48 lm-sensors/trunk/doc/busses/i2c-piix4
r1155 r1188 5 5 Supported adapters: 6 6 * Intel 82371AB PIIX4 and PIIX4E 7 * Intel 824443MX (440MX) 7 8 Datasheet: Publicly available at the Intel website 8 9 * ServerWorks OSB4 and CSB5 southbridges 9 Datasheet: only available via NDA from ServerWorks10 Datasheet: Only available via NDA from ServerWorks 10 11 11 12 Author: Frodo Looijaard <frodol@dds.nl> and Philip Edelbrock … … 61 62 driver on those mainboards. 62 63 63 The ServerWorks Southbridges are identical to the PIIX4 in I2C support. 64 The ServerWorks Southbridges and the Intel 440MX are identical 65 to the PIIX4 in I2C/SMBus support. lm-sensors/trunk/kernel/busses/i2c-piix4.c
r1163 r1188 22 22 /* 23 23 Supports: 24 Intel PIIX4 24 Intel PIIX4, 440MX 25 25 Serverworks OSB4, CSB5 26 SMSC Victory66 26 27 27 28 Note: we assume there can only be one device, with one SMBus interface. … … 41 42 #include <linux/init.h> 42 43 43 /* Note: Since the ServerWorks OSB4 SMBus host interface isidentical44 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. */ 45 46 46 47 #ifndef PCI_DEVICE_ID_SERVERWORKS_OSB4 … … 56 57 #endif 57 58 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 71 struct sd { 72 const unsigned short mfr; 73 const unsigned short dev; 74 const unsigned char fn; 75 const char *name; 76 }; 77 78 static 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 }; 58 86 59 87 /* PIIX4 SMBus address offsets */ … … 152 180 static int __initdata piix4_initialized; 153 181 static unsigned short piix4_smba = 0; 154 static int kind = 0;155 182 156 183 /* Detect whether a PIIX4 can be found, and initialize it, where necessary. … … 162 189 int error_return = 0; 163 190 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 168 194 if (pci_present() == 0) { 169 printk("i2c-piix4.o: Error: No PCI-bus found!\n");170 195 error_return = -ENODEV; 171 196 goto END; 172 197 } 173 198 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 182 211 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"); 196 214 error_return = -ENODEV; 197 215 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); 200 218 201 219 … … 205 223 force = 0; 206 224 } else { 207 208 225 pci_read_config_word(PIIX4_dev, SMBBA, &piix4_smba); 209 226 piix4_smba &= 0xfff0; … … 212 229 if (check_region(piix4_smba, 8)) { 213 230 printk 214 ("i2c-piix4.o: PIIX4_smbregion 0x%x already in use!\n",231 ("i2c-piix4.o: SMB region 0x%x already in use!\n", 215 232 piix4_smba); 216 233 error_return = -ENODEV; … … 226 243 pci_write_config_byte(PIIX4_dev, SMBHSTCFG, temp | 0x01); 227 244 printk 228 ("i2c-piix4.o: WARNING: PIIX4SMBus interface set to new "245 ("i2c-piix4.o: WARNING: SMBus interface set to new " 229 246 "address %04x!\n", piix4_smba); 230 247 } else if ((temp & 1) == 0) { … … 239 256 temp | 1); 240 257 printk 241 ("i2c-piix4.o: WARNING: PIIX4SMBus interface has been FORCEFULLY "258 ("i2c-piix4.o: WARNING: SMBus interface has been FORCEFULLY " 242 259 "ENABLED!\n"); 243 260 } else { … … 250 267 251 268 /* 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"); 253 270 254 271 #ifdef DEBUG 255 272 if ((temp & 0x0E) == 8) 256 273 printk 257 ("i2c-piix4.o: PIIX4 using Interrupt 9 for SMBus.\n");274 ("i2c-piix4.o: Using Interrupt 9 for SMBus.\n"); 258 275 else if ((temp & 0x0E) == 0) 259 276 printk 260 ("i2c-piix4.o: PIIX4 using Interrupt SMI# for SMBus.\n");277 ("i2c-piix4.o: Using Interrupt SMI# for SMBus.\n"); 261 278 else 262 279 printk 263 ("i2c-piix4.o: PIIX4:Illegal Interrupt configuration (or code out "280 ("i2c-piix4.o: Illegal Interrupt configuration (or code out " 264 281 "of date)!\n"); 265 282 266 283 pci_read_config_byte(PIIX4_dev, SMBREV, &temp); 267 284 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); 269 286 #endif /* DEBUG */ 270 287 … … 323 340 } while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT)); 324 341 342 #ifdef DEBUG 325 343 /* If the SMBus is still busy, we give up */ 326 344 if (timeout >= MAX_TIMEOUT) { 327 #ifdef DEBUG328 345 printk("i2c-piix4.o: SMBus Timeout!\n"); 329 346 result = -1; 330 #endif 331 } 347 } 348 #endif 332 349 333 350 if (temp & 0x10) { … … 356 373 outb_p(inb(SMBHSTSTS), SMBHSTSTS); 357 374 375 #ifdef DEBUG 358 376 if ((temp = inb_p(SMBHSTSTS)) != 0x00) { 359 #ifdef DEBUG360 377 printk 361 378 ("i2c-piix4.o: Failed reset at end of transaction (%02x)\n", 362 379 temp); 363 #endif 364 } 365 #ifdef DEBUG 380 } 366 381 printk 367 382 ("i2c-piix4.o: Transaction (post): CNT=%02x, CMD=%02x, ADD=%02x, " … … 495 510 if ((res = piix4_setup())) { 496 511 printk 497 ("i2c-piix4.o: PIIX4not detected, module not inserted.\n");512 ("i2c-piix4.o: Device not detected, module not inserted.\n"); 498 513 piix4_cleanup(); 499 514 return res; 500 515 } 501 516 piix4_initialized++; 502 sprintf(piix4_adapter.name, kind==1?"SMBus PIIX4 adapter at %04x":"SMBus OSB4/CSB5adapter at %04x",517 sprintf(piix4_adapter.name, "SMBus PIIX4 adapter at %04x", 503 518 piix4_smba); 504 519 if ((res = i2c_add_adapter(&piix4_adapter))) { … … 509 524 } 510 525 piix4_initialized++; 511 printk("i2c-piix4.o: PIIX4 bus detected and initialized\n");526 printk("i2c-piix4.o: SMBus detected and initialized\n"); 512 527 return 0; 513 528 }
