<div dir="ltr"><span style="font-family:monospace,monospace">MMIO register space was off by 4 bytes, bottom bits of<br>PCI BAR registers are not part of the address.<br><br>Test boot on real hardware:<br><br>PCI device 00:14.7 (vd=1022:7813 c=0805)<br><br>Searching bootorder for: /pci@i0cf8/*@14,7<br>sdhci@0xfeb25500 ver=1001 cap=31fe3fb2 2570<br>sdcard_set_frequency 63 400 8000<br>sdcard_pio command stop (code=1)<br>sdcard_set_frequency 63 25000 200<br>Found sdcard at 0xfeb25500: SD card SD01G 982MiB<br>Registering bootable: SD card SD01G 982MiB (type:2 prio:103 data:f46e0)<br><br>Signed-off-by: Kyösti Mälkki <<a href="mailto:kyosti.malkki@gmail.com">kyosti.malkki@gmail.com</a>><br>---<br> src/hw/sdcard.c | 1 +<br> 1 file changed, 1 insertion(+)<br><br>diff --git a/src/hw/sdcard.c b/src/hw/sdcard.c<br>index d80b473..be726d2 100644<br>--- a/src/hw/sdcard.c<br>+++ b/src/hw/sdcard.c<br>@@ -527,6 +527,7 @@ sdcard_pci_setup(void *data)<br>     wait_preempt();  // Avoid pci_config_readl when preempting<br>     // XXX - bars dependent on slot index register in pci config space<br>     u32 regs = pci_config_readl(pci->bdf, PCI_BASE_ADDRESS_0);<br>+    regs &= PCI_BASE_ADDRESS_MEM_MASK;<br>     pci_config_maskw(pci->bdf, PCI_COMMAND, 0,<br>                      PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);<br>     int prio = bootprio_find_pci_device(pci);<br>-- <br>1.9.1</span></div>