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 <nando4...@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 valuesetpci -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  
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to