aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2015-11-04 07:40:12 +0200
committerKevin O'Connor <kevin@koconnor.net>2015-11-04 08:02:07 -0500
commitcfc17bd88ea4902f129f91c59785e5da19fc96f9 (patch)
treef31ddb5df99215619d21fbc457f0f50edc03db4a
parent9efbc0f43d0b50a0f314cff98c3b612e5dfb3ed5 (diff)
downloadseabios-cfc17bd88ea4902f129f91c59785e5da19fc96f9.zip
seabios-cfc17bd88ea4902f129f91c59785e5da19fc96f9.tar.gz
seabios-cfc17bd88ea4902f129f91c59785e5da19fc96f9.tar.bz2
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 <kyosti.malkki@gmail.com>
-rw-r--r--src/hw/sdcard.c1
1 files changed, 1 insertions, 0 deletions
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);