All of lore.kernel.org
 help / color / mirror / Atom feed
From: lists@kaiser.cx (Martin Kaiser)
To: kernelnewbies@lists.kernelnewbies.org
Subject: how to best ioremap() the ranges part of a "simple-bus" device?
Date: Wed, 1 Aug 2018 10:34:43 +0200	[thread overview]
Message-ID: <20180801083443.ii2gq4ev7pzdiaj3@viti.kaiser.cx> (raw)
In-Reply-To: <20180801075925.vywifrbmpz77mkh2@viti.kaiser.cx>

Thus wrote Martin Kaiser (lists at kaiser.cx):

> Thus wrote rpjday at crashcourse.ca (rpjday at crashcourse.ca):


> > i'll need to access that device tree entry and effectively ioremap()
> > slave0's physical address to a usable virtual address.

> >   is there a canonical way to do this? short of manually extracting
> > the appropriate device tree node and reading that property and calling
> > ioremap()? is there a wrapper for that sort of operation, which i
> > imagine must be fairly common?

> I guess that of_iomap() does what you need here.

Oh, I missed your point. You were asking specifically about ranges,
of_remap() searches for a reg property.

I'm not aware of any generic function to parse ranges. All I found was
of_pci_range_to_resource() which is specific to PCI...

You could search the dt files for "ranges =", find the corresponding
drivers and see how they parse the info.

Sorry for the noise,
Martin

      reply	other threads:[~2018-08-01  8:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31 14:24 how to best ioremap() the ranges part of a "simple-bus" device? rpjday at crashcourse.ca
2018-08-01  7:59 ` Martin Kaiser
2018-08-01  8:34   ` Martin Kaiser [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=20180801083443.ii2gq4ev7pzdiaj3@viti.kaiser.cx \
    --to=lists@kaiser.cx \
    --cc=kernelnewbies@lists.kernelnewbies.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.