i2c on mpc5200
Hi!
I have a hardware clock (RTC) which is not yet supported in the linux kernel. It is RX-8025 module from EPSON and it is I2C bus-interface based. Before I start writing support for this module I would like to have I2C support working in my kernel. Has anybody succeeded in getting I2C supported for MPC5200 based boards with 2.6 kernels? I'm using the one which maintains Sylvain Munaut. If I boot up the kernel with I2C support in it I don't get any initialization messages for I2C, only this one line:
----------------------------------------------------------------------
eth0: Phy @ 0x0, type LXT971 (0x001378e2) mice: PS/2 mouse device common for all mice
i2c /dev entries driver
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
-----------------------------------------------------------------------
I tried with v various 2.4 kernels but I only had some success with a kernel
form metrowerks which I got from a colleague. This is it's output.
--------------------------------------------------------------------------------
i2c-core.o: i2c core module
i2c-dev.o: i2c /dev entries driver module
i2c-core.o: driver i2c-dev dummy driver registered.
i2c-algo-bit.o: i2c bit algorithm module
i2c-proc.o version 2.6.1 (20010825)devfs_register(ttyS): could not append to parent, err: -17devfs_register(ttyS): could not append to parent, err: -17devfs_register(cua): could not append to parent, err: -17devfs_register(cua): could not append to parent, err: -17
PORT CONFIG 4
PORT CONFIG 500044
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
i2c-dev.o: Registered 'Icecube I2C module #2 interface' as minor 0
i2c-core.o: adapter Icecube I2C module #2 interface registered as adapter 0.
i2c-algo-5xxx.o: scanning bus Icecube I2C module #2 interface... ..................................................(0x32).............................(0x50)(0x51)(0x52)(0x53)(0x54)(0x55)(0x56)(0x57).......................................(0x) i2c-icecube.o: I2C module #2 installed
------------------------------------------------------------------------------------
This kernel has some strange hacks in it and I needed to change some code in order for it to compile under gcc. Ok, it works now but I would really like to code the driver for RTC module under 2.6 tree and like it is supposed to be done. I like the 2.6 I2C directory tree and it all makes more sense to a newb like me. First I need to get those core.o and algo.o stuff working. Under the menuconfig in the I2C there is a
I2C Hardware Bus support ---> [*] MPC107/824x/85xx/52xx
'Help' says :
"If you say yes to this option, support will be included for the
built-in I2C interface on the MPC107/Tsi107/MPC8240/MPC8245 and
MPC85xx family processors. The driver may also work on 52xx
family processors, though interrupts are known not to work."
I'm guessing this (drivers/i2c/busses/i2c-mpc.c) is the part I need to work on? Of course any input on where should I start would be greatly appreciated. Also if anyone has already succeeded in supporting i2c for mpc5200 I would love to hear your experience.
Best regards,
Ivica
Quoted 1 line · In message <[email protected]> you wrote:
...
Quoted 1 line
module I would like to have I2C support working in my kernel.
...
Quoted 3 lines
I tried with v various 2.4 kernels but I only had some success with a kernel
form metrowerks which I got from a colleague. This is it's output.
It works fine with the 2.4.x kernel on our CVS server.
Quoted 9 lines
i2c-core.o: i2c core module
i2c-dev.o: i2c /dev entries driver module i2c-core.o: driver i2c-dev dummy driver registered. i2c-algo-bit.o: i2c bit algorithm module i2c-proc.o version 2.6.1 (20010825)devfs_register(ttyS): could not append to parent, err: -17devfs_register(ttyS): could not append to parent, err: -17devfs_register(cua): could not append to parent, err: -17devfs_register(cua): could not append to parent, err: -17
Did you try NOT using devfs?
Quoted 3 lines
Also if anyone has already succeeded in supporting i2c for mpc5200 I would love
to hear your experience.
We did, in 2.4, where it works OK, at least as long as the hardware is OK (some of the earlier Icecube boards had some issues).
Best regards,
Wolfgang Denk
Signature · 4 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] The ultimate barrier is one's viewpoint. - Terry Pratchett, _The Dark Side of the Sun_
Quoted 9 lines · Wolfgang Denk
We did, in 2.4, where it works OK, at least as long as the hardware is OK (some of the earlier Icecube boards had some issues).
Best regards,
Wolfgang Denk
This is true. I get this output when I boot latest kernel from DENX.
I think I decided I will go to 2.6 because it had the preemptible kernel
option which I will probably need later on.
******************************************************
i2c-core.o: i2c core module version 2.6.1 (20010830)
i2c-dev.o: i2c /dev entries driver module version 2.6.1 (20010830)
i2c-algo-pcf.o: i2c pcf8584 algorithm module
i2c-proc.o version 2.6.1 (20010830)
ttyS0 on PSC1
ttyS1 on PSC2
ttyS2 on PSC3
RAMDISK driver initialized: 16 RAM disks of 10240K size 1024 blocksize
loop: loaded (max 8 devices)
i2c-algo-5xxx.o: scanning bus Icecube I2C module #2 interface... ..................................................(0x32).............................(0x50)(0x51)(0x52)(0x53)(0x54)(0x55)(0x56)(0x57).......................................(0x) i2c-icecube.o: I2C module #2 installed
eth0: Phy @ 0x0, type LXT971 (0x001378e2)
*****************************************************
Root file system on NFS doesn't work though. I get this errors:
******************************************************
Looking up port of RPC 100003/2 on 192.168.254.58 MPC5xxx_FEC_IEVENT_RFIFO_ERROR MPC5xxx_FEC_IEVENT_RFIFO_ERROR MPC5xxx_FEC_IEVENT_RFIFO_ERROR MPC5xxx_FEC_IEVENT_RFIFO_ERROR MPC5xxx_FEC_IEVENT_RFIFO_ERROR MPC5xxx_FEC_IEVENT_RFIFO_ERROR MPC5xxx_FEC_IEVENT_RFIFO_ERROR
*******************************************************
But this is not that big of a problem. I'll just boot stand alone images. So, for writing a driver for my RTC i2c module I should look at Documentation/i2c/writing-clients right?
And it should be under
[*] I2C Chips support ---> right?
Best regards,
Ivica
Hi
Quoted 6 lines
I have a hardware clock (RTC) which is not yet supported in the linux kernel. It is RX-8025 module from EPSON and it is I2C bus-interface based. Before I start writing support for this module I would like to have I2C support working in my kernel. Has anybody succeeded in getting I2C supported for MPC5200 based boards with 2.6 kernels? I'm using the one which maintains
Quoted 8 lines
Sylvain Munaut. If I boot up the kernel with I2C support in it I don't get any initialization messages for I2C, only this one line:
----------------------------------------------------------------------
eth0: Phy @0x0, type LXT971 (0x001378e2) mice: PS/2 mouse device common for all mice
i2c /dev entries driver
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
-----------------------------------------------------------------------
Are you sure it doesn't work ?
On my system there are no I2C init message either, the driver is just not noisy ... (unless you activate all the I2C debug stuff).
I have the exact same message than you but if I activate the eeprom support then in /sys/bus/i2c/devices, the lite5200 eeprom shows up and I can read it ...
Sylvain
Quoted 3 lines · Sylvain Munaut
Are you sure it doesn't work ?
On my system there are no I2C init message either, the driver is just not noisy ... (unless you activate all the I2C debug stuff).
Debug stuff didn't output any messages. Then I simply listed kernel symbol table and grep for i2c. This is what I got.:
# cat proc/kallsyms |grep i2c
c00e4134 T i2c_device_probec00e413c T i2c_device_removec00e4144 t i2c_adapter_dev_releasec00e4168 t i2c_adapter_class_dev_releasec00e41bc t i2c_client_releasec00e4210 T i2c_add_adapterc00e447c T i2c_del_adapterc00e4758 T i2c_add_driverc00e48a4 T i2c_del_driverc00e4adc t __i2c_check_addrc00e4b20 T i2c_check_addrc00e4be8 T i2c_adapter_idc00e4bf0 T i2c_attach_clientc00e4dec T i2c_detach_clientc00e4f48 t i2c_dec_use_clientc00e4f4c T i2c_use_clientc00e4f98 T i2c_release_clientc00e4ff8 T i2c_clients_commandc00e512c t i2c_device_matchc00e5134 t i2c_bus_suspendc00e5194 t i2c_bus_resumec00e51f4 T i2c_transferc00e5304 T i2c_master_sendc00e5438 T i2c_master_recvc00e55b4 T i2c_controlc00e56a4 T i2c_get_adapterc00e57a8 T i2c_put_adapterc00e57dc T i2c_smbus_partial_pecc00e5870 T i2c_smbus_pecc00e58a4 T i2c_smbus_add_pecc00e5994 T i2c_smbus_check_pecc00e5ad0 T i2c_get_functionalityc00e5b10 T i2c_check_functionalityc00e5b4c T i2c_smbus_xferc00e6130 T i2c_smbus_read_i2c_block_datac00e61b8 T i2c_smbus_block_process_callc00e627c T i2c_smbus_write_block_datac00e6304 T i2c_smbus_write_word_datac00e6348 T i2c_smbus_read_word_datac00e6398 T i2c_smbus_write_byte_datac00e63dc T i2c_smbus_read_byte_datac00e642c T i2c_smbus_write_bytec00e646c T i2c_smbus_read_bytec00e64bc T i2c_smbus_write_quickc00e64e0 T i2c_probec00e6a2c T i2c_dev_get_by_minorc00e6a40 T i2c_dev_get_by_adapterc00e6a80 t return_i2c_devc00e6b0c t i2cdev_readc00e6c20 t i2cdev_writec00e6d30 T i2cdev_ioctlc00e74e0 t i2cdev_openc00e7580 t i2cdev_releasec00e75c8 t release_i2c_devc00e75ec t i2cdev_attach_adapterc00e77b4 t i2cdev_detach_adapterc00e7868 t i2cdev_detach_clientc00e7870 t i2cdev_commandc00e7878 T i2c_detectc00e7d74 T i2c_which_vrmc00e7da0 t mpc_i2c_isrc00e7e20 t i2c_waitc00e953c t i2c_startc00e95e0 t i2c_repstartc00e9790 t i2c_stopc00e9904 t i2c_outbc00ea71c T i2c_bit_add_busc00eace4 T i2c_bit_del_busc00ead04 t i2c_startc00ead8c t i2c_repstartc00eae14 t i2c_stopc00eb608 T i2c_pcf_add_busc00eb8e8 T i2c_pcf_del_busc00ec1c4 T i2c_pca_add_busc00ec2e4 T i2c_pca_del_busc01569a0 t i2c_exitc01569e0 t i2c_dev_exitc0156a34 t mpc_i2c_removec01b7e20 t i2c_initc01b7e7c t i2c_dev_initc01b7f40 t mpc_i2c_probe
I think this proves i2c support is in the kernel. Right?
regards,
Ivica