* MPC5200 I2C and 2.6 kernel
@ 2007-11-27 10:07 Oliver Rutsch
2007-11-28 20:22 ` Wolfgang Denk
0 siblings, 1 reply; 4+ messages in thread
From: Oliver Rutsch @ 2007-11-27 10:07 UTC (permalink / raw)
To: Linuxppc-dev
Hi,
I'm using a TQM5200S (MPC5200B CPU) module on the STK52xx starter kit.
For some reasons I have to use the 2.6 kernel (the latest 2.6.23.1 from
the DENX git archive) with ARCH=powerpc and most of my external hardware
is running fine with this.
On the starter kit there is an external I2C RTC (M41T00) and I like to
use it now. In the 2.4 kernel there were some options regarding MPC5200
I2C, but I could not find them in the 2.6 kernel.
There were options for MPCxxx I2C Algorithm or MPC5xxx TQM5200 I2C
Adapter, for example.
Regardless what I'm doing in the 2.6 kernel configuration I can't get
this RTC running (I activated RTC support and the driver for the M41T00
in the configuration).
hwclock --debug tells me:
hwclock: Open of /dev/rtc failed, errno=19: No such device.
No usable clock interface found.
So the questions is: Is the I2C support for the MPC5200 in the 2.6.23
kernel in an usable state? Or do I need some special patches from TQ for
this board to get it running?
Thanks in advance and bye,
--
Dipl. Ing. Oliver Rutsch
EMail: orutsch@sympatec.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MPC5200 I2C and 2.6 kernel
2007-11-27 10:07 MPC5200 I2C and 2.6 kernel Oliver Rutsch
@ 2007-11-28 20:22 ` Wolfgang Denk
2007-11-28 23:54 ` Jon Smirl
2007-11-29 11:00 ` Oliver Rutsch
0 siblings, 2 replies; 4+ messages in thread
From: Wolfgang Denk @ 2007-11-28 20:22 UTC (permalink / raw)
To: Oliver Rutsch; +Cc: Linuxppc-dev
In message <474BEC4F.3080800@sympatec.com> you wrote:
>
> Regardless what I'm doing in the 2.6 kernel configuration I can't get
> this RTC running (I activated RTC support and the driver for the M41T00
> in the configuration).
> hwclock --debug tells me:
> hwclock: Open of /dev/rtc failed, errno=19: No such device.
Well... did you check how your /dev/rtc is set up? It used to be a
misc device with MAJ=10 MIN=135 in old kernel versions, but now it's
MAJ=254 MIN=4, i. e. it should look like this:
crw-r--r-- 1 root root 254, 0 Jun 22 18:30 /dev/rtc
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
For every complex problem, there is a solution that is simple, neat,
and wrong. -- H. L. Mencken
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MPC5200 I2C and 2.6 kernel
2007-11-28 20:22 ` Wolfgang Denk
@ 2007-11-28 23:54 ` Jon Smirl
2007-11-29 11:00 ` Oliver Rutsch
1 sibling, 0 replies; 4+ messages in thread
From: Jon Smirl @ 2007-11-28 23:54 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: Linuxppc-dev
On 11/28/07, Wolfgang Denk <wd@denx.de> wrote:
> In message <474BEC4F.3080800@sympatec.com> you wrote:
> >
> > Regardless what I'm doing in the 2.6 kernel configuration I can't get
> > this RTC running (I activated RTC support and the driver for the M41T00
> > in the configuration).
> > hwclock --debug tells me:
You have to add the i2c device to this table in arch/powerpc/sysdev/fsl_soc.c
static struct i2c_driver_device i2c_devices[] __initdata = {
{"ricoh,rs5c372a", "rtc-rs5c372", "rs5c372a",},
{"ricoh,rs5c372b", "rtc-rs5c372", "rs5c372b",},
{"ricoh,rv5c386", "rtc-rs5c372", "rv5c386",},
{"ricoh,rv5c387a", "rtc-rs5c372", "rv5c387a",},
{"dallas,ds1307", "rtc-ds1307", "ds1307",},
{"dallas,ds1337", "rtc-ds1307", "ds1337",},
{"dallas,ds1338", "rtc-ds1307", "ds1338",},
{"dallas,ds1339", "rtc-ds1307", "ds1339",},
{"dallas,ds1340", "rtc-ds1307", "ds1340",},
{"stm,m41t00", "rtc-ds1307", "m41t00"},
{"dallas,ds1374", "rtc-ds1374", "rtc-ds1374",},
};
Then make a device tree node for it with the address.
i2c@3d40 {
compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
reg = <3d40 40>;
interrupts = <2 10 0>;
interrupt-parent = <&mpc5200_pic>;
fsl5200-clocking;
rtc@51 {
compatible = "epson,rtc8564";
reg = <51>;
};
};
The device will be named /dev/rtc0. A more update to date version of
hwclock will find it or you can make a symlink from rtc to rtc0.
When it works right:
rtc-pcf8563 1-0051: rtc core: registered rtc-pcf8563 as rtc0
rtc-pcf8563 1-0051: setting system clock to 2007-11-28 16:53:12 UTC (1196268792)
I have a pending series of patches that removes this table and moves
the aliasing into the i2c drivers. It is waiting for a core change to
go into the i2c subsystem.
> > hwclock: Open of /dev/rtc failed, errno=19: No such device.
>
> Well... did you check how your /dev/rtc is set up? It used to be a
> misc device with MAJ=10 MIN=135 in old kernel versions, but now it's
> MAJ=254 MIN=4, i. e. it should look like this:
>
> crw-r--r-- 1 root root 254, 0 Jun 22 18:30 /dev/rtc
>
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
> For every complex problem, there is a solution that is simple, neat,
> and wrong. -- H. L. Mencken
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MPC5200 I2C and 2.6 kernel
2007-11-28 20:22 ` Wolfgang Denk
2007-11-28 23:54 ` Jon Smirl
@ 2007-11-29 11:00 ` Oliver Rutsch
1 sibling, 0 replies; 4+ messages in thread
From: Oliver Rutsch @ 2007-11-29 11:00 UTC (permalink / raw)
To: Linuxppc-dev
Hi,
>> hwclock --debug tells me:
>
>> hwclock: Open of /dev/rtc failed, errno=19: No such device.
>
> Well... did you check how your /dev/rtc is set up? It used to be a
> misc device with MAJ=10 MIN=135 in old kernel versions, but now it's
> MAJ=254 MIN=4, i. e. it should look like this:
>
> crw-r--r-- 1 root root 254, 0 Jun 22 18:30 /dev/rtc
>
Yes this was not correct in my filesystem. But in your filesystem
it looks like MAJ=254 MIN=0. I set MIN to 0 and applied Jon's
suggestions and now it works! So many thanks to Wolfgang and Jon,
this was really a hard problem for me!
But I should mention that I modified my dts for the M41T00 RTC
in the following way:
rtc@68 {
compatible = "stm,m41t00";
reg = <68>;
};
In some piece of an older driver I found the I2C Address for this RTC
(0x68), although the data sheet tells me that the slave address is 0xD0.
However, now it's up and running!
Thanks and bye,
--
Dipl. Ing. Oliver Rutsch
EMail: orutsch@sympatec.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-11-29 11:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-27 10:07 MPC5200 I2C and 2.6 kernel Oliver Rutsch
2007-11-28 20:22 ` Wolfgang Denk
2007-11-28 23:54 ` Jon Smirl
2007-11-29 11:00 ` Oliver Rutsch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).