From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.7215.1588683818556325558 for ; Tue, 05 May 2020 06:03:38 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: aditya.angadi@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 32DC030E; Tue, 5 May 2020 06:03:38 -0700 (PDT) Received: from usa.arm.com (a073440-lin.blr.arm.com [10.162.16.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 44BB93F68F; Tue, 5 May 2020 06:03:36 -0700 (PDT) From: "Aditya Angadi" To: devel@edk2.groups.io Cc: thomas.abraham@arm.com, ard.biesheuvel@arm.com, vijayenthiran.subramaniam@arm.com, leif@nuviainc.com, Aditya Angadi Subject: [PATCH v5][edk2-platforms 05/17] Platform/ARM/SgiPkg: Let platform specify the ACPI tables to include Date: Tue, 5 May 2020 18:32:02 +0530 Message-Id: <20200505130214.25592-6-aditya.angadi@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200505130214.25592-1-aditya.angadi@arm.com> References: <20200505130214.25592-1-aditya.angadi@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The last change in moving away from single binary for all SGI/RD platforms to independent binary for each platform is to let the platform select only the ACPI table module that is required for the platform. Each platform dsc file specifies the ACPI table module to use. All the platform specific ACPI table modules are assigned a common file guid which is looked up by the platform dxe driver, thereby, removing the need to lookup for a ACPI table module file guid using the platform id hob. Signed-off-by: Aditya Angadi --- Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf | 2 +- Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf | 2 +- Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf | 2 +- Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf | 2 +- Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c | 69 +----------= --------- Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf | 5 +- Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc | 8 +++ Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc | 8 +++ Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc | 8 +++ Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc | 10 +++ Platform/ARM/SgiPkg/SgiPlatform.dec | 5 +- Platform/ARM/SgiPkg/SgiPlatform.dsc.inc | 4 -- Platform/ARM/SgiPkg/SgiPlatform.fdf | 5 +- 13 files changed, 42 insertions(+), 88 deletions(-) diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf b/Plat= form/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf index 3a4d4e7b9502..e780698cdf57 100644 --- a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf +++ b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf @@ -10,7 +10,7 @@ [Defines] INF_VERSION =3D 0x0001001A BASE_NAME =3D RdE1EdgeAcpiTables - FILE_GUID =3D 2af40815-a84e-4de9-8c38-9140b354407= 3 + FILE_GUID =3D c712719a-0aaf-438c-9cdd-35ab4d60207= d # gArmSgiAcpiTablesGuid MODULE_TYPE =3D USER_DEFINED VERSION_STRING =3D 1.0 =20 diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf b/Plat= form/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf index 58c33ecb8ec2..871697eab19e 100644 --- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf +++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf @@ -10,7 +10,7 @@ [Defines] INF_VERSION =3D 0x0001001A BASE_NAME =3D RdN1EdgeAcpiTables - FILE_GUID =3D 4b0b91d0-4a05-45c4-88a7-88e170e7669= 4 + FILE_GUID =3D c712719a-0aaf-438c-9cdd-35ab4d60207= d # gArmSgiAcpiTablesGuid MODULE_TYPE =3D USER_DEFINED VERSION_STRING =3D 1.0 =20 diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf b/Pl= atform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf index 1b584b152455..61f17b3ee8ac 100644 --- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf +++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf @@ -10,7 +10,7 @@ [Defines] INF_VERSION =3D 0x0001001A BASE_NAME =3D RdN1EdgeX2AcpiTables - FILE_GUID =3D 82a34150-0fc6-45f4-8ea0-f0a4660cf35= d + FILE_GUID =3D c712719a-0aaf-438c-9cdd-35ab4d60207= d # gArmSgiAcpiTablesGuid MODULE_TYPE =3D USER_DEFINED VERSION_STRING =3D 1.0 =20 diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf b/Platfo= rm/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf index 097ef854df42..466e0fb658eb 100644 --- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf +++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf @@ -10,7 +10,7 @@ [Defines] INF_VERSION =3D 0x0001001A BASE_NAME =3D Sgi575AcpiTables - FILE_GUID =3D c712719a-0aaf-438c-9cdd-35ab4d60207= d # gSgi575AcpiTablesFileGuid + FILE_GUID =3D c712719a-0aaf-438c-9cdd-35ab4d60207= d # gArmSgiAcpiTablesGuid MODULE_TYPE =3D USER_DEFINED VERSION_STRING =3D 1.0 =20 diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c b/Plat= form/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c index 387397d74598..2f72e7152ff3 100644 --- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c +++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c @@ -11,43 +11,6 @@ #include #include =20 -typedef struct { - SGI_PLATFORM_DESCRIPTOR SgiPlafromDescriptor; - CONST EFI_GUID* AcpiTableGuid; -} SGI_PLATFORM_ACPI_TABLE_GUID_LOOKUP; - -// Macro to construct the SGI_PLATFORM_ACPI_TABLE_GUID_LOOKUP structure -#define ACPI_GUID_LOOKUP(PART_NUM, CONFIG_NUM, MULTI_CHIP_MODE, GUID) = \ -{ = \ - { = \ - PART_NUM, CONFIG_NUM, MULTI_CHIP_MODE = \ - }, = \ - GUID = \ -} = \ - -STATIC SGI_PLATFORM_ACPI_TABLE_GUID_LOOKUP AcpiTableGuidLookup[] =3D { - ACPI_GUID_LOOKUP ( - SGI575_PART_NUM, - SGI575_CONF_NUM, - MULTI_CHIP_MODE_DISABLED, - &gSgi575AcpiTablesFileGuid), - ACPI_GUID_LOOKUP ( - RD_N1E1_EDGE_PART_NUM, - RD_N1_EDGE_CONF_ID, - MULTI_CHIP_MODE_DISABLED, - &gRdN1EdgeAcpiTablesFileGuid), - ACPI_GUID_LOOKUP ( - RD_N1E1_EDGE_PART_NUM, - RD_N1_EDGE_CONF_ID, - MULTI_CHIP_MODE_ENABLED, - &gRdN1EdgeX2AcpiTablesFileGuid), - ACPI_GUID_LOOKUP ( - RD_N1E1_EDGE_PART_NUM, - RD_E1_EDGE_CONF_ID, - MULTI_CHIP_MODE_DISABLED, - &gRdE1EdgeAcpiTablesFileGuid), -}; - VOID InitVirtioDevices ( VOID @@ -61,38 +24,8 @@ ArmSgiPkgEntryPoint ( ) { EFI_STATUS Status; - VOID *SystemIdHob; - SGI_PLATFORM_DESCRIPTOR *HobData; - UINTN Idx; - UINT32 ConfigId; - UINT32 PartNum; - UINT32 MultiChipMode; - - SystemIdHob =3D GetFirstGuidHob (&gArmSgiPlatformIdDescriptorGuid); - if (SystemIdHob =3D=3D NULL) { - DEBUG ((DEBUG_ERROR, "System ID HOB is NULL\n")); - return EFI_INVALID_PARAMETER; - } - - HobData =3D (SGI_PLATFORM_DESCRIPTOR *)GET_GUID_HOB_DATA (SystemIdHob)= ; - - PartNum =3D HobData->PlatformId; - ConfigId =3D HobData->ConfigId; - MultiChipMode =3D HobData->MultiChipMode; - - Status =3D EFI_UNSUPPORTED; - - // Walk through the AcpiTableGuidLookup lookup array - for (Idx =3D 0; Idx < ARRAY_SIZE (AcpiTableGuidLookup); Idx++) { - if ((PartNum =3D=3D AcpiTableGuidLookup[Idx].SgiPlafromDescriptor.Pl= atformId) && - (ConfigId =3D=3D AcpiTableGuidLookup[Idx].SgiPlafromDescriptor.C= onfigId) && - (MultiChipMode =3D=3D - AcpiTableGuidLookup[Idx].SgiPlafromDescriptor.MultiChipMode)) { - Status =3D LocateAndInstallAcpiFromFv (AcpiTableGuidLookup[Idx].Ac= piTableGuid); - break; - } - } =20 + Status =3D LocateAndInstallAcpiFromFv (&gArmSgiAcpiTablesGuid); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a: Failed to install ACPI tables\n", __FUNCTI= ON__)); return Status; diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf b/Pl= atform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf index 741dcc75ed6a..9d89314a594e 100644 --- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf +++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf @@ -30,10 +30,7 @@ [LibraryClasses] =20 [Guids] gArmSgiPlatformIdDescriptorGuid - gSgi575AcpiTablesFileGuid - gRdN1EdgeAcpiTablesFileGuid - gRdN1EdgeX2AcpiTablesFileGuid - gRdE1EdgeAcpiTablesFileGuid + gArmSgiAcpiTablesGuid =20 [FeaturePcd] gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported diff --git a/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc b/Platform/ARM/Sgi= Pkg/RdE1Edge/RdE1Edge.dsc index fefd0e35125f..a108b4eab0d8 100644 --- a/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc +++ b/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc @@ -41,3 +41,11 @@ [PcdsFixedAtBuild.common] gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x300C0000 gArmSgiTokenSpaceGuid.PcdGicSize|0x100000 =20 +########################################################################= ######## +# +# Components Section - list of all EDK II Modules needed by this Platfor= m +# +########################################################################= ######## + +[Components.common] + Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf diff --git a/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc b/Platform/ARM/Sgi= Pkg/RdN1Edge/RdN1Edge.dsc index 71407f701af8..a59a6c5b8f3a 100644 --- a/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc +++ b/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc @@ -41,3 +41,11 @@ [PcdsFixedAtBuild.common] gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x300C0000 gArmSgiTokenSpaceGuid.PcdGicSize|0x100000 =20 +########################################################################= ######## +# +# Components Section - list of all EDK II Modules needed by this Platfor= m +# +########################################################################= ######## + +[Components.common] + Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf diff --git a/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc b/Platform/ARM= /SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc index 5bc286626bb1..6c9e30eadb95 100644 --- a/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc +++ b/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc @@ -41,3 +41,11 @@ [PcdsFixedAtBuild.common] gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x300C0000 gArmSgiTokenSpaceGuid.PcdGicSize|0x100000 =20 +########################################################################= ######## +# +# Components Section - list of all EDK II Modules needed by this Platfor= m +# +########################################################################= ######## + +[Components.common] + Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf diff --git a/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc b/Platform/ARM/SgiPkg/= Sgi575/Sgi575.dsc index b5f39c4db3bc..bdfd69d0477c 100644 --- a/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc +++ b/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc @@ -41,3 +41,13 @@ [PcdsFixedAtBuild.common] gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x300C0000 gArmSgiTokenSpaceGuid.PcdGicSize|0x100000 =20 + +########################################################################= ######## +# +# Components Section - list of all EDK II Modules needed by this Platfor= m +# +########################################################################= ######## + +[Components.common] + Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf + diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec b/Platform/ARM/SgiPkg/Sg= iPlatform.dec index 4ac3dec91e3d..97c1e40349ea 100644 --- a/Platform/ARM/SgiPkg/SgiPlatform.dec +++ b/Platform/ARM/SgiPkg/SgiPlatform.dec @@ -26,10 +26,7 @@ [Guids.common] # ARM Sgi Platform ID descriptor gArmSgiPlatformIdDescriptorGuid =3D { 0xf56f152a, 0xad2a, 0x11e6, { 0x= b1, 0xa7, 0x00, 0x50, 0x56, 0x3c, 0x44, 0xcc } } gArmSgiTokenSpaceGuid =3D { 0x577d6941, 0xaea1, 0x40b4, { 0x90, 0= x93, 0x2a, 0x86, 0x61, 0x72, 0x5a, 0x57 } } - gSgi575AcpiTablesFileGuid =3D { 0xc712719a, 0x0aaf, 0x438c, { 0x9c, 0= xdd, 0x35, 0xab, 0x4d, 0x60, 0x20, 0x7d } } - gRdN1EdgeAcpiTablesFileGuid =3D { 0x4b0b91d0, 0x4a05, 0x45c4, { 0x88, = 0xa7, 0x88, 0xe1, 0x70, 0xe7, 0x66, 0x94 } } - gRdN1EdgeX2AcpiTablesFileGuid =3D { 0x82a34150, 0x0fc6, 0x45f4, { 0x8e= , 0xa0, 0xf0, 0xa4, 0x66, 0x0c, 0xf3, 0x5d } } - gRdE1EdgeAcpiTablesFileGuid =3D { 0x2af40815, 0xa84e, 0x4de9, { 0x8c, = 0x38, 0x91, 0x40, 0xb3, 0x54, 0x40, 0x73 } } + gArmSgiAcpiTablesGuid =3D { 0xc712719a, 0x0aaf, 0x438c, { 0x9c, 0xdd, = 0x35, 0xab, 0x4d, 0x60, 0x20, 0x7d } } =20 [PcdsFeatureFlag.common] gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported|FALSE|BOOLEAN|0x00000001 diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc b/Platform/ARM/SgiPk= g/SgiPlatform.dsc.inc index ae5ef5a8d2ef..1f33557edf18 100644 --- a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc +++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc @@ -252,10 +252,6 @@ [Components.common] # ACPI Support # MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf - Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf - Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf - Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf - Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf =20 # diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf b/Platform/ARM/SgiPkg/Sg= iPlatform.fdf index 3d13998015b9..9fc011a6d630 100644 --- a/Platform/ARM/SgiPkg/SgiPlatform.fdf +++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf @@ -99,11 +99,8 @@ [FV.FvMain] # ACPI Support # INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf - INF RuleOverride=3DACPITABLE Platform/ARM/SgiPkg/AcpiTables/Sgi575Acpi= Tables.inf - INF RuleOverride=3DACPITABLE Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAc= piTables.inf - INF RuleOverride=3DACPITABLE Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2= AcpiTables.inf - INF RuleOverride=3DACPITABLE Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAc= piTables.inf INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf +!include $(BOARD_DXE_FV_COMPONENTS) =20 # Required by PCI INF ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf --=20 2.17.1