diff options
author | Jason Thorpe <thorpej@me.com> | 2021-06-05 17:36:16 -0700 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2021-06-05 17:44:34 -0700 |
commit | 4793b2841559003eab79ee77cf4b688a195c62e1 (patch) | |
tree | 5e22cee0c73a5cbdc2be1d5f1152a9daa1d05022 | |
parent | 0cbd87c2c426c7fd8a27f4d0dc8bd878d488dac0 (diff) | |
download | qemu-palcode-4793b2841559003eab79ee77cf4b688a195c62e1.zip qemu-palcode-4793b2841559003eab79ee77cf4b688a195c62e1.tar.gz qemu-palcode-4793b2841559003eab79ee77cf4b688a195c62e1.tar.bz2 |
Fix incorrect initialization of PCI BARs
Only program a BAR as a 64-bit MEM BAR if it really is a 64-bit MEM BAR.
Fixes an issue with the CMD646 IDE controller under NetBSD.
Signed-off-by: Jason Thorpe <thorpej@me.com>
Message-Id: <20210603035317.6814-6-thorpej@me.com>
[rth: Combine the two tests.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r-- | pci.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -120,8 +120,8 @@ pci_setup_device(int bdf, uint32_t *p_io_base, uint32_t *p_mem_base) printf("PCI: region %d: %08x\r\n", region, addr); - if ((val & PCI_BASE_ADDRESS_MEM_TYPE_MASK) - == PCI_BASE_ADDRESS_MEM_TYPE_64) + if ((old & (PCI_BASE_ADDRESS_SPACE | PCI_BASE_ADDRESS_MEM_TYPE_MASK)) + == (PCI_BASE_ADDRESS_SPACE_MEMORY | PCI_BASE_ADDRESS_MEM_TYPE_64)) { pci_config_writel(bdf, ofs + 4, 0); region++; |