diff mbox series

[edk2,edk2-platforms,4/6] Silicon/AMD/Styx: emit DSDT as aml directly

Message ID 20181205185020.21441-5-ard.biesheuvel@linaro.org
State New
Headers show
Series Styx: fixes for IASL abuse and more | expand

Commit Message

Ard Biesheuvel Dec. 5, 2018, 6:50 p.m. UTC
Instead of emitting the DSDT by incorporating the intermediate output
of [some version of] the iasl compiler, move the DSDT source file to
the ACPI platform driver, which will install it directly. This permits
us to drop a lot of cruft related to handling of this intermediate
output.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 Platform/AMD/OverdriveBoard/OverdriveBoard.dsc                    |  3 --
 Platform/LeMaker/CelloBoard/CelloBoard.dsc                        |  4 ---
 Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc       |  3 --
 Platform/AMD/OverdriveBoard/OverdriveBoard.fdf                    |  1 -
 Platform/LeMaker/CelloBoard/CelloBoard.fdf                        |  1 -
 Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.fdf       |  1 -
 Silicon/AMD/Styx/AcpiTables/AcpiAml.inf                           | 29 --------------------
 Silicon/AMD/Styx/AcpiTables/AcpiTables.inf                        |  1 -
 Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf      |  1 +
 Silicon/AMD/Styx/Common/AmdStyxAcpiLib.h                          |  1 -
 Silicon/AMD/Styx/AcpiTables/Dsdt.c                                | 26 ------------------
 Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c           |  1 -
 Silicon/AMD/Styx/{AcpiTables => Drivers/AcpiPlatformDxe}/Dsdt.asl |  0
 13 files changed, 1 insertion(+), 71 deletions(-)

-- 
2.19.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox series

Patch

diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
index b062f671f57f..7c66af6128c5 100644
--- a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
+++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
@@ -272,8 +272,6 @@  DEFINE DO_CAPSULE   = FALSE
   GCC:*_*_AARCH64_ARCHCC_FLAGS = -DDO_XGBE=$(DO_XGBE) -DDO_KCS=$(DO_KCS) -DNUM_CORES=$(NUM_CORES) -DARM_CPU_AARCH64
   GCC:*_*_AARCH64_PP_FLAGS = -DDO_XGBE=$(DO_XGBE) -DDO_KCS=$(DO_KCS) -DNUM_CORES=$(NUM_CORES) -DARM_CPU_AARCH64
 
-  GCC:*_*_AARCH64_PLATFORM_FLAGS = -I$(BIN_DIR)/Silicon/AMD/Styx/AcpiTables/AcpiAml/OUTPUT
-
 [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
   GCC:*_*_AARCH64_DLINK_FLAGS = -z common-page-size=0x10000
 
@@ -683,7 +681,6 @@  DEFINE DO_CAPSULE   = FALSE
       NULL|EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf
   }
 
-  Silicon/AMD/Styx/AcpiTables/AcpiAml.inf
   Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
   MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
 
diff --git a/Platform/LeMaker/CelloBoard/CelloBoard.dsc b/Platform/LeMaker/CelloBoard/CelloBoard.dsc
index 103c2fb74114..7c22bbbfa90f 100644
--- a/Platform/LeMaker/CelloBoard/CelloBoard.dsc
+++ b/Platform/LeMaker/CelloBoard/CelloBoard.dsc
@@ -264,8 +264,6 @@  DEFINE DO_FLASHER   = FALSE
   GCC:*_*_AARCH64_ARCHCC_FLAGS = -DDO_KCS=$(DO_KCS) -DNUM_CORES=$(NUM_CORES) -DARM_CPU_AARCH64
   GCC:*_*_AARCH64_PP_FLAGS = -DDO_KCS=$(DO_KCS) -DNUM_CORES=$(NUM_CORES) -DARM_CPU_AARCH64
 
