kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: "Chan Kim" <ckim@etri.re.kr>
To: <kernelnewbies@kernelnewbies.org>
Subject: How is 'ranges' property of pci node of a device tree determined?
Date: Wed, 4 May 2022 18:01:49 +0900	[thread overview]
Message-ID: <069901d85f95$9774f520$c65edf60$@etri.re.kr> (raw)

Hello all,

I was reading
https://elinux.org/Device_Tree_Usage#Ranges_.28Address_Translation.29 and
have a question (I have read it in the past). 
In the device tree node for the PCI bridge, there is "ranges" property and
this is to show the address mapping between PCI address and CPU physical
address.
And this seems to be the relationship between BARs and the CPU physical
address and this is usually determined and set by the firmware before linux
boots by filling in the BARs and setting the PCI bridge's address
translation logic appropriately. So does this mean this pci node in the
device tree is filled (or modified) by the firmware(BIOS) during
initialization and passed to the OS? (I guess so). I know how the BIOS or
firmware detects the address ranges's type (memory or IO, cachable, and
size) from the initial BAR registers and fills them. I'd appreciate it if
someone could confirm this.
(and the dma-ranges property seems to be the relationship between PCI
address and the host side memory address)

Thank you!

Chan Kim





_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

                 reply	other threads:[~2022-05-04  9:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='069901d85f95$9774f520$c65edf60$@etri.re.kr' \
    --to=ckim@etri.re.kr \
    --cc=kernelnewbies@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 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).