[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/8] Fix incorrect initialization of PCI BARs.
From: |
Jason Thorpe |
Subject: |
[PATCH 5/8] Fix incorrect initialization of PCI BARs. |
Date: |
Wed, 2 Jun 2021 20:53:14 -0700 |
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.
Improve some debug/info messages.
Signed-off-by: Jason Thorpe <thorpej@me.com>
---
pci.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/pci.c b/pci.c
index ba05adb..5e9c906 100644
--- a/pci.c
+++ b/pci.c
@@ -84,7 +84,7 @@ pci_setup_device(int bdf, uint32_t *p_io_base, uint32_t
*p_mem_base)
device_id = pci_config_readw(bdf, PCI_DEVICE_ID);
class_id = pci_config_readw(bdf, PCI_CLASS_DEVICE);
- printf("PCI: %02x:%02x:%x class %04x id %04x:%04x\r\n",
+ printf("PCI: %d:%d:%d class %04x id %04x:%04x\r\n",
PCI_BUS(bdf), PCI_SLOT(bdf), PCI_FUNC(bdf),
class_id, vendor_id, device_id);
@@ -118,9 +118,10 @@ pci_setup_device(int bdf, uint32_t *p_io_base, uint32_t
*p_mem_base)
*p_base = addr + size;
pci_config_writel(bdf, ofs, addr);
- printf("PCI: region %d: %08x\r\n", region, addr);
+ printf("PCI: region %d (BAR %02x): %08x\r\n", region, ofs, addr);
- if ((val & PCI_BASE_ADDRESS_MEM_TYPE_MASK)
+ if ((old & PCI_BASE_ADDRESS_SPACE_IO) == 0 &&
+ (old & PCI_BASE_ADDRESS_MEM_TYPE_MASK)
== PCI_BASE_ADDRESS_MEM_TYPE_64)
{
pci_config_writel(bdf, ofs + 4, 0);
--
2.30.2
- [PATCH 0/8] PALcode fixes required to run NetBSD/alpha., Jason Thorpe, 2021/06/02
- [PATCH 3/8] Fix initialization of the hwrpb.hwrpb.cpuid field., Jason Thorpe, 2021/06/02
- [PATCH 1/8] Make qemu-palcode build environment standalone. NFC., Jason Thorpe, 2021/06/02
- [PATCH 2/8] Fix delivery of unaligned access exceptions., Jason Thorpe, 2021/06/02
- [PATCH 4/8] Make some PCI macros available to other files. NFC., Jason Thorpe, 2021/06/02
- [PATCH 5/8] Fix incorrect initialization of PCI BARs.,
Jason Thorpe <=
- [PATCH 6/8] Provide interrupt mapping information in PCI config registers., Jason Thorpe, 2021/06/02
- [PATCH 7/8] Provide a Console Terminal Block in the HWRPB., Jason Thorpe, 2021/06/02
- [PATCH 8/8] Fixes for seconday CPU start-up., Jason Thorpe, 2021/06/02