linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Simon Kagstrom <simon.kagstrom@ericsson.com>
Cc: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>
Subject: Re: of_serial and device trees
Date: Wed, 25 Mar 2009 11:39:33 -0500	[thread overview]
Message-ID: <49CA5E45.9070300@freescale.com> (raw)
In-Reply-To: <20090325155113.52048fe0@seasc0532.dyn.rnd.as.sw.ericsson.se>

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.

-Scott

  reply	other threads:[~2009-03-25 16:39 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 [this message]
2009-03-26  0:53       ` Michael Ellerman

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=49CA5E45.9070300@freescale.com \
    --to=scottwood@freescale.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=simon.kagstrom@ericsson.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).