* Are the I2C drivers on MPC8540 Kernel 2.6.10 working?
@ 2005-02-09 17:48 Clemens Koller
2005-02-09 18:57 ` Eugene Surovegin
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Clemens Koller @ 2005-02-09 17:48 UTC (permalink / raw)
To: linuxppc-embedded
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 messages
rtc8564_attach: client=c02c1e00
rtc8564_attach: client.id=61440
i2c_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: RTC8564
i2c_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 messages
rtc8564_attach: client=c02c1200
rtc8564_attach: client.id=61440
i2c_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_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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Are the I2C drivers on MPC8540 Kernel 2.6.10 working?
2005-02-09 17:48 Are the I2C drivers on MPC8540 Kernel 2.6.10 working? Clemens Koller
@ 2005-02-09 18:57 ` Eugene Surovegin
2005-02-09 19:26 ` Kumar Gala
2005-02-14 7:35 ` Babarovic Ivica
2 siblings, 0 replies; 4+ messages in thread
From: Eugene Surovegin @ 2005-02-09 18:57 UTC (permalink / raw)
To: Clemens Koller; +Cc: linuxppc-embedded
On Wed, Feb 09, 2005 at 06:48:35PM +0100, Clemens Koller wrote:
> 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):
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Are the I2C drivers on MPC8540 Kernel 2.6.10 working?
2005-02-09 17:48 Are the I2C drivers on MPC8540 Kernel 2.6.10 working? Clemens Koller
2005-02-09 18:57 ` Eugene Surovegin
@ 2005-02-09 19:26 ` Kumar Gala
2005-02-14 7:35 ` Babarovic Ivica
2 siblings, 0 replies; 4+ messages in thread
From: Kumar Gala @ 2005-02-09 19:26 UTC (permalink / raw)
To: Clemens Koller; +Cc: linuxppc-embedded
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
On Feb 9, 2005, at 11:48 AM, Clemens Koller wrote:
> 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=3D1
>
> I cannot access /dev/misc/rtc with the hwclock (latest version=3D2.23):
> -----8<------------------------------------
> hwclock -w
> hwclock: ioctl() (RTC_SET_TIME) to /dev/misc/rtc to 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_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 messages
> rtc8564_attach: client=3Dc02c1e00
> rtc8564_attach: client.id=3D61440
> i2c_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: RTC8564
> i2c_adapter i2c-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
> 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<------------------------------------
>
> 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 messages
> rtc8564_attach: client=3Dc02c1200
> rtc8564_attach: client.id=3D61440
> i2c_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_adapter i2c-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
> 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
> -----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
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Are the I2C drivers on MPC8540 Kernel 2.6.10 working?
2005-02-09 17:48 Are the I2C drivers on MPC8540 Kernel 2.6.10 working? Clemens Koller
2005-02-09 18:57 ` Eugene Surovegin
2005-02-09 19:26 ` Kumar Gala
@ 2005-02-14 7:35 ` Babarovic Ivica
2 siblings, 0 replies; 4+ messages in thread
From: Babarovic Ivica @ 2005-02-14 7:35 UTC (permalink / raw)
To: linuxppc-embedded
Clemens Koller wrote:
> 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.
> 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<------------------------------------
>
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
> 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 messages
> rtc8564_attach: client=c02c1e00
> rtc8564_attach: client.id=61440
> i2c_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: RTC8564
> i2c_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 messages
> rtc8564_attach: client=c02c1200
> rtc8564_attach: client.id=61440
> i2c_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_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?
>
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-02-14 7:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-09 17:48 Are the I2C drivers on MPC8540 Kernel 2.6.10 working? Clemens Koller
2005-02-09 18:57 ` Eugene Surovegin
2005-02-09 19:26 ` Kumar Gala
2005-02-14 7:35 ` Babarovic Ivica
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.