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.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4282 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2007-01-06 10:55:02 +00:00
1 parent ddd9ba2baf
commit dc9d483940
3 files changed
+49 -20

No files matched your search

+1
View File
@@ -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
+17 -6
View File
@@ -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.
+31 -14
View File
@@ -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 <IljaRauhut@web.de> and
@@ -44,6 +44,8 @@
*
* Apr 13, 2004, modified for ICH4-M (82801DBM) -- Axel Thimm <Axel.Thimm@ATrpms.net>
* 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 <IljaRauhut@web.de>, "
MODULE_DESCRIPTION("i801smbus PCI Inserter");
#endif /* MODULE */