* [PATCH 1/3] pci_auto: Downgrade prefetch if necessary
@ 2025-02-26 13:56 Patrick Rudolph
2025-02-26 13:56 ` [PATCH 2/3] emulation: qemu-sbsa: Select SYS_PCI_64BIT Patrick Rudolph
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Patrick Rudolph @ 2025-02-26 13:56 UTC (permalink / raw)
To: Tom Rini; +Cc: Patrick Rudolph, u-boot
Legacy PCI devices, like qemu's Bochs VGA device, are allowed to have
prefetchable 32-bit BARs, while PCIe devices are not allowed to have
32-bit prefetchable BARs. Typically prefetchable BARs are 64-bit and
typically the prefetch MMIO window is also 64-bit and placed above
4GiB, as it's the case on qemu sbsa-ref.
Currently the U-Boot code assumes that prefetchable BARs are
64-bit BARs and always tries to assign them into the prefetch
MMIO window.
When a 32-bit BAR is marked as prefetch, but the prefetch area is
not within the first 4GiB of the address space, then downgrade the
BAR and place it in the non-prefetch MMIO window.
For prefetch BARs there's no downside on being placed in non prefetch
MMIO areas, besides the possible slower performance when a driver tries
to map it Write-Combine.
TEST: Fixes pci_auto on QEMU sbsa-ref fails to autoconfigure BAR0.
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
---
drivers/pci/pci_auto.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c
index 90f81886445..e68e31a8227 100644
--- a/drivers/pci/pci_auto.c
+++ b/drivers/pci/pci_auto.c
@@ -107,7 +107,8 @@ static void dm_pciauto_setup_device(struct udevice *dev,
}
if (prefetch &&
- (bar_response & PCI_BASE_ADDRESS_MEM_PREFETCH))
+ (bar_response & PCI_BASE_ADDRESS_MEM_PREFETCH) &&
+ (found_mem64 || prefetch->bus_lower < 0x100000000ULL))
bar_res = prefetch;
else
bar_res = mem;
--
2.48.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/3] emulation: qemu-sbsa: Select SYS_PCI_64BIT
2025-02-26 13:56 [PATCH 1/3] pci_auto: Downgrade prefetch if necessary Patrick Rudolph
@ 2025-02-26 13:56 ` Patrick Rudolph
2025-02-26 13:56 ` [PATCH 3/3] emulation: qemu-sbsa: Enable PCI enumeration Patrick Rudolph
2025-03-12 19:43 ` [PATCH 1/3] pci_auto: Downgrade prefetch if necessary Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Patrick Rudolph @ 2025-02-26 13:56 UTC (permalink / raw)
To: Tom Rini; +Cc: Patrick Rudolph, u-boot
qemu's sbsa-ref is always using a 64bit CPU and the PCI prefetch MMIO
window is located above 4GiB, thus always enable SYS_PCI_64BIT.
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
---
board/emulation/qemu-sbsa/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/board/emulation/qemu-sbsa/Kconfig b/board/emulation/qemu-sbsa/Kconfig
index 72c76b351fa..f4ad63e681c 100644
--- a/board/emulation/qemu-sbsa/Kconfig
+++ b/board/emulation/qemu-sbsa/Kconfig
@@ -33,6 +33,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select OF_SEPARATE
select PCI
select PCIE_ECAM_GENERIC
+ select SYS_PCI_64BIT
select USB
select GIC_V3
select GIC_V3_ITS
--
2.48.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] emulation: qemu-sbsa: Enable PCI enumeration
2025-02-26 13:56 [PATCH 1/3] pci_auto: Downgrade prefetch if necessary Patrick Rudolph
2025-02-26 13:56 ` [PATCH 2/3] emulation: qemu-sbsa: Select SYS_PCI_64BIT Patrick Rudolph
@ 2025-02-26 13:56 ` Patrick Rudolph
2025-03-12 19:43 ` [PATCH 1/3] pci_auto: Downgrade prefetch if necessary Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Patrick Rudolph @ 2025-02-26 13:56 UTC (permalink / raw)
To: Tom Rini; +Cc: Patrick Rudolph, u-boot
Enable PCI enumeration by default to get the Bochs display driver up
and running before the boot medium is scanned.
This is just to enhance the user-experience while booting the machine.
TEST: U-Boot logo, version, log output and the U-Boot shell is visible
on the display device.
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
---
board/emulation/qemu-sbsa/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/board/emulation/qemu-sbsa/Kconfig b/board/emulation/qemu-sbsa/Kconfig
index f4ad63e681c..728cecae6b3 100644
--- a/board/emulation/qemu-sbsa/Kconfig
+++ b/board/emulation/qemu-sbsa/Kconfig
@@ -49,6 +49,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
imply CFI_FLASH
imply SYS_MTDPARTS_RUNTIME
imply SET_DFU_ALT_INFO
+ imply PCI_INIT_R
if DEBUG_UART
--
2.48.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 1/3] pci_auto: Downgrade prefetch if necessary
2025-02-26 13:56 [PATCH 1/3] pci_auto: Downgrade prefetch if necessary Patrick Rudolph
2025-02-26 13:56 ` [PATCH 2/3] emulation: qemu-sbsa: Select SYS_PCI_64BIT Patrick Rudolph
2025-02-26 13:56 ` [PATCH 3/3] emulation: qemu-sbsa: Enable PCI enumeration Patrick Rudolph
@ 2025-03-12 19:43 ` Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2025-03-12 19:43 UTC (permalink / raw)
To: Patrick Rudolph; +Cc: u-boot
On Wed, 26 Feb 2025 14:56:42 +0100, Patrick Rudolph wrote:
> Legacy PCI devices, like qemu's Bochs VGA device, are allowed to have
> prefetchable 32-bit BARs, while PCIe devices are not allowed to have
> 32-bit prefetchable BARs. Typically prefetchable BARs are 64-bit and
> typically the prefetch MMIO window is also 64-bit and placed above
> 4GiB, as it's the case on qemu sbsa-ref.
>
> Currently the U-Boot code assumes that prefetchable BARs are
> 64-bit BARs and always tries to assign them into the prefetch
> MMIO window.
>
> [...]
Applied to u-boot/next, thanks!
[1/3] pci_auto: Downgrade prefetch if necessary
commit: 699baa63ddcabe141adf3305d61f7b2a0d2de5db
[2/3] emulation: qemu-sbsa: Select SYS_PCI_64BIT
commit: 0dbb770981d6acff3cc4921454403998dd5d0c92
[3/3] emulation: qemu-sbsa: Enable PCI enumeration
commit: 6b9f4d0f7f070845133bcddf5e5c2dfedf32170b
--
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-03-12 19:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-26 13:56 [PATCH 1/3] pci_auto: Downgrade prefetch if necessary Patrick Rudolph
2025-02-26 13:56 ` [PATCH 2/3] emulation: qemu-sbsa: Select SYS_PCI_64BIT Patrick Rudolph
2025-02-26 13:56 ` [PATCH 3/3] emulation: qemu-sbsa: Enable PCI enumeration Patrick Rudolph
2025-03-12 19:43 ` [PATCH 1/3] pci_auto: Downgrade prefetch if necessary 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.