aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2024-11-21 16:48:12 +0100
committerGerd Hoffmann <kraxel@redhat.com>2024-11-21 17:06:21 +0100
commitedd88a99f6f5468840054d06cc002bafb84b875f (patch)
tree49e8c97f04881758847dc4884bfd4eb6a21a60c5
parent1be8d771d57fb9c892d5a1958c94734b12d3dda5 (diff)
downloadseabios-edd88a99f6f5468840054d06cc002bafb84b875f.tar.gz
add fwcfg override for pci_pad_mem64pci64-cfg
Allow setting pci_pad_mem64 via fw_cfg. Usage: qemu -fw_cfg name=opt/org.seabios/pci64,string={yes,no} Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--src/fw/paravirt.c13
-rw-r--r--src/fw/pciinit.c2
-rw-r--r--src/util.h1
3 files changed, 15 insertions, 1 deletions
diff --git a/src/fw/paravirt.c b/src/fw/paravirt.c
index e5d4eca0..6428a703 100644
--- a/src/fw/paravirt.c
+++ b/src/fw/paravirt.c
@@ -718,6 +718,19 @@ void qemu_cfg_init(void)
dprintf(1, "Moving pm_base to 0x%x\n", acpi_pm_base);
}
+ // 64-bit pci mmio window
+ char *hint = romfile_loadfile("opt/org.seabios/pci64", NULL);
+ if (hint) {
+ if (0 == strcmp(hint, "0") ||
+ 0 == strcmp(hint, "no") ||
+ 0 == strcmp(hint, "off"))
+ pci_pad_mem64 = 0;
+ if (0 == strcmp(hint, "1") ||
+ 0 == strcmp(hint, "yes") ||
+ 0 == strcmp(hint, "on"))
+ pci_pad_mem64 = 1;
+ }
+
// serial console
u16 nogfx = 0;
qemu_cfg_read_entry(&nogfx, QEMU_CFG_NOGRAPHIC, sizeof(nogfx));
diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c
index df63acc1..5b4cf3bd 100644
--- a/src/fw/pciinit.c
+++ b/src/fw/pciinit.c
@@ -55,7 +55,7 @@ u64 pcimem64_end = BUILD_PCIMEM64_END;
// Resource allocation limits
static u64 pci_io_low_end = 0xa000;
static u64 pci_mem64_top = 0;
-static u32 pci_pad_mem64 = -1;
+u32 pci_pad_mem64 = -1;
struct pci_region_entry {
struct pci_device *dev;
diff --git a/src/util.h b/src/util.h
index aff8e888..03dcafb8 100644
--- a/src/util.h
+++ b/src/util.h
@@ -135,6 +135,7 @@ void multiboot_init(void);
extern u64 pcimem_start, pcimem_end;
extern u64 pcimem64_start, pcimem64_end;
extern const u8 pci_irqs[4];
+extern u32 pci_pad_mem64;
void pci_setup(void);
void pci_resume(void);