title: How does PCIe Endpoint device memory is mapped into the systems memory map (MMIO)?
body: <p>How does <strong>Linux Kernel</strong> or <strong>BIOS</strong> map the <strong>PCIe</strong> <strong>endpoint</strong> device memory into systems <strong>MMIO</strong> space ? Is there any API to achieve it ?
  Lets assume that when writing a Linux device driver for a PCIe endpoint device, How can we map <strong>PCIe</strong> device memory into MMIO space ? Or Is it true that the device is already mapped into MMIO by BIOS during enumeration and what I would need to do it just remap the device <strong>MMIO</strong> into the <strong>kernel virtual addres</strong>s space using <strong>ioremap</strong>() ?</p>
  <p>Platform : Linux on x86</p>