Changeset 1404
- Timestamp:
- 06/28/02 04:49:46 (11 years ago)
- Location:
- lm-sensors/trunk/prog/hotplug
- Files:
-
- 3 modified
-
README (modified) (1 diff)
-
README.p4b (modified) (3 diffs)
-
p4b_smbus.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/prog/hotplug/README
r1046 r1404 1 1 M7101 - SMBus Support for ALi M15x3 based motherboards. 2 For Asus P4B motherboards, use the p4b_smbus module; 3 see the file README.p4b. 2 4 3 5 -------------------------------------------------------- -
lm-sensors/trunk/prog/hotplug/README.p4b
r1374 r1404 6 6 It works by turning on the SMBus PCI device. 7 7 It is implemented as a module, p4b_smbus.o. 8 It only works with the ICH2 (82801BA) and ICH4 (82801DB). 8 9 9 ASUS switches off the SMBus PCI Device in the i801 ICH2 chip. I spoke two times 10 ASUS switches off the SMBus PCI Device 11 in the i801 ICH2/4 chip. I spoke two times 10 12 with the German support and learned that: "We do not want the users to be 11 13 irritated by just another PCI Device in the Win98 device manager." … … 14 16 What does the module do? 15 17 ------------------------ 18 (Note: the following instructions assume the ICH2. For the ICH4, 19 the PCI IDs are 24C0 and 24C3) 16 20 17 21 It turnes off (!) the bits number 8 and 3 in the LPC register of the ICH2. … … 39 43 --------------------------------- 40 44 41 - Obviously a board with Intel i801BA ICH2with broken bios.45 - Obviously a board with Intel i801BA/DB ICH2/4 with broken bios. 42 46 - A linux working with a 2.4 kernel AND hotplug support in it! 43 47 - A installed kernel tree and gcc. -
lm-sensors/trunk/prog/hotplug/p4b_smbus.c
r1331 r1404 5 5 */ 6 6 /* 7 Copyright (c) 2002 Ilja Rauhut <IljaRauhut@web.de>, 7 Copyright (c) 2002 Ilja Rauhut <IljaRauhut@web.de> and 8 Klaus Woltereck <kw42@gmx.net>, 8 9 9 10 Based on the m7101.c hotplug example by: … … 39 40 * gcc > 2.7.2 or egcs >= 2.95.2. 40 41 * 42 * 43 * June 21, 2002, added support for the ICH4, code clean up -- Klaus 41 44 */ 42 45 … … 85 88 #define SMB_BASE 0x20 86 89 90 91 /* 92 * some shorter definitions for the ICHx PCI device IDs 93 */ 94 95 #define ICH2 PCI_DEVICE_ID_INTEL_82801BA_0 96 #define ICH2_SMBUS PCI_DEVICE_ID_INTEL_82801BA_3 97 98 99 #ifndef PCI_DEVICE_ID_INTEL_82801DB_0 100 #define PCI_DEVICE_ID_INTEL_82801DB_0 0x24c0 101 #define PCI_DEVICE_ID_INTEL_82801DB_3 0x24c3 102 #endif 103 104 #define ICH4 PCI_DEVICE_ID_INTEL_82801DB_0 105 #define ICH4_SMBUS PCI_DEVICE_ID_INTEL_82801DB_3 106 87 107 /* status, used to indicate that io space needs to be freed */ 88 108 static struct pci_dev *i801smbus = NULL; 89 109 static int i801smbus_inserted = FALSE; 90 extern void cleanup_module( );110 extern void cleanup_module(void); 91 111 92 112 static rwlock_t i801smbus_lock = RW_LOCK_UNLOCKED; … … 95 115 /* 96 116 * Checks whether SMBus is enabled and turns it on in case they are not. 97 * It's done by clearing Bit 8 and 4 in i801 config space F2h, PCI-Device 0x8086:0x2440 117 * It's done by clearing Bit 8 and 4 in i801 config space F2h, PCI-Device 0x8086:0x2440(ICH2)/0x24c0(ICH4) 98 118 */ 99 119 static int … … 146 166 (*i801smbus)->devfn = devfn; 147 167 ret = pci_read_config_word(*i801smbus, PCI_DEVICE_ID, &id); 148 if (ret == 0 && 0x2443 == id) {168 if (ret == 0 && (ICH2_SMBUS == id || ICH4_SMBUS == id)) { 149 169 pci_read_config_word(*i801smbus, PCI_VENDOR_ID, &vid); 150 170 if(vid == 0x8086) … … 152 172 } 153 173 } 154 if ( 0x2443 != id) {174 if (!(ICH2_SMBUS == id || ICH4_SMBUS == id)) { 155 175 DBG("i801smbus: i801smbus not found although i801 present - strange.\n"); 156 176 return -EACCES; … … 164 184 (*i801smbus)->vendor = 0x8086; 165 185 (*i801smbus)->hdr_type = PCI_HEADER_TYPE_NORMAL; 166 (*i801smbus)->device = 0x2443;186 (*i801smbus)->device = id; 167 187 168 188 return(pci_setup_device(*i801smbus)); … … 188 208 189 209 /* We want to be sure that the i801smbus is not present yet. */ 190 dev = pci_find_device(0x8086, 0x2443, NULL);210 dev = pci_find_device(0x8086, ICH2_SMBUS, NULL); 191 211 192 212 if (dev) 193 213 { 194 printk("i801smbus: SMBus already actve\n"); 214 printk("i801smbus: SMBus already active\n"); 215 return -EPERM; 216 } 217 218 dev = pci_find_device(0x8086, ICH4_SMBUS, NULL); 219 220 if (dev) 221 { 222 printk("i801smbus: SMBus already active\n"); 195 223 return -EPERM; 196 224 } 197 225 198 226 /* Are we operating a i801 chipset */ 199 dev = pci_find_device(0x8086, 0x2440, NULL);227 dev = pci_find_device(0x8086, ICH2, NULL); 200 228 if (NULL == dev) 201 229 { 202 printk("INTEL ICH2 type 82801BA not found.\n"); 203 return -ENODEV ; 204 } 230 dev = pci_find_device(0x8086, ICH4, NULL); 231 if (NULL == dev) 232 { 233 printk("INTEL ICH2/4 (82801AB/DB) not found.\n"); 234 return -ENODEV ; 235 } 236 else 237 { 238 printk("found Intel ICH4 (82801DB).\n"); 239 } 240 } 241 else 242 { 243 printk("found Intel ICH2 (82801AB).\n"); 244 } 245 205 246 /* we need the bus pointer later */ 206 247 bus = dev->bus; … … 230 271 231 272 232 void cleanup_module( )273 void cleanup_module(void) 233 274 { 234 275 write_lock_irqsave(i801smbus_lock, i801smbus_lock_flags); … … 255 296 "Burkhard Kohl <bku@buks.ipn.de>, " 256 297 "Frank Bauer <frank.bauer@nikocity.de>, " 257 "and Mark Studebaker <mdsxyz123@yahoo.com>"); 298 "Mark Studebaker <mdsxyz123@yahoo.com>," 299 "and Klaus Woltereck <kw42@gmx.net>"); 258 300 MODULE_DESCRIPTION("i801smbus PCI Inserter"); 259 301
