Are the I2C drivers on MPC8540 Kernel 2.6.10 working?
Hello,
My questions:
Is I2C and the Real Time Clock stuff working for the MPC8540 in Kernel 2.6.10?
Are there any hidden bugs/traps/features I need to tweak? Does anybody work successfully with the I2C in this configuration?
My problems:
I try to get a I2C Philips PCF8563 Real Time Clock working which is connected to the I2C of my MPC8540 processor.
The chip should be sw-compatible with the Epson RTC8564 component (according to the datasheets), so I tried to enable the MPC85xx I2C bus, the EPSON RTC8564 and the Kernel RTC support. I tried several configs - compiled i2c into the kernel or as a modules to load and unload them with debug=1
I cannot access /dev/misc/rtc with the hwclock (latest version=2.23):
-----8<------------------------------------
hwclock -w
hwclock: ioctl() (RTC_SET_TIME) to /dev/misc/rtc to set time failed, errno = Invalid argument (22). -----8<------------------------------------
Now I try to work with the modules and try to track down the problem:
after a modprobe rtc8564:
-----8<------------------------------------ i2c_adapter i2c-0: examining adapter
i2c-core: driver unregistered: RTC8564
i2c-core: driver RTC8564 registered.i2c_adapter i2c-0: found normal i2c entry for adapter 0, addr 51 i2c_adapter i2c-0: master_xfer: with 1 msgs.
Doing write 0 bytes to 0x51 - 1 of 1 messagesrtc8564_attach: client=c02c1e00rtc8564_attach: client.id=61440i2c_adapter i2c-0: master_xfer: with 1 msgs.
Doing write 2 bytes to 0x51 - 1 of 1 messages
I2C: No RXAK
rtc8564: cant init ctrl1
i2c-core: unregister_driver - looking for clients. i2c_adapter i2c-0: examining adapter
i2c-core: driver unregistered: RTC8564i2c_adapter i2c-0: adapter unregistered
i2c-core: driver RTC8564 registered. -----8<------------------------------------
Module Size Used by rtc8564 6660 0 i2c_core 25264 1 rtc8564
-----8<------------------------------------
and after a modprobe i2c-mpc I get:
-----8<------------------------------------ i2c_adapter i2c-0: found normal i2c entry for adapter 0, addr 51 i2c_adapter i2c-0: master_xfer: with 1 msgs.
Doing write 0 bytes to 0x51 - 1 of 1 messagesrtc8564_attach: client=c02c1200rtc8564_attach: client.id=61440i2c_adapter i2c-0: master_xfer: with 1 msgs.
Doing write 2 bytes to 0x51 - 1 of 1 messages
I2C: No RXAK
rtc8564: cant init ctrl1i2c_adapter i2c-0: registered as adapter #0 -----8<------------------------------------
Module Size Used by i2c_mpc 5376 0 rtc8564 6660 0 i2c_core 25264 2 i2c_mpc,rtc8564
-----8<------------------------------------
So, the output looks basically fine, except of the
I2C: No RXAK
rtc8564: cant init ctrl1
Which means that I don't get an ACK from my RTC. I connected an oscilloscope to the I2C - there is a lot of traffic. So I believe that the problem is more on the protocol side?
Does somebody have any suggestions before I dig into the code?
Thank you in advance!
Best greets,
Clemens Koller
_______________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Str. 45/1
81379 Muenchen
Germany
http://www.anagramm.de
Phone: +49-89-741518-50
Fax: +49-89-741518-19
Quoted 10 lines · Clemens Koller
My problems:
I try to get a I2C Philips PCF8563 Real Time Clock working which is connected to the I2C of my MPC8540 processor.
The chip should be sw-compatible with the Epson RTC8564 component (according to the datasheets), so I tried to enable the MPC85xx I2C bus, the EPSON RTC8564 and the Kernel RTC support. I tried several configs - compiled i2c into the kernel or as a modules to load and unload them with debug=1I cannot access
/dev/misc/rtcwith the hwclock (latest version=2.23):
Make sure I2C address for your RTC clock is correct. They may be compatible, but usually I2C address depends on board design and you may have to tweak the driver a little.
--
Eugene.
One issue with the 2.6.10 driver was it was very slow. I changed some=20=
sleep calls in 2.6.11 to improve its performance. You may want to try=20=
grabbing the driver out of 2.6.11-rc3 and see if that helps also.
- kumar
Quoted 41 lines · Clemens Koller
Hello,
My questions:
Is I2C and the Real Time Clock stuff working for the MPC8540 in Kernel 2.6.10?
Are there any hidden bugs/traps/features I need to tweak? Does anybody work successfully with the I2C in this configuration?My problems:
I try to get a I2C Philips PCF8563 Real Time Clock working which is connected to the I2C of my MPC8540 processor.
The chip should be sw-compatible with the Epson RTC8564 component (according to the datasheets), so I tried to enable the MPC85xx I2C bus, the EPSON RTC8564 and the Kernel RTC support. I tried several configs - compiled i2c into the kernel or as a modules to load and unload them with debug=3D1I cannot access
/dev/misc/rtcwith the hwclock (latest version=3D2.23):
-----8<------------------------------------
hwclock -w
hwclock:ioctl()(RTC_SET_TIME) to/dev/misc/rtcto set time failed,
errno =3D Invalid argument (22). -----8<------------------------------------Now I try to work with the modules and try to track down
the problem:after a modprobe rtc8564:
-----8<------------------------------------i2c_adapteri2c-0: examining adapter
i2c-core: driver unregistered: RTC8564
i2c-core: driver RTC8564 registered.
i2c_adapteri2c-0: found normal i2c entry for adapter 0, addr 51i2c_adapteri2c-0:master_xfer: with 1 msgs.
Doing write 0 bytes to0x51- 1 of 1 messages
rtc8564_attach: client=3Dc02c1e00rtc8564_attach: client.id=3D61440i2c_adapteri2c-0:master_xfer: with 1 msgs.
Doing write 2 bytes to0x51- 1 of 1 messages
I2C: No RXAK
Quoted 8 lines
rtc8564: cant init ctrl1
i2c-core:unregister_driver- looking for clients.i2c_adapteri2c-0: examining adapter
i2c-core: driver unregistered: RTC8564
i2c_adapteri2c-0: adapter unregistered
i2c-core: driver RTC8564 registered. -----8<------------------------------------ Module=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Size=A0 =
Used by
Quoted 4 lines
rtc8564=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 6660=A0 0 i2c_core=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 25264=A0 1 rtc8564 -----8<------------------------------------
Quoted 14 lines
and after a modprobe i2c-mpc I get:
-----8<------------------------------------
i2c_adapteri2c-0: found normal i2c entry for adapter 0, addr 51i2c_adapteri2c-0:master_xfer: with 1 msgs.
Doing write 0 bytes to0x51- 1 of 1 messages
rtc8564_attach: client=3Dc02c1200rtc8564_attach: client.id=3D61440i2c_adapteri2c-0:master_xfer: with 1 msgs.
Doing write 2 bytes to0x51- 1 of 1 messages
I2C: No RXAK
rtc8564: cant init ctrl1
i2c_adapteri2c-0: registered as adapter #0 -----8<------------------------------------ Module=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Size=A0 =
Used by
Quoted 3 lines
i2c_mpc=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 5376=A0 0 rtc8564=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 6660=A0 0 i2c_core=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 25264=A0 2 =
i2c_mpc,rtc8564
Quoted 33 lines
-----8<------------------------------------
So, the output looks basically fine, except of the
I2C: No RXAK
rtc8564: cant init ctrl1Which means that I don't get an ACK from my RTC.
I connected an oscilloscope to the I2C - there
is a lot of traffic. So I believe that the problem
is more on the protocol side?Does somebody have any suggestions before I dig into
the code?
Thank you in advance!Best greets,
Clemens Koller
_______________________________
R&D Imaging Devices
Anagramm GmbH
Rupert-Mayer-Str. 45/1
81379 Muenchen
Germanyhttp://www.anagramm.de
Phone: +49-89-741518-50
Fax: +49-89-741518-19
_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Quoted 9 lines · Clemens Koller
Hello,
My questions:
Is I2C and the Real Time Clock stuff working for the MPC8540 in Kernel 2.6.10?
Are there any hidden bugs/traps/features I need to tweak? Does anybody work successfully with the I2C in this configuration?
Don't know about bugs/traps ... I guess you will need to test it out I managed to get things working on my MPC5200 board and for EPSON RX-8025 RTC chip that sits on I2C bus. Driver needs some more tweaking but it basically works. All this was based on Stefan Eletzhofer's work on RTC8564 and some other stuff I read about on LKML archives.
Quoted 9 lines
My problems:
I try to get a I2C Philips PCF8563 Real Time Clock working which is connected to the I2C of my MPC8540 processor.
The chip should be sw-compatible with the Epson RTC8564 component (according to the datasheets), so I tried to enable the MPC85xx I2C bus, the EPSON RTC8564 and the Kernel RTC support. I tried several configs - compiled i2c into the kernel or as a modules to load and unload them with debug=1
Quoted 6 lines
I cannot access
/dev/misc/rtcwith the hwclock (latest version=2.23):
-----8<------------------------------------
hwclock -w
hwclock:ioctl()(RTC_SET_TIME) to/dev/misc/rtcto set time failed, errno = Invalid argument (22). -----8<------------------------------------
This is probably because you included RTC driver that is for BIOS based RTC clocks. ( and the Kernel RTC support.)
You need to write one that will access routines in RTC8564 driver. IIRC BIOS RTC driver gets up pretty fast after boot up. You don't need that because you have an I2C based RTC device. Your RTC driver needs to get initialized only after you have initialized I2C protocol first. What I did basicaly is this:
-I modified RTC8564 driver to fit mine RTC chip (EPSON RX=8025),
-I modified a RTC driver I got from Stefan Eletzhofer. It creates /dev/misc/rtc device and accesses routines in my RTC8025 driver,
-Added a function 2c_get_client() to i2c-core.c . This function
was removed from from i2c-core.c at some point but was still
listed in include/linux/i2c.h .
I read that from LKML archives.
hwclock works just fine right now. :D
Quoted 49 lines
Now I try to work with the modules and try to track down the problem:
after a modprobe rtc8564:
-----8<------------------------------------i2c_adapteri2c-0: examining adapter
i2c-core: driver unregistered: RTC8564
i2c-core: driver RTC8564 registered.i2c_adapteri2c-0: found normal i2c entry for adapter 0, addr 51i2c_adapteri2c-0:master_xfer: with 1 msgs.
Doing write 0 bytes to0x51- 1 of 1 messagesrtc8564_attach: client=c02c1e00rtc8564_attach: client.id=61440i2c_adapteri2c-0:master_xfer: with 1 msgs.
Doing write 2 bytes to0x51- 1 of 1 messages
I2C: No RXAK
rtc8564: cant init ctrl1
i2c-core:unregister_driver- looking for clients.i2c_adapteri2c-0: examining adapter
i2c-core: driver unregistered: RTC8564i2c_adapteri2c-0: adapter unregistered
i2c-core: driver RTC8564 registered. -----8<------------------------------------Module Size Used by rtc8564 6660 0 i2c_core 25264 1 rtc8564-----8<------------------------------------
and after a modprobe i2c-mpc I get:
-----8<------------------------------------i2c_adapteri2c-0: found normal i2c entry for adapter 0, addr 51i2c_adapteri2c-0:master_xfer: with 1 msgs.
Doing write 0 bytes to0x51- 1 of 1 messagesrtc8564_attach: client=c02c1200rtc8564_attach: client.id=61440i2c_adapteri2c-0:master_xfer: with 1 msgs.
Doing write 2 bytes to0x51- 1 of 1 messages
I2C: No RXAK
rtc8564: cant init ctrl1i2c_adapteri2c-0: registered as adapter #0 -----8<------------------------------------Module Size Used by i2c_mpc 5376 0 rtc8564 6660 0 i2c_core 25264 2 i2c_mpc,rtc8564-----8<------------------------------------
So, the output looks basically fine, except of the
Quoted 8 lines
I2C: No RXAK
rtc8564: cant init ctrl1Which means that I don't get an ACK from my RTC. I connected an oscilloscope to the I2C - there is a lot of traffic. So I believe that the problem is more on the protocol side?
As suggested earlier try checking your I2C address of the RTC chip. I had exactly the same problem until I found the address. The manual said one thing but I guess board designers had different ideas. I didn't go into details but somehow address changed from 0x64 to 0x32. I would also suggests you cross compile the following tools. i2cdetect, i2cdump and i2cset . They can help a lot. You will get them at http://secure.netroedge.com/~lm78/ .
I hope this helps. I can also send you mine dirty hacks if you want but they aren't ready for public yet. :D
regards,
Ivica