diff --git a/CHANGES b/CHANGES index 23e1089e..e9285c8c 100644 --- a/CHANGES +++ b/CHANGES @@ -19,6 +19,7 @@ SVN HEAD Module bmcsensors: Fix several warnings Fix fragile structure initialization Module i2c-i801: Add ICH9 support + Module p4b_smbus: Add support for the ICH5 Module f71805f: Fix the device address decoding (2.6 backport) Module icspll: Delete. It was useless and dangerous. Program eepromer: Fix loads of warnings diff --git a/prog/hotplug/README.p4b b/prog/hotplug/README.p4b index 154db209..0be25f71 100644 --- a/prog/hotplug/README.p4b +++ b/prog/hotplug/README.p4b @@ -13,16 +13,27 @@ This is just a quick and dirty hack to get the hardware monitoring working on the ASUS P4B board under Linux. It works by turning on the SMBus PCI device. It is implemented as a module, p4b_smbus.o. -It only works with the ICH2 (82801BA) and ICH4 (82801DB). +It works with the following chips: + * ICH2 (82801BA) + * ICH2-M (82801BAM) + * ICH4 (82801DB) + * ICH4-M (82801DBM) + * ICH5 (82801EB) -ASUS switches off the SMBus PCI Device -in the i801 ICH2/4 chip. I spoke two times +ASUS switches off the SMBus PCI Device in the i801 ICH chip. I spoke twice with the German support and learned that: "We do not want the users to be irritated by just another PCI Device in the Win98 device manager." Really funny :-). -NOTE: We have a report that as of kernel 2.4.23, the kernel activates -the SMBus PCI device, so that this module is not required. +NOTE: As of kernel 2.4.23, the kernel activates the SMBus PCI device +on the following boards: + * Asus P4B + * Asus P4B533 + * Asus P4PE + * Asus P4T533 + * Asus P4G8X Deluxe +So this module is no longer required for these boards. For the other +affected boards, it still is. What does the module do? @@ -54,7 +65,7 @@ The device is activated, but not included in /proc/pci and What are the system requirements? --------------------------------- -- Obviously a board with Intel i801BA/DB ICH2/4 with broken bios. +- Obviously a board with Intel i801BA/DB/EB ICH2/4/5 with broken BIOS. - A linux working with a 2.4 kernel AND hotplug support in it! - A installed kernel tree and gcc. - i2c and sensor modules installed. diff --git a/prog/hotplug/p4b_smbus.c b/prog/hotplug/p4b_smbus.c index c10a998e..9f3e96c0 100644 --- a/prog/hotplug/p4b_smbus.c +++ b/prog/hotplug/p4b_smbus.c @@ -1,7 +1,7 @@ /* * p4b_smbus.c * - * Initialize the SMBus device on ICH2/2-M/4/4-M (82801BA/BAM/DB/DBM) + * Initialize the SMBus device on ICH2/2-M/4/4-M/5 (82801BA/BAM/DB/DBM/EB) */ /* Copyright (c) 2002 Ilja Rauhut and @@ -44,6 +44,8 @@ * * Apr 13, 2004, modified for ICH4-M (82801DBM) -- Axel Thimm * bugfix: register F2/bit 8 on ICH2* is bit 0 on ICH4* + * + * Jan 6, 2007, added support for the ICH5 -- Jean Delvare */ @@ -97,6 +99,14 @@ rmm from lm_sensors-2.3.3: #define ICH4_M 0x24cc #define ICH4_SMBUS 0x24c3 +#define ICH5 0x24d0 +#define ICH5_SMBUS 0x24d3 + +#define is_supported_smbus(id) \ + ((id) == ICH2_SMBUS || \ + (id) == ICH4_SMBUS || \ + (id) == ICH5_SMBUS) + /* status, used to indicate that io space needs to be freed */ static struct pci_dev *i801smbus = NULL; static int i801smbus_inserted = FALSE; @@ -114,6 +124,8 @@ static unsigned long i801smbus_lock_flags = 0; * ICH4(-M): PCI-Device 0x8086:0x24c0(0x24cc) * Bit 3: Disables SMBus Host Controller function. * Bit 0: allows SMBus I/O space to be accessible when Bit 3 is set. + * ICH5: PCI-Device 0x8086:0x24d0 + * Same as ICH4. */ static int i801smbus_enable(struct pci_dev *dev, u16 testmask, u16 mask){ @@ -164,13 +176,13 @@ static int i801smbus_build(struct pci_dev **i801smbus, struct pci_bus *bus) for (id = 0, devfn = 0; devfn < 0xFF; devfn++) { (*i801smbus)->devfn = devfn; ret = pci_read_config_word(*i801smbus, PCI_DEVICE_ID, &id); - if (ret == 0 && (ICH2_SMBUS == id || ICH4_SMBUS == id)) { + if (ret == 0 && is_supported_smbus(id)) { pci_read_config_word(*i801smbus, PCI_VENDOR_ID, &vid); if(vid == 0x8086) break; } } - if (!(ICH2_SMBUS == id || ICH4_SMBUS == id)) { + if (!is_supported_smbus(id)) { DBG("i801smbus: i801smbus not found although i801 present - strange.\n"); return -EACCES; } else { @@ -217,6 +229,14 @@ int init_module(void) dev = pci_find_device(0x8086, ICH4_SMBUS, NULL); + if (dev) + { + printk("i801smbus: SMBus already active\n"); + return -EPERM; + } + + dev = pci_find_device(0x8086, ICH5_SMBUS, NULL); + if (dev) { printk("i801smbus: SMBus already active\n"); @@ -248,9 +268,16 @@ int init_module(void) testmask = 0x008; mask = 0xfff6; } + else if ((dev = pci_find_device(0x8086, ICH5, NULL)) != 0) + { + printk(KERN_INFO "i801smbus: Found Intel ICH5 (82801EB)\n"); + testmask = 0x008; + mask = 0xfff6; + } else { - printk("i801smbus: INTEL ICH2/2-M/4/4-M (82801BA/BAM/DB/DBM) not found.\n"); + printk(KERN_NOTICE "i801smbus: No supported Intel ICH (82801) " + "chip found\n"); return -ENODEV ; } @@ -311,13 +338,3 @@ MODULE_AUTHOR("Ilja Rauhut , " MODULE_DESCRIPTION("i801smbus PCI Inserter"); #endif /* MODULE */ - - - - - - - - - -