grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: enhancement request: setpci.mod to work on PCIe registers (0xfff) -


From: address@hidden
Subject: Re: enhancement request: setpci.mod to work on PCIe registers (0xfff) - currently limited to PCI registers (0xff)
Date: Wed, 5 Apr 2023 10:27:04 +0000 (UTC)

Have found the problem is grub2's setpci uses I/O-mapped read/write which are limited up to PCI register 0xff. Below is the offending code:

static inline grub_uint8_t
grub_pci_read_byte (grub_pci_address_t addr)
{
  grub_outl (addr & ~3, GRUB_PCI_ADDR_REG);
  return grub_inb (GRUB_PCI_DATA_REG + (addr & 3));
}

The solution: To modify grub2 code to do memory mapped read/write to PCIe register 0x209 (or up to full 4k) using formula along the lines of:

address=RCBA + -s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]] .. whatever it is.

PCIUtil's setpci does allow 4k register read/writes,  so there is a code base for it already.


On Tuesday, 28 March 2023 at 08:56:10 pm AEDT, Nando <nando4eva@gmail.com> wrote:


Hello everybody,

As per title, setpci.mod's setpci command can read/write up to 0xFF registers but returns an incorrect (0xFF) value for any registers beyond 0xFF.. There is a 4K PCIe configuration space (0xFFF) per device.

eg:
setpci -s 0:1f.0 0xf0.l -> returns correct value
setpci -s 0:1f.0 0x200.l -> returns 0xff (incorrect)

Extending setpci.mod in this way would bring it's functionality in line with EFI Shells 'mm' command that can read/write all 4K PCIe registers, as well as pciutils' setpci command that can do the same.

Thank you

reply via email to

[Prev in Thread] Current Thread [Next in Thread]