Changeset 4282

Show
Ignore:
Timestamp:
01/06/07 11:55:02 (8 years ago)
Author:
khali
Message:

p4b_smbus: Add support for the ICH5. The Asus P4P800-X motherboard that
was given to our project by Winbond has its SMBus hidden and needs this.
Also update the documentation a bit.

Location:
lm-sensors/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r4281 r4282  
    2020                     Fix fragile structure initialization 
    2121  Module i2c-i801: Add ICH9 support 
     22  Module p4b_smbus: Add support for the ICH5 
    2223  Module f71805f: Fix the device address decoding (2.6 backport) 
    2324  Module icspll: Delete. It was useless and dangerous. 
  • lm-sensors/trunk/prog/hotplug/README.p4b

    r2973 r4282  
    1414It works by turning on the SMBus PCI device. 
    1515It is implemented as a module, p4b_smbus.o. 
    16 It only works with the ICH2 (82801BA) and ICH4 (82801DB). 
     16It works with the following chips: 
     17 * ICH2   (82801BA) 
     18 * ICH2-M (82801BAM) 
     19 * ICH4   (82801DB) 
     20 * ICH4-M (82801DBM) 
     21 * ICH5   (82801EB) 
    1722 
    18 ASUS switches off the SMBus PCI Device 
    19 in the i801 ICH2/4 chip. I spoke two times 
     23ASUS switches off the SMBus PCI Device in the i801 ICH chip. I spoke twice 
    2024with the German support and learned that: "We do not want the users to be 
    2125irritated by just another PCI Device in the Win98 device manager." 
    2226Really funny :-). 
    2327 
    24 NOTE: We have a report that as of kernel 2.4.23, the kernel activates 
    25 the SMBus PCI device, so that this module is not required. 
     28NOTE: As of kernel 2.4.23, the kernel activates the SMBus PCI device 
     29on the following boards: 
     30 * Asus P4B 
     31 * Asus P4B533 
     32 * Asus P4PE 
     33 * Asus P4T533 
     34 * Asus P4G8X Deluxe 
     35So this module is no longer required for these boards. For the other  
     36affected boards, it still is. 
    2637 
    2738 
     
    5566--------------------------------- 
    5667 
    57 - Obviously a board with Intel i801BA/DB ICH2/4 with broken bios. 
     68- Obviously a board with Intel i801BA/DB/EB ICH2/4/5 with broken BIOS. 
    5869- A linux working with a 2.4 kernel AND hotplug support in it!  
    5970- A installed kernel tree and gcc. 
  • lm-sensors/trunk/prog/hotplug/p4b_smbus.c

    r2459 r4282  
    22 * p4b_smbus.c 
    33 * 
    4  * Initialize the SMBus device on ICH2/2-M/4/4-M (82801BA/BAM/DB/DBM) 
     4 * Initialize the SMBus device on ICH2/2-M/4/4-M/5 (82801BA/BAM/DB/DBM/EB) 
    55 */ 
    66/* 
     
    4545 * Apr 13, 2004, modified for ICH4-M (82801DBM) -- Axel Thimm <Axel.Thimm@ATrpms.net> 
    4646 *               bugfix: register F2/bit 8 on ICH2* is bit 0 on ICH4* 
     47 * 
     48 * Jan 6, 2007, added support for the ICH5 -- Jean Delvare 
    4749 */ 
    4850 
     
    98100#define ICH4_SMBUS 0x24c3 
    99101 
     102#define ICH5 0x24d0 
     103#define ICH5_SMBUS 0x24d3 
     104 
     105#define is_supported_smbus(id) \ 
     106        ((id) == ICH2_SMBUS || \ 
     107         (id) == ICH4_SMBUS || \ 
     108         (id) == ICH5_SMBUS) 
     109 
    100110/* status, used to indicate that io space needs to be freed */ 
    101111static struct pci_dev *i801smbus = NULL; 
     
    115125 *           Bit 3: Disables SMBus Host Controller function. 
    116126 *           Bit 0: allows SMBus I/O space to be accessible when Bit 3 is set. 
     127 * ICH5:     PCI-Device 0x8086:0x24d0 
     128 *           Same as ICH4. 
    117129 */ 
    118130static int 
     
    165177                (*i801smbus)->devfn = devfn; 
    166178                ret = pci_read_config_word(*i801smbus, PCI_DEVICE_ID, &id); 
    167                 if (ret == 0 && (ICH2_SMBUS == id || ICH4_SMBUS == id)) { 
     179                if (ret == 0 && is_supported_smbus(id)) { 
    168180                        pci_read_config_word(*i801smbus, PCI_VENDOR_ID, &vid); 
    169181                        if(vid == 0x8086) 
     
    171183                } 
    172184        } 
    173         if (!(ICH2_SMBUS == id || ICH4_SMBUS == id)) {   
     185        if (!is_supported_smbus(id)) {   
    174186                DBG("i801smbus: i801smbus not found although i801 present - strange.\n"); 
    175187                return -EACCES; 
     
    224236          } 
    225237         
     238        dev = pci_find_device(0x8086, ICH5_SMBUS, NULL); 
     239 
     240        if (dev)  
     241          { 
     242            printk("i801smbus: SMBus already active\n"); 
     243            return -EPERM; 
     244          } 
     245         
    226246        /* Are we operating a i801 chipset */ 
    227247        if ((dev = pci_find_device(0x8086, ICH2, NULL)) != 0) 
     
    249269            mask = 0xfff6; 
    250270          } 
     271        else if ((dev = pci_find_device(0x8086, ICH5, NULL)) != 0) 
     272          { 
     273            printk(KERN_INFO "i801smbus: Found Intel ICH5 (82801EB)\n"); 
     274            testmask = 0x008; 
     275            mask = 0xfff6; 
     276          } 
    251277        else 
    252278          { 
    253             printk("i801smbus: INTEL ICH2/2-M/4/4-M (82801BA/BAM/DB/DBM) not found.\n"); 
     279            printk(KERN_NOTICE "i801smbus: No supported Intel ICH (82801) " 
     280                   "chip found\n"); 
    254281            return -ENODEV ; 
    255282          } 
     
    312339 
    313340#endif                          /* MODULE */ 
    314  
    315  
    316  
    317  
    318  
    319  
    320  
    321  
    322  
    323