Kernel Newbies archive mirror
 help / color / mirror / Atom feed
From: "Chan Kim" <ckim@etri.re.kr>
To: <kernelnewbies@kernelnewbies.org>
Subject: What does OS do with the 'ranges' property in PCI RC node in the device tree?
Date: Mon, 21 Nov 2022 22:15:34 +0900	[thread overview]
Message-ID: <013d01d8fdab$56bbc1d0$04334570$@etri.re.kr> (raw)

Hello linux experts,

I read https://elinux.org/Device_Tree_Usage, and it says about the "ranges"
property in the PCIe Root Complex node, 
"The above ranges define how the CPU see the PCI memory, and helps the CPU
to set up the right memory windows and write the right parameters into
various PCI device registers. This is sometimes referred to as outbound
memory."
I know the 'ranges' property shows how the PCI devices's addresses are
mapped to host CPU's addresses. The PCI devices are identified by the
bus/device/function pair and the address is indicated the
config/IO/memory32/memory64 types and start and length in the PCI bus. 
I understand that the BIOS or bootloader initializes PCI RC and does the
enumeration and assigns the BAR registers so that the device's resources are
mapped in host CPU's address space.
And I guess the bootloader fixes the device tree (or ACPI table) by filling
in the 'ranges' property. Is it correct?
My another question is, what does the OS do with this 'ranges' information
in the device tree? Of course the PCI device's driver uses BAR to get the
physical address (seen from the host CPU) and by ioremap, it can access the
devices memory and registers using virtual address. In the above link it
says "The above ranges define how the CPU see the PCI memory, and helps the
CPU to set up the right memory windows and write the right parameters into
various PCI device registers. This is sometimes referred to as outbound
memory." What does it mean? Does the OS do something with this 'ranges'
value?
I'll appreciated if someone could explain it to me.
Thank you!

Chan Kim




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

             reply	other threads:[~2022-11-21 13:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 13:15 Chan Kim [this message]
2022-11-21 16:51 ` What does OS do with the 'ranges' property in PCI RC node in the device tree? Saad Masood

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='013d01d8fdab$56bbc1d0$04334570$@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 read-only IMAP folder(s) and NNTP newsgroup(s).