Skip to contentSkip to conversation

SiS735 chipset SMBus driver for kernel 2.6

DISCUSSION Mark M. Hoffman 3 participants 6 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw

Hi Paolo:

(cc'ed to sensors mailing list...)

Quoted 1 line · Paolo Cesare BERVA

Hi Mark, here the tests I did with kernel 2.6.2:

<snip>

Quoted 10 lines
# setpci -s 00:02.0 0x40
98
# setpci -s 00:02.0 0x40=0xd8
# lspci -H1 -n | grep "00:02.0"
00:02.0 Class 0601: 1039:0018
# setpci -s 00:02.0 0x40=0x98
# lspci -H1 -n | grep "00:02.0"
00:02.0 Class 0601: 1039:0008

Excellent, that's just as I expected.

Quoted 1 line

Mark M. Hoffman wrote:

<snip>

Quoted 11 lines
Quoted 11 lines

You are missing device 1039:0016 here. I think I understand why, but I want to make sure. I asked another user to take some further steps, but he never responded.

You can find the steps here:

http://archives.andrew.net.au/lm-sensors/msg06132.html

Everything starting from "With kernel 2.6, the driver" applies to you. If you could please follow those steps and send the results, then next I will send a patch to test.

So here's the patch vs. 2.6.3. When you build it, select eeprom as a module (and of course i2c-sis96x). Please try it, and send me the results of a few commands...

lspci -n (again)
modprobe i2c-sis96x
modprobe eeprom
sensors

If none of that seems to work, then please send the results of 'dmesg'.

Thanks again,

Signature · 52 lines
Mark M. Hoffman
[email protected]

-------------- next part --------------
diff -Nru linux-2.6.3-orig/drivers/pci/quirks.c linux-2.6.3-mmh/drivers/pci/quirks.c
--- linux-2.6.3-orig/drivers/pci/quirks.c	2004-02-10 12:55:18.000000000 -0500
+++ linux-2.6.3-mmh/drivers/pci/quirks.c	2004-02-18 20:37:32.000000000 -0500
@@ -757,7 +757,7 @@
 
 #define SIS_DETECT_REGISTER 0x40
 
-static void __init quirk_sis_503_smbus(struct pci_dev *dev)
+static void __init quirk_sis_503(struct pci_dev *dev)
 {
 	u8 reg;
 	u16 devid;
@@ -765,7 +765,7 @@
 	pci_read_config_byte(dev, SIS_DETECT_REGISTER, &reg);
 	pci_write_config_byte(dev, SIS_DETECT_REGISTER, reg | (1 << 6));
 	pci_read_config_word(dev, PCI_DEVICE_ID, &devid);
-	if ((devid & 0xfff0) != 0x0960) {
+	if (((devid & 0xfff0) != 0x0960) && (devid != 0x0018)) {
 		pci_write_config_byte(dev, SIS_DETECT_REGISTER, reg);
 		return;
 	}
@@ -877,12 +877,14 @@
 	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_INTEL, 	PCI_DEVICE_ID_INTEL_82443BX_2, 	quirk_natoma },
 	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_5597,		quirk_nopcipci },
 	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_496,		quirk_nopcipci },
-	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_503,		quirk_sis_503_smbus },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_503,		quirk_sis_503 },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_LPC,		quirk_sis_96x_smbus },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_645,		quirk_sis_96x_compatible },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_646,		quirk_sis_96x_compatible },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_648,		quirk_sis_96x_compatible },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_650,		quirk_sis_96x_compatible },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_651,		quirk_sis_96x_compatible },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_735,		quirk_sis_96x_compatible },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_961,		quirk_sis_96x_smbus },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_962,		quirk_sis_96x_smbus },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_963,		quirk_sis_96x_smbus },
diff -Nru linux-2.6.3-orig/include/linux/pci_ids.h linux-2.6.3-mmh/include/linux/pci_ids.h
--- linux-2.6.3-orig/include/linux/pci_ids.h	2004-02-18 20:20:21.000000000 -0500
+++ linux-2.6.3-mmh/include/linux/pci_ids.h	2004-02-18 20:29:25.000000000 -0500
@@ -569,6 +569,7 @@
 #define PCI_DEVICE_ID_SI_6202		0x0002
 #define PCI_DEVICE_ID_SI_503		0x0008
 #define PCI_DEVICE_ID_SI_ACPI		0x0009
+#define PCI_DEVICE_ID_SI_LPC		0x0018
 #define PCI_DEVICE_ID_SI_5597_VGA	0x0200
 #define PCI_DEVICE_ID_SI_6205		0x0205
 #define PCI_DEVICE_ID_SI_501		0x0406
#1 lore raw

drivers/pci/quirks.c line 760

Quoted 9 lines · Mark M. Hoffman

diff -Nru linux-2.6.3-orig/drivers/pci/quirks.c linux-2.6.3-mmh/drivers/pci/quirks.c

drivers/pci/quirks.c +1 -1
@@ -757,7 +757,7 @@
 
 #define SIS_DETECT_REGISTER 0x40
 
-static void __init quirk_sis_503_smbus(struct pci_dev *dev)
+static void __init quirk_sis_503(struct pci_dev *dev)

Why rename the function?

thanks,

greg k-h