-  GCC:*_*_AARCH64_PLATFORM_FLAGS = -I$(BIN_DIR)/Silicon/AMD/Styx/AcpiTables/AcpiAml/OUTPUT
-
 [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
   GCC:*_*_AARCH64_DLINK_FLAGS = -z common-page-size=0x10000
 
@@ -617,8 +615,6 @@  DEFINE DO_FLASHER   = FALSE
     <LibraryClasses>
       NULL|EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf
   }
-
-  Silicon/AMD/Styx/AcpiTables/AcpiAml.inf
   Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
 
   #
diff --git a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
index 1927ef3ebafb..793bd5359a23 100644
--- a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
+++ b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
@@ -262,8 +262,6 @@  DEFINE DO_FLASHER   = FALSE
   GCC:*_*_AARCH64_ARCHCC_FLAGS = -DDO_KCS=$(DO_KCS) -DNUM_CORES=$(NUM_CORES) -DARM_CPU_AARCH64
   GCC:*_*_AARCH64_PP_FLAGS = -DDO_KCS=$(DO_KCS) -DNUM_CORES=$(NUM_CORES) -DARM_CPU_AARCH64
 
-  GCC:*_*_AARCH64_PLATFORM_FLAGS = -I$(BIN_DIR)/Silicon/AMD/Styx/AcpiTables/AcpiAml/OUTPUT
-
 [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
   GCC:*_*_AARCH64_DLINK_FLAGS = -z common-page-size=0x10000
 
@@ -612,7 +610,6 @@  DEFINE DO_FLASHER   = FALSE
     <LibraryClasses>
       NULL|EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf
   }
-  Silicon/AMD/Styx/AcpiTables/AcpiAml.inf
   Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
 
   #
diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.fdf b/Platform/AMD/OverdriveBoard/OverdriveBoard.fdf
index cc082031621c..96df83e0da5a 100644
--- a/Platform/AMD/OverdriveBoard/OverdriveBoard.fdf
+++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.fdf
@@ -219,7 +219,6 @@  READ_LOCK_STATUS   = TRUE
   # ACPI Support
   #
   INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
-  INF RuleOverride=ACPITABLE Silicon/AMD/Styx/AcpiTables/AcpiAml.inf
   INF Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
   INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
 
diff --git a/Platform/LeMaker/CelloBoard/CelloBoard.fdf b/Platform/LeMaker/CelloBoard/CelloBoard.fdf
index 45fc850c36cb..fc977f14b5a1 100644
--- a/Platform/LeMaker/CelloBoard/CelloBoard.fdf
+++ b/Platform/LeMaker/CelloBoard/CelloBoard.fdf
@@ -204,7 +204,6 @@  READ_LOCK_STATUS   = TRUE
   # ACPI Support
   #
   INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
-  INF RuleOverride=ACPITABLE Silicon/AMD/Styx/AcpiTables/AcpiAml.inf
   INF Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
 
   #
diff --git a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.fdf b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.fdf
index fec3acdd767c..8fc9a979aebc 100644
--- a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.fdf
+++ b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.fdf
@@ -217,7 +217,6 @@  READ_LOCK_STATUS   = TRUE
   # ACPI Support
   #
   INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
-  INF RuleOverride=ACPITABLE Silicon/AMD/Styx/AcpiTables/AcpiAml.inf
   INF Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
 
   #
diff --git a/Silicon/AMD/Styx/AcpiTables/AcpiAml.inf b/Silicon/AMD/Styx/AcpiTables/AcpiAml.inf
deleted file mode 100644
index 08a7aabe8256..000000000000
--- a/Silicon/AMD/Styx/AcpiTables/AcpiAml.inf
+++ /dev/null
@@ -1,29 +0,0 @@ 
-#/** @file
-#
-#  Copyright (c) 2014 - 2016, AMD Inc. All rights reserved.<BR>
-#
-#  This program and the accompanying materials
-#  are licensed and made available under the terms and conditions of the BSD License
-#  which accompanies this distribution.  The full text of the license may be found at
-#  http://opensource.org/licenses/bsd-license.php
-#
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#**/
-
-[Defines]
-  INF_VERSION                    = 0x00010005
-  BASE_NAME                      = AcpiAml
-  FILE_GUID                      = 2df2a2ee-5f34-4dea-b4b6-da724e455f33
-  MODULE_TYPE                    = USER_DEFINED
-  VERSION_STRING                 = 1.0
-
-[Sources]
-  Dsdt.asl
-
-[Packages]
-  MdePkg/MdePkg.dec
-  MdeModulePkg/MdeModulePkg.dec
-  Silicon/AMD/Styx/AmdStyx.dec
-
diff --git a/Silicon/AMD/Styx/AcpiTables/AcpiTables.inf b/Silicon/AMD/Styx/AcpiTables/AcpiTables.inf
index 692717950f40..0bc5b1e98964 100644
--- a/Silicon/AMD/Styx/AcpiTables/AcpiTables.inf
+++ b/Silicon/AMD/Styx/AcpiTables/AcpiTables.inf
@@ -36,7 +36,6 @@ 
   Madt.c
   Mcfg.c
   Csrt.c
