Linux PCIe Physical Bus Address

1

I am working on designing a custom PCI-Express card.

I am trying to write a kernel module that will DMA my custom card.

Right now when I plug the card into Linux no valid PCI device shows up (meaning I probably have a error on my end, I know) however, If I halt the system at startup in the bootloader (uboot) I am able to directly access the card as I know in uboot the physical memory address that is mapped to my device.

Is there a way I can access the card in a simliar fashion on Linux?

Without me Its just Aweso

Posted 2010-08-31T20:41:17.813

Reputation: 133

Answers

1

Is your card returning FFFFFFFF for device or vendor ID? You might still be able to access in U-Boot via the pci command but since that means no device present on a device scan, Linux would not pick it up. I could be very wrong about that (I presume this is an ARM platform since you mention U-Boot - maybe it works differently on different CPU architectures ...)

It's possible that Linux is reading the PCI bus incorrectly. Do other PCI devices than your custom one work? If not, check to make sure you are using the right kernel for your board or maybe need to look into your make menuconfig options more closely when building your kernel.

/dev/mem lets you directly access unmapped memory addresses. You can use tools like dd and such, though doing specific reads and writes to single addresses through bash is not going to be pleasant or easy. I'm unaware of a Linux tool that acts like a "monitor", directly reading and writing memory or a device (maybe gdb but it operates in userspace ...)

LawrenceC

Posted 2010-08-31T20:41:17.813

Reputation: 63 487

You also might be able to finagle something with the mtd driver. It would basically turn a block of memory into a device. – LawrenceC – 2014-01-03T21:40:33.143

0

Basic diagnostic information about PCI cards can be gleaned with lspci -vvv.

Ignacio Vazquez-Abrams

Posted 2010-08-31T20:41:17.813

Reputation: 100 516

nothing shows up when i do lspci ... I think what confuses me the most is that I can talk to it in Uboot but not in linux... – Without me Its just Aweso – 2010-09-01T19:51:45.417