MMIO register space was off by 4 bytes, bottom bits of
PCI BAR registers are not part of the address.
Test boot on real hardware:
PCI device 00:14.7 (vd=3D1022:7813 c=3D0805)
Searching bootorder for: /pci@i0cf8/*@14,7
sdhci@0xfeb25500 ver=3D1001 cap=
3D31fe3fb2 2570
sdcard_set_frequency 63 400 8000
sdcard_pio command stop (code=3D1)
sdcard_set_frequency 63 25000 200
Found sdcard at 0xfeb25500: SD card SD01G 982MiB
Registering bootable: SD card SD01G 982MiB (type:2 prio:103 data:f46e0)
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
wait_preempt(); // Avoid pci_config_readl when preempting
// XXX - bars dependent on slot index register in pci config space
u32 regs = pci_config_readl(pci->bdf, PCI_BASE_ADDRESS_0);
+ regs &= PCI_BASE_ADDRESS_MEM_MASK;
pci_config_maskw(pci->bdf, PCI_COMMAND, 0,
PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
int prio = bootprio_find_pci_device(pci);