-  Dsdt.c
   Iort.c
   Pptt.c
 
diff --git a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
index cc2320e4262d..92f185fa4bee 100644
--- a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
+++ b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
@@ -28,6 +28,7 @@ 
 
 [Sources]
   AcpiPlatform.c
+  Dsdt.asl
   SsdtB1.asl
   SsdtXgbe.asl
 
diff --git a/Silicon/AMD/Styx/Common/AmdStyxAcpiLib.h b/Silicon/AMD/Styx/Common/AmdStyxAcpiLib.h
index 58e160b6d727..0dfd7635e897 100644
--- a/Silicon/AMD/Styx/Common/AmdStyxAcpiLib.h
+++ b/Silicon/AMD/Styx/Common/AmdStyxAcpiLib.h
@@ -22,7 +22,6 @@  EFI_ACPI_DESCRIPTION_HEADER *FadtTable (void);
 EFI_ACPI_DESCRIPTION_HEADER *FacsTable (void);
 EFI_ACPI_DESCRIPTION_HEADER *MadtHeader (void);
 EFI_ACPI_DESCRIPTION_HEADER *GtdtHeader (void);
-EFI_ACPI_DESCRIPTION_HEADER *DsdtHeader (void);
 EFI_ACPI_DESCRIPTION_HEADER *McfgHeader (void);
 EFI_ACPI_DESCRIPTION_HEADER *Dbg2Header (void);
 EFI_ACPI_DESCRIPTION_HEADER *SpcrHeader (void);
diff --git a/Silicon/AMD/Styx/AcpiTables/Dsdt.c b/Silicon/AMD/Styx/AcpiTables/Dsdt.c
deleted file mode 100644
index 25e654acabbc..000000000000
--- a/Silicon/AMD/Styx/AcpiTables/Dsdt.c
+++ /dev/null
@@ -1,26 +0,0 @@ 
-/** @file
-
-  C language wrapper to build DSDT generated data.
-
-  Copyright (c) 2014 - 2016, AMD Inc. All rights reserved.<BR>
-
-  This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
-
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <AmdStyxAcpiLib.h>
-#include <Dsdt.hex>
-
-EFI_ACPI_DESCRIPTION_HEADER *
-DsdtHeader (
-  VOID
-  )
-{
-  return (EFI_ACPI_DESCRIPTION_HEADER *) &AmlCode[0];
-}
diff --git a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c
index 460fb4c480c3..a00bd3bd2215 100644
--- a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c
+++ b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c
@@ -176,7 +176,6 @@  AcpiPlatformEntryPoint (
 
   TableIndex = 0;
   AcpiTableList[TableIndex++] = FadtTable();
-  AcpiTableList[TableIndex++] = DsdtHeader();
   AcpiTableList[TableIndex++] = MadtHeader();
   AcpiTableList[TableIndex++] = GtdtHeader();
   AcpiTableList[TableIndex++] = Dbg2Header();
diff --git a/Silicon/AMD/Styx/AcpiTables/Dsdt.asl b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Dsdt.asl
similarity index 100%
rename from Silicon/AMD/Styx/AcpiTables/Dsdt.asl
rename to Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Dsdt.asl