[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/7] pci: designware: ignore new bits in ATU CR1
From: |
Ben Dooks |
Subject: |
[PATCH 4/7] pci: designware: ignore new bits in ATU CR1 |
Date: |
Wed, 13 Jul 2022 17:54:46 +0100 |
In version 4 and anver ATU CR1 has more bits in it than just the
viewport type. Make a guess at masking these out to avoid issues
where Linux writes these bits and fails to enable memory ATUs.
Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
---
hw/pci-host/designware.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c
index 6403416634..947547d153 100644
--- a/hw/pci-host/designware.c
+++ b/hw/pci-host/designware.c
@@ -276,10 +276,10 @@ static void
designware_pcie_update_viewport(DesignwarePCIERoot *root,
const uint64_t base = viewport->base;
const uint64_t size = viewport->limit - base + 1;
const bool enabled = viewport->cr[1] & DESIGNWARE_PCIE_ATU_ENABLE;
-
+ uint32_t cr0 = viewport->cr[0];
MemoryRegion *current, *other;
- if (viewport->cr[0] == DESIGNWARE_PCIE_ATU_TYPE_MEM) {
+ if ((cr0 & 0xFF) == DESIGNWARE_PCIE_ATU_TYPE_MEM) {
current = &viewport->mem;
other = &viewport->cfg;
memory_region_set_alias_offset(current, target);
--
2.35.1
- updates for designware pci-host, Ben Dooks, 2022/07/13
- [PATCH 7/7] pci: designware: add initial tracing events, Ben Dooks, 2022/07/13
- [PATCH 3/7] pci: designware: clamp viewport index, Ben Dooks, 2022/07/13
- [PATCH 1/7] pci: designware: add 64-bit viewport limit, Ben Dooks, 2022/07/13
- [PATCH 5/7] pci: designware: move msi to entry 5, Ben Dooks, 2022/07/13
- [PATCH 6/7] pci: designware: correct host's class_id, Ben Dooks, 2022/07/13
- [PATCH 2/7] pci: designware: fix DESIGNWARE_PCIE_ATU_UPPER_TARGET, Ben Dooks, 2022/07/13
- [PATCH 4/7] pci: designware: ignore new bits in ATU CR1,
Ben Dooks <=
- Re: updates for designware pci-host, Ben Dooks, 2022/07/27