i2c clock running at 16Khz
Hi Oliver,
Quoted 4 lines
i am running gentoo linux 2.6.10-r6 on a via EPiA-m board that uses a VT835 southbridge. when you i use the i2c bus, the clock and data lines appear to be running at 16KHz not the more normal 100kHz or 400KHz speeds
100kHz and 400kHz are *maximum* frequency for standard and high-speed *I2C* busses. What your VIA bridge really is is an SMBus, so it must run at a speed between 10kHz and 100kHz if I remember correctly.
As a matter of fact, I already measured both my VIA and Intel SMBus chips at 16kHz, exactly like you. So I am not surprised at all by what you are reporting.
BTW, may I ask how you did measure the frequency?
Quoted 3 lines
Do you have any documentation on what the registers inside the via southbridge chips do, so i can try and fix this problem? If not do, you know if this is a known problem with the via chip sets?
As far as I know, there is no way to change the clock for the Intel SMBus. I have no documentation for the VIA chips but I would suspect that you cannot change it there either.
May I know the SMBus speed (or rather slowness) is so important to you?
Thanks,
--
Jean Delvare
Jean,
Quoted 13 lines · Jean Delvare
Hi Oliver,
Quoted 4 lines
i am running gentoo linux 2.6.10-r6 on a via EPiA-m board that uses a VT835 southbridge. when you i use the i2c bus, the clock and data lines appear to be running at 16KHz not the more normal 100kHz or 400KHz speeds
100kHz and 400kHz are *maximum* frequency for standard and high-speed *I2C* busses. What your VIA bridge really is is an SMBus, so it must run
at a speed between 10kHz and 100kHz if I remember correctly.
Quoted 7 lines
As a matter of fact, I already measured both my VIA and Intel SMBus chips
at 16kHz, exactly like you. So I am not surprised at all by what you are
reporting.BTW, may I ask how you did measure the frequency?
I hooked an oscilloscope to the clock and data pins.
Quoted 10 lines
Quoted 4 lines
Do you have any documentation on what the registers inside the via southbridge chips do, so i can try and fix this problem? If not do, you know if this is a known problem with the via chip sets?
As far as I know, there is no way to change the clock for the Intel SMBus. I have no documentation for the VIA chips but I would suspect that you cannot change it there either.
May I know the SMBus speed (or rather slowness) is so important to you?
The 3rd party board I am trying to use does not seem to like the slower clock rate.
Quoted 5 lines
Thanks,
--
Jean Delvare
Hi Oliver,
Quoted 3 lines
Quoted 1 line
BTW, may I ask how you did measure the frequency?
I hooked an oscilloscope to the clock and data pins.
Impressive :) I wish I had the necessary hardware to do so.
Quoted 5 lines
Quoted 2 lines
May I know the SMBus speed (or rather slowness) is so important to you?
The 3rd party board I am trying to use does not seem to like the slower clock rate.
Strange, usually most chips are fine with that (which is why they chose it, I guess).
OK, you may try to apply the attached patch to your kernel tree. It attempts to change a PCI configuration bit which *might* switch the SMBus speed from 16kHz to 64kHz. I am not able to verify whether it works or not since I do not have an oscilloscope, and the i2c-viapro is poll-based so measuring performance from userspace doesn't help (the poll delay dominates the SMBus speed by a huge factor). Also it might not work for all VIA chips, I have no datasheets, I can't say. You tell me if it works for you :)
Signature · 24 lines
Jean Delvare
http://khali.linux-fr.org/
-------------- next part --------------
--- linux-2.6.11-rc1-bk8/drivers/i2c/busses/i2c-viapro.c.orig 2005-01-21 20:05:05.000000000 +0100
+++ linux-2.6.11-rc1-bk8/drivers/i2c/busses/i2c-viapro.c 2005-01-25 20:50:37.000000000 +0100
@@ -341,6 +341,18 @@
}
pci_read_config_byte(pdev, SMBHSTCFG, &temp);
+
+ dev_info(&pdev->dev, "SMBus Host Configuration register: 0x%02x\n", temp);
+ if (!(temp & 0x04)) {
+ dev_info(&pdev->dev, "Attempting to increase SMBus speed... ");
+ pci_write_config_byte(pdev, SMBHSTCFG, temp | 0x04);
+ pci_read_config_byte(pdev, SMBHSTCFG, &temp);
+ if (temp & 0x04)
+ printk("Success!\n");
+ else
+ printk("Failed!\n");
+ }
+
/* If force_addr is set, we program the new address here. Just to make
sure, we disable the VT596 first. */
if (force_addr) {