Skip to contentSkip to conversation

Follow up for Ticket 1538

DISCUSSION Pierre Lamon 2 participants 5 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

thanks a lot for your quick answer! Before following your advice I want to make sure I understood.

Quoted 9 lines

Reply from support:
we have just submitted a new parport driver to 2.6 that consolidates all the previous parallel port drivers.
You may wish to try it.
If you want to use kernel 2.4 then you want the driver that matches what you built; see the info in our doc/ directory in our i2c release. For more info on the new driver if you can?t find it email us, ref. your ticket #.
MDS 1/24/04

1) Could I take the latest cvs version of your i2c directory and copy the files into the linux-2.6.1 directory (I'm using 2.6.1)? What is the best way to update the kernel sources?

2) Should I use i2c-pcf-epp for the following circuit? Is this the right driver to use? Which i2c modules should be insmoded at the same time?
http://www.voxel.at/prj/i2c/images/i2c/i2c_adap.gif

Thanks a lot for your help
~Pierre

#1 lore raw
Quoted 4 lines
Quoted 4 lines

Reply from support:
we have just submitted a new parport driver to 2.6 that consolidates all the previous parallel port drivers. You may wish to try it.

Just one thing: the new driver does not replace *all* previous drivers. It replaces simple, parallel-port-pins-bashing drivers (media/video/i2c-parport, i2c-elv, i2c-velleman and i2c-philips-par), but not more complex drivers involving bidirectional parallel ports or extra chips (i2c-pport and i2c-pcf-epp). i2c-pport might be integrated someday. i2c-pcf-epp will never be, it's too different so it wouldn't make sense.

Quoted 3 lines

1) Could I take the latest cvs version of your i2c directory and copy the files into the linux-2.6.1 directory (I'm using 2.6.1)? What is the best way to update the kernel sources?

It won't work. Drivers for linux 2.4 and linux 2.6 are different, you can't mix them. If you need a driver that hasn't been ported yet, you'll have to port it first.

Quoted 3 lines

2) Should I use i2c-pcf-epp for the following circuit? Is this the right driver to use? Which i2c modules should be insmoded at the same time? http://www.voxel.at/prj/i2c/images/i2c/i2c_adap.gif

I am no electronics guy, but I think that you need i2c-algo-pcf + i2c-pcf-epp. The later hasn't been ported to Linux 2.6 yet. I suggest that you first try with a 2.4 kernel. If it turns out to be what you need, or only needs little change to work, and you really want Linux 2.6, then you'll have to port the driver. It's one of the latest bus drivers still missing so your help will be welcome.

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#2 lore raw
In reply to Pierre Lamon
Quoted 6 lines

it would be nice if you can find what's going on. Here is a detailed description of the problem (kernel 2.4.24):

While modprobing the module the following error occurs (modprobe i2c-pcf-epp):

Quoted 9 lines

On the console:
/lib/modules/2.4.20/kernel/drivers/i2c/i2c-pcf-epp.o: init_module: No such device or address
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters /lib/modules/2.4.20/kernel/drivers/i2c/i2c-pcf-epp.o: insmod /lib/modules/2.4.20/kernel/drivers/i2c/i2c-pcf-epp.o failed /lib/modules/2.4.20/kernel/drivers/i2c/i2c-pcf-epp.o: insmod i2c-pcf-epp failed

So this has do be 2.4.20, not 2.4.24. Nevermind.

Quoted 5 lines

Here is the content of dmesg:
i2c-core.o: i2c core module version 2.8.2 (20031211) i2c-pcf-epp.o: i2c pcf8584-epp adapter module version 2.8.2 (20031211)
i2c_pcf_add_bus caused an error: -6

This basically means that your PCF8584 wasn't detected as such. We would
need more details to track the problem. Please unload the i2c-algo-pcf module and reload it with with "i2c_debug=3". That way, the log will be much more verbose. And try again ;)

Quoted 6 lines

After (there is a segfault)

Unable to handle kernel paging request at virtual address cf86666b

*pde = 0ed3e067
*pte = 00000000
(...)
Segmentation fault

This is very bad. Whatever happens, *this* shouldn't happen. I think you
need to pass this through a program called ksymoops if we want to see where exactly the problem happened.

Quoted 9 lines

The available bios options are as follow (related to the parallel port):

