Changeset 106352 in vbox for trunk/src/VBox/Devices/EFI/Firmware
- Timestamp:
- Oct 16, 2024 11:36:33 AM (6 months ago)
- svn:sync-xref-src-repo-rev:
- 165165
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware/ArmVirtPkg/ArmVirtQemu.dsc
r105670 r106352 619 619 [Components.AARCH64] 620 620 MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf 621 !ifndef $(VBOX) 621 622 OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf { 622 623 <LibraryClasses> 623 624 NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf 624 625 } 626 !else 627 VBoxPkg/VBoxAcpiPlatformDxe/VBoxAcpiPlatformDxe.inf 628 !endif -
trunk/src/VBox/Devices/EFI/Firmware/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
r105670 r106352 154 154 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf 155 155 INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf 156 !ifndef $(VBOX) 156 157 INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf 158 !else 159 INF VBoxPkg/VBoxAcpiPlatformDxe/VBoxAcpiPlatformDxe.inf 160 !endif 157 161 !endif 158 162 -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c
r99404 r106352 16 16 #include <Library/UefiBootServicesTableLib.h> 17 17 18 #ifdef VBOX 19 # include <Library/VBoxArmPlatformLib.h> 20 #endif 21 18 22 EFI_STATUS 19 23 EFIAPI … … 32 36 // errors here. 33 37 // 38 #ifndef VBOX 34 39 if ((MAX_UINTN == MAX_UINT64) && 35 40 !PcdGetBool (PcdForceNoAcpi) && … … 41 46 ) 42 47 )) 48 #else 49 if ( !PcdGetBool (PcdForceNoAcpi) 50 && VBoxArmPlatformAcpiStartGetPhysAddr() != 0) 51 #endif 43 52 { 44 53 // -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf
r99404 r106352 24 24 MdePkg/MdePkg.dec 25 25 OvmfPkg/OvmfPkg.dec 26 VBoxPkg/VBoxPkg.dec # VBox: Added 26 27 27 28 [LibraryClasses] … … 32 33 UefiBootServicesTableLib 33 34 UefiDriverEntryPoint 35 VBoxArmPlatformLib # VBox: Added 34 36 35 37 [Guids] -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/Include/Library/VBoxArmPlatformLib.h
r106061 r106352 143 143 UINTN EFIAPI VBoxArmPlatformMmio32SizeGet(VOID); 144 144 145 146 /** 147 * Returns the physical address of the start of the ACPI XSDP. 148 * 149 * @returns Physical address of the ACPI XSDP table. 150 */ 151 EFI_PHYSICAL_ADDRESS EFIAPI VBoxArmPlatformAcpiXsdpStartGetPhysAddr(VOID); 152 153 154 /** 155 * Returns the size of the ACPI XSDP. 156 * 157 * @returns Size of the ACPI XSDP in bytes. 158 */ 159 UINTN EFIAPI VBoxArmPlatformAcpiXsdpSizeGet(VOID); 160 161 162 /** 163 * Returns the physical address of the start of the ACPI tables. 164 * 165 * @returns Physical address of the ACPI table region start. 166 */ 167 EFI_PHYSICAL_ADDRESS EFIAPI VBoxArmPlatformAcpiStartGetPhysAddr(VOID); 168 169 170 /** 171 * Returns the physical address of the start of the ACPI tables. 172 * 173 * @returns Size of the ACPI region in bytes. 174 */ 175 UINTN EFIAPI VBoxArmPlatformAcpiSizeGet(VOID); 176 145 177 #endif 146 178 -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/Library/VBoxArmPlatformLib/VBoxArmPlatformLib.c
r106061 r106352 169 169 return pDesc->cbMmio32; 170 170 } 171 172 173 EFI_PHYSICAL_ADDRESS EFIAPI VBoxArmPlatformAcpiXsdpStartGetPhysAddr(VOID) 174 { 175 PCVBOXPLATFORMARMV8 pDesc = (PCVBOXPLATFORMARMV8)VBoxArmPlatformDescGet(); 176 ASSERT(pDesc->u32Magic == VBOXPLATFORMARMV8_MAGIC); 177 178 if (!pDesc->cbAcpiXsdp) 179 return 0; 180 181 return (EFI_PHYSICAL_ADDRESS)((UINTN)pDesc + pDesc->i64OffAcpiXsdp); 182 } 183 184 185 UINTN EFIAPI VBoxArmPlatformAcpiXsdpSizeGet(VOID) 186 { 187 PCVBOXPLATFORMARMV8 pDesc = (PCVBOXPLATFORMARMV8)VBoxArmPlatformDescGet(); 188 ASSERT(pDesc->u32Magic == VBOXPLATFORMARMV8_MAGIC); 189 190 return pDesc->cbAcpiXsdp; 191 } 192 193 194 EFI_PHYSICAL_ADDRESS EFIAPI VBoxArmPlatformAcpiStartGetPhysAddr(VOID) 195 { 196 PCVBOXPLATFORMARMV8 pDesc = (PCVBOXPLATFORMARMV8)VBoxArmPlatformDescGet(); 197 ASSERT(pDesc->u32Magic == VBOXPLATFORMARMV8_MAGIC); 198 199 if (!pDesc->cbAcpi) 200 return 0; 201 202 return (EFI_PHYSICAL_ADDRESS)((UINTN)pDesc + pDesc->i64OffAcpi); 203 } 204 205 206 UINTN EFIAPI VBoxArmPlatformAcpiSizeGet(VOID) 207 { 208 PCVBOXPLATFORMARMV8 pDesc = (PCVBOXPLATFORMARMV8)VBoxArmPlatformDescGet(); 209 ASSERT(pDesc->u32Magic == VBOXPLATFORMARMV8_MAGIC); 210 211 return pDesc->cbAcpi; 212 } -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/Library/VBoxVirtMemInfoLib/VBoxVirtMemInfoLib.c
r106061 r106352 46 46 47 47 // Number of Virtual Memory Map Descriptors 48 #define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 748 #define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS 8 49 49 50 50 /** … … 89 89 { 90 90 ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable; 91 UINT8 idxMemDesc = 0; 91 92 92 93 ASSERT (VirtualMemoryMap != NULL); … … 103 104 104 105 // System DRAM 105 VirtualMemoryTable[0].PhysicalBase = VBoxArmPlatformRamBaseStartGetPhysAddr(); 106 VirtualMemoryTable[0].VirtualBase = VirtualMemoryTable[0].PhysicalBase; 107 VirtualMemoryTable[0].Length = VBoxArmPlatformRamBaseSizeGet(); 108 VirtualMemoryTable[0].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK; 106 VirtualMemoryTable[idxMemDesc].PhysicalBase = VBoxArmPlatformRamBaseStartGetPhysAddr(); 107 VirtualMemoryTable[idxMemDesc].VirtualBase = VirtualMemoryTable[idxMemDesc].PhysicalBase; 108 VirtualMemoryTable[idxMemDesc].Length = VBoxArmPlatformRamBaseSizeGet(); 109 VirtualMemoryTable[idxMemDesc].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK; 110 idxMemDesc++; 109 111 110 112 // Memory mapped peripherals 111 VirtualMemoryTable[1].PhysicalBase = VBoxArmPlatformMmioStartGetPhysAddr(); 112 VirtualMemoryTable[1].VirtualBase = VirtualMemoryTable[1].PhysicalBase; 113 VirtualMemoryTable[1].Length = VBoxArmPlatformMmioSizeGet(); 114 VirtualMemoryTable[1].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE; 113 VirtualMemoryTable[idxMemDesc].PhysicalBase = VBoxArmPlatformMmioStartGetPhysAddr(); 114 VirtualMemoryTable[idxMemDesc].VirtualBase = VirtualMemoryTable[idxMemDesc].PhysicalBase; 115 VirtualMemoryTable[idxMemDesc].Length = VBoxArmPlatformMmioSizeGet(); 116 VirtualMemoryTable[idxMemDesc].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE; 117 idxMemDesc++; 115 118 116 119 // Map the FV region as normal executable memory 117 VirtualMemoryTable[2].PhysicalBase = VBoxArmPlatformUefiRomStartGetPhysAddr(); 118 VirtualMemoryTable[2].VirtualBase = VirtualMemoryTable[2].PhysicalBase; 119 VirtualMemoryTable[2].Length = FixedPcdGet32 (PcdFvSize); 120 VirtualMemoryTable[2].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_RO; 120 VirtualMemoryTable[idxMemDesc].PhysicalBase = VBoxArmPlatformUefiRomStartGetPhysAddr(); 121 VirtualMemoryTable[idxMemDesc].VirtualBase = VirtualMemoryTable[idxMemDesc].PhysicalBase; 122 VirtualMemoryTable[idxMemDesc].Length = FixedPcdGet32 (PcdFvSize); 123 VirtualMemoryTable[idxMemDesc].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_RO; 124 idxMemDesc++; 121 125 122 126 // Map the FDT region readonnly. 123 VirtualMemoryTable[3].PhysicalBase = VBoxArmPlatformFdtGet(); 124 VirtualMemoryTable[3].VirtualBase = VirtualMemoryTable[3].PhysicalBase; 125 VirtualMemoryTable[3].Length = VBoxArmPlatformFdtSizeGet(); 126 VirtualMemoryTable[3].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_RO; 127 VirtualMemoryTable[idxMemDesc].PhysicalBase = VBoxArmPlatformFdtGet(); 128 VirtualMemoryTable[idxMemDesc].VirtualBase = VirtualMemoryTable[idxMemDesc].PhysicalBase; 129 VirtualMemoryTable[idxMemDesc].Length = VBoxArmPlatformFdtSizeGet(); 130 VirtualMemoryTable[idxMemDesc].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_RO; 131 idxMemDesc++; 127 132 128 133 // Map the VBox descriptor region readonly. 129 VirtualMemoryTable[4].PhysicalBase = VBoxArmPlatformDescGetPhysAddr(); 130 VirtualMemoryTable[4].VirtualBase = VirtualMemoryTable[4].PhysicalBase; 131 VirtualMemoryTable[4].Length = VBoxArmPlatformDescSizeGet(); 132 VirtualMemoryTable[4].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_RO; 134 VirtualMemoryTable[idxMemDesc].PhysicalBase = VBoxArmPlatformDescGetPhysAddr(); 135 VirtualMemoryTable[idxMemDesc].VirtualBase = VirtualMemoryTable[idxMemDesc].PhysicalBase; 136 VirtualMemoryTable[idxMemDesc].Length = VBoxArmPlatformDescSizeGet(); 137 VirtualMemoryTable[idxMemDesc].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_RO; 138 idxMemDesc++; 139 140 // Map the ACPI region if it exists. 141 if (VBoxArmPlatformAcpiSizeGet() != 0) 142 { 143 VirtualMemoryTable[idxMemDesc].PhysicalBase = VBoxArmPlatformAcpiStartGetPhysAddr(); 144 VirtualMemoryTable[idxMemDesc].VirtualBase = VirtualMemoryTable[idxMemDesc].PhysicalBase; 145 VirtualMemoryTable[idxMemDesc].Length = VBoxArmPlatformAcpiSizeGet(); 146 VirtualMemoryTable[idxMemDesc].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_RO; 147 idxMemDesc++; 148 } 133 149 134 150 // Map the MMIO32 region if it exists. 135 151 if (VBoxArmPlatformMmio32SizeGet() != 0) 136 152 { 137 VirtualMemoryTable[5].PhysicalBase = VBoxArmPlatformMmio32StartGetPhysAddr(); 138 VirtualMemoryTable[5].VirtualBase = VirtualMemoryTable[5].PhysicalBase; 139 VirtualMemoryTable[5].Length = VBoxArmPlatformMmio32SizeGet(); 140 VirtualMemoryTable[5].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE; 153 VirtualMemoryTable[idxMemDesc].PhysicalBase = VBoxArmPlatformMmio32StartGetPhysAddr(); 154 VirtualMemoryTable[idxMemDesc].VirtualBase = VirtualMemoryTable[idxMemDesc].PhysicalBase; 155 VirtualMemoryTable[idxMemDesc].Length = VBoxArmPlatformMmio32SizeGet(); 156 VirtualMemoryTable[idxMemDesc].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE; 157 idxMemDesc++; 141 158 } 142 159 143 160 // End of Table 144 ZeroMem (&VirtualMemoryTable[ 6], sizeof (ARM_MEMORY_REGION_DESCRIPTOR));161 ZeroMem (&VirtualMemoryTable[idxMemDesc], sizeof (ARM_MEMORY_REGION_DESCRIPTOR)); 145 162 146 163 for (UINTN i = 0; i < MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS; i++)
Note:
See TracChangeset
for help on using the changeset viewer.