From: Michael Ellerman <michael@ellerman•id.au>
To: Scott Wood <scottwood@freescale•com>
Cc: "linuxppc-dev@ozlabs•org" <linuxppc-dev@ozlabs•org>,
Simon Kagstrom <simon.kagstrom@ericsson•com>
Subject: Re: of_serial and device trees
Date: Thu, 26 Mar 2009 11:53:39 +1100 [thread overview]
Message-ID: <1238028819.20679.25.camel@localhost> (raw)
In-Reply-To: <49CA5E45.9070300@freescale.com>
[-- Attachment #1: Type: text/plain, Size: 1758 bytes --]
On Wed, 2009-03-25 at 11:39 -0500, Scott Wood wrote:
> Simon Kagstrom wrote:
> > There are no other versions yet, but I suppose there will be (it's
> > implemented in a FPGA after all!). So what is the general handling of
> > versions, should it be something like
> >
> > compatible = "ericsson,isf-pic", "ericsson,isf-pic-v2"
> >
> > etc if we'd make new revisions of the device?
>
> Looks good.
>
> >> I'm guessing that your FPGA PIC driver isn't getting its register address
> >> from the device tree, given that it works without the ranges property?
> >
> > It is, but I didn't check it for correctness yet, so I suppose I might
> > have mapped the wrong thing. The code looks like this:
> >
> > struct resource phys_addr;
> >
> > if (of_address_to_resource(np, 0, &phys_addr) != 0) {
> > printk(KERN_ERR": Could not get ISF PIC memory resource\n");
> > return NULL;
> > }
> >
> > spin_lock_init(&isf->lock);
> > isf->ioaddr = ioremap(phys_addr.start,
> > phys_addr.end - phys_addr.start);
>
> That looks good -- I'd have expected of_address_to_resource to fail,
> though, when the ranges property was missing. The kernel's device tree
> parsing code can sometimes be overly tolerant of broken device trees,
> which is probably what happened.
It assumes a missing ranges == empty ranges, which means 1:1. See the
comment in of_translate_one(). And thank Apple ;)
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
prev parent reply other threads:[~2009-03-26 0:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-24 8:49 of_serial and device trees Simon Kagstrom
2009-03-24 15:55 ` Scott Wood
2009-03-25 14:51 ` Simon Kagstrom
2009-03-25 16:39 ` Scott Wood
2009-03-26 0:53 ` Michael Ellerman [this message]
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=1238028819.20679.25.camel@localhost \
--to=michael@ellerman$(echo .)id.au \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=scottwood@freescale$(echo .)com \
--cc=simon.kagstrom@ericsson$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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