Onboard parallel port : [3BC/IRQ7] or [378/IRQ7] or [278/IRQ5] (choosen
[378/IRQ7])
Onboard parallel mode : [EPP] or [ECP] or [ECP/EPP] (choosen [EPP]) EPP type: [EPP1.7] or [EPP1.9] (choosen [EPP1.9])

Quoted 4 lines

IRQ-7 assigned to [Legacy ISA] or [PCI/ISA PnP] (choosen [PCI/ISA PnP])

Which configuration should I use ?

That I can't tell. Choosing EPP is obviously correct, but I cannot tell you which version is "best" (if that matters). As for Legacy vs. Pnp, it depends on wether you enabled PNP support in your kernel. If you do, choose PnP. If you didn't, better choose ISA and let the BIOS assign the IRQ for you.

Quoted 6 lines
Quoted 5 lines

Great. Couldn't you do the same with more simple parallel-ports adapters, such as i2c-philips-par, i2c-elv or i2c-velleman? These have been ported to Linux 2.6 already, and are supported by my unified driver too, while i2c-pport hasn't been ported and isn't part of the unified driver.

Quoted 6 lines

Since we have developped our own PC104 motherboard we wanted to integrate the i2c circuit on it. I couldn't find the elv and velleman schematics.
Furthermore, I was concerning about the performances: hoping that the use of the PCF8584 will provide better performance. (less cpu load, interrupt driven for byte reading, etc.)

I'll try to draw a sample schematics. It's more simple than the one for i2c-pport IMHO. Basically, i2c-pport uses the bidirectionality of some pins in order to use 2 pins of the parallel port only instead of 3 or 4, and allows the concurent use of another parallel port device. Other drivers don't allow this - but I don't think you need it, do you?

Quoted 3 lines

i2c-pport was very convenient for testing. It took less than an hour for wiring the cables, loading the module and detecting the slave with i2cdetect. I might not be the only one who needs it.

The real question is wether you could have done the same with the same ease with the new i2c-parport module, providing a sample schematics similar to the one for i2c-pport was given.

I guess that at least the author of i2c-pport is using it ;) but I still
believe that in 99% of the cases, the extra complexity is not needed. This is the reason why I still hesitate to integrate i2c-pport into the new 2.6 driver.

Great that our work can be of some use to you :)

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#3 lore raw
In reply to Pierre Lamon
Quoted 5 lines

thanks a lot for your answer. I've finally choosen not to use the PCF8584 for interfacing the i2c bus because I was not able to modprobe it whatever the kernel or the i2c-x version (I've been trying for around 3 days). However, I'm still interested to know if it has been tested and if anybody uses it successfully.

I'm surprised you couldn't get it to work. As far as I know, the driver is precisely made for people who build a board according to Simon Vogl's schematics. If you provide details about the failures, we might try to help.

Quoted 2 lines

Finally I'm using direct parallel port access and everything works fine with the i2c-pport driver :-)

Great. Couldn't you do the same with more simple parallel-ports adapters, such as i2c-philips-par, i2c-elv or i2c-velleman? These have been ported to Linux 2.6 already, and are supported by my unified driver too, while i2c-pport hasn't been ported and isn't part of the unified driver.

Actually I wonder if I will port and/or integrate the i2c-pport logic in Linux 2.6, because in most cases, the additional complexity shouldn't be required. But if you really need it, I'll think of it.

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#4 lore raw
In reply to Pierre Lamon

Hello,

it would be nice if you can find what's going on. Here is a detailed description of the problem (kernel 2.4.24):

While modprobing the module the following error occurs (modprobe i2c-pcf-epp):

On the console:
/lib/modules/2.4.20/kernel/drivers/i2c/i2c-pcf-epp.o: init_module: No such device or address
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters /lib/modules/2.4.20/kernel/drivers/i2c/i2c-pcf-epp.o: insmod /lib/modules/2.4.20/kernel/drivers/i2c/i2c-pcf-epp.o failed /lib/modules/2.4.20/kernel/drivers/i2c/i2c-pcf-epp.o: insmod i2c-pcf-epp failed

Here is the content of dmesg:
i2c-core.o: i2c core module version 2.8.2 (20031211) i2c-pcf-epp.o: i2c pcf8584-epp adapter module version 2.8.2 (20031211) i2c_pcf_add_bus caused an error: -6

Before loading the module (less /proc/interrupts):
CPU0

  0:      34934          XT-PIC  timer
  1:        112          XT-PIC  keyboard
  2:          0          XT-PIC  cascade
 10:         14          XT-PIC  ide1
 11:         40          XT-PIC  usb-uhci, eth0
 12:         20          XT-PIC  PS/2 Mouse
 14:       3193          XT-PIC  ide0
