All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] PCI: dm: Ignore 64-bit memory regions if CONFIG_SYS_PCI_64BIT not set
@ 2018-05-14 15:47 Tuomas Tynkkynen
  2018-05-14 15:47 ` [U-Boot] [PATCH 2/3] ARM: qemu-arm: Bump RAM size in AArch64 MMU table Tuomas Tynkkynen
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Tuomas Tynkkynen @ 2018-05-14 15:47 UTC (permalink / raw)
  To: u-boot

Currently, qemu_arm_defconfig and qemu_arm64_defconfig only work with
the 'highmem=off' parameter passed to QEMU's virt machine. The reason is
that when 'highmem' is not disabled, QEMU appends 64-bit a memory
resource to the PCI controller's regions property in DT in addition to
the 32-bit PCI memory window in low memory. And the current DT parsing
code picks the last (thus the 64-bit one) memory resource, whose address
eventually gets silently truncated to 32 bits because
CONFIG_SYS_PCI_64BIT is not set, which obviously causes PCI to break.

Avoid this problem by ignoring memory regions whose addresses are above
the 32-bit boundary when CONFIG_SYS_PCI_64BIT is not set.

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
---
 drivers/pci/pci-uclass.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index 49be1ebdd7..1cd1e409e3 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -860,6 +860,13 @@ static int decode_regions(struct pci_controller *hose, ofnode parent_node,
 		} else {
 			continue;
 		}
+
+		if (!IS_ENABLED(CONFIG_SYS_PCI_64BIT) &&
+		    type == PCI_REGION_MEM && upper_32_bits(pci_addr)) {
+			debug(" - beyond the 32-bit boundary, ignoring\n");
+			continue;
+		}
+
 		pos = -1;
 		for (i = 0; i < hose->region_count; i++) {
 			if (hose->regions[i].flags == type)
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-09-04  6:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-14 15:47 [U-Boot] [PATCH 1/3] PCI: dm: Ignore 64-bit memory regions if CONFIG_SYS_PCI_64BIT not set Tuomas Tynkkynen
2018-05-14 15:47 ` [U-Boot] [PATCH 2/3] ARM: qemu-arm: Bump RAM size in AArch64 MMU table Tuomas Tynkkynen
2018-05-14 19:51   ` Simon Glass
2018-05-28 19:12   ` [U-Boot] [U-Boot, " Tom Rini
2018-05-14 15:47 ` [U-Boot] [PATCH 3/3] doc: qemu-arm: Drop highmem=off references Tuomas Tynkkynen
2018-05-14 19:51   ` Simon Glass
2018-05-28 19:12   ` [U-Boot] [U-Boot, " Tom Rini
2018-09-04  6:22   ` [U-Boot] [PATCH " Jonathan Gray
2018-05-14 19:51 ` [U-Boot] [PATCH 1/3] PCI: dm: Ignore 64-bit memory regions if CONFIG_SYS_PCI_64BIT not set Simon Glass
2018-05-28 19:12 ` [U-Boot] [U-Boot, " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.