Questions tagged [pci]

Questions in this tag are only for questions related to the PCI Local Bus standard which is a computer bus for attaching hardware devices in a computer.

Questions in this tag are only for questions related to the PCI Local Bus standard which is a computer bus for attaching hardware devices in a computer.

483 questions
8
votes
2 answers

when Linux calls PCI driver's probe function?

Before registering a PCI driver, we have to initialize struct pci_driver and pass it to pci_register_driver. One of fields of the structure is a pointer to driver's probe function. My question is - when the kernel calls driver's probe routine. Is…
Mark
  • 6,052
  • 8
  • 61
  • 129
8
votes
1 answer

What's the difference between pci_enable_device and pcim_enable_device?

This book's PCI chapter explain about: int pci_enable_device(struct pci_dev *dev); however there's also: int pcim_enable_device (struct pci_dev * pdev); But besides stating it's a "Managed pci_enable_device", it has no explanation. So what's the…
Tar
  • 8,529
  • 9
  • 56
  • 127
8
votes
1 answer

who and when to assign PCI/PCIe device BARs base address?

I'm looking for how kernel to do PCI/PCIe enumeration and BAR assigning. I thought that kernel will assign PCI base addresses of BAR when start-up, but when I tried pci earlydump (before kernel initial PCI subsystem) to see the BARs valuse, I found…
jia-chiam
  • 81
  • 1
  • 2
8
votes
2 answers

How do I obtain PCI Region size in Windows?

I needed to scan my PCI bus and obtain information for specific devices from specific vendors. My goal is to find the PCI Region size for the AMD Graphics card, in order to map the PCI memory of that card to userspace in order to do i2c transfers…
farmdve
  • 786
  • 3
  • 13
  • 26
7
votes
2 answers

Linux PCI Device Driver - Bus v. Kernel IRQ

I am writing a device driver for a PCIe card in Linux. I am trying to use interrupts in my driver. Reading the "IRQ Line" section of the PCI configuration register (offset 0x3C) reports that the assigned IRQ line for the device is 11. lspci -b -vv…
s.brookes
  • 179
  • 1
  • 10
7
votes
2 answers

PCIe 64-bit Non-Prefetchable Spaces

I've been reading through the horror that is the PCIe spec, and still can't get any kind of resolution to the following question pair. Does PCIe allow for mapping huge (say 16GB) 64-bit non-prefetchable memory spaces up above the 4GB boundary? Or…
Rgaddi
  • 445
  • 1
  • 4
  • 11
6
votes
1 answer

Streaming DMA in PCIE linux kernel driver

I'm working on FPGA driver for Linux kernel. Code seems to work fine on x86, but on x86_64 I've got some problems. I implemented streaming DMA. So it goes like get_user_pages(...); for (...) { sg_set_page(); } pci_map_sg(); But pci_map_sg…
soh
  • 85
  • 1
  • 6
6
votes
2 answers

Finding Memory Address of a Parallel Port on Linux

I'm trying to find the base (memory) address of a parallel port I have connected to my laptop via a PCI express card. Running lspci -v shows that my computer recognizes the parallel port and gives the I/O ports (1000 and 1008) but not the memory…
Sam
  • 129
  • 1
  • 2
  • 7
6
votes
4 answers

What is the lshw equivalent in windows which can give me a tree structure of hardware as lshw does on Linux?

I need hardware information just as listed below which was generated using lshw in linux. I need a windows equivalent without a GUI more preferably like a code or dll which can be used to extract the information in the same tree like structure.…
nullpointer
  • 61
  • 1
  • 1
  • 2
6
votes
1 answer

How does MSI interrupt work in linux driver?

Currently working on a PCI device driver. And the device is programmed like this: When a DMA transmission is done, the device send a MSI interrupt to PC with MSI data "001" binary. Now I'm writing a driver for this pci device, and for the MSI…
Cong Li
  • 369
  • 2
  • 5
  • 13
6
votes
3 answers

How do I read data from bar 0, from userspace, on a pci-e card in linux?

On windows there is this program called pcitree that allows you to set and read memory without writing a device driver. Is there a linux alternative to pcitree that will allow me read memory on block 0 of my pcie card? A simple use case would be…
user514156
  • 630
  • 1
  • 7
  • 14
6
votes
2 answers

What information does the resource file under /sys/bus/pci/device/0000:xx:xx.x/resource contain?

I am doing a project to read the registers of the device from the pci configuration space and for that I need to mmap the space, for this I have to read the resource file. But what data this file contains. By looking at it, it looks to save some…
lokesharo
  • 305
  • 2
  • 11
6
votes
1 answer

Retrieving PCI coordinates by Windows' API (user mode)

Is there a way to obtain PCI coordinates (bus/slot/function numbers) of devices by using Windows c/c++ API (e.g PnP Configuration Manager API)? I already know how to do it in kernel mode, I need an user-mode solution. My target system is Windows…
Giuseppe Guerrini
  • 4,274
  • 17
  • 32
5
votes
2 answers

How to read extended PCIE configuration space in Linux?

I've tried both reading userspace pci entry under /proc/bus/pci directory and calling kernel space API pci_read_config_word() in the driver. but it seems both can only read pci basic configuration space, offset less than 0x100. The offset I want to…
OliveU
  • 359
  • 2
  • 5
  • 10
5
votes
2 answers

How to access PCIe configuration space? (ECAM)

In order to access PCI Configuration Space, I/O port address 0xCF8, 0xCFC is used according to various articles. mov eax, dword 0x80000000 mov dx, word 0x0CF8 out dx, eax mov dx, word 0x0CFC in eax, dx The value of eax in the above code was…
YoonSeok OH
  • 647
  • 2
  • 7
  • 15
1
2
3
32 33