From: "Grant Likely" <grant.likely@secretlab.ca>
To: "Clemens Koller" <clemens.koller@anagramm.de>
Cc: Alessandro Zummo <alessandro.zummo@towertech.it>,
rtc-linux@googlegroups.com, linuxppc-embedded@ozlabs.org
Subject: Re: OT: Re: solved: Re: [rtc-linux] Re: DS1337 RTC on I2C broken.
Date: Mon, 3 Dec 2007 13:05:56 -0700 [thread overview]
Message-ID: <fa686aa40712031205v6c85f563g22b6486c76a0c7c6@mail.gmail.com> (raw)
In-Reply-To: <47545A81.90804@anagramm.de>
On 12/3/07, Clemens Koller <clemens.koller@anagramm.de> wrote:
> Hello, Scott!
>
> Scott Wood schrieb:
> >> Here, the next idea which comes to my mind:
> >> Maybe we should think about a kernel-config -> dts compiler for
> >> the future where the enabled drivers generate their default dts
> >> entries automagically?
> >
> > Sorry, there's just not enough information in .config for that.
>
> If there is really the need to put more information (which I don't
> see in the case of the RTCs) to .config, it might be an idea to
> extend the current structure for this use instead of duplicating
> and maintaining a second repository.
>
> And regarding the DS1337 (or the PCF8563 and similar RTCs):
> It's address (0x68) is immutable fixed by the manufacturer
> of that device. So, why do we include it in the DT, when we
> already told the kernel what driver we want to use?
I2C is an odd bus in that it is only partially probeable; you can
probe for presence, but you can't trust that you know what is there.
The device tree approach sidesteps that uncertainty by just mandating
that you specify that address and type of each device. This is
neither hard or onerous on the developer to do.
If we *could* trust the i2c probing (like we can on PCI), then i2c
devices would *not* need to be in the device tree.
> Even if I have an eeprom which can have varying addresses,
> I can simply tell the driver/the kernel .config what address
> it should use... If I want to be able to alter that address
> for whatever reason by OF, I still don't want to touch a
> separate file in the kernel tree.
Kconfig was never designed for that type of board level detail and it
would be awkward to shoehorn that in (not to mention that it doesn't
solve the problem of one kernel running on many boards.)
Historically we solved the config problem with board specific code in
.c files. A solution I'm sure you'll agree might work, but it's not
sustainable in the long run.
As for modifying the device tree; you've got many choices; choose what
works best for you.
For example, you could:
a. write a separate .dts file per board varient, or
b. write single .dts files which only contains the common properties
and the bootloader populates the board specific ones, or
c. write a single .dts file which contains all possible nodes and the
bootloader deletes the nodes which are irrelevant.
Regardless of what method you choose, you just need to make sure that
the device tree that the kernel receives is an accurate representation
of the hardware (ie. no nodes for non-present devices)
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
next prev parent reply other threads:[~2007-12-03 20:05 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-28 18:25 DS1337 RTC on I2C broken Clemens Koller
2007-11-28 18:43 ` Alessandro Zummo
2007-11-28 19:20 ` Clemens Koller
2007-11-28 19:36 ` Clemens Koller
2007-11-28 20:34 ` [rtc-linux] " Alessandro Zummo
2007-11-29 11:24 ` Clemens Koller
2007-11-29 11:34 ` raul.moreno
2007-11-29 12:43 ` Clemens Koller
2007-11-29 20:03 ` Clemens Koller
2007-11-29 20:19 ` Alessandro Zummo
2007-11-30 11:04 ` Clemens Koller
2007-11-30 11:20 ` [rtc-linux] " Alessandro Zummo
2007-11-30 14:12 ` Clemens Koller
2007-12-01 12:24 ` Alessandro Zummo
2007-12-02 20:25 ` Olof Johansson
2007-11-30 18:12 ` Clemens Koller
2007-12-01 12:16 ` Alessandro Zummo
2007-12-03 15:14 ` Clemens Koller
2007-12-03 16:07 ` Bartlomiej Sieka
2007-12-03 16:38 ` Clemens Koller
2007-12-03 16:09 ` solved: " Clemens Koller
2007-12-03 16:48 ` Scott Wood
2007-12-03 17:41 ` OT: " Clemens Koller
2007-12-03 18:07 ` Scott Wood
2007-12-03 19:35 ` Clemens Koller
2007-12-03 20:05 ` Grant Likely [this message]
2007-12-03 20:46 ` Scott Wood
2007-12-04 11:42 ` Clemens Koller
2007-12-04 13:08 ` Scott Wood
2007-12-04 15:32 ` Clemens Koller
2007-12-04 16:08 ` Scott Wood
2007-12-05 10:27 ` Clemens Koller
2007-12-04 17:19 ` Jon Smirl
2007-12-05 10:30 ` Clemens Koller
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=fa686aa40712031205v6c85f563g22b6486c76a0c7c6@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--cc=alessandro.zummo@towertech.it \
--cc=clemens.koller@anagramm.de \
--cc=linuxppc-embedded@ozlabs.org \
--cc=rtc-linux@googlegroups.com \
/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 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).