-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Configure SMMU config HOB in SbsaPlatformPeiLib - Update SbsaQemuAcpiDxe to use ArmMonitor calls to work with updated qemu version 9.1.50 - Relies on cherry-pick 42925c15bee09162c6dfc8c2204843ffac6201c1 in Silicon/Arm/TFA
- Loading branch information
Showing
6 changed files
with
263 additions
and
4 deletions.
There are no files selected for viewing
144 changes: 144 additions & 0 deletions
144
Platforms/QemuSbsaPkg/Library/SbsaPlatformPeiLib/PlatformPeiLib.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
/** @file | ||
Copyright (c) 2011-2014, ARM Limited. All rights reserved. | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#include <Guid/SmmuConfig.h> | ||
#include <Library/ArmPlatformLib.h> | ||
#include <Library/DebugLib.h> | ||
#include <Library/HobLib.h> | ||
#include <Library/PcdLib.h> | ||
#include <PiPei.h> | ||
|
||
#define SBSAQEMU_ACPI_HEADER(Signature, Type, Revision) \ | ||
{ \ | ||
Signature, /* UINT32 Signature */ \ | ||
sizeof (Type), /* UINT32 Length */ \ | ||
Revision, /* UINT8 Revision */ \ | ||
0, /* UINT8 Checksum */ \ | ||
{ 'L', 'I', 'N', 'A', 'R', 'O' }, /* UINT8 OemId[6] */ \ | ||
FixedPcdGet64 (PcdAcpiDefaultOemTableId), /* UINT64 OemTableId */ \ | ||
FixedPcdGet32 (PcdAcpiDefaultOemRevision), /* UINT32 OemRevision */ \ | ||
FixedPcdGet32 (PcdAcpiDefaultCreatorId), /* UINT32 CreatorId */ \ | ||
FixedPcdGet32 (PcdAcpiDefaultCreatorRevision) /* UINT32 CreatorRevision */ \ | ||
} | ||
|
||
EFI_STATUS | ||
EFIAPI | ||
PlatformPeim ( | ||
VOID | ||
) | ||
{ | ||
BuildFvHob (PcdGet64 (PcdFvBaseAddress), PcdGet32 (PcdFvSize)); | ||
|
||
// Create SMMU Config Hob struct. Same as IORT we want to publish as it is platform dependent. | ||
SMMU_CONFIG SmmuConfig = { | ||
// Initialize IORT Table Header | ||
.Config.Iort = { | ||
SBSAQEMU_ACPI_HEADER ( | ||
EFI_ACPI_6_0_IO_REMAPPING_TABLE_SIGNATURE, | ||
SBSA_IO_REMAPPING_STRUCTURE, | ||
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00 | ||
), | ||
3, | ||
sizeof (EFI_ACPI_6_0_IO_REMAPPING_TABLE), // NodeOffset | ||
0 | ||
}, | ||
|
||
// Initialize SMMU3 Structure | ||
.Config.SmmuNode = { | ||
{ | ||
{ | ||
EFI_ACPI_IORT_TYPE_SMMUv3, | ||
sizeof (SBSA_EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE), | ||
2, // Revision | ||
0, // Reserved | ||
1, // NumIdMapping | ||
OFFSET_OF ( | ||
SBSA_EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE, | ||
SmmuIdMap | ||
) // IdReference | ||
}, | ||
0x60050000, // Base address | ||
EFI_ACPI_IORT_SMMUv3_FLAG_COHAC_OVERRIDE, // Flags | ||
0, // Reserved | ||
0, // VATOS address | ||
EFI_ACPI_IORT_SMMUv3_MODEL_GENERIC, // SMMUv3 Model | ||
74, // Event | ||
75, // Pri | ||
77, // Gerror | ||
76, // Sync | ||
0, // Proximity domain | ||
1 // DevIDMappingIndex | ||
}, | ||
{ | ||
0x0000, // InputBase | ||
0xffff, // NumIds | ||
0x0000, // OutputBase | ||
OFFSET_OF (SBSA_IO_REMAPPING_STRUCTURE, ItsNode), // OutputReference | ||
0 // Flags | ||
} | ||
}, | ||
|
||
// Initialize RC Node | ||
.Config.RcNode = { | ||
{ | ||
{ | ||
EFI_ACPI_IORT_TYPE_ROOT_COMPLEX, // Type | ||
sizeof (SBSA_EFI_ACPI_6_0_IO_REMAPPING_RC_NODE), // Length | ||
0, // Revision | ||
0, // Reserved | ||
1, // NumIdMappings | ||
OFFSET_OF ( | ||
SBSA_EFI_ACPI_6_0_IO_REMAPPING_RC_NODE, | ||
RcIdMap | ||
) // IdReference | ||
}, | ||
1, // CacheCoherent | ||
0, // AllocationHints | ||
0, // Reserved | ||
1, // MemoryAccessFlags | ||
EFI_ACPI_IORT_ROOT_COMPLEX_ATS_UNSUPPORTED, // AtsAttribute | ||
0x0, // PciSegmentNumber | ||
// 0, //MemoryAddressSizeLimit | ||
}, | ||
{ | ||
0x0000, // InputBase | ||
0xffff, // NumIds | ||
0x0000, // OutputBase | ||
OFFSET_OF ( | ||
SBSA_IO_REMAPPING_STRUCTURE, | ||
SmmuNode | ||
), // OutputReference | ||
0, // Flags | ||
} | ||
}, | ||
|
||
// Initialize ITS Node | ||
.Config.ItsNode = { | ||
// EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE | ||
{ | ||
// EFI_ACPI_6_0_IO_REMAPPING_NODE | ||
{ | ||
EFI_ACPI_IORT_TYPE_ITS_GROUP, // Type | ||
sizeof (SBSA_EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE), // Length | ||
0, // Revision | ||
0, // Identifier | ||
0, // NumIdMappings | ||
0, // IdReference | ||
}, | ||
1, // ITS count | ||
}, | ||
0 // GIC ITS Identifiers | ||
} | ||
}; | ||
|
||
BuildGuidDataHob (&gEfiSmmuConfigGuid, &SmmuConfig, sizeof (SMMU_CONFIG)); | ||
|
||
DEBUG ((DEBUG_INFO, "Configured SmmuConfig Hob.\n")); | ||
|
||
return EFI_SUCCESS; | ||
} |
52 changes: 52 additions & 0 deletions
52
Platforms/QemuSbsaPkg/Library/SbsaPlatformPeiLib/PlatformPeiLib.inf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#/** @file | ||
# | ||
# Copyright (c) 2011-2012, ARM Limited. All rights reserved. | ||
# | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
# | ||
#**/ | ||
|
||
[Defines] | ||
INF_VERSION = 0x00010005 | ||
BASE_NAME = ArmPlatformPeiLib | ||
FILE_GUID = aa2c31d7-9029-4071-8a6b-9ca3f55c9bb0 | ||
MODULE_TYPE = SEC | ||
VERSION_STRING = 1.0 | ||
LIBRARY_CLASS = PlatformPeiLib | ||
|
||
[Sources] | ||
PlatformPeiLib.c | ||
|
||
[Packages] | ||
MdePkg/MdePkg.dec | ||
MdeModulePkg/MdeModulePkg.dec | ||
EmbeddedPkg/EmbeddedPkg.dec | ||
ArmPkg/ArmPkg.dec | ||
ArmPlatformPkg/ArmPlatformPkg.dec | ||
|
||
[LibraryClasses] | ||
DebugLib | ||
HobLib | ||
ArmPlatformLib | ||
|
||
[Guids] | ||
gEfiSmmuConfigGuid | ||
|
||
[Ppis] | ||
gEfiPeiMasterBootModePpiGuid # PPI ALWAYS_PRODUCED | ||
gEfiPeiBootInRecoveryModePpiGuid # PPI SOMETIMES_PRODUCED | ||
|
||
[FixedPcd] | ||
gArmTokenSpaceGuid.PcdFdBaseAddress | ||
gArmTokenSpaceGuid.PcdFdSize | ||
|
||
gArmTokenSpaceGuid.PcdFvBaseAddress | ||
gArmTokenSpaceGuid.PcdFvSize | ||
|
||
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId | ||
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision | ||
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId | ||
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision | ||
|
||
[depex] | ||
TRUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters