From 43233ff9f88e5c9b88228810f7725bade4cdfecf Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Tue, 28 Jan 2025 17:18:19 +0100 Subject: ArmVirtPkg/ArmVirtQemu: Reduce MMIO region mapped by default Currently, the ArmVirtQemu startup code maps a 128 MiB of MMIO space, as it knows that the UART, GIC and RTC live there. Now that the GIC driver maps its MMIO registers itself, there is no need for this region to cover its MMIO space. And there are other regions here that don't need to be mapped by default: the only ones that need to be mapped are the UARTS, the RTC, the fw_cfg MMIO interface and the virtio-mmio regions, all of which live in a 32 MiB window starting at address 0x900_0000. Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c index d435d72598..331c600d42 100644 --- a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c +++ b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c @@ -18,13 +18,13 @@ #define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 5 // -// mach-virt's core peripherals such as the UART, the GIC and the RTC are -// all mapped in the 'miscellaneous device I/O' region, which we just map -// in its entirety rather than device by device. Note that it does not -// cover any of the NOR flash banks or PCI resource windows. +// mach-virt's core peripherals such as the UART and the RTC are all mapped in +// the 'miscellaneous device I/O' region, which we just map in its entirety +// rather than device by device. Note that it does not cover the GIC, any of +// the NOR flash banks or PCI resource windows. // -#define MACH_VIRT_PERIPH_BASE 0x08000000 -#define MACH_VIRT_PERIPH_SIZE SIZE_128MB +#define MACH_VIRT_PERIPH_BASE 0x09000000 +#define MACH_VIRT_PERIPH_SIZE SIZE_32MB /** Default library constructor that obtains the memory size from a PCD. @@ -105,7 +105,7 @@ ArmVirtGetMemoryMap ( VirtualMemoryTable[0].Length )); - // Memory mapped peripherals (UART, RTC, GIC, virtio-mmio, etc) + // Memory mapped peripherals (UART, RTC, virtio-mmio, etc) VirtualMemoryTable[1].PhysicalBase = MACH_VIRT_PERIPH_BASE; VirtualMemoryTable[1].VirtualBase = MACH_VIRT_PERIPH_BASE; VirtualMemoryTable[1].Length = MACH_VIRT_PERIPH_SIZE; -- cgit