NMI:          0
ERR:          0

After (there is a segfault)

Unable to handle kernel paging request at virtual address cf86666b
*pde = 0ed3e067
*pte = 00000000
Oops: 0000
CPU:    0
EIP:    0010:[<c02308a0>]    Not tainted
EFLAGS: 00010297
eax: cf86666b   ebx: cd6770b2   ecx: cf86666b   edx: fffffffe
esi: cd9a9f1c   edi: ffffffff   ebp: cf86666b   esp: cd9a9ec4
ds: 0018   es: 0018   ss: 0018
Process less (pid: 1319, stackpageÍ9a9000)
Stack: cd6770b0 cdc5aa00 00000007 000000e0 cdc5aa00 00000007 ffffffff
00000000
       ffffffff c0230aa5 cd6770b0 32988f50 c0234f37 cd9a9f18 c0230abd
cd6770b0
       c0234f34 cd9a9f18 c01095d2 cd6770b0 c0234f34 cf86666b cd6770a1
c0234f2e
Call Trace:    [<c0230aa5>] [<c0230abd>] [<c01095d2>] [<c0148c46>]

[<c0146cfd>]
[<c012cb2e>] [<c01084a3>]

Code: 80 38 00 74 07 40 4a 83 fa ff 75 f4 29 c8 89 44 24 10 8b 44
 Segmentation fault

The available bios options are as follow (related to the parallel port):

Onboard parallel port : [3BC/IRQ7] or [378/IRQ7] or [278/IRQ5] (choosen [378/IRQ7])
Onboard parallel mode : [EPP] or [ECP] or [ECP/EPP] (choosen [EPP]) EPP type: [EPP1.7] or [EPP1.9] (choosen [EPP1.9])

IRQ-7 assigned to [Legacy ISA] or [PCI/ISA PnP] (choosen [PCI/ISA PnP])

Which configuration should I use ?

Quoted 5 lines

Great. Couldn't you do the same with more simple parallel-ports adapters, such as i2c-philips-par, i2c-elv or i2c-velleman? These have been ported to Linux 2.6 already, and are supported by my unified driver too, while i2c-pport hasn't been ported and isn't part of the unified driver.

Since we have developped our own PC104 motherboard we wanted to integrate the i2c circuit on it. I couldn't find the elv and velleman schematics. Furthermore, I was concerning about the performances: hoping that the use of the PCF8584 will provide better performance. (less cpu load, interrupt driven for byte reading, etc.)

Quoted 3 lines

Actually I wonder if I will port and/or integrate the i2c-pport logic in Linux 2.6, because in most cases, the additional complexity shouldn't be required. But if you really need it, I'll think of it.

i2c-pport was very convenient for testing. It took less than an hour for wiring the cables, loading the module and detecting the slave with i2cdetect. I might not be the only one who needs it.

Thanks for all!

~Pierre

PS : btw, here is the robot I'm working on
http://asl.epfl.ch/index.html?content=research/systems/Solero/solero.php

-----Original Message-----
From: Jean Delvare [mailto:[email protected]]
Sent: Tuesday, January 27, 2004 10:01 PM
To: [email protected]
Cc: LM Sensors
Subject: Re: Follow up for Ticket 1538

Quoted 5 lines

thanks a lot for your answer. I've finally choosen not to use the PCF8584 for interfacing the i2c bus because I was not able to modprobe it whatever the kernel or the i2c-x version (I've been trying for around 3 days). However, I'm still interested to know if it has been tested and if anybody uses it successfully.

I'm surprised you couldn't get it to work. As far as I know, the driver is precisely made for people who build a board according to Simon Vogl's schematics. If you provide details about the failures, we might try to help.

Quoted 2 lines

Finally I'm using direct parallel port access and everything works fine with the i2c-pport driver :-)

Great. Couldn't you do the same with more simple parallel-ports adapters, such as i2c-philips-par, i2c-elv or i2c-velleman? These have been ported to Linux 2.6 already, and are supported by my unified driver too, while i2c-pport hasn't been ported and isn't part of the unified driver.

Actually I wonder if I will port and/or integrate the i2c-pport logic in Linux 2.6, because in most cases, the additional complexity shouldn't be required. But if you really need it, I'll think of it.

--
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/