#2 lore raw
In reply to Mark M. Hoffman
Quoted 48 lines · Mark M. Hoffman

Hi Paolo:

(cc'ed to sensors mailing list...)

Quoted 1 line · Paolo Cesare BERVA

Hi Mark, here the tests I did with kernel 2.6.2:

<snip>

Quoted 10 lines
# setpci -s 00:02.0 0x40
98
# setpci -s 00:02.0 0x40=0xd8
# lspci -H1 -n | grep "00:02.0"
00:02.0 Class 0601: 1039:0018
# setpci -s 00:02.0 0x40=0x98
# lspci -H1 -n | grep "00:02.0"
00:02.0 Class 0601: 1039:0008

Excellent, that's just as I expected.

Quoted 1 line

Mark M. Hoffman wrote:

<snip>

Quoted 11 lines
Quoted 11 lines

You are missing device 1039:0016 here. I think I understand why, but I want to make sure. I asked another user to take some further steps, but he never responded.

You can find the steps here:

http://archives.andrew.net.au/lm-sensors/msg06132.html

Everything starting from "With kernel 2.6, the driver" applies to you. If you could please follow those steps and send the results, then next I will send a patch to test.

So here's the patch vs. 2.6.3. When you build it, select eeprom as a module (and of course i2c-sis96x). Please try it, and send me the results of a few commands...

Quoted 7 lines

lspci -n (again)
modprobe i2c-sis96x
modprobe eeprom
sensors

If none of that seems to work, then please send the results of 'dmesg'.

Hi Mark, applied the patch and rebuilt the kernel, here the results:

# uname -a
Linux localhost 2.6.3 #1 Fri Feb 20 00:02:27 CET 2004 i686 GNU/Linux
# lspci -n
00:00.0 Class 0600: 1039:0735 (rev 01)
00:01.0 Class 0604: 1039:0001
00:02.0 Class 0601: 1039:0018
00:02.1 Class 0c05: 1039:0016
00:02.2 Class 0c03: 1039:7001 (rev 07)
00:02.3 Class 0c03: 1039:7001 (rev 07)
00:02.5 Class 0101: 1039:5513 (rev d0)
00:0f.0 Class 0200: 10ec:8139 (rev 10)
00:11.0 Class 0401: 1274:5880 (rev 02)
01:00.0 Class 0300: 10de:0110 (rev b2)
# modprobe i2c-sis96x
# modprobe eeprom
# sensors
eeprom-i2c-0-50
Adapter: SiS96x SMBus adapter at 0x0c00
Memory type:            DDR SDRAM DIMM
Memory size (MB):       512

Thank you
Paolo

#3 lore raw
In reply to Mark M. Hoffman
Quoted 6 lines · Greg KH
Quoted 5 lines · Mark M. Hoffman

diff -Nru linux-2.6.3-orig/drivers/pci/quirks.c linux-2.6.3-mmh/drivers/pci/quirks.c

drivers/pci/quirks.c +0 -0
@@ -757,7 +757,7 @@
 
Quoted 6 lines

drivers/pci/quirks.c line 760

Quoted 4 lines
drivers/pci/quirks.c +1 -1
 #define SIS_DETECT_REGISTER 0x40
 
-static void __init quirk_sis_503_smbus(struct pci_dev *dev)
+static void __init quirk_sis_503(struct pci_dev *dev)

Why rename the function?

Because that routine no longer has anything to do with the smbus (as it did when I originally wrote it). Now, it simply renames the 503 device if necessary.

I should have mentioned this when Linus made that change, but I patched it now since I was already editing there.

Regards,

Signature · 2 lines
Mark M. Hoffman
[email protected]
#4 lore raw
In reply to Mark M. Hoffman
Quoted 14 lines · Mark M. Hoffman
Quoted 6 lines · Greg KH
Quoted 5 lines · Mark M. Hoffman

diff -Nru linux-2.6.3-orig/drivers/pci/quirks.c linux-2.6.3-mmh/drivers/pci/quirks.c

drivers/pci/quirks.c +0 -0
@@ -757,7 +757,7 @@
 
Quoted 6 lines

drivers/pci/quirks.c line 760

Quoted 4 lines
drivers/pci/quirks.c +1 -1
 #define SIS_DETECT_REGISTER 0x40
 
-static void __init quirk_sis_503_smbus(struct pci_dev *dev)
+static void __init quirk_sis_503(struct pci_dev *dev)

Why rename the function?

Quoted 6 lines

Because that routine no longer has anything to do with the smbus (as it did when I originally wrote it). Now, it simply renames the 503 device if necessary.

I should have mentioned this when Linus made that change, but I patched it now since I was already editing there.

Ok, that makes sense. I've applied this patch to my trees and will send it on in the next big sync up.

thanks,

greg k-h

#5 lore raw
In reply to Mark M. Hoffman

* Greg KH <[email protected]> [2004-02-23 16:45:31 -0800]:

<snip>

Quoted 2 lines

Ok, that makes sense. I've applied this patch to my trees and will send it on in the next big sync up.

Greg: thanks.

Paolo Berva: thank you for your help by testing. It seems likely this patch will make it into Linux 2.6.4.

Regards,

Signature · 2 lines
Mark M. Hoffman
[email protected]