From: Peter Korsgaard <jacmet@sunsite.dk>
To: Bruce_Leonard@selinc.com
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: Device tree and external RTC
Date: Thu, 04 Oct 2007 13:21:10 +0200 [thread overview]
Message-ID: <87ve9nw2ft.fsf@macbook.be.48ers.dk> (raw)
In-Reply-To: <OFFFD4BE8F.17F6E427-ON88257369.006D8651-88257369.00736D96@selinc.com> (Bruce Leonard's message of "Wed\, 3 Oct 2007 14\:00\:49 -0700")
>>>>> "Bruce" == Bruce Leonard <Bruce_Leonard@selinc.com> writes:
Hi,
Bruce> I'm seriously confused by how things are supposed to work now
Bruce> with device trees on the PowerPC arch. I'm bringing up our
Bruce> custom HW which is bassed on the mpc8347e, with an m41t00 RTC
Bruce> hanging off the i2c bus, U-boot is 1.2.0, kernel is 2.6.22.
Bruce> My problem is I can't get the kernel to access the RTC. It
Bruce> works fine in U-boot, but nothing in the kernel.
Bruce> I've searched through all the device tree files that come with
Bruce> the kernel
Bruce> and I can't find any that explicitly show an external device
Bruce> as a child node to a SoC I2C controller but it sure seems to
Bruce> me that the purpose of the device tree is to describe to the
Bruce> kernel all the hardware in the system. Therefore it seems to
Bruce> me that there should be something like the following in the
Bruce> device tree:
Bruce> <snip>
Bruce> i2c@3000 {
Bruce> device_type = "i2c";
Bruce> compatible = "fsl-i2c";
Bruce> reg = <3000 100>;
Bruce> interrupts = <e 8>;
Bruce> interrupt-parent = < &ipic >;
Bruce> dfsrr;
You need to add #address/size-cells to the I2C node, E.G.:
+ #address-cells = <1>;
+ #size-cells = <0>;
Bruce> rtc@54 {
Bruce> device_type = "rtc";
Bruce> something;
Bruce> something;
Bruce> something;
Bruce> }
Bruce> }
Bruce> <snip>
You need to set compatible and reg, E.G.
rtc@54 {
device_type = "rtc";
compatible = "stm,m41t00";
reg = <54>;
};
And it should get picked up automatically by
fsl_soc.c:of_find_i2c_driver().
Notice that you will need to use galak's git tree
(git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git) or
apply the following patch:
http://ozlabs.org/pipermail/linuxppc-dev/2007-September/042896.html
As it isn't in mainline yet.
--
Bye, Peter Korsgaard
next prev parent reply other threads:[~2007-10-04 11:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-03 21:00 Device tree and external RTC Bruce_Leonard
2007-10-03 23:15 ` Bruce_Leonard
2007-10-03 23:33 ` Jon Smirl
2007-10-04 0:59 ` linux ethernet problem jxnuxdy
2007-10-04 11:45 ` Valentine Barshak
2007-10-04 9:29 ` Device tree and external RTC Guennadi Liakhovetski
2007-10-04 18:17 ` Bruce_Leonard
2007-10-04 19:52 ` Guennadi Liakhovetski
2007-10-04 11:21 ` Peter Korsgaard [this message]
2007-10-04 18:25 ` Bruce_Leonard
2007-10-05 10:45 ` Guennadi Liakhovetski
2007-10-05 19:37 ` Bruce_Leonard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ve9nw2ft.fsf@macbook.be.48ers.dk \
--to=jacmet@sunsite.dk \
--cc=Bruce_Leonard@selinc.com \
--cc=linuxppc-embedded@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.