cx18: Possible causal realtionship for HVR-1600 I2C errors
Quite a few HVR-1600 users have reported cx18 driver I2C related problems usually with the following errors present:
tveeprom 1-0050: Huh, no eeprom present (err=-121)?
tveeprom 1-0050: Encountered bad packet header [ff]. Corrupt or not a Hauppauge eeprom.
s5h1409_readreg: readreg error (ret == -121)
cx18: frontend initialization failed
cx18-0: DVB failed to register
and an unusable HVR-1600/CX23418 under linux.
On the surface the problem appeared to be related to the devices on the I2C buses of the HVR-1600. Given the data from a number of user reports piling up, I think I can say that it's likely a PCI v2.2 or earlier bus problem with the CX23418 under linux. The I2C bus errors appear to be just a symptom of a larger underlying problem.
The CX23418 is a PCI v2.3 device according to Conexant's publicly available product literature. The users who experience the dreaded -121 (-EREMOTEIO) errors under linux, all (I need to double check with Michael) seem to have the HVR-1600 card installed in a machine with a PCI v2.2 or earlier chipset. **So I suspect, under linux at least, the HVR-1600 or CX23418 won't work with a PCI v2.2 or earlier chipset.**
Here are my collected reports.
Non-working (under linux) setups:
Reporter: Scott PCI chipset: Intel 82850 & 82801BA rev 4 PCI version: v2.2 AGP: Yes Video: PCI nVidia NV34 GeForce FX 5500 Symptoms: tveeprom ret=-121 error, card not working
Reporter: Ryan Watts PCI chipset: VIA VT8363/8365 & VT82C686 PCI version: v2.2 (VT8363) AGP: Yes Video: AGP nVidia NV18 GeForce4 MX 4000 Symptoms: tveeprom ret=-121 error, card not working
Reporter: Michael PCI Chipset: ? PCI Version: ? AGP: ? Video: ? Symptoms: I2C bus intermittently seems to work as intialization
completes including tveeprom and dvb demodulator init. Analog tuner init doesn't seem to happen. HVR-1600 cannot be made to do useful work.
Reporter: Matt Loomis
PCI Chipset: VIA VT8363/8365 & VT82C686
PCI Version: v2.2 (VT8363)
AGP: Yes
Video: AGP ATI Technologies Inc Radeon RV200 QW [Radeon 7500]
PCI Silicon Integrated Systems [SiS] 86C326 5598/6326Symptoms: cx18 driver fails to init with the tveeprom ret=121 error.
Both sets of CX23418 I2C control registers are returning bogus values when read (they don't match what was just written). ***Card works under Windows XP with Hauppauge drivers.****
Reporter: Michael Papet PCI Chipset: Intel 82845G & 82801DB PCI Version: v2.2 (82801DB) AGP: ? Video: 82845 Integrated Graphics Symptoms: cx18 driver fails to init at boot time with I2C ret=-121
errors. If blacklisted for boot and modprobed later, driver appears to initialize. Card seems unable to be tuned.
Reporter: Gerhard Wittreich PCI Chipset: Intel 82845 & 82801BA PCI Version: V2.2 (82801) AGP: Yes Video: AGP ATI Technologies Inc Rage 128 Pro Ultra TF Symptoms: cx18 driver fails to init due to apparent I2C bus errors,
but one set of CX23418 I2C control registers is acting normally while the other set is returning bogus values when read (identical to the values in Matt Loomis' reports).
Working setups:
Reporter: Gerhard Wittreich PCI Chipset: nVidia MPC61 PCI Version: Unknown but it's a PCIe chipset, so assuming > v2.2 AGP: no Video: PCIe nVidia Corporation G70 [GeForce 7600 GT] Symptoms: No problems; card works.
Reporter: Gerhard Wittreich PCI Chipset: Intel 82915G* & 82801F* PCI Version: v2.3 (82801F*) AGP: no Video: ? Symptoms: No problems; card works.
Reporter: Andy Walls PCI Chipset: ATI RS740 & SB700 PCI Version: v2.3 (SB700) AGP: no Video: PCI ATI Technologies Inc Radeon 2100 Symptoms: No problems; card works.
I'd be interested in additional reports of:
1. Errors I made in the above collected data.
2. A CX23418 based card working properly or not under Linux (or Windows) in a machine with a PCI v2.2 or earlier chipset.
3. The differences between PCI v2.2 and v2.3 that would cause PC v2.2 host writes to a PCI v2.3 device to fail or for reads to return bogus values (i.e. reading back 0x7 after a value of 0x21c0b was just written.)?
4. If anyone knows what magical tweak Windows or the Hauppauge HVR-1600 Windows driver is making to get the HVR-1600 working with (at least) the VIA VT8363 & VT82C686.
Regards,
Andy
--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 17 lines
Quoted 8 lines
I'd be interested in additional reports of:
1. Errors I made in the above collected data.
2. A CX23418 based card working properly or not under Linux (or Windows) in a machine with a PCI v2.2 or earlier chipset.
Quoted 9 lines
3. The differences between PCI v2.2 and v2.3 that would cause PC v2.2 host writes to a PCI v2.3 device to fail or for reads to return bogus values (i.e. reading back
0x7after a value of0x21c0bwas just written.)?4. If anyone knows what magical tweak Windows or the Hauppauge HVR-1600 Windows driver is making to get the HVR-1600 working with (at least) the VIA VT8363 & VT82C686.
Quoted 8 lines
I suggested to Hans a while ago (irc) that if the gpio register definition was incorrect, and the linux driver was writing to the wrong register to bring the demod's in and out of reset, then a floating gpio at a different address might cause the demod to go into reset and the tuner access to be blocked. This would likely be platform specific and power related.
Check this.
Steve,
Thanks, I will talk with Hans to verify the GPIO pins. The best that I know is that the comment block at the top os cx18-gpio.c is the correct definition:
/*
* HVR-1600 GPIO pins, courtesy of Hauppauge:
*
* gpio0: zilog ir process reset pin
* gpio1: zilog programming pin (you should never use this)
* gpio12: cx24227 reset pin
* gpio13: cs5345 reset pin
*/
That the HVR-1600 entries in cx18-cards.c match that comment:
.gpio_init.initial_value = 0x3001,
.gpio_init.direction = 0x3001,
.gpio_i2c_slave_reset = {
.active_lo_mask = 0x3001,
.msecs_asserted = 10,
.msecs_recovery = 40,
.ir_reset_mask = 0x0001,
},and I wrote a reset function to assert the reset lines and wait for the recovery period.
The Zilog programming pin is, I assume, the DBG pin of the Z8F0811 and is an open collector/drain pin according to Zilog data sheets. I've assumed it's wired to a pull-up on the HVR-1600 and doesn't need to driven by the CX23418.
Quoted 3 lines
Also, Hauppauge do not have PCI v2.2 tech support calls that I'm aware of - meaning either we're not hearing about them - or the problem is specific to the linux driver.
I have one user reporting it doesn't work under linux, but does under XP on a PCI v2.2 system; so that's consistent with your observations about possibly being specific to linux.
The really strange case that let me know it likely wasn't a GPIO pin or stuck I2C bus slave problem was Gerhard's and Matt's reports of readback's from the I2C control registers being just plain wrong. Here's an excerpt from Gerhard's log file:
Jul 19 12:23:01 wittregr-pvr kernel: [12569.016045] cx18: Start initialization, version 1.0.0 Jul 19 12:23:01 wittregr-pvr kernel: [12569.016905] cx18-0: Initializing card #0 Jul 19 12:23:01 wittregr-pvr kernel: [12569.016923] cx18-0: Autodetected Hauppauge card Jul 19 12:23:01 wittregr-pvr kernel: [12569.019858] cx18-0: cx23418 revision 01010000 (B) Jul 19 12:23:02 wittregr-pvr kernel: [12569.092391] cx18-0 i2c: i2c init Jul 19 12:23:02 wittregr-pvr kernel: [12569.839087] cx180 i2c: cx18_setscl: On entry CX18_REG_I2C_1_WR = 0x7 Jul 19 12:23:02 wittregr-pvr kernel: [12569.839093] cx18-0 warning: cx18_setscl: On entry read value (0x7) and previously written value (0x21c0b) upper bytes differ. Using previous value as it should be correct. Jul 19 12:23:02 wittregr-pvr kernel: [12569.839100] cx180 i2c: cx18_setscl: Wrote CX18_REG_I2C_1_WR = 0x21c0b Jul 19 12:23:02 wittregr-pvr kernel: [12569.839265] cx180 i2c: cx18_setscl: Readback CX18_REG_I2C_1_WR = 0x7 Jul 19 12:23:02 wittregr-pvr kernel: [12569.839270] cx18-0 warning: cx18_setscl: On exit readback value (0x7) and written value (0x21c0b) upper bytes differ Jul 19 12:23:02 wittregr-pvr kernel: [12569.839276] cx180 i2c: cx18_setsda: On entry CX18_REG_I2C_1_WR = 0x7 Jul 19 12:23:02 wittregr-pvr kernel: [12569.839281] cx18-0 warning: cx18_setsda: On entry read value (0x7) and previously written value (0x21c0b) upper bytes differ. Using previous value as it should be correct. Jul 19 12:23:02 wittregr-pvr kernel: [12569.839287] cx180 i2c: cx18_setsda: Wrote CX18_REG_I2C_1_WR = 0x21c0b Jul 19 12:23:02 wittregr-pvr kernel: [12569.839452] cx180 i2c: cx18_setsda: Readback CX18_REG_I2C_1_WR = 0x7 Jul 19 12:23:02 wittregr-pvr kernel: [12569.839457] cx18-0 warning: cx18_setsda: On exit readback value (0x7) and written value (0x21c0b) upper bytes differ Jul 19 12:23:02 wittregr-pvr kernel: [12569.839956] cx180 i2c: cx18_setscl: On entry CX18_REG_I2C_2_WR = 0x7 Jul 19 12:23:02 wittregr-pvr kernel: [12569.839961] cx18-0 warning: cx18_setscl: On entry read value (0x7) and previously written value (0x21c0b) upper bytes differ. Using previous value as it should be correct. Jul 19 12:23:02 wittregr-pvr kernel: [12569.839967] cx180 i2c: cx18_setscl: Wrote CX18_REG_I2C_2_WR = 0x21c0b Jul 19 12:23:02 wittregr-pvr kernel: [12569.840307] cx180 i2c: cx18_setscl: Readback CX18_REG_I2C_2_WR = 0x7 Jul 19 12:23:02 wittregr-pvr kernel: [12569.840312] cx18-0 warning: cx18_setscl: On exit readback value (0x7) and written value (0x21c0b) upper bytes differ Jul 19 12:23:02 wittregr-pvr kernel: [12569.840482] cx180 i2c: cx18_setsda: On entry CX18_REG_I2C_2_WR = 0x7 Jul 19 12:23:02 wittregr-pvr kernel: [12569.840488] cx18-0 warning: cx18_setsda: On entry read value (0x7) and previously written value (0x21c0b) upper bytes differ. Using previous value as it should be correct. Jul 19 12:23:02 wittregr-pvr kernel: [12569.840493] cx180 i2c: cx18_setsda: Wrote CX18_REG_I2C_2_WR = 0x21c0b Jul 19 12:23:02 wittregr-pvr kernel: [12569.840822] cx180 i2c: cx18_setsda: Readback CX18_REG_I2C_2_WR = 0x7 Jul 19 12:23:02 wittregr-pvr kernel: [12569.840827] cx18-0 warning: cx18_setsda: On exit readback value (0x7) and written value (0x21c0b) upper bytes differ
The value just written to the registers (0x21c0b) is not the value read back (0x7). The PCI bus ordering rules for bridges and devices are supposed to guarantee that the readback value will be the value from the register after the write has occurred or 0xffffffff on a PCI bus error.
There was a case where one user (I can't remember who) had one set of CX23418 I2C control registers respond properly, but the other set, 64 kB away, responded as above: reading back 0x7 from the WR register and 0xf for the RD register.
I have toyed with the idea that the I2C block within the CX23418 wasn't being reset properly, but the one case where one I2C master appeared to work while the other didn't threw some doubt on that.
Regards,
Andy
Quoted 1 line
- Steve
--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
Quoted 22 lines
Quoted 19 lines · Andy Walls
Quite a few HVR-1600 users have reported cx18 driver I2C related problems usually with the following errors present:
tveeprom 1-0050: Huh, no eeprom present (err=-121)?
tveeprom 1-0050: Encountered bad packet header [ff]. Corrupt or not a Hauppauge eeprom.
s5h1409_readreg: readreg error (ret == -121)
cx18: frontend initialization failed
cx18-0: DVB failed to registerand an unusable HVR-1600/CX23418 under linux.
On the surface the problem appeared to be related to the devices on the I2C buses of the HVR-1600. Given the data from a number of user reports piling up, I think I can say that it's likely a PCI v2.2 or earlier bus problem with the CX23418 under linux. The I2C bus errors appear to be just a symptom of a larger underlying problem.
Quoted 2 lines
Quoted 2 lines
2. A CX23418 based card working properly or not under Linux (or Windows) in a machine with a PCI v2.2 or earlier chipset.
A Status update on this. I am happy(?) to report that I can reproduce this problem myself now on an old machine with an Intel 82801AA Southbridge with the Conexant Raptor PAL/SECAM card installed:
Aug 5 21:17:39 arabian kernel: Linux video capture interface: v2.00 Aug 5 21:17:39 arabian kernel: cx18: Start initialization, version 1.0.0 Aug 5 21:17:39 arabian kernel: cx18-0: Initializing card #0 Aug 5 21:17:39 arabian kernel: cx18-0: Autodetected Conexant Raptor PAL/SECAM card Aug 5 21:17:39 arabian kernel: cx18-0 info: base addr: 0xf8000000 Aug 5 21:17:39 arabian kernel: cx18-0 info: Enabling pci device Aug 5 21:17:39 arabian kernel: ACPI: PCI Interrupt 0000:01:03.0[A] -> Link [LNKD] -> GSI 9 (level, low) -> IR Q 9 Aug 5 21:17:39 arabian kernel: cx18-0 info: cx23418 (rev 0) at 01:03.0, irq: 9, latency: 64, memory: 0xf80000 00 Aug 5 21:17:39 arabian kernel: cx18-0 info: attempting ioremap at 0xf8000000 len 0x04000000 Aug 5 21:17:39 arabian kernel: cx18-0: cx23418 revision 01010000 (B) Aug 5 21:17:40 arabian kernel: cx18-0 info: GPIO initial dir: 0000ffff/0000ffff out: 00000000/00000000 Aug 5 21:17:40 arabian kernel: cx18-0 info: activating i2c... Aug 5 21:17:40 arabian kernel: cx18-0 i2c: i2c init Aug 5 21:17:40 arabian kernel: cx180 i2c: cx18_setscl: On entry CX18_REG_I2C_1_WR = 0x7 Aug 5 21:17:40 arabian kernel: cx18-0 warning: cx18_setscl: On entry read value (0x7) and previously written value (0x21c0b) upper bytes differ. Using previous value as it should be correct. Aug 5 21:17:40 arabian kernel: cx180 i2c: cx18_setscl: Wrote CX18_REG_I2C_1_WR = 0x21c0b Aug 5 21:17:40 arabian kernel: cx180 i2c: cx18_setscl: Readback CX18_REG_I2C_1_WR = 0x7 Aug 5 21:17:40 arabian kernel: cx18-0 warning: cx18_setscl: On exit readback value (0x7) and written value (0x21c0b) upper bytes differ Aug 5 21:17:40 arabian kernel: cx180 i2c: cx18_setsda: On entry CX18_REG_I2C_1_WR = 0x7
This should hopefully speed resolution of the CX23418 I2C problems under Linux with older systems. I'm sure I won't be able to get too far towards resolution before 25 Aug, due to a busy upcoming personal schedule.
This is a step forward so at least I won't have to bother users with the sometimes painful iterative troubleshooting. To all the cx18 users who have patiently provided data at my request on this problem so far, thank you.
Regards,
Andy
--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
cx18: Testers needed for patch to solve non-working CX23418 cards under linux (Re: cx18: Possible causal realtionship for HVR-1600 I2C errors)
Quoted 11 lines · Andy Walls
Quoted 11 lines
Quoted 10 lines · Andy Walls
Quite a few HVR-1600 users have reported cx18 driver I2C related problems usually with the following errors present:
tveeprom 1-0050: Huh, no eeprom present (err=-121)?
tveeprom 1-0050: Encountered bad packet header [ff]. Corrupt or not a Hauppauge eeprom.
s5h1409_readreg: readreg error (ret == -121)
cx18: frontend initialization failed
cx18-0: DVB failed to register
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
and an unusable HVR-1600/CX23418 under linux.
On the surface the problem appeared to be related to the devices on the I2C buses of the HVR-1600. [...] The I2C bus errors appear to be just a symptom of a larger underlying problem.
To all the users of CX23418 based cards that currently don't seem to work, showing some of the above symptoms, please test my latest changes at:
http://linuxtv.org/hg/~awalls/v4l-dvb
If your card still doesn't work with the default module options, then try upping the "mmio_ndelay" module parameter by multiples of about 30.3 ns until the card does work:
For example, if the default "mmio_ndelay=31" doesn't work for you, then use:
# /sbin/modprobe cx18 mmio_ndelay=61
or 91, or 121, or 152, etc. until your card does work.
If you have multiple cx18 cards, and the default doesn't work, then you will have to specify a value for each card. For example:
# /sbin/modprobe cx18 mmio_ndelay=61,61,61
for a three card setup.
As always feedback is appreciated. In this case, I'd especially like to hear about digital captures, simultaneous analog & digital capture, and the (in)correctness of the cx18_memcpy_fromio() and cx18_memset_io() routines.
This patch works for me to get my HVR-1600 and my Raptor PAL/SECAM card working in my older machine with an Intel 82810E Northbridge and 82801AA Southbridge. I have only been able to test analog capture from the analog tuner and composite 1 input in this setup using 'cat /dev/video0
Quoted 1 line
foo.mpg' and playing the mpg file on another machine. (The machine has
no keyboard nor monitor nor apps like mplayer and mythtv). Things
appear to be working properly.
Quoted 3 lines
To all the cx18 users who
have patiently provided data at my request on this problem so far, thank you.
Thanks, again for helping me resolve this problem.
<hypothesis>
The underlying cause appears to be that the CX23418 can't handle very rapid memory mapped IO accesses to differing locations under certain (unknown) conditions. In the Linux cx18 driver, these rapid MMIO accesses apparently happened quite often. In certain modern motherboard configurations, the PCI bridges apparently were slowing things down or adding retries so that the CX23418 would actually work for some people. </hypothesis>
These patches work by adding a short delay (a 10's of ns busy wait) after *every* access to CX23418 mmio addresses. If your card already works fine and these busy waits bother you, then you can get approximately the previous behavior by setting "mmio_ndelay=0" which will skip all the calls to ndelay().
Regards,
Andy
--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list