Changeset 1196
- Timestamp:
- 10/07/01 00:20:41 (7 years ago)
- Files:
-
- lm-sensors/trunk/CHANGES (modified) (1 diff)
- lm-sensors/trunk/README (modified) (1 diff)
- lm-sensors/trunk/doc/busses/i2c-viapro (modified) (3 diffs)
- lm-sensors/trunk/kernel/busses/i2c-viapro.c (modified) (15 diffs)
- lm-sensors/trunk/prog/detect/sensors-detect (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/trunk/CHANGES
r1194 r1196 20 20 2.6.2 (2001????) 21 21 Chip Modules (all): malloc.h -> slab.h 22 File doc/FAQ: More updates and additions 22 23 Module fscpos: new (Fujitsu-Siemens Poseidon driver) 23 24 Module i2c-amd756: Improve busy handling/printk's 24 25 Module i2c-piix4: Add Intel 82443MX and SMSC Victory66 support 26 Module i2c-viapro: Add Via VT8233 support 25 27 Module via686a: Make limit initializations reliable 26 28 Program sensors-detect: Add ALI1535 detection, 27 29 add Intel 82443MX detection, 28 add Via VT8233 detection (no driver yet),30 add Via VT8233 detection, 29 31 add ITE 8172G detection (driver in kernel 2.4.10) 30 32 lm-sensors/trunk/README
r1188 r1196 44 44 SMSC Victory66 45 45 3Dfx Voodoo 3 and Banshee 46 VIA Technologies VT82C586B, VT82C596A/B, and VT82C686A/B46 VIA Technologies VT82C586B, VT82C596A/B, VT82C686A/B, and VT8233 47 47 48 48 lm-sensors/trunk/doc/busses/i2c-viapro
r521 r1196 1 1 Kernel driver `i2c-viapro.o' 2 2 3 Status: Complete but untested3 Status: Stable 4 4 5 5 Supported adapters: 6 * VIA Technologies, In C. VT82C6867 Datasheet: Publiclyavailable at the VIA website6 * VIA Technologies, Inc. VT82C596A/B 7 Datasheet: Sometimes available at the VIA website 8 8 9 * VIA Technologies, InC. VT82C596 10 Datasheet: Available per request 9 * VIA Technologies, Inc. VT82C686 10 Datasheet: Sometimes available at the VIA website 11 12 * VIA Technologies, Inc. VT8233 13 Datasheet: not available? 11 14 12 15 Author: Kyösti Mälkki <kmalkki@cc.hut.fi> 16 13 17 14 18 Module Parameters … … 20 24 Forcibly enable the SMBus at the given address. EXTREMELY DANGEROUS! 21 25 26 22 27 Description 23 28 ----------- … … 26 31 supported VIA southbridges. 27 32 28 Your /proc/pci or lspci -n listing must show eitherof these :33 Your /proc/pci or lspci -n listing must show one of these : 29 34 30 35 device 1106:3050 (vt82c596 function 3) 36 device 1106:3051 (vt82c596 function 3) 31 37 device 1106:3057 (vt82c686 function 4) 38 device 1106:3074 (vt8233 function 4) 32 39 33 If n eitherof these show up, you should look in the BIOS for settings like40 If none of these show up, you should look in the BIOS for settings like 34 41 enable ACPI / SMBus or even USB. 35 42 lm-sensors/trunk/kernel/busses/i2c-viapro.c
r949 r1196 2 2 i2c-viapro.c - Part of lm_sensors, Linux kernel modules for hardware 3 3 monitoring 4 Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>, 5 Philip Edelbrock <phil@netroedge.com>, Kyösti Mälkki <kmalkki@cc.hut.fi> 4 Copyright (c) 1998 - 2001 Frodo Looijaard <frodol@dds.nl>, 5 Philip Edelbrock <phil@netroedge.com>, Kyösti Mälkki <kmalkki@cc.hut.fi>, 6 Mark D. Studebaker <mdsxyz123@yahoo.com> 6 7 7 8 This program is free software; you can redistribute it and/or modify … … 20 21 */ 21 22 22 /* Note: we assume there can only be one VT596A/B, with one SMBus interface */ 23 /* 24 Supports Via devices: 25 82C596A/B (0x3050) 26 82C596B (0x3051) 27 82C686A/B 28 8233 29 Note: we assume there can only be one device, with one SMBus interface. 30 */ 23 31 24 32 #include <linux/version.h> … … 36 44 37 45 #ifndef PCI_DEVICE_ID_VIA_82C596_3 38 #define PCI_DEVICE_ID_VIA_82C596_3 0x305046 #define PCI_DEVICE_ID_VIA_82C596_3 0x3050 39 47 #endif 40 48 #ifndef PCI_DEVICE_ID_VIA_82C596B_3 … … 42 50 #endif 43 51 #ifndef PCI_DEVICE_ID_VIA_82C686_4 44 #define PCI_DEVICE_ID_VIA_82C686_4 0x3057 45 #endif 52 #define PCI_DEVICE_ID_VIA_82C686_4 0x3057 53 #endif 54 #ifndef PCI_DEVICE_ID_VIA_8233_0 55 #define PCI_DEVICE_ID_VIA_8233_0 0x3074 56 #endif 57 58 #define SMBBA1 0x90 59 #define SMBBA2 0x80 60 #define SMBBA3 0xD0 61 62 struct sd { 63 const unsigned short dev; 64 const unsigned char base; 65 const unsigned char hstcfg; 66 const char *name; 67 }; 68 69 static struct sd supported[] = { 70 {PCI_DEVICE_ID_VIA_82C596_3, SMBBA1, 0xD2, "VT82C596A/B"}, 71 {PCI_DEVICE_ID_VIA_82C596B_3, SMBBA1, 0xD2, "VT82C596B"}, 72 {PCI_DEVICE_ID_VIA_82C686_4, SMBBA1, 0xD2, "VT82C686A/B"}, 73 {PCI_DEVICE_ID_VIA_8233_0, SMBBA3, 0xD2, "VT8233"}, 74 {0, 0, 0, NULL} 75 }; 76 77 static struct sd *num = supported; 46 78 47 79 /* SMBus address offsets */ … … 64 96 We try to select the better one*/ 65 97 66 static unsigned short smb_cf_base;67 98 static unsigned short smb_cf_hstcfg; 68 99 69 #define SMBBA1 0x9070 #define SMBBA2 0x8071 #define SMBBA (smb_cf_base)72 100 #define SMBHSTCFG (smb_cf_hstcfg) 73 101 #define SMBSLVC (SMBHSTCFG+1) … … 93 121 static int force = 0; 94 122 MODULE_PARM(force, "i"); 95 MODULE_PARM_DESC(force, "Forcibly enable the VT82C596SMBus. DANGEROUS!");123 MODULE_PARM_DESC(force, "Forcibly enable the SMBus. DANGEROUS!"); 96 124 97 125 /* If force_addr is set to anything different from 0, we forcibly enable … … 100 128 MODULE_PARM(force_addr, "i"); 101 129 MODULE_PARM_DESC(force_addr, 102 "Forcibly enable the VT82C596SMBus at the given address. "130 "Forcibly enable the SMBus at the given address. " 103 131 "EXTREMELY DANGEROUS!"); 104 132 … … 151 179 152 180 153 /* Detect whether a VT596 can be found, and initialize it, where necessary. 154 Note the differences between kernels with the old PCI BIOS interface and 155 newer kernels with the real PCI interface. In compat.h some things are 156 defined to make the transition easier. */ 181 /* Detect whether a compatible device can be found, and initialize it. */ 157 182 int vt596_setup(void) 158 183 { 159 int error_return = 0;160 184 unsigned char temp; 161 185 162 struct pci_dev *VT596_dev ;186 struct pci_dev *VT596_dev = NULL; 163 187 164 188 /* First check whether we can access PCI at all */ 165 if (pci_present() == 0) {166 printk("i2c-viapro.o: Error: No PCI-bus found!\n");167 error_return = -ENODEV; 168 goto END;169 }170 171 /* Look for the VT596 function 3 _or_ VT686 function 4 */172 VT596_dev = NULL;173 VT596_dev = pci_find_device(PCI_VENDOR_ID_VIA,174 PCI_DEVICE_ID_VIA_82C596_3, VT596_dev); 189 if (pci_present() == 0) 190 return(-ENODEV); 191 192 /* Look for a supported device/function */ 193 do { 194 if((VT596_dev = pci_find_device(PCI_VENDOR_ID_VIA, num->dev, 195 VT596_dev))) 196 break; 197 } while ((++num)->dev); 198 175 199 if (VT596_dev == NULL) 176 VT596_dev = pci_find_device(PCI_VENDOR_ID_VIA, 177 PCI_DEVICE_ID_VIA_82C686_4, 178 VT596_dev); 179 180 if (VT596_dev == NULL) 181 VT596_dev = pci_find_device(PCI_VENDOR_ID_VIA, 182 PCI_DEVICE_ID_VIA_82C596B_3, 183 VT596_dev); 184 185 if (VT596_dev == NULL) { 186 printk 187 ("i2c-viapro.o: Error: Can't detect vt82c596 or vt82c686"); 188 error_return = -ENODEV; 189 goto END; 190 } 191 192 /* Determine the configuration space registers for the SMBus areas */ 193 if ((!pci_read_config_word(VT596_dev, SMBBA1, &vt596_smba)) 194 && (vt596_smba & 0x1)) { 195 smb_cf_base = SMBBA1; 196 smb_cf_hstcfg = 0xD2; 197 } else if ((!pci_read_config_word(VT596_dev, SMBBA2, &vt596_smba)) 198 && (vt596_smba & 0x1)) { 199 smb_cf_base = SMBBA2; 200 smb_cf_hstcfg = 0x84; 201 } else { 202 printk 203 ("i2c-viapro.o: Cannot configure SMBus I/O Base address\n"); 204 error_return = -ENODEV; 205 goto END; 206 } 200 return(-ENODEV); 201 printk("i2c-viapro.o: Found Via %s device\n", num->name); 207 202 208 203 /* Determine the address of the SMBus areas */ 204 smb_cf_hstcfg = num->hstcfg; 209 205 if (force_addr) { 210 vt596_smba = force_addr & 0xfff0;206 vt596_smba = force_addr; 211 207 force = 0; 212 208 } else { 213 vt596_smba &= 0xfff0; 214 } 209 if ((pci_read_config_word(VT596_dev, num->base, &vt596_smba)) 210 || !(vt596_smba & 0x1)) { 211 /* try 2nd address and config reg. for 596 */ 212 if((num->dev == PCI_DEVICE_ID_VIA_82C596_3) && 213 (!pci_read_config_word(VT596_dev, SMBBA2, &vt596_smba)) && 214 (vt596_smba & 0x1)) 215 smb_cf_hstcfg = 0x84; 216 else 217 goto FAIL; 218 } else { 219 FAIL: 220 printk 221 ("i2c-viapro.o: Cannot configure SMBus I/O Base address\n"); 222 return(-ENODEV); 223 } 224 } 225 vt596_smba &= 0xfff0; 215 226 216 227 if (check_region(vt596_smba, 8)) { 217 printk 218 ("i2c-viapro.o: vt82c596_smb region 0x%x already in use!\n", 219 vt596_smba); 220 error_return = -ENODEV; 221 goto END; 228 printk("i2c-viapro.o: SMB region 0x%x already in use!\n", 229 vt596_smba); 230 return(-ENODEV); 222 231 } 223 232 … … 227 236 if (force_addr) { 228 237 pci_write_config_byte(VT596_dev, SMBHSTCFG, temp & 0xfe); 229 pci_write_config_word(VT596_dev, SMBBA, vt596_smba);238 pci_write_config_word(VT596_dev, num->base, vt596_smba); 230 239 pci_write_config_byte(VT596_dev, SMBHSTCFG, temp | 0x01); 231 240 printk 232 ("i2c-viapro.o: WARNING: VT596SMBus interface set to new "233 "address %04x!\n", vt596_smba);241 ("i2c-viapro.o: WARNING: SMBus interface set to new " 242 "address 0x%04x!\n", vt596_smba); 234 243 } else if ((temp & 1) == 0) { 235 244 if (force) { … … 246 255 printk 247 256 ("SMBUS: Error: Host SMBus controller not enabled!\n"); 248 error_return = -ENODEV; 249 goto END; 257 return(-ENODEV); 250 258 } 251 259 } … … 269 277 #endif /* DEBUG */ 270 278 271 END: 272 return error_return; 279 return(0); 273 280 } 274 281 … … 298 305 if ((temp = inb_p(SMBHSTSTS)) != 0x00) { 299 306 #ifdef DEBUG 300 printk("i2c-viapro.o: SMBus busy ( %02x). Resetting... \n",307 printk("i2c-viapro.o: SMBus busy (0x%02x). Resetting... \n", 301 308 temp); 302 309 #endif … … 304 311 if ((temp = inb_p(SMBHSTSTS)) != 0x00) { 305 312 #ifdef DEBUG 306 printk("i2c-viapro.o: Failed! ( %02x)\n", temp);313 printk("i2c-viapro.o: Failed! (0x%02x)\n", temp); 307 314 #endif 308 315 return -1; … … 499 506 if ((res = vt596_setup())) { 500 507 printk 501 ("i2c-viapro.o: vt82c596 not detected, module not inserted.\n");508 ("i2c-viapro.o: Can't detect vt82c596 or compatible device, module not inserted.\n"); 502 509 vt596_cleanup(); 503 510 return res; 504 511 } 505 512 vt596_initialized++; 506 sprintf(vt596_adapter.name, "SMBus vt82c596adapter at %04x",513 sprintf(vt596_adapter.name, "SMBus Via Pro adapter at %04x", 507 514 vt596_smba); 508 515 if ((res = i2c_add_adapter(&vt596_adapter))) { … … 513 520 } 514 521 vt596_initialized++; 515 printk("i2c-viapro.o: vt82c596 bus detected and initialized\n");522 printk("i2c-viapro.o: Via Pro SMBus detected and initialized\n"); 516 523 return 0; 517 524 } lm-sensors/trunk/prog/detect/sensors-detect
r1194 r1196 93 93 devid => 0x3040, 94 94 func => 3, 95 procid => "VIA Technologies VT 82C586B Apollo ACPI",95 procid => "VIA Technologies VT82C586B Apollo ACPI", 96 96 driver => "i2c-via", 97 97 match => sub { $_[0] =~ /^VIA i2c/ }, … … 101 101 devid => 0x3050, 102 102 func => 3, 103 procid => "VIA Technologies VT 82C596 Apollo ACPI",103 procid => "VIA Technologies VT82C596 Apollo ACPI", 104 104 driver => "i2c-viapro", 105 match => sub { $_[0] =~ /^SMBus vt82c596 adapter at [0-9,a-f]{4}/ },105 match => sub { $_[0] =~ /^SMBus Via Pro adapter at/ }, 106 106 } , 107 107 { … … 109 109 devid => 0x3051, 110 110 func => 3, 111 procid => "VIA Technologies VT 82C596B ACPI",111 procid => "VIA Technologies VT82C596B ACPI", 112 112 driver => "i2c-viapro", 113 match => sub { $_[0] =~ /^SMBus vt82c596 adapter at [0-9,a-f]{4}/ },113 match => sub { $_[0] =~ /^SMBus Via Pro adapter at/ }, 114 114 } , 115 115 { … … 117 117 devid => 0x3057, 118 118 func => 4, 119 procid => "VIA Technologies VT 82C686 Apollo ACPI",119 procid => "VIA Technologies VT82C686 Apollo ACPI", 120 120 driver => "i2c-viapro", 121 match => sub { $_[0] =~ /^SMBus vt82c596 adapter at [0-9,a-f]{4}/ },121 match => sub { $_[0] =~ /^SMBus Via Pro adapter at/ }, 122 122 } , 123 123 { … … 125 125 devid => 0x3074, 126 126 func => 0, 127 procid => "VIA Technologies VT8233 Apollo 266 South Bridge", 128 match => sub { $_[0] =~ /^dontmatchthis/ }, 127 procid => "VIA Technologies VT8233 VLink South Bridge", 128 driver => "i2c-viapro", 129 match => sub { $_[0] =~ /^SMBus Via Pro adapter at/ }, 129 130 } , 130 131 {
