From: Kyösti Mälkki Date: Wed, 4 Nov 2015 05:40:12 +0000 (+0200) Subject: PCI SDHCI driver: Fix base address X-Git-Tag: rel-1.9.0~3 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=cfc17bd88ea4902f129f91c59785e5da19fc96f9;p=seabios.git PCI SDHCI driver: Fix base address 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 --- diff --git a/src/hw/sdcard.c b/src/hw/sdcard.c index d80b473..be726d2 100644 --- a/src/hw/sdcard.c +++ b/src/hw/sdcard.c @@ -527,6 +527,7 @@ sdcard_pci_setup(void *data) 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);