[lkml]   [2016]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Purpose of pci_remap_iospace
On Tuesday, July 12, 2016 6:57:10 AM CEST Bharat Kumar Gogada wrote:
> Hi,
> I have a query.
> Can any once explain the purpose of pci_remap_iospace function in root port driver.
> What is its dependency with architecture ?
> Here is my understanding, the above API takes PCIe IO resource and its to be mapped CPU address from
> ranges property and remaps into virtual address space.
> So my question is who uses this virtual addresses ?

The inb()/outb() functions declared in asm/io.h

> When End Point requests for IO BARs doesn't it get
> from the above resource range (first parameter of API) and
> do ioremap to access this region ?

Device drivers generally do not ioremap() the I/O BARs but they
use inb()/outb() directly. They can also call pci_iomap() and
do ioread8()/iowrite8() on the pointer returned from that function,
but generally the call to pci_iomap() then returns a pointer into
the virtual address that is already mapped.

> But why root complex driver is mapping this address region ?

The PCI core does not know that the I/O space is memory mapped.
On x86 and a few others, I/O space is not memory mapped but requires
the use of special CPU instructions.


 \ /
  Last update: 2016-07-12 10:41    [W:0.191 / U:34.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site