0

I read who and when to assign PCI/PCIe device BARs base address? and Bar asssignment in Linux. In second link the next was mentioned:

On all IBM PC-compatible machines, BARs are assigned by the BIOS. Linux simply scans through the buses and records the BAR values. Some MIPS boards adopt similar approaches, where BARs are assigned by firmware. However, the quality of BAR assignment by firmware vary quite a bit. Some firmware simply assigns BARs to on-board PCI devices and ignore all add-on PCI cards. In that case, Linux cannot solely rely on the firmware's assignment.

There is another issue of depending on the firmware assignment. You need to stick with the address range setup by the firmware. In other words, if the firmware assigns PCI memory space from 0x10000000 to 0x14000000, you cannot easily move it to a different address space somewhere else in Linux. There three ways to possibly fix this:

. . .

The second way is to do a complete PCI resource assignment before Linux starts PCI bus scanning. In other words, we discard any PCI resource assignment done in firmware, if there is any, and do a new assignment by ourselves. This approach gives us complete control over the address range and resource allocation. . . .

My firmware for x86 based system doesn't set appropriate BAR value which is works for me.

Is it possible to set BAR value in manual for x86 based system before Linux kernel starts? Maybe Linux kernel has some specific pci boot options?

P.S. No one of pci=option Linux kernel boot options helps me.

Yurij Goncharuk
  • 159
  • 1
  • 11
  • What does this mean? *doesn't set BAR correctly (address range overfill available physical memory)* BAR values shouldn't be in the range of of physical memory, they can be above it. – prl Aug 31 '22 at 02:19
  • @prl Or these days of systems with more than 4 GB memory, 32-bit BAR regions will be physically mapped below most of the system RAM. – Ian Abbott Aug 31 '22 at 09:00
  • @prl Thank you for the reply! I had a huge mistake about BAR value and ranges of available physical memory. I corrected it in the question. Is it possible to set specific BAR value on x86 based system? – Yurij Goncharuk Aug 31 '22 at 12:46
  • ACPI provides for user-supplied DSDT information. Check with your firmware vendor how to do this. – stark Aug 31 '22 at 16:59
  • @Ian, That's exactly why I wrote "can be" instead of "will be" above physical memory. – prl Aug 31 '22 at 19:28
  • There are quirks in the Linux kernel that can be applied on early stages. If you really need one, you may write it. – 0andriy Jan 12 '23 at 19:20

0 Answers0