All of lore.kernel.org
 help / color / mirror / Atom feed
From: rpjday@crashcourse.ca (rpjday at crashcourse.ca)
To: kernelnewbies@lists.kernelnewbies.org
Subject: how to best ioremap() the ranges part of a "simple-bus" device?
Date: Tue, 31 Jul 2018 10:24:49 -0400	[thread overview]
Message-ID: <20180731102449.Horde.1z7io_6Z3o-YiVoMcjWtBTc@crashcourse.ca> (raw)


   another (i suspect) fairly simple question, i've just never had the occasion
to mess around in this part of the code.

   if i have a device tree source file containing the snippet:

         slave0: slave0-fubar at 90000000 {
                 compatible = "simple-bus";
                 ranges = <0x0 0x90000000 0x10000000>;
                 #address-cells = <1>;
                 #size-cells = <1>;
         };

         slave1: slave1-fubar at a0000000 {
                 compatible = "simple-bus";
                 ranges = <0x0 0xa0000000 0x10000000>;
                 #address-cells = <1>;
                 #size-cells = <1>;
         };

those two ranges actually represent physical addresses within
an FPGA and, when certain events occur, i want some driver code to
read/write some registers in slave0's address space, so obviously
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?

   oh, and a pointer to a good example in the current kernel source
would, of course, be useful.

rday

             reply	other threads:[~2018-07-31 14:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31 14:24 rpjday at crashcourse.ca [this message]
2018-08-01  7:59 ` how to best ioremap() the ranges part of a "simple-bus" device? Martin Kaiser
2018-08-01  8:34   ` Martin Kaiser

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=20180731102449.Horde.1z7io_6Z3o-YiVoMcjWtBTc@crashcourse.ca \
    --to=rpjday@crashcourse.ca \
    --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.