Re: [edk2] aarch64-linux-gnu-gcc.exe: error due to loss ‘/’in code path in in Jenkins server

2019-04-03 Thread Sami Mujawar
I cannot spot anything obvious, but we have seen issues where the workspace 
depth is long, which we resolve by using junctions on Windows.

We have tried building the FVP platform firmware on our Jenkins Windows 10 
infrastructure, using the same gcc toolchain 
(gcc-linaro-7.3.1-2018.05-i686-mingw32_aarch64-linux-gnu) and don’t see this 
issue.
Our Jenkins PC is configured with the following tools. It might be worth 
checking this in your setup.
1. python --version
Python 2.7.14

2. java -version
java version "1.8.0_202"
   Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
   Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)

Note: We do not use Cygwin in our Jenkins infrastructure. Our build scripts are 
in DOS batch file format and are invoked by Jenkins.

Regards,

Sami Mujawar

-Original Message-
From: Leif Lindholm 
Sent: 03 April 2019 11:59 AM
To: wang xiaofeng 
Cc: Sami Mujawar ; Gao, Liming ; 
edk2-devel@lists.01.org; ard.biesheu...@linaro.org
Subject: Re: Re: aarch64-linux-gnu-gcc.exe: error due to loss ‘/’in code path 
in in Jenkins server

On Wed, Apr 03, 2019 at 04:07:58PM +0800, wang xiaofeng wrote:
> Hi Leif,
>We use VC for X86 (do not need GCC cross complie)

Ah, that was not clear from the original mail.

Are both server and local system using cygwin/mingw32?

Best Regards,

Leif

>gcc revision :
> Using built-in specs.
> COLLECT_GCC=aarch64-linux-gnu-gcc.exe
> COLLECT_LTO_WRAPPER=c:/code/gnutools/gcc-linaro-7.3.1-2018.05-i686-min
> gw32_aarch64-linux-gnu/bin/../libexec/gcc/aarch64-linux-gnu/7.3.1/lto-
> wrapper.exe
> Target: aarch64-linux-gnu
> Configured with:
> '/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/
> label/tcwg-x86_64-build/target/aarch64-linux-gnu/snapshots/gcc.git~lin
> aro-7.3-2018.05/configure' SHELL=/bin/bash
> --with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_a
> rch/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu/_build/buil
> ds/destdir/i686-w64-mingw32
> --with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_
> arch/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu/_build/bui
> lds/destdir/i686-w64-mingw32
> --with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_a
> rch/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu/_build/buil
> ds/destdir/i686-w64-mingw32 --with-gnu-as --with-gnu-ld
> --disable-libmudflap --enable-lto --enable-shared
> --without-included-gettext --enable-nls --with-system-zlib
> --disable-sjlj-exceptions --enable-gnu-unique-object
> --enable-linker-build-id --disable-libstdcxx-pch --enable-c99
> --enable-clocale=gnu --enable-libstdcxx-debug --enable-long-long
> --with-cloog=no --with-ppl=no --with-isl=no --disable-multilib
> --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419
> --with-arch=armv8-a --enable-threads=posix --enable-multiarch
> --enable-libstdcxx-time=yes --enable-gnu-indirect-function
> --with-build-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release
> /builder_arch/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu/_
> build/sysroots/aarch64-linux-gnu
> --with-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/build
> er_arch/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu/_build/
> builds/destdir/i686-w64-mingw32/aarch64-linux-gnu/libc
> --enable-checking=release --disable-bootstrap
> --enable-languages=c,c++,fortran,lto
> --with-libiconv-prefix=/home/tcwg-buildslave/workspace/tcwg-make-relea
> se/builder_arch/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu
> /_build/builds/destdir/i686-w64-mingw32/usr --with-system-zlib=no
> --build=x86_64-unknown-linux-gnu --host=i686-w64-mingw32
> --target=aarch64-linux-gnu
> --prefix=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arc
> h/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu/_build/builds
> /destdir/i686-w64-mingw32
> Thread model: posix
> gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision
> d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05)
>
>
>
>
>GNUmake revision : GNUMake-3.81_win32
>
>
>  Can the tool provide more debug output ?
>
>
>
>
>
>
>
>
>
>
> At 2019-04-03 16:00:04, "Leif Lindholm"  wrote:
> >Sami, any ideas?
> >
> >Xiaofeng, what gcc is being used for x86? (output of "gcc -v")
> >
> >Best Regards,
> >
> >Leif
> >
> >On Wed, Apr 03, 2019 at 03:54:33PM +0800, wang xiaofeng wrote:
> >> HI ARM Base tool owners,
> >>I meet a strange issue that aarch64 build . The aarch64 build
> >> pass on my local server.  But it fails at Jenkins server(a Win10
> >> autobuild system written by Java that will can call edk2 bat in
> >> command

[edk2] [PATCH v1 2/2] DynamicTablesPkg: Disable deprecated APIs

2019-03-26 Thread Sami Mujawar
Add the DISABLE_NEW_DEPRECATED_INTERFACES macro to
the DynamicTablesPkg package build flags to disable
deprecated APIs.

Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTablesPkg.dsc | 4 
 1 file changed, 4 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTablesPkg.dsc 
b/DynamicTablesPkg/DynamicTablesPkg.dsc
index 
a66bba976ccdf5ced9213eb464f3ac8f6fd52da4..b9236fd63fdd3c53b2146fc256bc56d4a70eeaa4
 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dsc
+++ b/DynamicTablesPkg/DynamicTablesPkg.dsc
@@ -2,6 +2,7 @@
 #  Dsc file for Dynamic Tables Framework.
 #
 #  Copyright (c) 2019, Linaro Limited. All rights reserved.
+#  Copyright (c) 2019, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials are licensed and made available
 #  under the terms and conditions of the BSD License which accompanies this
@@ -42,3 +43,6 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64]
 
 [Components.common]
   DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
+
+[BuildOptions]
+  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 1/2] DynamicTablesPkg: Fix line endings in dsc file

2019-03-26 Thread Sami Mujawar
Changed the line endings to DOS line endings for
DynamicTablesPkg/DynamicTablesPkg.dsc

Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTablesPkg.dsc | 88 ++--
 1 file changed, 44 insertions(+), 44 deletions(-)

diff --git a/DynamicTablesPkg/DynamicTablesPkg.dsc 
b/DynamicTablesPkg/DynamicTablesPkg.dsc
index 
f71120c2d359d715b8046b170025fe530387b6a8..a66bba976ccdf5ced9213eb464f3ac8f6fd52da4
 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dsc
+++ b/DynamicTablesPkg/DynamicTablesPkg.dsc
@@ -1,44 +1,44 @@
-## @file
-#  Dsc file for Dynamic Tables Framework.
-#
-#  Copyright (c) 2019, Linaro Limited. All rights reserved.
-#
-#  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]
-  PLATFORM_NAME  = DynamicTables
-  PLATFORM_GUID  = f39096a0-7a0a-442a-9413-cf584ef80cbb
-  PLATFORM_VERSION   = 0.1
-  DSC_SPECIFICATION  = 0x0001001a
-  OUTPUT_DIRECTORY   = Build/DynamicTables
-  SUPPORTED_ARCHITECTURES= ARM|AARCH64
-  BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
-  SKUID_IDENTIFIER   = DEFAULT
-
-!include DynamicTables.dsc.inc
-
-[LibraryClasses]
-  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
-  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
-  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
-  
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
-  
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
-  
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
-
-[LibraryClasses.ARM, LibraryClasses.AARCH64]
-  PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
-
-[Components.common]
-  DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
+## @file
+#  Dsc file for Dynamic Tables Framework.
+#
+#  Copyright (c) 2019, Linaro Limited. All rights reserved.
+#
+#  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]
+  PLATFORM_NAME  = DynamicTables
+  PLATFORM_GUID  = f39096a0-7a0a-442a-9413-cf584ef80cbb
+  PLATFORM_VERSION   = 0.1
+  DSC_SPECIFICATION  = 0x0001001a
+  OUTPUT_DIRECTORY   = Build/DynamicTables
+  SUPPORTED_ARCHITECTURES= ARM|AARCH64
+  BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
+  SKUID_IDENTIFIER   = DEFAULT
+
+!include DynamicTables.dsc.inc
+
+[LibraryClasses]
+  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
+  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
+  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
+  
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
+  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
+  
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
+  
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
+
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
+  PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
+
+[Components.common]
+  DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 0/2] DynamicTablesPkg: Fix line endings and disable deprecated APIs

2019-03-26 Thread Sami Mujawar
This patch series updates the DynamicTablesPkg.dsc file to:
- fix line endings
- disable the deprecated APIs

Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 

The changes can be seen at 
https://github.com/samimujawar/edk2/tree/499_dynamic_tables_disable_deprecated_apis_v1

Sami Mujawar (2):
  DynamicTablesPkg: Fix line endings in dsc file
  DynamicTablesPkg: Disable deprecated APIs

 DynamicTablesPkg/DynamicTablesPkg.dsc | 92 ++--
 1 file changed, 48 insertions(+), 44 deletions(-)

-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms v4 4/4] Platform/ARM: Dynamic Tables support for FVP

2019-03-26 Thread Sami Mujawar
The dynamic tables framework uses the platform hardware
information described by the configuration manager to
generate ACPI tables. This support is configurable and
can be enabled using the DYNAMIC_TABLES_FRAMEWORK build
option.

When DYNAMIC_TABLES_FRAMEWORK is defined, ACPI tables are
generated and installed by the dynamic table framework.
Therefore, installation of ACPI tables from the Firmware
Volume (FV) is disabled by this option.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 15 +++
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf | 16 ++--
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc 
b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
index 
0941edeaf53c236cd69fbb54e47df9bd407a56d8..1cf2ebb58f99899864e3bc90b7a22a75ea9fc29b
 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
@@ -38,6 +38,10 @@ [Defines]
   DT_SUPPORT = FALSE
 
 !include Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+!ifdef DYNAMIC_TABLES_FRAMEWORK
+  !include DynamicTablesPkg/DynamicTables.dsc.inc
+  !include 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc
+!endif
 
 [LibraryClasses.common]
   ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
@@ -128,6 +132,15 @@ [PcdsFixedAtBuild.common]
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x1c0a
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultReceiveFifoDepth|0
+  gArmPlatformTokenSpaceGuid.PL011UartInterrupt|0x25
+
+  ## PL011 Serial Debug UART (DBG2)
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase|0x1c0b
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgUartBaudRate|115200
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgUartClkInHz|2400
+
+  # SBSA Generic Watchdog
+  gArmTokenSpaceGuid.PcdGenericWatchdogEl2IntrNum|59
 
   ## PL031 RealTimeClock
   gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x1C17
@@ -257,8 +270,10 @@ [Components.common]
 !endif
   }
 
+!ifndef DYNAMIC_TABLES_FRAMEWORK
   MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
   Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf
+!endif
 
   ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf 
b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf
index 
c3e573e1bb4fcf7889fefec4d6c919b118b76653..fc998ec746913a98ac6f62c1109b809bb530fb16
 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2011 - 2015, ARM Limited. All rights reserved.
+#  Copyright (c) 2011 - 2018, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -97,9 +97,19 @@ [FV.FvMain]
 
   # ACPI Support
   #
-  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
   INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
+!ifndef DYNAMIC_TABLES_FRAMEWORK
+  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
   INF RuleOverride=ACPITABLE Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf
+!else
+  # Configuration Manager
+  INF 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+
+  #
+  # Dynamic Table fdf
+  #
+  !include DynamicTablesPkg/DynamicTables.fdf.inc
+!endif
 
   #
   # Multiple Console IO support
@@ -319,8 +329,10 @@ [Rule.Common.UEFI_APPLICATION.BINARY]
 VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
   }
 
+!ifndef DYNAMIC_TABLES_FRAMEWORK
 [Rule.Common.USER_DEFINED.ACPITABLE]
   FILE FREEFORM = $(NAMED_GUID) {
 RAW ACPI   |.acpi
 RAW ASL|.aml
   }
+!endif
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms v4 2/4] Platform/ARM: Dynamic Tables support for Juno

2019-03-26 Thread Sami Mujawar
The dynamic tables framework uses the platform hardware
information described by the configuration manager to
generate ACPI tables. This support is configurable and
can be enabled using the DYNAMIC_TABLES_FRAMEWORK build
option.

When DYNAMIC_TABLES_FRAMEWORK is defined, ACPI tables are
generated and installed by the dynamic table framework.
Therefore, installation of ACPI tables from the Firmware
Volume (FV) is disabled by this option.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 Platform/ARM/JunoPkg/ArmJuno.dsc | 12 +++-
 Platform/ARM/JunoPkg/ArmJuno.fdf | 12 
 Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c |  9 +++--
 3 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index 
3edde5b65be47fe14988940ce2ef31a60f38dd31..a355c1e1d983339b3b461eddbf60e4a31888a361
 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -33,6 +33,11 @@ [Defines]
 # On RTSM, most peripherals are VExpress Motherboard peripherals
 !include Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
 
+!ifdef DYNAMIC_TABLES_FRAMEWORK
+!include DynamicTablesPkg/DynamicTables.dsc.inc
+!include Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
+!endif
+
 [LibraryClasses.common]
   ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
   ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
@@ -79,6 +84,10 @@ [LibraryClasses.common.UEFI_DRIVER, 
LibraryClasses.common.UEFI_APPLICATION, Libr
 [BuildOptions]
   GCC:*_*_ARM_PLATFORM_FLAGS = -march=armv8-a
 
+!ifdef DYNAMIC_TABLES_FRAMEWORK
+  *_*_*_PLATFORM_FLAGS = -DDYNAMIC_TABLES_FRAMEWORK
+!endif
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
@@ -266,8 +275,9 @@ [Components.common]
   # ACPI Support
   #
   MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
+!ifndef DYNAMIC_TABLES_FRAMEWORK
   Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
-
+!endif
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 
   ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
diff --git a/Platform/ARM/JunoPkg/ArmJuno.fdf b/Platform/ARM/JunoPkg/ArmJuno.fdf
index 
0a8b636d0ebd10a7bceb3cbe6ca1bed8688da1a6..b1295a579b094db1433898589a282702ec854bfb
 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.fdf
+++ b/Platform/ARM/JunoPkg/ArmJuno.fdf
@@ -114,7 +114,17 @@ [FV.FvMain]
   # ACPI Support
   #
   INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
+!ifndef DYNAMIC_TABLES_FRAMEWORK
   INF RuleOverride=ACPITABLE Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
+!else
+  # Configuration Manager
+  INF 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+
+  #
+  # Dynamic Table fdf
+  #
+  !include DynamicTablesPkg/DynamicTables.fdf.inc
+!endif
 
   INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 
@@ -378,8 +388,10 @@ [Rule.Common.UEFI_APPLICATION.BINARY]
 VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
   }
 
+!ifndef DYNAMIC_TABLES_FRAMEWORK
 [Rule.Common.USER_DEFINED.ACPITABLE]
   FILE FREEFORM = $(NAMED_GUID) {
 RAW ACPI   |.acpi
 RAW ASL|.aml
   }
+!endif
diff --git a/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c 
b/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
index 
18491c7378523f365644658c270de95e711c5ac1..0a42d21d4e9b60824f1d313a4d5ad9e4bc6db3aa
 100644
--- a/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
+++ b/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2013-2015, ARM Limited. All rights reserved.
+*  Copyright (c) 2013-2017, ARM Limited. All rights reserved.
 *
 *  This program and the accompanying materials
 *  are licensed and made available under the terms and conditions of the BSD 
License
@@ -33,9 +33,10 @@
 #include 
 #include 
 
-
+#ifndef DYNAMIC_TABLES_FRAMEWORK
 // This GUID must match the FILE_GUID in 
ArmPlatformPkg/ArmJunoPkg/AcpiTables/AcpiTables.inf
 STATIC CONST EFI_GUID mJunoAcpiTableFile = { 0xa1dd808e, 0x1e95, 0x4399, { 
0xab, 0xc0, 0x65, 0x3c, 0x82, 0xe8, 0x53, 0x0c } };
+#endif
 
 typedef struct {
   ACPI_HID_DEVICE_PATH  AcpiDevicePath;
@@ -487,11 +488,13 @@ ArmJunoEntryPoint (
 
   GetJunoRevision(JunoRevision);
 
+#ifndef DYNAMIC_TABLES_FRAMEWORK
   //
   // Try to install the ACPI Tables
   //
   Status = LocateAndInstallAcpiFromFv ();
   ASSERT_EFI_ERROR (Status);
+#endif
 
   //
   // Setup R1/R2 options if not already done.
@@ -516,6 +519,7 @@ ArmJunoEntryPoint (
 
 );
 
+#ifndef DYNAMIC_TABLES_FRAMEWORK
 // Declare the related ACPI Tables
 EfiCreateProtocolNotifyEvent (
 ,
@@ -524,6 +528,7 @@ ArmJunoEntryPoint (
 NULL,
 
 );
+#endif
   }
 
   //
-- 
'Gui

[edk2] [PATCH edk2-platforms v4 1/4] Platform/ARM: Configuration Manager for Juno

2019-03-26 Thread Sami Mujawar
The dynamic tables framework utilizes the configuration manager
protocol to get the platform specific information required for
building the firmware tables.

The configuration manager is a platform specific component that
collates the platform hardware information and builds an abstract
platform configuration repository. The configuration manager also
implements the configuration manager protocol which returns the
hardware information requested by the table generators.

This patch implements the configuration manager support for the
Juno platform.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---

Notes:
v4:
- Sort #include files and .inf sections in alphabetical order [Leif]
- Updates done based on review comments, also updated INF_VERSION [Sami]

 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
   |  29 +
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 750 
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
  | 179 +
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 |  87 +++
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h   
   |  99 +++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
   | 276 +++
 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
   |  45 ++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtJunoUsb.asl 
   | 123 
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtPci.asl 
   | 201 ++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtUart.asl
   |  48 ++
 10 files changed, 1837 insertions(+)

diff --git 
a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
new file mode 100644
index 
..a5fe869483f4a005942006c8ba43d3a5aabad5bb
--- /dev/null
+++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
@@ -0,0 +1,29 @@
+## @file
+#  dsc include file for Configuration Manager
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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]
+
+[BuildOptions]
+
+[LibraryClasses.common]
+
+[Components.common]
+  # Configuration Manager
+  
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 {
+
+# Platform ASL Tables
+
PlatformAslTablesLib|Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
+  
+   *_*_*_PLATFORM_FLAGS = 
-I$(BIN_DIR)/Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib/OUTPUT
+  }
diff --git 
a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
new file mode 100644
index 
..38e3a878dd933b4ae5a39b7d5d9c5a277885655d
--- /dev/null
+++ 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -0,0 +1,750 @@
+/** @file
+  Configuration Manager Dxe
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "ArmPlatform.h"
+#include "ConfigurationManager.h"
+#include "Platform.h"
+
+// AML Code Include files generated by iASL Compiler
+#include 
+#include 
+#include 
+#include 
+
+/** The platform configuration repository information.
+*/
+STATIC
+EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformRepositoryInfo = {
+  /// Configuration Manager information
+  { CONFIGURATION_MANA

[edk2] [PATCH edk2-platforms v4 3/4] Platform/ARM: Configuration Manager for FVP

2019-03-26 Thread Sami Mujawar
The dynamic tables framework utilizes the configuration manager
protocol to get the platform specific information required for
building the firmware tables.

The configuration manager is a platform specific component that
collates the platform hardware information and builds an abstract
platform configuration repository. The configuration manager also
implements the configuration manager protocol which returns the
hardware information requested by the table generators.

This patch implements the configuration manager support for the
FVP platform.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---

Notes:
v4:
- Sort #include files and .inf sections in alphabetical order [Leif]
- Updates done based on review comments, also updated INF_VERSION [Sami]

 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
   |  31 +
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 682 
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
  | 181 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 |  80 +++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h
  |  99 +++
 Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
   |  73 +++
 
Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
   |  35 +
 7 files changed, 1181 insertions(+)

diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc
new file mode 100644
index 
..788b145b273fd49da7fb5d238491aef956977e61
--- /dev/null
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc
@@ -0,0 +1,31 @@
+## @file
+#  dsc include file for Configuration Manager
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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]
+
+[BuildOptions]
+# Required for pre-processing ASL files that include ArmPlatform.h
+  *_*_*_ASLPP_FLAGS= $(PLATFORM_FLAGS)
+
+[LibraryClasses.common]
+
+[Components.common]
+  # Configuration Manager
+  
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 {
+
+# Platform ASL Tables
+
PlatformAslTablesLib|Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
+  
+   *_*_*_PLATFORM_FLAGS = 
-I$(BIN_DIR)/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib/OUTPUT
+  }
diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
new file mode 100644
index 
..fb482dd5915e6f02033bcf4b26e1cec128ff9f66
--- /dev/null
+++ 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -0,0 +1,682 @@
+/** @file
+  Configuration Manager Dxe
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "ArmPlatform.h"
+#include "ConfigurationManager.h"
+#include "Platform.h"
+
+// AML Code Include files generated by iASL Compiler
+#include 
+
+/** The platform configuration repository information.
+*/
+STATIC
+EDKII_PLATFORM_REPOSITORY_INFO VExpressPlatRepositoryInfo = {
+  /// Configuration Manager information
+  { CONFIGURATION_MANAGER_REVISION, CFG_MGR_OEM_ID },
+
+  // ACPI Table List
+  {
+// FADT Table
+{
+  EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
+  EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_T

[edk2] [PATCH edk2-platforms v4 0/4] Platform/ARM: Platform support for Dynamic Tables Framework

2019-03-26 Thread Sami Mujawar
Dynamic Tables Framework aims to reduce the amount of effort
required for porting firmware to new platforms by simplifying
the generation of firmware tables based on hardware description
provided by a platform specific component.

The Dynamic Tables Framework core queries the platform specific
component to retrieve the required hardware information for
generating standardised firmware tables at run-time.

The platform specific component responsible for collating the
hardware information is called the Configuration Manager.

This patch series introduce the Configuration Manager that
provides the hardware description to Dynamic Tables Framework.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 

The changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/365_dynamic_tables_framework_v4

This v4 patch series incorporates:
  * Updates based on review comments to sort #include files and .inf sections
in alphabetical order.

Patches updated in this series are:
  - Platform/ARM: Configuration Manager for Juno
  - Platform/ARM: Configuration Manager for FVP

The corresponding edk2 code changes can be seen at:
https://github.com/samimujawar/edk2/tree/365_dynamic_tables_framework_v2

Sami Mujawar (4):
  Platform/ARM: Configuration Manager for Juno
  Platform/ARM: Dynamic Tables support for Juno
  Platform/ARM: Configuration Manager for FVP
  Platform/ARM: Dynamic Tables support for FVP

 Platform/ARM/JunoPkg/ArmJuno.dsc   
   |  12 +-
 Platform/ARM/JunoPkg/ArmJuno.fdf   
   |  12 +
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
   |  29 +
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 750 
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
  | 179 +
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 |  87 +++
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h   
   |  99 +++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
   | 276 +++
 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
   |  45 ++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtJunoUsb.asl 
   | 123 
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtPci.asl 
   | 201 ++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtUart.asl
   |  48 ++
 Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c   
   |   9 +-
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc   
   |  15 +
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf   
   |  16 +-
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
   |  31 +
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 682 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
  | 181 +
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 |  80 +++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h
  |  99 +++
 Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
   |  73 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
   |  35 +
 22 files changed, 3077 insertions(+), 5 deletions(-)
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtJunoUsb.asl
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtPci.asl
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtUart.asl
 create

Re: [edk2] [PATCH 0/2] DynamicTablesPkg: add package .dsc

2019-03-19 Thread Sami Mujawar
Pushed as 7681a891cec6..fbdfef35cb82

-Original Message-
From: Sami Mujawar 
Sent: 19 March 2019 05:25 PM
To: Leif Lindholm ; edk2-devel@lists.01.org
Cc: Alexei Fedorov ; nd 
Subject: RE: [PATCH 0/2] DynamicTablesPkg: add package .dsc

Reviewed-by: Sami Mujawar 

-Original Message-
From: Leif Lindholm  
Sent: 18 March 2019 03:57 PM
To: edk2-devel@lists.01.org
Cc: Sami Mujawar ; Alexei Fedorov 
Subject: [PATCH 0/2] DynamicTablesPkg: add package .dsc

Having a top-level .dsc simplifies automated builds of core modules in 
isolation from any final platforms. As demonstrated by 1/2, discovered while 
putting the .dsc together.

Leif Lindholm (2):
  DynamicTablesPkg: correct LibraryClass dependencies for Arm/DBG2
  DynamicTablesPkg: add package .dsc file

 DynamicTablesPkg/DynamicTablesPkg.dsc  | 44 ++
 .../Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf |  2 +-
 2 files changed, 45 insertions(+), 1 deletion(-)  create mode 100644 
DynamicTablesPkg/DynamicTablesPkg.dsc

--
2.11.0

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 6/6] DynamicTablesPkg: Minor updates and fix typos

2019-03-19 Thread Sami Mujawar
This patch was originally merged in edk2 master at
07f4e26eb6fe5203028ecfe9bad90d3b67dc72c8. However, this was
later reverted at 4c20a791fdbd3b4c83dba060fefa84027313
as it was merged during the Soft Feature Freeze for
edk2-stable201903.

Resubmitting this patch as the edk2 merge window is now open.

Minor updates to comments and typo fixes. Also removed
unused structure CM_ARM_CPU_INFO_LIST.

Cc: Laszlo Ersek 
Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
Reviewed-by: Alexei Fedorov 
---
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 66 
 1 file changed, 55 insertions(+), 11 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 
73139eb3273e89205ef9e6bee67b1b842f7f516b..ec31c40449d0658f98a89ce0bb6f604b491f1f34
 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -59,6 +59,8 @@ typedef enum ArmObjectID {
 
 /** A structure that describes the
 ARM Boot Architecture flags.
+
+ID: EArmObjBootArchInfo
 */
 typedef struct CmArmBootArchInfo {
   /** This is the ARM_BOOT_ARCH flags field of the FADT Table
@@ -71,13 +73,10 @@ typedef struct CmArmCpuInfo {
   // Reserved for use when SMBIOS tables are implemented
 } CM_ARM_CPU_INFO;
 
-typedef struct CmArmCpuInfoList {
-  UINT32 CpuCount;
-  CM_ARM_CPU_INFO  * CpuInfo;
-} CM_ARM_CPU_INFO_LIST;
-
 /** A structure that describes the
 Power Management Profile Information for the Platform.
+
+ID: EArmObjPowerManagementProfileInfo
 */
 typedef struct CmArmPowerManagementProfileInfo {
   /** This is the Preferred_PM_Profile field of the FADT Table
@@ -88,6 +87,8 @@ typedef struct CmArmPowerManagementProfileInfo {
 
 /** A structure that describes the
 GIC CPU Interface for the Platform.
+
+ID: EArmObjGicCInfo
 */
 typedef struct CmArmGicCInfo {
   /// The GIC CPU Interface number.
@@ -164,6 +165,8 @@ typedef struct CmArmGicCInfo {
 
 /** A structure that describes the
 GIC Distributor information for the Platform.
+
+ID: EArmObjGicDInfo
 */
 typedef struct CmArmGicDInfo {
   /// The Physical Base address for the GIC Distributor.
@@ -184,6 +187,8 @@ typedef struct CmArmGicDInfo {
 
 /** A structure that describes the
 GIC MSI Frame information for the Platform.
+
+ID: EArmObjGicMsiFrameInfo
 */
 typedef struct CmArmGicMsiFrameInfo {
   /// The GIC MSI Frame ID
@@ -207,6 +212,8 @@ typedef struct CmArmGicMsiFrameInfo {
 
 /** A structure that describes the
 GIC Redistributor information for the Platform.
+
+ID: EArmObjGicRedistributorInfo
 */
 typedef struct CmArmGicRedistInfo {
   /** The physical address of a page range
@@ -220,6 +227,8 @@ typedef struct CmArmGicRedistInfo {
 
 /** A structure that describes the
 GIC Interrupt Translation Service information for the Platform.
+
+ID: EArmObjGicItsInfo
 */
 typedef struct CmArmGicItsInfo {
   /// The GIC ITS ID
@@ -231,6 +240,9 @@ typedef struct CmArmGicItsInfo {
 
 /** A structure that describes the
 Serial Port information for the Platform.
+
+ID: EArmObjSerialConsolePortInfo or
+EArmObjSerialDebugPortInfo
 */
 typedef struct CmArmSerialPortInfo {
   /// The physical base address for the serial port
@@ -251,6 +263,8 @@ typedef struct CmArmSerialPortInfo {
 
 /** A structure that describes the
 Generic Timer information for the Platform.
+
+ID: EArmObjGenericTimerInfo
 */
 typedef struct CmArmGenericTimerInfo {
   /// The physical base address for the counter control frame
@@ -286,6 +300,8 @@ typedef struct CmArmGenericTimerInfo {
 
 /** A structure that describes the
 Platform Generic Block Timer Frame information for the Platform.
+
+ID: EArmObjGTBlockTimerFrameInfo
 */
 typedef struct CmArmGTBlockTimerFrameInfo {
   /// The Generic Timer frame number
@@ -321,6 +337,8 @@ typedef struct CmArmGTBlockTimerFrameInfo {
 
 /** A structure that describes the
 Platform Generic Block Timer information for the Platform.
+
+ID: EArmObjPlatformGTBlockInfo
 */
 typedef struct CmArmGTBlockInfo {
   /// The physical base address for the GT Block Timer structure
@@ -335,6 +353,8 @@ typedef struct CmArmGTBlockInfo {
 
 /** A structure that describes the
 SBSA Generic Watchdog information for the Platform.
+
+ID: EArmObjPlatformGenericWatchdogInfo
 */
 typedef struct CmArmGenericWatchdogInfo {
   /// The physical base address of the SBSA Watchdog control frame
@@ -354,6 +374,8 @@ typedef struct CmArmGenericWatchdogInfo {
 
 /** A structure that describes the
 PCI Configuration Space information for the Platform.
+
+ID: EArmObjPciConfigSpaceInfo
 */
 typedef struct CmArmPciConfigSpaceInfo {
   /// The physical base address for the PCI segment
@@ -371,6 +393,8 @@ typedef struct CmArmPciConfigSpaceInfo {
 
 /** A structure that describes the
 Hypervisor Vendor ID information for the Platform

[edk2] [PATCH v2 3/6] DynamicTablesPkg: Add OEM Info

2019-03-19 Thread Sami Mujawar
This patch originally merged in edk2 master at
c788bdaba47536447ae37518a96d92e0da54aad7. However, this was
later reverted at bdbbedea949eb4b10d24110c0e559b03c7a6bce4
as it was merged during the Soft Feature Freeze for
edk2-stable201903.

Resubmitting this patch as the edk2 merge window is now open.

Added option for OEMs to provide OEM Table ID and
OEM Revision for ACPI tables.

Cc: Laszlo Ersek 
Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
Reviewed-by: Alexei Fedorov 
---
 DynamicTablesPkg/Include/Library/TableHelperLib.h|  4 +--
 DynamicTablesPkg/Include/StandardNameSpaceObjects.h  | 18 
++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c |  2 +-
 DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c | 26 
++--
 10 files changed, 46 insertions(+), 16 deletions(-)

diff --git a/DynamicTablesPkg/Include/Library/TableHelperLib.h 
b/DynamicTablesPkg/Include/Library/TableHelperLib.h
index 
3c4e1d23d2e6955388ab0b51fb57779f2225beb2..0f872bc3d08bf78e33bd8dab866e7bf57e00cb8c
 100644
--- a/DynamicTablesPkg/Include/Library/TableHelperLib.h
+++ b/DynamicTablesPkg/Include/Library/TableHelperLib.h
@@ -45,7 +45,7 @@ GetCgfMgrInfo (
   @param [in] Generator  Pointer to the ACPI table Generator.
   @param [in,out] AcpiHeader Pointer to the ACPI table header to be
  updated.
-  @param [in] Revision   Revision of the ACPI table.
+  @param [in] AcpiTableInfo  Pointer to the ACPI table info structure.
   @param [in] Length Length of the ACPI table.
 
   @retval EFI_SUCCESS   The ACPI table is updated successfully.
@@ -61,7 +61,7 @@ AddAcpiHeader (
   IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST CfgMgrProtocol,
   IN  CONST ACPI_TABLE_GENERATOR  * CONST Generator,
   IN OUT  EFI_ACPI_DESCRIPTION_HEADER * CONST AcpiHeader,
-  IN  CONST UINT32Revision,
+  IN  CONST CM_STD_OBJ_ACPI_TABLE_INFO* CONST AcpiTableInfo,
   IN  CONST UINT32Length
   );
 
diff --git a/DynamicTablesPkg/Include/StandardNameSpaceObjects.h 
b/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
index 
4377ee8f785399b02fec824f3a34d2f4ed3b1c01..58503858b27141cf7647a410c4b0b3fa574033de
 100644
--- a/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
@@ -93,6 +93,24 @@ typedef struct CmAStdObjAcpiTableInfo {
   /// Optional pointer to the ACPI table data
   EFI_ACPI_DESCRIPTION_HEADER  * AcpiTableData;
 
+  /// An OEM-supplied string that the OEM uses to identify the particular
+  /// data table. This field is particularly useful when defining a definition
+  /// block to distinguish definition block functions. The OEM assigns each
+  /// dissimilar table a new OEM Table ID.
+  /// This field could be constructed using the SIGNATURE_64() macro.
+  ///   e.g. SIGNATURE_64 ('A','R','M','H','G','T','D','T')
+  /// Note: If this field is not populated (has value of Zero), then the
+  /// Generators shall populate this information using part of the
+  /// CM_STD_OBJ_CONFIGURATION_MANAGER_INFO.OemId field and the
+  /// ACPI table signature.
+  UINT64 OemTableId;
+
+  /// An OEM-supplied revision number. Larger numbers are assumed to be
+  /// newer revisions.
+  /// Note: If this field is not populated (has value of Zero), then the
+  /// Generators shall populate this information using the revision of the
+  /// Configuration Manager (CM_STD_OBJ_CONFIGURATION_MANAGER_INFO.Revision).
+  UINT32 OemRevision;
 } CM_STD_OBJ_ACPI_TABLE_INFO;
 
 /** A structure used to describe the SMBIOS table generators to be invoked.
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
index 
e21e2b660634b1aedce8167b74573694d6df2a3b..697cfc46abaedf34d30abf26e7ebb2b4d271822a
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
@@ -342,7 +342,7 @@ BuildDbg2Table (
  CfgMgrProtocol,
  This,
  (EFI_ACPI_DESCRIPTION_HEADER*),
- AcpiTableInfo->AcpiTableRevision,
+ AcpiTableInfo,
  sizeof (DBG2_TA

[edk2] [PATCH v2 5/6] DynamicTablesPkg: Remove GIC Distributor Id field

2019-03-19 Thread Sami Mujawar
This patch was originally merged in edk2 master at
d3a15f435f9716aa2f2ea5e9b35fcda04f267ab4. However, this was
later reverted at 82c4426a176c271d24915b403b267a431bdc52f5
as it was merged during the Soft Feature Freeze for
edk2-stable201903.

Resubmitting this patch as the edk2 merge window is now open.

According to ACPI 6.2 Specification - Errata A, 'One,
and only one, GIC distributor structure must be present
in the MADT for an ARM based system'. Therefore,
the GIC Distributor ID field in the ACPI MADT GICD
substructure can be set to zero and there is no need
for the Configuration Manager to provide this information.

Update the CM_ARM_GICD_INFO structure to remove the GicId
field. Similarly update the MADT Generator to set the GicId
field in the GICD substructure to zero.

Cc: Laszlo Ersek 
Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
Reviewed-by: Alexei Fedorov 
---
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h   | 5 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c | 4 +++-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 
2adaa788083e4e15d049f5f6b6312f77f3c02488..73139eb3273e89205ef9e6bee67b1b842f7f516b
 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -166,9 +166,6 @@ typedef struct CmArmGicCInfo {
 GIC Distributor information for the Platform.
 */
 typedef struct CmArmGicDInfo {
-  /// The GIC Distributor ID.
-  UINT32  GicId;
-
   /// The Physical Base address for the GIC Distributor.
   UINT64  PhysicalBaseAddress;
 
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
index 
1ee0b9e006bfa00ea5bbf6aa64209dac244c90a0..6b89c3f65d36ff35fcfc81cdffdeae8e4306c976
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
@@ -192,7 +192,9 @@ AddGICD (
   // UINT16 Reserved
   Gicd->Reserved1 = EFI_ACPI_RESERVED_WORD;
   // UINT32 Identifier
-  Gicd->GicId = GicDInfo->GicId;
+  // One, and only one, GIC distributor structure must be present
+  // in the MADT for an ARM based system
+  Gicd->GicId = 0;
   // UINT64 PhysicalBaseAddress
   Gicd->PhysicalBaseAddress = GicDInfo->PhysicalBaseAddress;
   // UINT32 VectorBase
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 4/6] DynamicTablesPkg: DGB2: Update DBG2_DEBUG_PORT_DDI

2019-03-19 Thread Sami Mujawar
This patch was originally merged in edk2 master at
6814256083a90ef218e7ae240e51922045175df1. However, this was
later reverted at db8382ef5e44bd07654fb4726b77f3c329210561
as it was merged during the Soft Feature Freeze for
edk2-stable201903.

Resubmitting this patch as the edk2 merge window is now open.

The DBG2_DEBUG_PORT_DDI() macro supports adding only one
Generic Base Address Register. Therefore, removed the
superfluous parameter NumReg and updated the macro to
use DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS which has
a value 1.

Cc: Laszlo Ersek 
Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
Reviewed-by: Alexei Fedorov 
---
 DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
index 
697cfc46abaedf34d30abf26e7ebb2b4d271822a..90380f48da017b257476ee63bcc1beae5efe1d65
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
@@ -97,14 +97,12 @@ typedef struct {
 /** A helper macro used for initializing the debug port device
 information structure.
 
-  @param [in]  NumReg   The number of generic address registers.
   @param [in]  SubType  The DBG Port SubType.
   @param [in]  UartBase The UART port base address.
   @param [in]  UartAddrLen  The UART port address range length.
   @param [in]  UartNameStr  The UART port name string.
 **/
 #define DBG2_DEBUG_PORT_DDI(  \
-  NumReg, \
   SubType,\
   UartBase,   \
   UartAddrLen,\
@@ -116,7 +114,7 @@ typedef struct {
   /* UINT16Length */  \
   sizeof (DBG2_DEBUG_DEVICE_INFORMATION), \
   /* UINT8 NumberofGenericAddressRegisters */ \
-  NumReg, \
+  DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS,   \
   /* UINT16NameSpaceStringLength */   \
   DBG2_NAMESPACESTRING_FIELD_SIZE,\
   /* UINT16NameSpaceStringOffset */   \
@@ -164,7 +162,6 @@ DBG2_TABLE AcpiDbg2 = {
  * Debug port 1
  */
 DBG2_DEBUG_PORT_DDI (
-  DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS,
   0,// {Template}: Serial Port Subtype
   0,// {Template}: Serial Port Base Address
   PL011_UART_LENGTH,
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 2/6] DynamicTablesPkg: Rename enum used for ID Mapping

2019-03-19 Thread Sami Mujawar
This patch was originally merged in edk2 master at
1d49a75367ef6827b8b8f77f61e9ce245d1bdee3. However, this was
later reverted at 334111b0dab80394aeb1ebb8f0f3314847e2dc1f
as it was merged during the Soft Feature Freeze for
edk2-stable201903.

Resubmitting this patch as the edk2 merge window is now open.

Renamed the enum EArmObjIdMapping to EArmObjIdMappingArray
and updated the IORT generator accordingly.

Cc: Laszlo Ersek 
Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
Reviewed-by: Alexei Fedorov 
---
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h   | 2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 
93cb6949f0eb2ac2ad3524494e4a14c7a6fab4b8..2adaa788083e4e15d049f5f6b6312f77f3c02488
 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -52,7 +52,7 @@ typedef enum ArmObjectID {
   EArmObjSmmuV3,  ///< 22 - SMMUv3
   EArmObjPmcg,///< 23 - PMCG
   EArmObjGicItsIdentifierArray,   ///< 24 - GIC ITS Identifier Array
-  EArmObjIdMapping,   ///< 25 - ID Mapping
+  EArmObjIdMappingArray,  ///< 25 - ID Mapping Array
   EArmObjSmmuInterruptArray,  ///< 26 - SMMU Interrupt Array
   EArmObjMax
 } EARM_OBJECT_ID;
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
index 
a3ee60664ecbeb1b12b01683f838e11804884daf..b53c4bb47798d4ad441db1fe1b1e5b180e313403
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
@@ -44,7 +44,7 @@ Requirements:
   - EArmObjSmmuV3
   - EArmObjPmcg
   - EArmObjGicItsIdentifierArray
-  - EArmObjIdMapping
+  - EArmObjIdMappingArray
   - EArmObjGicItsIdentifierArray
 */
 
@@ -116,7 +116,7 @@ GET_OBJECT_LIST (
 */
 GET_OBJECT_LIST (
   EObjNameSpaceArm,
-  EArmObjIdMapping,
+  EArmObjIdMappingArray,
   CM_ARM_ID_MAPPING
   );
 
@@ -653,7 +653,7 @@ AddIdMappingArray (
   Generator = (ACPI_IORT_GENERATOR*)This;
 
   // Get the Id Mapping Array
-  Status = GetEArmObjIdMapping (
+  Status = GetEArmObjIdMappingArray (
  CfgMgrProtocol,
  IdMappingToken,
  ,
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 0/6] DynamicTablesPkg: Framework updates and fixes

2019-03-19 Thread Sami Mujawar
This patch series was originally merged in edk2 master. However, this
was later reverted as it was merged during the Soft Feature Freeze for
edk2-stable201903.

Resubmitting this patch series as the edk2 merge window is now open.

This patch series updates the Dynamic Tables Framework to
incorporate the following changes:
  * Fix protocol section.
  * Add options for OEMs to provide OEM Table ID and revision.
  * Update DBG2_DEBUG_PORT_DDI macro to remove unused parameter.
  * Remove GIC Distributor ID field.
  * Minor updates to comments and typo fixes.

Cc: Laszlo Ersek 
Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 

The changes can be seen at:
https://github.com/samimujawar/edk2/tree/473_dynamic_tables_framework_v2

The corresponding edk2-platform code changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/473_dynamic_tables_framework_v1

Sami Mujawar (6):
  DynamicTablesPkg: Fix protocol section
  DynamicTablesPkg: Rename enum used for ID Mapping
  DynamicTablesPkg: Add OEM Info
  DynamicTablesPkg: DGB2: Update DBG2_DEBUG_PORT_DDI
  DynamicTablesPkg: Remove GIC Distributor Id field
  DynamicTablesPkg: Minor updates and fix typos

 DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf |  
7 +-
 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf |  
7 +-
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 
73 +++-
 DynamicTablesPkg/Include/Library/TableHelperLib.h  |  
4 +-
 DynamicTablesPkg/Include/StandardNameSpaceObjects.h| 
18 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c   |  
7 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c   |  
2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c   |  
2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c   |  
8 +--
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c   |  
6 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c   |  
2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c   |  
2 +-
 DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c   | 
26 +--
 13 files changed, 116 insertions(+), 48 deletions(-)

-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 1/6] DynamicTablesPkg: Fix protocol section

2019-03-19 Thread Sami Mujawar
This patch was originally merged in edk2 master at
bde673b2dcd1b087af7f49dd5f0c3b82b02172a5. However, this was
later reverted at 7d180efeaa03df25973416dc0aad099f4fe7e251
as it was merged during the Soft Feature Freeze for
edk2-stable201903.

Resubmitting this patch as the edk2 merge window is now open.

Updated the Protocols section to reflect the protocols
that are produced or consumed.

Cc: Laszlo Ersek 
Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
Reviewed-by: Alexei Fedorov 
---
 DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf | 7 
++-
 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf | 7 
---
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git 
a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf 
b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf
index 
740811d0fc0590543a62360e6753eb04fb675d70..02c907c38023e8b44829a38ed93436904d8cf3d3
 100644
--- a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf
+++ b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf
@@ -1,7 +1,7 @@
 ## @file
 #  Module to manage the list of available table factories.
 #
-#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -51,10 +51,7 @@ [FixedPcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxCustomDTGenerators
 
 [Protocols]
-  gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED
-  gEfiSmbiosProtocolGuid# PROTOCOL ALWAYS_CONSUMED
-  gEdkiiConfigurationManagerProtocolGuid
-  gEdkiiDynamicTableFactoryProtocolGuid
+  gEdkiiDynamicTableFactoryProtocolGuid # PRODUCES
 
 [Depex]
   TRUE
diff --git 
a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf 
b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
index 
fef8b20672fb943b78302a152fcf0f66db264b0a..e78218a914ce993f3e605841e2bffae700076dd0
 100644
--- a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
+++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
@@ -1,7 +1,7 @@
 ## @file
 # Module that drives the table generation and installation process.
 #
-#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -42,8 +42,9 @@ [LibraryClasses]
 
 [Protocols]
   gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED
-  gEdkiiConfigurationManagerProtocolGuid
-  gEdkiiDynamicTableFactoryProtocolGuid
+
+  gEdkiiConfigurationManagerProtocolGuid# PROTOCOL ALWAYS_CONSUMED
+  gEdkiiDynamicTableFactoryProtocolGuid # PROTOCOL ALWAYS_CONSUMED
 
 [Depex]
   gEfiAcpiTableProtocolGuid AND
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v1 0/6] Revert DynamicTablesPkg: Framework updates and fixes

2019-02-27 Thread Sami Mujawar
Hi Laszlo,

The DynamicTablesPkg won't be in use until the corresponding edk2-platform 
patches for Dynamic Tables are merged (at which point it would be a major 
feature addition).
I think for now, I will hold on until the stable release is tagged.

Regards,

Sami Mujawar
-Original Message-
From: Laszlo Ersek  
Sent: 26 February 2019 11:06 AM
To: Sami Mujawar ; edk2-devel@lists.01.org
Cc: Stephanie Hughes-Fitt ; Alexei Fedorov 
; nd 
Subject: Re: [edk2] [PATCH v1 0/6] Revert DynamicTablesPkg: Framework updates 
and fixes

On 02/26/19 12:01, Laszlo Ersek wrote:
> On 02/26/19 09:44, Sami Mujawar wrote:
>> Reverting this patch series as Soft Feature Freeze for
>> edk2-stable201903 started on 22 Feb 2019.
>>
>> Cc: Laszlo Ersek 
>> Cc: Alexei Fedorov 
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Sami Mujawar 
>>
>> The changes can be seen at 
>> https://github.com/samimujawar/edk2/tree/Revert_473_dynamic_tables_fr
>> amework_v1
>>
>> Sami Mujawar (6):
>>   Revert "DynamicTablesPkg: Minor updates and fix typos"
>>   Revert "DynamicTablesPkg: Remove GIC Distributor Id field"
>>   Revert "DynamicTablesPkg: DGB2: Update DBG2_DEBUG_PORT_DDI"
>>   Revert "DynamicTablesPkg: Add OEM Info"
>>   Revert "DynamicTablesPkg: Rename enum used for ID Mapping"
>>   Revert "DynamicTablesPkg: Fix protocol section"
>>
>>  
>> DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf | 
>>  7 +-  
>> DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf | 
>>  7 +-
>>  DynamicTablesPkg/Include/ArmNameSpaceObjects.h 
>> | 73 +---
>>  DynamicTablesPkg/Include/Library/TableHelperLib.h  
>> |  4 +-
>>  DynamicTablesPkg/Include/StandardNameSpaceObjects.h
>> | 18 -
>>  DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c   
>> |  7 +-
>>  DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c   
>> |  2 +-
>>  DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c   
>> |  2 +-
>>  DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c   
>> |  8 +--
>>  DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c   
>> |  6 +-
>>  DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c   
>> |  2 +-
>>  DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c   
>> |  2 +-
>>  DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c   
>> | 26 ++-
>>  13 files changed, 48 insertions(+), 116 deletions(-)
>>
> 
> Thank you. Sorry about the inconvenience.
> 
> Acked-by: Laszlo Ersek 
> 
> Laszlo
> 

Note: if you have small individual patches that cleanly qualify as bugfixes, 
especially for features introduced during this development cycle (since the 
last table tag), those should be acceptable even during the hard feature freeze.

https://github.com/tianocore/tianocore.github.io/wiki/HardFeatureFreeze

So if you have fixes like that (possibly a subset of the present patch set), I 
certainly encourage you to repost those. I'm not familiar with 
DynamicTablesPkg, and so I can't evaluate this question myself, on a 
patch-by-patch basis. It's also possible that you'll have to split out parts of 
larger patches (refactor them) so that only the strict-sense fixes can be 
posted and applied.

Thanks!
Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 1/6] Revert "DynamicTablesPkg: Minor updates and fix typos"

2019-02-26 Thread Sami Mujawar
This reverts commit 07f4e26eb6fe5203028ecfe9bad90d3b67dc72c8.

Reverting this patch as Soft Feature Freeze for
edk2-stable201903 started on 22 Feb 2019.

Cc: Laszlo Ersek 
Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 66 
 1 file changed, 11 insertions(+), 55 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 
ec31c40449d0658f98a89ce0bb6f604b491f1f34..73139eb3273e89205ef9e6bee67b1b842f7f516b
 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -59,8 +59,6 @@ typedef enum ArmObjectID {
 
 /** A structure that describes the
 ARM Boot Architecture flags.
-
-ID: EArmObjBootArchInfo
 */
 typedef struct CmArmBootArchInfo {
   /** This is the ARM_BOOT_ARCH flags field of the FADT Table
@@ -73,10 +71,13 @@ typedef struct CmArmCpuInfo {
   // Reserved for use when SMBIOS tables are implemented
 } CM_ARM_CPU_INFO;
 
+typedef struct CmArmCpuInfoList {
+  UINT32 CpuCount;
+  CM_ARM_CPU_INFO  * CpuInfo;
+} CM_ARM_CPU_INFO_LIST;
+
 /** A structure that describes the
 Power Management Profile Information for the Platform.
-
-ID: EArmObjPowerManagementProfileInfo
 */
 typedef struct CmArmPowerManagementProfileInfo {
   /** This is the Preferred_PM_Profile field of the FADT Table
@@ -87,8 +88,6 @@ typedef struct CmArmPowerManagementProfileInfo {
 
 /** A structure that describes the
 GIC CPU Interface for the Platform.
-
-ID: EArmObjGicCInfo
 */
 typedef struct CmArmGicCInfo {
   /// The GIC CPU Interface number.
@@ -165,8 +164,6 @@ typedef struct CmArmGicCInfo {
 
 /** A structure that describes the
 GIC Distributor information for the Platform.
-
-ID: EArmObjGicDInfo
 */
 typedef struct CmArmGicDInfo {
   /// The Physical Base address for the GIC Distributor.
@@ -187,8 +184,6 @@ typedef struct CmArmGicDInfo {
 
 /** A structure that describes the
 GIC MSI Frame information for the Platform.
-
-ID: EArmObjGicMsiFrameInfo
 */
 typedef struct CmArmGicMsiFrameInfo {
   /// The GIC MSI Frame ID
@@ -212,8 +207,6 @@ typedef struct CmArmGicMsiFrameInfo {
 
 /** A structure that describes the
 GIC Redistributor information for the Platform.
-
-ID: EArmObjGicRedistributorInfo
 */
 typedef struct CmArmGicRedistInfo {
   /** The physical address of a page range
@@ -227,8 +220,6 @@ typedef struct CmArmGicRedistInfo {
 
 /** A structure that describes the
 GIC Interrupt Translation Service information for the Platform.
-
-ID: EArmObjGicItsInfo
 */
 typedef struct CmArmGicItsInfo {
   /// The GIC ITS ID
@@ -240,9 +231,6 @@ typedef struct CmArmGicItsInfo {
 
 /** A structure that describes the
 Serial Port information for the Platform.
-
-ID: EArmObjSerialConsolePortInfo or
-EArmObjSerialDebugPortInfo
 */
 typedef struct CmArmSerialPortInfo {
   /// The physical base address for the serial port
@@ -263,8 +251,6 @@ typedef struct CmArmSerialPortInfo {
 
 /** A structure that describes the
 Generic Timer information for the Platform.
-
-ID: EArmObjGenericTimerInfo
 */
 typedef struct CmArmGenericTimerInfo {
   /// The physical base address for the counter control frame
@@ -300,8 +286,6 @@ typedef struct CmArmGenericTimerInfo {
 
 /** A structure that describes the
 Platform Generic Block Timer Frame information for the Platform.
-
-ID: EArmObjGTBlockTimerFrameInfo
 */
 typedef struct CmArmGTBlockTimerFrameInfo {
   /// The Generic Timer frame number
@@ -337,8 +321,6 @@ typedef struct CmArmGTBlockTimerFrameInfo {
 
 /** A structure that describes the
 Platform Generic Block Timer information for the Platform.
-
-ID: EArmObjPlatformGTBlockInfo
 */
 typedef struct CmArmGTBlockInfo {
   /// The physical base address for the GT Block Timer structure
@@ -353,8 +335,6 @@ typedef struct CmArmGTBlockInfo {
 
 /** A structure that describes the
 SBSA Generic Watchdog information for the Platform.
-
-ID: EArmObjPlatformGenericWatchdogInfo
 */
 typedef struct CmArmGenericWatchdogInfo {
   /// The physical base address of the SBSA Watchdog control frame
@@ -374,8 +354,6 @@ typedef struct CmArmGenericWatchdogInfo {
 
 /** A structure that describes the
 PCI Configuration Space information for the Platform.
-
-ID: EArmObjPciConfigSpaceInfo
 */
 typedef struct CmArmPciConfigSpaceInfo {
   /// The physical base address for the PCI segment
@@ -393,8 +371,6 @@ typedef struct CmArmPciConfigSpaceInfo {
 
 /** A structure that describes the
 Hypervisor Vendor ID information for the Platform.
-
-ID: EArmObjHypervisorVendorIdentity
 */
 typedef struct CmArmHypervisorVendorId {
   /// The hypervisor Vendor ID
@@ -403,8 +379,6 @@ typedef struct CmArmHypervisorVendorId {
 
 /** A structure that describes the
 Fixed feature flags for the Platform.
-
-ID

[edk2] [PATCH v1 4/6] Revert "DynamicTablesPkg: Add OEM Info"

2019-02-26 Thread Sami Mujawar
This reverts commit c788bdaba47536447ae37518a96d92e0da54aad7.

Reverting this patch as Soft Feature Freeze for
edk2-stable201903 started on 22 Feb 2019.

Cc: Laszlo Ersek 
Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/Library/TableHelperLib.h|  4 +--
 DynamicTablesPkg/Include/StandardNameSpaceObjects.h  | 18 
--
 DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c |  2 +-
 DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c | 26 
++--
 10 files changed, 16 insertions(+), 46 deletions(-)

diff --git a/DynamicTablesPkg/Include/Library/TableHelperLib.h 
b/DynamicTablesPkg/Include/Library/TableHelperLib.h
index 
0f872bc3d08bf78e33bd8dab866e7bf57e00cb8c..3c4e1d23d2e6955388ab0b51fb57779f2225beb2
 100644
--- a/DynamicTablesPkg/Include/Library/TableHelperLib.h
+++ b/DynamicTablesPkg/Include/Library/TableHelperLib.h
@@ -45,7 +45,7 @@ GetCgfMgrInfo (
   @param [in] Generator  Pointer to the ACPI table Generator.
   @param [in,out] AcpiHeader Pointer to the ACPI table header to be
  updated.
-  @param [in] AcpiTableInfo  Pointer to the ACPI table info structure.
+  @param [in] Revision   Revision of the ACPI table.
   @param [in] Length Length of the ACPI table.
 
   @retval EFI_SUCCESS   The ACPI table is updated successfully.
@@ -61,7 +61,7 @@ AddAcpiHeader (
   IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST CfgMgrProtocol,
   IN  CONST ACPI_TABLE_GENERATOR  * CONST Generator,
   IN OUT  EFI_ACPI_DESCRIPTION_HEADER * CONST AcpiHeader,
-  IN  CONST CM_STD_OBJ_ACPI_TABLE_INFO* CONST AcpiTableInfo,
+  IN  CONST UINT32Revision,
   IN  CONST UINT32Length
   );
 
diff --git a/DynamicTablesPkg/Include/StandardNameSpaceObjects.h 
b/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
index 
58503858b27141cf7647a410c4b0b3fa574033de..4377ee8f785399b02fec824f3a34d2f4ed3b1c01
 100644
--- a/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
@@ -93,24 +93,6 @@ typedef struct CmAStdObjAcpiTableInfo {
   /// Optional pointer to the ACPI table data
   EFI_ACPI_DESCRIPTION_HEADER  * AcpiTableData;
 
-  /// An OEM-supplied string that the OEM uses to identify the particular
-  /// data table. This field is particularly useful when defining a definition
-  /// block to distinguish definition block functions. The OEM assigns each
-  /// dissimilar table a new OEM Table ID.
-  /// This field could be constructed using the SIGNATURE_64() macro.
-  ///   e.g. SIGNATURE_64 ('A','R','M','H','G','T','D','T')
-  /// Note: If this field is not populated (has value of Zero), then the
-  /// Generators shall populate this information using part of the
-  /// CM_STD_OBJ_CONFIGURATION_MANAGER_INFO.OemId field and the
-  /// ACPI table signature.
-  UINT64 OemTableId;
-
-  /// An OEM-supplied revision number. Larger numbers are assumed to be
-  /// newer revisions.
-  /// Note: If this field is not populated (has value of Zero), then the
-  /// Generators shall populate this information using the revision of the
-  /// Configuration Manager (CM_STD_OBJ_CONFIGURATION_MANAGER_INFO.Revision).
-  UINT32 OemRevision;
 } CM_STD_OBJ_ACPI_TABLE_INFO;
 
 /** A structure used to describe the SMBIOS table generators to be invoked.
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
index 
697cfc46abaedf34d30abf26e7ebb2b4d271822a..e21e2b660634b1aedce8167b74573694d6df2a3b
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
@@ -342,7 +342,7 @@ BuildDbg2Table (
  CfgMgrProtocol,
  This,
  (EFI_ACPI_DESCRIPTION_HEADER*),
- AcpiTableInfo,
+ AcpiTableInfo->AcpiTableRevision,
  sizeof (DBG2_TABLE)
  );
   if (EFI_ERROR (Status)) {
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c
index 
6699901b42a63a152027de59887ed097748ece91..62927b51d6d7c1585da1cb0d59785e2382639

[edk2] [PATCH v1 0/6] Revert DynamicTablesPkg: Framework updates and fixes

2019-02-26 Thread Sami Mujawar
Reverting this patch series as Soft Feature Freeze for
edk2-stable201903 started on 22 Feb 2019.

Cc: Laszlo Ersek 
Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 

The changes can be seen at 
https://github.com/samimujawar/edk2/tree/Revert_473_dynamic_tables_framework_v1

Sami Mujawar (6):
  Revert "DynamicTablesPkg: Minor updates and fix typos"
  Revert "DynamicTablesPkg: Remove GIC Distributor Id field"
  Revert "DynamicTablesPkg: DGB2: Update DBG2_DEBUG_PORT_DDI"
  Revert "DynamicTablesPkg: Add OEM Info"
  Revert "DynamicTablesPkg: Rename enum used for ID Mapping"
  Revert "DynamicTablesPkg: Fix protocol section"

 DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf |  
7 +-
 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf |  
7 +-
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 
73 +---
 DynamicTablesPkg/Include/Library/TableHelperLib.h  |  
4 +-
 DynamicTablesPkg/Include/StandardNameSpaceObjects.h| 
18 -
 DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c   |  
7 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c   |  
2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c   |  
2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c   |  
8 +--
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c   |  
6 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c   |  
2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c   |  
2 +-
 DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c   | 
26 ++-
 13 files changed, 48 insertions(+), 116 deletions(-)

-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 5/6] Revert "DynamicTablesPkg: Rename enum used for ID Mapping"

2019-02-26 Thread Sami Mujawar
This reverts commit 1d49a75367ef6827b8b8f77f61e9ce245d1bdee3.

Reverting this patch as Soft Feature Freeze for
edk2-stable201903 started on 22 Feb 2019.

Cc: Laszlo Ersek 
Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h   | 2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 
2adaa788083e4e15d049f5f6b6312f77f3c02488..93cb6949f0eb2ac2ad3524494e4a14c7a6fab4b8
 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -52,7 +52,7 @@ typedef enum ArmObjectID {
   EArmObjSmmuV3,  ///< 22 - SMMUv3
   EArmObjPmcg,///< 23 - PMCG
   EArmObjGicItsIdentifierArray,   ///< 24 - GIC ITS Identifier Array
-  EArmObjIdMappingArray,  ///< 25 - ID Mapping Array
+  EArmObjIdMapping,   ///< 25 - ID Mapping
   EArmObjSmmuInterruptArray,  ///< 26 - SMMU Interrupt Array
   EArmObjMax
 } EARM_OBJECT_ID;
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
index 
b53c4bb47798d4ad441db1fe1b1e5b180e313403..a3ee60664ecbeb1b12b01683f838e11804884daf
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
@@ -44,7 +44,7 @@ Requirements:
   - EArmObjSmmuV3
   - EArmObjPmcg
   - EArmObjGicItsIdentifierArray
-  - EArmObjIdMappingArray
+  - EArmObjIdMapping
   - EArmObjGicItsIdentifierArray
 */
 
@@ -116,7 +116,7 @@ GET_OBJECT_LIST (
 */
 GET_OBJECT_LIST (
   EObjNameSpaceArm,
-  EArmObjIdMappingArray,
+  EArmObjIdMapping,
   CM_ARM_ID_MAPPING
   );
 
@@ -653,7 +653,7 @@ AddIdMappingArray (
   Generator = (ACPI_IORT_GENERATOR*)This;
 
   // Get the Id Mapping Array
-  Status = GetEArmObjIdMappingArray (
+  Status = GetEArmObjIdMapping (
  CfgMgrProtocol,
  IdMappingToken,
  ,
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 6/6] Revert "DynamicTablesPkg: Fix protocol section"

2019-02-26 Thread Sami Mujawar
This reverts commit bde673b2dcd1b087af7f49dd5f0c3b82b02172a5.

Reverting this patch as Soft Feature Freeze for
edk2-stable201903 started on 22 Feb 2019.

Cc: Laszlo Ersek 
Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf | 7 
+--
 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf | 7 
+++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git 
a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf 
b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf
index 
02c907c38023e8b44829a38ed93436904d8cf3d3..740811d0fc0590543a62360e6753eb04fb675d70
 100644
--- a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf
+++ b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf
@@ -1,7 +1,7 @@
 ## @file
 #  Module to manage the list of available table factories.
 #
-#  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -51,7 +51,10 @@ [FixedPcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxCustomDTGenerators
 
 [Protocols]
-  gEdkiiDynamicTableFactoryProtocolGuid # PRODUCES
+  gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED
+  gEfiSmbiosProtocolGuid# PROTOCOL ALWAYS_CONSUMED
+  gEdkiiConfigurationManagerProtocolGuid
+  gEdkiiDynamicTableFactoryProtocolGuid
 
 [Depex]
   TRUE
diff --git 
a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf 
b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
index 
e78218a914ce993f3e605841e2bffae700076dd0..fef8b20672fb943b78302a152fcf0f66db264b0a
 100644
--- a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
+++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
@@ -1,7 +1,7 @@
 ## @file
 # Module that drives the table generation and installation process.
 #
-#  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -42,9 +42,8 @@ [LibraryClasses]
 
 [Protocols]
   gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED
-
-  gEdkiiConfigurationManagerProtocolGuid# PROTOCOL ALWAYS_CONSUMED
-  gEdkiiDynamicTableFactoryProtocolGuid # PROTOCOL ALWAYS_CONSUMED
+  gEdkiiConfigurationManagerProtocolGuid
+  gEdkiiDynamicTableFactoryProtocolGuid
 
 [Depex]
   gEfiAcpiTableProtocolGuid AND
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 2/6] Revert "DynamicTablesPkg: Remove GIC Distributor Id field"

2019-02-26 Thread Sami Mujawar
This reverts commit d3a15f435f9716aa2f2ea5e9b35fcda04f267ab4.

Reverting this patch as Soft Feature Freeze for
edk2-stable201903 started on 22 Feb 2019.

Cc: Laszlo Ersek 
Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h   | 5 -
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c | 4 +---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 
73139eb3273e89205ef9e6bee67b1b842f7f516b..2adaa788083e4e15d049f5f6b6312f77f3c02488
 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -166,6 +166,9 @@ typedef struct CmArmGicCInfo {
 GIC Distributor information for the Platform.
 */
 typedef struct CmArmGicDInfo {
+  /// The GIC Distributor ID.
+  UINT32  GicId;
+
   /// The Physical Base address for the GIC Distributor.
   UINT64  PhysicalBaseAddress;
 
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
index 
6b89c3f65d36ff35fcfc81cdffdeae8e4306c976..1ee0b9e006bfa00ea5bbf6aa64209dac244c90a0
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
@@ -192,9 +192,7 @@ AddGICD (
   // UINT16 Reserved
   Gicd->Reserved1 = EFI_ACPI_RESERVED_WORD;
   // UINT32 Identifier
-  // One, and only one, GIC distributor structure must be present
-  // in the MADT for an ARM based system
-  Gicd->GicId = 0;
+  Gicd->GicId = GicDInfo->GicId;
   // UINT64 PhysicalBaseAddress
   Gicd->PhysicalBaseAddress = GicDInfo->PhysicalBaseAddress;
   // UINT32 VectorBase
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 3/6] Revert "DynamicTablesPkg: DGB2: Update DBG2_DEBUG_PORT_DDI"

2019-02-26 Thread Sami Mujawar
This reverts commit 6814256083a90ef218e7ae240e51922045175df1.

Reverting this patch as Soft Feature Freeze for
edk2-stable201903 started on 22 Feb 2019.

Cc: Laszlo Ersek 
Cc: Alexei Fedorov 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
index 
90380f48da017b257476ee63bcc1beae5efe1d65..697cfc46abaedf34d30abf26e7ebb2b4d271822a
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
@@ -97,12 +97,14 @@ typedef struct {
 /** A helper macro used for initializing the debug port device
 information structure.
 
+  @param [in]  NumReg   The number of generic address registers.
   @param [in]  SubType  The DBG Port SubType.
   @param [in]  UartBase The UART port base address.
   @param [in]  UartAddrLen  The UART port address range length.
   @param [in]  UartNameStr  The UART port name string.
 **/
 #define DBG2_DEBUG_PORT_DDI(  \
+  NumReg, \
   SubType,\
   UartBase,   \
   UartAddrLen,\
@@ -114,7 +116,7 @@ typedef struct {
   /* UINT16Length */  \
   sizeof (DBG2_DEBUG_DEVICE_INFORMATION), \
   /* UINT8 NumberofGenericAddressRegisters */ \
-  DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS,   \
+  NumReg, \
   /* UINT16NameSpaceStringLength */   \
   DBG2_NAMESPACESTRING_FIELD_SIZE,\
   /* UINT16NameSpaceStringOffset */   \
@@ -162,6 +164,7 @@ DBG2_TABLE AcpiDbg2 = {
  * Debug port 1
  */
 DBG2_DEBUG_PORT_DDI (
+  DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS,
   0,// {Template}: Serial Port Subtype
   0,// {Template}: Serial Port Base Address
   PL011_UART_LENGTH,
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v1 0/4] Platform/ARM: Updates corresponding to Dynamic Tables Framework changes

2019-02-25 Thread Sami Mujawar
Hi Leif, Ard,

I have pushed the Dynamic Tables Framework changes to tianocore\edk2.

You should now be able to build the edk2-platform patches for dynamic tables 
with latest edk2 master.

Regards,

Sami Mujawar

-Original Message-
From: Sami Mujawar  
Sent: 21 February 2019 06:15 PM
To: edk2-devel@lists.01.org
Cc: Sami Mujawar ; ard.biesheu...@linaro.org; 
leif.lindh...@linaro.org; michael.d.kin...@intel.com; Alexei Fedorov 
; Matteo Carlini ; Stephanie 
Hughes-Fitt ; nd 
Subject: [PATCH edk2-platforms v1 0/4] Platform/ARM: Updates corresponding to 
Dynamic Tables Framework changes

The Dynamic tables framework has been updated to incorporated a series of 
updates namely:
  * Resolving DEPEX order for modules.
  * Removing GIC Distributor ID

This patch series implement the corresponding changes required in the platform 
Configuration Manager.

Note: This patch series is dependent on the patch series:
https://lists.01.org/pipermail/edk2-devel/2019-January/035611.html

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 

The changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/473_dynamic_tables_framework_v1

The corresponding edk2 code changes can be seen at:
https://github.com/samimujawar/edk2/tree/473_dynamic_tables_framework_v1

Sami Mujawar (4):
  Platform/ARM: Juno: Configuration Manager depex
  Platform/ARM: FVP: Configuration Manager depex
  Platform/ARM: FVP: Config Mgr remove GICD ID
  Platform/ARM: Juno: Config Mgr remove GICD ID

 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 1 -
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 | 4 ++--
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 1 -
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 | 4 ++--
 4 files changed, 4 insertions(+), 6 deletions(-)

--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 0/2] DynamicTablesPkg Updates

2019-02-25 Thread Sami Mujawar
Reviewed-by: Sami Mujawar 

-Original Message-
From: Ashish Singhal  
Sent: 21 February 2019 06:39 PM
To: edk2-devel@lists.01.org
Cc: Sami Mujawar ; Alexei Fedorov 
; Ashish Singhal 
Subject: [PATCH 0/2] DynamicTablesPkg Updates

DynamicTablesPkg/DynamicTableManagerDxe: Update DEPEX

This patch adds appropriate dependencies to DynamicTableManagerDxe.
The initialization function fails if gEdkiiDynamicTableFactoryProtocolGuid
and gEdkiiConfigurationManagerProtocolGuid are not present already. Since we 
are not relying on a callback but locating these in initialization, we should 
add these dependencies. Towards the end of initialization function where we 
build and install ACPI tables, we locate gEfiAcpiTableProtocolGuid and return a 
failure is not present. We need to add approriate dependency for this as well. 
Adding these proper dependencies would make the code not rely on drivers 
forcefully dispatched in a particular order

DynamicTablesPkg/AcpiSpcrLibArm: Support 16550 UART.

This patch adds support for 16550 UART in ACPI SPCR table. HLOS support for 
this type of UART is already present.

Both the patches have been verified to work on hardware.

Ashish Singhal (2):
  DynamicTablesPkg/DynamicTableManagerDxe: Update DEPEX
  DynamicTablesPkg/AcpiSpcrLibArm: Support 16550 UART.

 .../Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf | 4 +++-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c  | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

--
2.7.4

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 1/1] ArmPkg: Fix writes to GICv3 GICD_IROUTER reg

2019-02-22 Thread Sami Mujawar
According to ARM Generic Interrupt Controller Architecture
Specification, GIC architecture version 3.0 and version 4.0,
GICD_IROUTER is a 64-bit register.

Fixed code to use 64 bit MMIO write operations so that the
Aff3 value (bits [39:32]) is written to GICD_IROUTER.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
Reported-by: Carl van Schaik 
---

The changes can be seen at 
https://github.com/samimujawar/edk2/tree/352_fix_gicv3_GICD_IROUTERn_v1


 ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c 
b/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c
index 
1558db31713a828f324a807583076b21dd3302d0..67c74f79654586f8b6e47795d3c7400b88172d6e
 100644
--- a/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c
+++ b/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2011-2017, ARM Limited. All rights reserved.
+*  Copyright (c) 2011-2018, ARM Limited. All rights reserved.
 *
 *  This program and the accompanying materials
 *  are licensed and made available under the terms and conditions of the BSD 
License
@@ -467,7 +467,7 @@ GicV3DxeInitialize (
 
 // Route the SPIs to the primary CPU. SPIs start at the INTID 32
 for (Index = 0; Index < (mGicNumInterrupts - 32); Index++) {
-  MmioWrite32 (
+  MmioWrite64 (
 mGicDistributorBase + ARM_GICD_IROUTER + (Index * 8),
 CpuTarget
 );
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms v1 0/4] Platform/ARM: Updates corresponding to Dynamic Tables Framework changes

2019-02-21 Thread Sami Mujawar
The Dynamic tables framework has been updated to incorporated a series of
updates namely:
  * Resolving DEPEX order for modules.
  * Removing GIC Distributor ID

This patch series implement the corresponding changes required in the platform
Configuration Manager.

Note: This patch series is dependent on the patch series:
https://lists.01.org/pipermail/edk2-devel/2019-January/035611.html

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 

The changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/473_dynamic_tables_framework_v1

The corresponding edk2 code changes can be seen at:
https://github.com/samimujawar/edk2/tree/473_dynamic_tables_framework_v1

Sami Mujawar (4):
  Platform/ARM: Juno: Configuration Manager depex
  Platform/ARM: FVP: Configuration Manager depex
  Platform/ARM: FVP: Config Mgr remove GICD ID
  Platform/ARM: Juno: Config Mgr remove GICD ID

 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 1 -
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 | 4 ++--
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 1 -
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 | 4 ++--
 4 files changed, 4 insertions(+), 6 deletions(-)

-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms v1 2/4] Platform/ARM: FVP: Configuration Manager depex

2019-02-21 Thread Sami Mujawar
The Configuration Manager needs to be loaded before
other Dynamic Tables Framework Modules.

Fix the DEPEX section for Configuration Manager Dxe to
remove incorrect dependency.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
index 
c4c8f462b8fa8ea718589f2265ae42953ac0a49a..299c61f10f6fe41060d648a6fadcc63c310108a9
 100644
--- 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+++ 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
@@ -1,7 +1,7 @@
 ## @file
 # Configuration Manager Dxe
 #
-#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -76,4 +76,4 @@ [FixedPcd]
 [Pcd]
 
 [Depex]
-  gEdkiiDynamicTableFactoryProtocolGuid
+  TRUE
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms v1 3/4] Platform/ARM: FVP: Config Mgr remove GICD ID

2019-02-21 Thread Sami Mujawar
According to ACPI 6.2 Specification - Errata A, 'One,
and only one, GIC distributor structure must be present
in the MADT for an ARM based system'. Accordingly the
CM_ARM_GICD_INFO structure has been updated to remove
the GicId field as this value is set to zero by the
MADT generator.

This update reflects the corresponding change required
to the Configuration Manager.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 | 1 -
 1 file changed, 1 deletion(-)

diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
index 
66ee79341dfeceff1dc70c32b308056d87b99540..cdde32f6b43e876d8869941b4a11b0da8c72224e
 100644
--- 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
+++ 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -116,7 +116,6 @@ EDKII_PLATFORM_REPOSITORY_INFO VExpressPlatRepositoryInfo = 
{
 
   // GIC Distributor Info
   {
-0,  // UINT32  GicId
 FixedPcdGet64 (PcdGicDistributorBase),  // UINT64  PhysicalBaseAddress
 0,  // UINT32  SystemVectorBase
 3   // UINT8   GicVersion
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms v1 1/4] Platform/ARM: Juno: Configuration Manager depex

2019-02-21 Thread Sami Mujawar
The Configuration Manager needs to be loaded before
other Dynamic Tables Framework Modules.

Fix the DEPEX section for Configuration Manager Dxe to
remove incorrect dependency.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
index 
1491653ab8fe4d44ce11bdf9116f187cc3edf817..a8ef27108237d5cdf20166cffe7a348ebb2b2b12
 100644
--- 
a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+++ 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
@@ -1,7 +1,7 @@
 ## @file
 #  Configuration Manager Dxe
 #
-#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -83,4 +83,4 @@ [FixedPcd]
 [Pcd]
 
 [Depex]
-  gEdkiiDynamicTableFactoryProtocolGuid
+  TRUE
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms v1 4/4] Platform/ARM: Juno: Config Mgr remove GICD ID

2019-02-21 Thread Sami Mujawar
According to ACPI 6.2 Specification - Errata A, 'One,
and only one, GIC distributor structure must be present
in the MADT for an ARM based system'. Accordingly the
CM_ARM_GICD_INFO structure has been updated to remove
the GicId field as this value is set to zero by the
MADT generator.

This update reflects the corresponding change required
to the Configuration Manager.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 | 1 -
 1 file changed, 1 deletion(-)

diff --git 
a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
index 
55f0984ee6741f5434dd1ec673281c78e2a576f2..444c1d95af27d938da76e00e41756b800b977589
 100644
--- 
a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
+++ 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -145,7 +145,6 @@ EDKII_PLATFORM_REPOSITORY_INFO 
ArmJunoPlatformRepositoryInfo = {
 
   // GIC Distributor Info
   {
-0,  // UINT32  GicId
 FixedPcdGet64 (PcdGicDistributorBase),  // UINT64  PhysicalBaseAddress
 0,  // UINT32  SystemVectorBase
 2   // UINT8   GicVersion
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 6/6] DynamicTablesPkg: Minor updates and fix typos

2019-02-21 Thread Sami Mujawar
Minor updates to comments and typo fixes. Also removed
unused structure CM_ARM_CPU_INFO_LIST.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 66 
 1 file changed, 55 insertions(+), 11 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 
73139eb3273e89205ef9e6bee67b1b842f7f516b..ec31c40449d0658f98a89ce0bb6f604b491f1f34
 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -59,6 +59,8 @@ typedef enum ArmObjectID {
 
 /** A structure that describes the
 ARM Boot Architecture flags.
+
+ID: EArmObjBootArchInfo
 */
 typedef struct CmArmBootArchInfo {
   /** This is the ARM_BOOT_ARCH flags field of the FADT Table
@@ -71,13 +73,10 @@ typedef struct CmArmCpuInfo {
   // Reserved for use when SMBIOS tables are implemented
 } CM_ARM_CPU_INFO;
 
-typedef struct CmArmCpuInfoList {
-  UINT32 CpuCount;
-  CM_ARM_CPU_INFO  * CpuInfo;
-} CM_ARM_CPU_INFO_LIST;
-
 /** A structure that describes the
 Power Management Profile Information for the Platform.
+
+ID: EArmObjPowerManagementProfileInfo
 */
 typedef struct CmArmPowerManagementProfileInfo {
   /** This is the Preferred_PM_Profile field of the FADT Table
@@ -88,6 +87,8 @@ typedef struct CmArmPowerManagementProfileInfo {
 
 /** A structure that describes the
 GIC CPU Interface for the Platform.
+
+ID: EArmObjGicCInfo
 */
 typedef struct CmArmGicCInfo {
   /// The GIC CPU Interface number.
@@ -164,6 +165,8 @@ typedef struct CmArmGicCInfo {
 
 /** A structure that describes the
 GIC Distributor information for the Platform.
+
+ID: EArmObjGicDInfo
 */
 typedef struct CmArmGicDInfo {
   /// The Physical Base address for the GIC Distributor.
@@ -184,6 +187,8 @@ typedef struct CmArmGicDInfo {
 
 /** A structure that describes the
 GIC MSI Frame information for the Platform.
+
+ID: EArmObjGicMsiFrameInfo
 */
 typedef struct CmArmGicMsiFrameInfo {
   /// The GIC MSI Frame ID
@@ -207,6 +212,8 @@ typedef struct CmArmGicMsiFrameInfo {
 
 /** A structure that describes the
 GIC Redistributor information for the Platform.
+
+ID: EArmObjGicRedistributorInfo
 */
 typedef struct CmArmGicRedistInfo {
   /** The physical address of a page range
@@ -220,6 +227,8 @@ typedef struct CmArmGicRedistInfo {
 
 /** A structure that describes the
 GIC Interrupt Translation Service information for the Platform.
+
+ID: EArmObjGicItsInfo
 */
 typedef struct CmArmGicItsInfo {
   /// The GIC ITS ID
@@ -231,6 +240,9 @@ typedef struct CmArmGicItsInfo {
 
 /** A structure that describes the
 Serial Port information for the Platform.
+
+ID: EArmObjSerialConsolePortInfo or
+EArmObjSerialDebugPortInfo
 */
 typedef struct CmArmSerialPortInfo {
   /// The physical base address for the serial port
@@ -251,6 +263,8 @@ typedef struct CmArmSerialPortInfo {
 
 /** A structure that describes the
 Generic Timer information for the Platform.
+
+ID: EArmObjGenericTimerInfo
 */
 typedef struct CmArmGenericTimerInfo {
   /// The physical base address for the counter control frame
@@ -286,6 +300,8 @@ typedef struct CmArmGenericTimerInfo {
 
 /** A structure that describes the
 Platform Generic Block Timer Frame information for the Platform.
+
+ID: EArmObjGTBlockTimerFrameInfo
 */
 typedef struct CmArmGTBlockTimerFrameInfo {
   /// The Generic Timer frame number
@@ -321,6 +337,8 @@ typedef struct CmArmGTBlockTimerFrameInfo {
 
 /** A structure that describes the
 Platform Generic Block Timer information for the Platform.
+
+ID: EArmObjPlatformGTBlockInfo
 */
 typedef struct CmArmGTBlockInfo {
   /// The physical base address for the GT Block Timer structure
@@ -335,6 +353,8 @@ typedef struct CmArmGTBlockInfo {
 
 /** A structure that describes the
 SBSA Generic Watchdog information for the Platform.
+
+ID: EArmObjPlatformGenericWatchdogInfo
 */
 typedef struct CmArmGenericWatchdogInfo {
   /// The physical base address of the SBSA Watchdog control frame
@@ -354,6 +374,8 @@ typedef struct CmArmGenericWatchdogInfo {
 
 /** A structure that describes the
 PCI Configuration Space information for the Platform.
+
+ID: EArmObjPciConfigSpaceInfo
 */
 typedef struct CmArmPciConfigSpaceInfo {
   /// The physical base address for the PCI segment
@@ -371,6 +393,8 @@ typedef struct CmArmPciConfigSpaceInfo {
 
 /** A structure that describes the
 Hypervisor Vendor ID information for the Platform.
+
+ID: EArmObjHypervisorVendorIdentity
 */
 typedef struct CmArmHypervisorVendorId {
   /// The hypervisor Vendor ID
@@ -379,6 +403,8 @@ typedef struct CmArmHypervisorVendorId {
 
 /** A structure that describes the
 Fixed feature flags for the Platform.
+
+ID: EArmObjFixedFeatureFlags
 */
 typedef struct CmArmFixedFeatureFlags {
   /// The Fixed feature

[edk2] [PATCH v1 3/6] DynamicTablesPkg: Add OEM Info

2019-02-21 Thread Sami Mujawar
Added option for OEMs to provide OEM Table ID and
OEM Revision for ACPI tables.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/Library/TableHelperLib.h|  4 +--
 DynamicTablesPkg/Include/StandardNameSpaceObjects.h  | 18 
++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c |  2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c |  2 +-
 DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c | 26 
++--
 10 files changed, 46 insertions(+), 16 deletions(-)

diff --git a/DynamicTablesPkg/Include/Library/TableHelperLib.h 
b/DynamicTablesPkg/Include/Library/TableHelperLib.h
index 
3c4e1d23d2e6955388ab0b51fb57779f2225beb2..0f872bc3d08bf78e33bd8dab866e7bf57e00cb8c
 100644
--- a/DynamicTablesPkg/Include/Library/TableHelperLib.h
+++ b/DynamicTablesPkg/Include/Library/TableHelperLib.h
@@ -45,7 +45,7 @@ GetCgfMgrInfo (
   @param [in] Generator  Pointer to the ACPI table Generator.
   @param [in,out] AcpiHeader Pointer to the ACPI table header to be
  updated.
-  @param [in] Revision   Revision of the ACPI table.
+  @param [in] AcpiTableInfo  Pointer to the ACPI table info structure.
   @param [in] Length Length of the ACPI table.
 
   @retval EFI_SUCCESS   The ACPI table is updated successfully.
@@ -61,7 +61,7 @@ AddAcpiHeader (
   IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST CfgMgrProtocol,
   IN  CONST ACPI_TABLE_GENERATOR  * CONST Generator,
   IN OUT  EFI_ACPI_DESCRIPTION_HEADER * CONST AcpiHeader,
-  IN  CONST UINT32Revision,
+  IN  CONST CM_STD_OBJ_ACPI_TABLE_INFO* CONST AcpiTableInfo,
   IN  CONST UINT32Length
   );
 
diff --git a/DynamicTablesPkg/Include/StandardNameSpaceObjects.h 
b/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
index 
4377ee8f785399b02fec824f3a34d2f4ed3b1c01..58503858b27141cf7647a410c4b0b3fa574033de
 100644
--- a/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
@@ -93,6 +93,24 @@ typedef struct CmAStdObjAcpiTableInfo {
   /// Optional pointer to the ACPI table data
   EFI_ACPI_DESCRIPTION_HEADER  * AcpiTableData;
 
+  /// An OEM-supplied string that the OEM uses to identify the particular
+  /// data table. This field is particularly useful when defining a definition
+  /// block to distinguish definition block functions. The OEM assigns each
+  /// dissimilar table a new OEM Table ID.
+  /// This field could be constructed using the SIGNATURE_64() macro.
+  ///   e.g. SIGNATURE_64 ('A','R','M','H','G','T','D','T')
+  /// Note: If this field is not populated (has value of Zero), then the
+  /// Generators shall populate this information using part of the
+  /// CM_STD_OBJ_CONFIGURATION_MANAGER_INFO.OemId field and the
+  /// ACPI table signature.
+  UINT64 OemTableId;
+
+  /// An OEM-supplied revision number. Larger numbers are assumed to be
+  /// newer revisions.
+  /// Note: If this field is not populated (has value of Zero), then the
+  /// Generators shall populate this information using the revision of the
+  /// Configuration Manager (CM_STD_OBJ_CONFIGURATION_MANAGER_INFO.Revision).
+  UINT32 OemRevision;
 } CM_STD_OBJ_ACPI_TABLE_INFO;
 
 /** A structure used to describe the SMBIOS table generators to be invoked.
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
index 
e21e2b660634b1aedce8167b74573694d6df2a3b..697cfc46abaedf34d30abf26e7ebb2b4d271822a
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
@@ -342,7 +342,7 @@ BuildDbg2Table (
  CfgMgrProtocol,
  This,
  (EFI_ACPI_DESCRIPTION_HEADER*),
- AcpiTableInfo->AcpiTableRevision,
+ AcpiTableInfo,
  sizeof (DBG2_TABLE)
  );
   if (EFI_ERROR (Status)) {
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c
index 
62927b51d6d7c1585da1cb0d59785e2382639002..6699901b42a63a152027de59887ed097748ece91
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c
+++ b/DynamicTablesPkg/Libr

[edk2] [PATCH v1 1/6] DynamicTablesPkg: Fix depex and protocol section

2019-02-21 Thread Sami Mujawar
Updated the DynamicTableFactoryDxe and DynamicTableManagerDxe
to setup the correct dependency order. Also updated the
Protocols section to reflect the protocols that are produced
or consumed.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf |  
7 ++-
 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf | 
11 +++
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf 
b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf
index 
740811d0fc0590543a62360e6753eb04fb675d70..02c907c38023e8b44829a38ed93436904d8cf3d3
 100644
--- a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf
+++ b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf
@@ -1,7 +1,7 @@
 ## @file
 #  Module to manage the list of available table factories.
 #
-#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -51,10 +51,7 @@ [FixedPcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxCustomDTGenerators
 
 [Protocols]
-  gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED
-  gEfiSmbiosProtocolGuid# PROTOCOL ALWAYS_CONSUMED
-  gEdkiiConfigurationManagerProtocolGuid
-  gEdkiiDynamicTableFactoryProtocolGuid
+  gEdkiiDynamicTableFactoryProtocolGuid # PRODUCES
 
 [Depex]
   TRUE
diff --git 
a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf 
b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
index 
2aeaf15b157c0172c9cb073e55d789944a73e2ec..39b10b5536bc341dc253801b8ed7640a8b5d4217
 100644
--- a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
+++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf
@@ -1,7 +1,7 @@
 ## @file
 # Module that drives the table generation and installation process.
 #
-#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -42,9 +42,12 @@ [LibraryClasses]
 
 [Protocols]
   gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED
-  gEdkiiConfigurationManagerProtocolGuid
-  gEdkiiDynamicTableFactoryProtocolGuid
+
+  gEdkiiConfigurationManagerProtocolGuid# PROTOCOL ALWAYS_CONSUMED
+  gEdkiiDynamicTableFactoryProtocolGuid # PROTOCOL ALWAYS_CONSUMED
 
 [Depex]
-  gEdkiiConfigurationManagerProtocolGuid
+  gEfiAcpiTableProtocolGuid
+  AND gEdkiiConfigurationManagerProtocolGuid
+  AND gEdkiiDynamicTableFactoryProtocolGuid
 
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 4/6] DynamicTablesPkg: DGB2: Update DBG2_DEBUG_PORT_DDI

2019-02-21 Thread Sami Mujawar
The DBG2_DEBUG_PORT_DDI() macro supports adding only one
Generic Base Address Register. Therefore, removed the
superfluous parameter NumReg and updated the macro to
use DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS which has
a value 1.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
index 
697cfc46abaedf34d30abf26e7ebb2b4d271822a..90380f48da017b257476ee63bcc1beae5efe1d65
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
@@ -97,14 +97,12 @@ typedef struct {
 /** A helper macro used for initializing the debug port device
 information structure.
 
-  @param [in]  NumReg   The number of generic address registers.
   @param [in]  SubType  The DBG Port SubType.
   @param [in]  UartBase The UART port base address.
   @param [in]  UartAddrLen  The UART port address range length.
   @param [in]  UartNameStr  The UART port name string.
 **/
 #define DBG2_DEBUG_PORT_DDI(  \
-  NumReg, \
   SubType,\
   UartBase,   \
   UartAddrLen,\
@@ -116,7 +114,7 @@ typedef struct {
   /* UINT16Length */  \
   sizeof (DBG2_DEBUG_DEVICE_INFORMATION), \
   /* UINT8 NumberofGenericAddressRegisters */ \
-  NumReg, \
+  DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS,   \
   /* UINT16NameSpaceStringLength */   \
   DBG2_NAMESPACESTRING_FIELD_SIZE,\
   /* UINT16NameSpaceStringOffset */   \
@@ -164,7 +162,6 @@ DBG2_TABLE AcpiDbg2 = {
  * Debug port 1
  */
 DBG2_DEBUG_PORT_DDI (
-  DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS,
   0,// {Template}: Serial Port Subtype
   0,// {Template}: Serial Port Base Address
   PL011_UART_LENGTH,
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 2/6] DynamicTablesPkg: Rename enum used for ID Mapping

2019-02-21 Thread Sami Mujawar
Renamed the enum EArmObjIdMapping to EArmObjIdMappingArray
and updated the IORT generator accordingly.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h   | 2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 
93cb6949f0eb2ac2ad3524494e4a14c7a6fab4b8..2adaa788083e4e15d049f5f6b6312f77f3c02488
 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -52,7 +52,7 @@ typedef enum ArmObjectID {
   EArmObjSmmuV3,  ///< 22 - SMMUv3
   EArmObjPmcg,///< 23 - PMCG
   EArmObjGicItsIdentifierArray,   ///< 24 - GIC ITS Identifier Array
-  EArmObjIdMapping,   ///< 25 - ID Mapping
+  EArmObjIdMappingArray,  ///< 25 - ID Mapping Array
   EArmObjSmmuInterruptArray,  ///< 26 - SMMU Interrupt Array
   EArmObjMax
 } EARM_OBJECT_ID;
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
index 
a3ee60664ecbeb1b12b01683f838e11804884daf..b53c4bb47798d4ad441db1fe1b1e5b180e313403
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
@@ -44,7 +44,7 @@ Requirements:
   - EArmObjSmmuV3
   - EArmObjPmcg
   - EArmObjGicItsIdentifierArray
-  - EArmObjIdMapping
+  - EArmObjIdMappingArray
   - EArmObjGicItsIdentifierArray
 */
 
@@ -116,7 +116,7 @@ GET_OBJECT_LIST (
 */
 GET_OBJECT_LIST (
   EObjNameSpaceArm,
-  EArmObjIdMapping,
+  EArmObjIdMappingArray,
   CM_ARM_ID_MAPPING
   );
 
@@ -653,7 +653,7 @@ AddIdMappingArray (
   Generator = (ACPI_IORT_GENERATOR*)This;
 
   // Get the Id Mapping Array
-  Status = GetEArmObjIdMapping (
+  Status = GetEArmObjIdMappingArray (
  CfgMgrProtocol,
  IdMappingToken,
  ,
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 0/6] DynamicTablesPkg: Framework updates and fixes

2019-02-21 Thread Sami Mujawar
This patch series updates the Dynamic Tables Framework to
incorporate the following changes:
  * Fix DEPEX to load modules in correct order.
  * Add options for OEMs to provide OEM Table ID and revision.
  * Update DBG2_DEBUG_PORT_DDI macro to remove unused parameter.
  * Remove GIC Distributor ID field.
  * Minor updates to comments and typo fixes.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 

The changes can be seen at:
https://github.com/samimujawar/edk2/tree/473_dynamic_tables_framework_v1

The corresponding edk2-platform code changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/473_dynamic_tables_framework_v1

Sami Mujawar (6):
  DynamicTablesPkg: Fix depex and protocol section
  DynamicTablesPkg: Rename enum used for ID Mapping
  DynamicTablesPkg: Add OEM Info
  DynamicTablesPkg: DGB2: Update DBG2_DEBUG_PORT_DDI
  DynamicTablesPkg: Remove GIC Distributor Id field
  DynamicTablesPkg: Minor updates and fix typos

 DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf |  
7 +-
 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf | 
11 +--
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 
73 +++-
 DynamicTablesPkg/Include/Library/TableHelperLib.h  |  
4 +-
 DynamicTablesPkg/Include/StandardNameSpaceObjects.h| 
18 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c   |  
7 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c   |  
2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c   |  
2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c   |  
8 +--
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c   |  
6 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c   |  
2 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c   |  
2 +-
 DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c   | 
26 +--
 13 files changed, 119 insertions(+), 49 deletions(-)

-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 5/6] DynamicTablesPkg: Remove GIC Distributor Id field

2019-02-21 Thread Sami Mujawar
According to ACPI 6.2 Specification - Errata A, 'One,
and only one, GIC distributor structure must be present
in the MADT for an ARM based system'. Therefore,
the GIC Distributor ID field in the ACPI MADT GICD
substructure can be set to zero and there is no need
for the Configuration Manager to provide this information.

Update the CM_ARM_GICD_INFO structure to remove the GicId
field. Similarly update the MADT Generator to set the GicId
field in the GICD substructure to zero.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h   | 5 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c | 4 +++-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
index 
2adaa788083e4e15d049f5f6b6312f77f3c02488..73139eb3273e89205ef9e6bee67b1b842f7f516b
 100644
--- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -166,9 +166,6 @@ typedef struct CmArmGicCInfo {
 GIC Distributor information for the Platform.
 */
 typedef struct CmArmGicDInfo {
-  /// The GIC Distributor ID.
-  UINT32  GicId;
-
   /// The Physical Base address for the GIC Distributor.
   UINT64  PhysicalBaseAddress;
 
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
index 
1ee0b9e006bfa00ea5bbf6aa64209dac244c90a0..6b89c3f65d36ff35fcfc81cdffdeae8e4306c976
 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
@@ -192,7 +192,9 @@ AddGICD (
   // UINT16 Reserved
   Gicd->Reserved1 = EFI_ACPI_RESERVED_WORD;
   // UINT32 Identifier
-  Gicd->GicId = GicDInfo->GicId;
+  // One, and only one, GIC distributor structure must be present
+  // in the MADT for an ARM based system
+  Gicd->GicId = 0;
   // UINT64 PhysicalBaseAddress
   Gicd->PhysicalBaseAddress = GicDInfo->PhysicalBaseAddress;
   // UINT32 VectorBase
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 17/22] DynamicTablesPkg: Arm ACPI MADT Generator

2019-01-24 Thread Sami Mujawar
The MADT generator uses the configuration manager protocol to
obtain information about the Arm interrupt controllers (GICC,
GICD, etc.) and generates the ACPI MADT table. This table data
is then used by the Table Manager to install the MADT table.

The Table Manager then invokes the generator interface to free
any resources allocated by the MADT table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc  |   1 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf |  42 ++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c| 745 

 3 files changed, 788 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 
ffdf4f13bbc88c7d4ef97d15583c951a4c9ff599..cf86f2e6a05216236c4b773190d13779e86bbd3e
 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -28,6 +28,7 @@ [Components.common]
   DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {
 
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
+  NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
   }
 
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
new file mode 100644
index 
..6ba8af4632c25e97b948893c344517ac447ce01a
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
@@ -0,0 +1,42 @@
+## @file
+#  MADT Table Generator
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = AcpiMadtLibArm
+  FILE_GUID  = AF76C93B-41B5-454D-83CD-D2A80A1C1E38
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiMadtLibConstructor
+  DESTRUCTOR = AcpiMadtLibDestructor
+
+[Sources]
+  MadtGenerator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+
+[Pcd]
+
+[Protocols]
+
+[Guids]
+
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
new file mode 100644
index 
..06794758308e028b7d8da06670b1793cbdb3ae81
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
@@ -0,0 +1,745 @@
+/** @file
+  MADT Table Generator
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+  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.
+
+  @par Reference(s):
+  - ACPI 6.2 Specification - Errata A, September 2017
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** ARM standard MADT Generator
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjGicCInfo
+  - EArmObjGicDInfo
+  - EArmObjGicMsiFrameInfo (OPTIONAL)
+  - EArmObjGicRedistributorInfo (OPTIONAL)
+  - EArmObjGicItsInfo (OPTIONAL)
+*/
+
+/** This macro expands to a function that retrieves the GIC
+CPU interface Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjGicCInfo,
+  CM_ARM_GICC_INFO
+  );
+
+/** This macro expands to a function that retrieves the GIC
+Distributor Information from the Configuration Manager.
+*/
+
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjGicDInfo,
+  CM_ARM_GICD_INFO
+  );
+
+/** This macro expands to a function that retrieves the GIC
+MSI Frame Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjGicMsiFrameInfo,
+  CM_ARM_GIC_MSI_FRAME_INFO
+  );
+
+/** This macro expands to a function th

[edk2] [PATCH v2 16/22] DynamicTablesPkg: Arm ACPI FADT Generator

2019-01-24 Thread Sami Mujawar
The FADT generator collates the relevant information required
for generating a FADT table from configuration manager using
the configuration manager protocol. It then updates a template
FADT table structure. This table data is used by the Table
Manager to install the FADT table.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc  |   1 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf |  42 ++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c| 689 

 3 files changed, 732 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 
1dde21f393e9717c1d5adfbebe8dd8840da418c3..ffdf4f13bbc88c7d4ef97d15583c951a4c9ff599
 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -27,6 +27,7 @@ [Components.common]
   #
   DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {
 
+  NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
   }
 
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
new file mode 100644
index 
..e772409069caad8563e37be43ec2841f9d22e62d
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
@@ -0,0 +1,42 @@
+## @file
+#  FADT Table Generator
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = AcpiFadtLibArm
+  FILE_GUID  = 686FE5FE-B944-485F-8B1C-7D60E0056487
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiFadtLibConstructor
+  DESTRUCTOR = AcpiFadtLibDestructor
+
+[Sources]
+  FadtGenerator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+
+[Pcd]
+
+[Protocols]
+
+[Guids]
+
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c
new file mode 100644
index 
..62927b51d6d7c1585da1cb0d59785e2382639002
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c
@@ -0,0 +1,689 @@
+/** @file
+  FADT Table Generator
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+  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.
+
+  @par Reference(s):
+  - ACPI 6.2 Specification - Errata A, September 2017
+
+**/
+
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** ARM standard FADT Generator
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjPowerManagementProfileInfo
+  - EArmObjBootArchInfo
+  - EArmObjHypervisorVendorIdentity (OPTIONAL)
+*/
+
+/** This macro defines the FADT flag options for ARM Platforms.
+*/
+#define FADT_FLAGS  (EFI_ACPI_6_2_HW_REDUCED_ACPI |  \
+ EFI_ACPI_6_2_LOW_POWER_S0_IDLE_CAPABLE)
+
+/** This macro defines the valid mask for the FADT flag option
+if HW_REDUCED_ACPI flag in the table is set.
+
+  Invalid bits are: 1, 2, 3,7, 8, 13, 14,16, 17 and
+22-31 (reserved).
+
+  Valid bits are:
+EFI_ACPI_6_2_WBINVD   BIT0
+EFI_ACPI_6_2_PWR_BUTTON   BIT4
+EFI_ACPI_6_2_SLP_BUTTON   BIT5
+EFI_ACPI_6_2_FIX_RTC  BIT6
+EFI_ACPI_6_2_DCK_CAP  BIT9
+EFI_ACPI_6_2_RESET_REG_SUPBIT10
+EFI_ACPI_6_2_SEALED_CASE  BIT11
+EFI_ACPI_6_2_HEADLESS BIT12
+EFI_ACPI_6_

[edk2] [PATCH v2 03/22] DynamicTablesPkg: Acpi Table Generator

2019-01-24 Thread Sami Mujawar
This patch introduces the required interfaces and definitions
for implementing an ACPI table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/AcpiTableGenerator.h | 360 
 1 file changed, 360 insertions(+)

diff --git a/DynamicTablesPkg/Include/AcpiTableGenerator.h 
b/DynamicTablesPkg/Include/AcpiTableGenerator.h
new file mode 100644
index 
..639d243eb5a61b7e3dbadb1f281bb76f5239d911
--- /dev/null
+++ b/DynamicTablesPkg/Include/AcpiTableGenerator.h
@@ -0,0 +1,360 @@
+/** @file
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+- Std or STD - Standard
+**/
+
+#ifndef ACPI_TABLE_GENERATOR_H_
+#define ACPI_TABLE_GENERATOR_H_
+
+#include 
+
+// Module specific include files.
+#include 
+
+#pragma pack(1)
+
+/**
+The Dynamic Tables Framework provisions two classes of ACPI table
+generators.
+ - Standard generators: The ACPI table generators implemented by the
+Dynamic Tables Framework.
+ - OEM generators:  The ACPI table generators customized by the OEM.
+
+The Dynamic Tables Framework implements the following ACPI table generators:
+  - RAW   : This is the simplest ACPI table generator. It simply installs
+the ACPI table provided in the AcpiTableData member of the
+CM_STD_OBJ_ACPI_TABLE_INFO. The ACPI table data is provided by
+the Configuration Manager and is generated using an implementation
+defined mechanism.
+  - DSDT  : The DSDT generator is a clone of the RAW generator. The difference
+is in the way the ACPI Table Data is generated from an AML file.
+  - SSDT  : The SSDT generator is a clone of the RAW generator. The difference
+is in the way the ACPI Table Data is generated from an AML file.
+  - FADT  : The FADT generator collates the required platform information from
+the Configuration Manager and builds the FADT table.
+  - MADT  : The MADT generator collates the GIC information  from the
+Configuration Manager and builds the MADT table.
+  - GTDT  : The GTDT generator collates the Timer information from the
+Configuration Manager and builds the GTDT table.
+  - DBG2  : The DBG2 generator collates the debug serial port information from
+the Configuration Manager and builds the DBG2 table.
+  - SPCR  : The SPCR generator collates the serial port information from the
+Configuration Manager and builds the SPCR table.
+  - MCFG  : The MCFG generator collates the PCI configuration space information
+from the Configuration Manager and builds the MCFG table.
+  - IORT  : The IORT generator collates the IO Topology information from the
+Configuration Manager and builds the IORT table.
+*/
+
+/** The ACPI_TABLE_GENERATOR_ID type describes ACPI table generator ID.
+*/
+typedef TABLE_GENERATOR_ID ACPI_TABLE_GENERATOR_ID;
+
+/** The ESTD_ACPI_TABLE_ID enum describes the ACPI table IDs reserved for
+  the standard generators.
+*/
+typedef enum StdAcpiTableId {
+  EStdAcpiTableIdReserved = 0x, ///< Reserved
+  EStdAcpiTableIdRaw,   ///< RAW Generator
+  EStdAcpiTableIdDsdt = EStdAcpiTableIdRaw, ///< DSDT Generator
+  EStdAcpiTableIdSsdt = EStdAcpiTableIdRaw, ///< SSDT Generator
+  EStdAcpiTableIdFadt,  ///< FADT Generator
+  EStdAcpiTableIdMadt,  ///< MADT Generator
+  EStdAcpiTableIdGtdt,  ///< GTDT Generator
+  EStdAcpiTableIdDbg2,  ///< DBG2 Generator
+  EStdAcpiTableIdSpcr,  ///< SPCR Generator
+  EStdAcpiTableIdMcfg,  ///< MCFG Generator
+  EStdAcpiTableIdIort,  ///< IORT Generator
+  EStdAcpiTableIdMax
+} ESTD_ACPI_TABLE_ID;
+
+/** This macro checks if the Table Generator ID is for an ACPI Table Generator.
+
+  @param [in] TableGeneratorId  The table generator ID.
+
+  @return TRUE if the table generator ID is for an ACPI Table
+Generator.
+**/
+#define IS_GENERATOR_TYPE_ACPI(TableGeneratorId) \
+  (GET_TABLE_TYPE (TableGeneratorId) == ETableGeneratorTypeAcpi)
+
+/** This macro checks if the Table Generator ID is for a standard ACPI
+Table Generator.
+
+  @param [in] TableGeneratorId

[edk2] [PATCH v2 11/22] DynamicTablesPkg: Table Helper Library

2019-01-24 Thread Sami Mujawar
A helper library that implements common functionality
for use by table generators.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc|  20 +++
 DynamicTablesPkg/Include/Library/TableHelperLib.h |  68 

 DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c  | 176 

 DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf |  36 
 4 files changed, 300 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
new file mode 100644
index 
..1cac3e649afebb06190fb5bf6387857437706404
--- /dev/null
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -0,0 +1,20 @@
+## @file
+#  Dsc include file for Dynamic Tables Framework.
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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]
+
+[LibraryClasses.common]
+  
TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
+
diff --git a/DynamicTablesPkg/Include/Library/TableHelperLib.h 
b/DynamicTablesPkg/Include/Library/TableHelperLib.h
new file mode 100644
index 
..3c4e1d23d2e6955388ab0b51fb57779f2225beb2
--- /dev/null
+++ b/DynamicTablesPkg/Include/Library/TableHelperLib.h
@@ -0,0 +1,68 @@
+/** @file
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+
+  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.
+
+**/
+
+#ifndef TABLE_HELPER_LIB_H_
+#define TABLE_HELPER_LIB_H_
+
+/** The GetCgfMgrInfo function gets the CM_STD_OBJ_CONFIGURATION_MANAGER_INFO
+object from the Configuration Manager.
+
+  @param [in]  CfgMgrProtocol Pointer to the Configuration Manager protocol
+  interface.
+  @param [out] CfgMfrInfo Pointer to the Configuration Manager Info
+  object structure.
+
+  @retval EFI_SUCCESS   The object is returned.
+  @retval EFI_INVALID_PARAMETER The Object ID is invalid.
+  @retval EFI_NOT_FOUND The requested Object is not found.
+  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
+Manager is less than the Object size.
+**/
+EFI_STATUS
+EFIAPI
+GetCgfMgrInfo (
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST  CfgMgrProtocol,
+  OUT   CM_STD_OBJ_CONFIGURATION_MANAGER_INFO**CfgMfrInfo
+  );
+
+/** The AddAcpiHeader function updates the ACPI header structure. It uses the
+ACPI table Generator and the Configuration Manager protocol to obtain the
+information required for constructing the header.
+
+  @param [in] CfgMgrProtocol Pointer to the Configuration Manager
+ protocol interface.
+  @param [in] Generator  Pointer to the ACPI table Generator.
+  @param [in,out] AcpiHeader Pointer to the ACPI table header to be
+ updated.
+  @param [in] Revision   Revision of the ACPI table.
+  @param [in] Length Length of the ACPI table.
+
+  @retval EFI_SUCCESS   The ACPI table is updated successfully.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND The required object information is not found.
+  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
+Manager is less than the Object size for the
+requested object.
+**/
+EFI_STATUS
+EFIAPI
+AddAcpiHeader (
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST CfgMgrProtocol,
+  IN  CONST ACPI_TABLE_GENERATOR  * CONST Generator,
+  IN OUT  EFI_ACPI_DESCRIPTION_HEADER * CONST AcpiHeader,
+  IN  CONST UINT32Revision,
+  IN  CONST UINT32Length
+  );
+
+#endif // TABLE_HELPER_LIB_H_
diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c 
b/DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c
new fi

[edk2] [PATCH v2 12/22] DynamicTablesPkg: Dynamic Table Factory Protocol

2019-01-24 Thread Sami Mujawar
This patch introduces the dynamic table factory protocol
that provides an interface to register and retrieve
registered generators.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTablesPkg.dec   |   3 +
 DynamicTablesPkg/Include/Protocol/DynamicTableFactoryProtocol.h | 269 

 2 files changed, 272 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTablesPkg.dec 
b/DynamicTablesPkg/DynamicTablesPkg.dec
index 
e5e731085a721f5f2a0129b4678dedbb0c7b985a..3137c14247920974082bd74173cab4e7ac02b3f7
 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dec
+++ b/DynamicTablesPkg/DynamicTablesPkg.dec
@@ -27,3 +27,6 @@ [Protocols]
   # Configuration Manager Protocol GUID
   gEdkiiConfigurationManagerProtocolGuid = { 0xd85a4835, 0x5a82, 0x4894, { 
0xac, 0x2, 0x70, 0x6f, 0x43, 0xd5, 0x97, 0x8e } }
 
+  # Dynamic Table Factory Protocol GUID
+  gEdkiiDynamicTableFactoryProtocolGuid = { 0x91d1e327, 0xfe5a, 0x49b8, { 
0xab, 0x65, 0xe, 0xce, 0x2d, 0xdb, 0x45, 0xec } }
+
diff --git a/DynamicTablesPkg/Include/Protocol/DynamicTableFactoryProtocol.h 
b/DynamicTablesPkg/Include/Protocol/DynamicTableFactoryProtocol.h
new file mode 100644
index 
..55d62c9e7244c1cca35aaa6c7e3b1dbf9125c3b5
--- /dev/null
+++ b/DynamicTablesPkg/Include/Protocol/DynamicTableFactoryProtocol.h
@@ -0,0 +1,269 @@
+/** @file
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- ACPI   - Advanced Configuration and Power Interface
+- SMBIOS - System Management BIOS
+- DT - Device Tree
+**/
+
+#ifndef DYNAMIC_TABLE_FACTORY_PROTOCOL_H_
+#define DYNAMIC_TABLE_FACTORY_PROTOCOL_H_
+
+#include 
+#include 
+#include 
+
+/** This macro defines the Dynamic Table Factory Protocol GUID.
+
+  GUID: {91D1E327-FE5A-49B8-AB65-0ECE2DDB45EC}
+*/
+#define EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL_GUID   \
+  { 0x91d1e327, 0xfe5a, 0x49b8, \
+{ 0xab, 0x65, 0xe, 0xce, 0x2d, 0xdb, 0x45, 0xec }   \
+  };
+
+/** This macro defines the Configuration Manager Protocol Revision.
+*/
+#define EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL_REVISION  CREATE_REVISION (1, 0)
+
+#pragma pack(1)
+
+/**
+  Forward declarations:
+*/
+typedef struct DynamicTableFactoryProtocol 
EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL;
+typedef struct DynamicTableFactoryInfo EDKII_DYNAMIC_TABLE_FACTORY_INFO;
+
+/** Return a pointer to the ACPI table generator.
+
+  @param [in]  This   Pointer to the Dynamic Table Factory Protocol.
+  @param [in]  TableIdThe ACPI table generator ID for the
+  requested generator.
+  @param [out] Generator  Pointer to the requested ACPI table
+  generator.
+
+  @retval EFI_SUCCESS   Success.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND The requested generator is not found
+in the list of registered generators.
+**/
+typedef
+EFI_STATUS
+EFIAPI
+(EFIAPI * EDKII_DYNAMIC_TABLE_FACTORY_GET_ACPI_TABLE_GENERATOR) (
+  IN  CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL  * CONST This,
+  IN  CONST ACPI_TABLE_GENERATOR_ID   GeneratorId,
+  OUT CONST ACPI_TABLE_GENERATOR ** CONST Generator
+  );
+
+/** Registers an ACPI table generator.
+
+  @param [in]  GeneratorPointer to the ACPI table generator.
+
+  @retval EFI_SUCCESS   The Generator was registered
+successfully.
+  @retval EFI_INVALID_PARAMETER The Generator ID is invalid or
+the Generator pointer is NULL.
+  @retval EFI_ALREADY_STARTED   The Generator for the Table ID is
+already registered.
+**/
+typedef
+EFI_STATUS
+EFIAPI
+(EFIAPI * EDKII_DYNAMIC_TABLE_FACTORY_REGISTER_ACPI_TABLE_GENERATOR) (
+  IN  CONST ACPI_TABLE_GENERATOR* CONST Generator
+  );
+
+/** Deregister an ACPI table generator.
+
+  @param [in]  Generator   Pointer to the ACPI table generator.
+
+  @retval EFI_SUCCESS   Success.
+  @retval EFI_INVALID_PARAMETER The generator is invalid.
+  @retval EFI_NOT_FOUND The requested generator is not found
+in the list of registered generators.
+**/
+typedef
+EFI_STATUS
+EFIAPI
+(EFIAPI * EDKII_DYNAMIC_TABLE_FACTORY_DEREGISTER_ACPI_TABLE_GENERATOR) (
+  IN  CONST ACPI_TABLE_GENERATOR* CONST Generator
+  );
+
+/** Return

[edk2] [PATCH v2 10/22] DynamicTablesPkg: Configuration Manager Helper

2019-01-24 Thread Sami Mujawar
This patch defines a helper macro 'GET_OBJECT_LIST()' that
expands to a function that uses the configuration manager
protocol to retrieve configuration manager object(s).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/ConfigurationManagerHelper.h | 132 

 1 file changed, 132 insertions(+)

diff --git a/DynamicTablesPkg/Include/ConfigurationManagerHelper.h 
b/DynamicTablesPkg/Include/ConfigurationManagerHelper.h
new file mode 100644
index 
..cf9960040908d4aeb540714c1a4cf3d720c27029
--- /dev/null
+++ b/DynamicTablesPkg/Include/ConfigurationManagerHelper.h
@@ -0,0 +1,132 @@
+/** @file
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+**/
+
+#ifndef CONFIGURATION_MANAGER_HELPER_H_
+#define CONFIGURATION_MANAGER_HELPER_H_
+
+/** The GET_OBJECT_LIST macro expands to a function that is used to retrieve
+an object or an object list from the Configuration Manager using the
+Configuration Manager Protocol interface.
+
+  The macro expands to a function which has the following prototype:
+
+  STATIC
+  EFI_STATUS
+  EFIAPI
+  Get (
+IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
+IN  CONST CM_OBJECT_TOKEN  Token OPTIONAL,
+OUT   Type**   List,
+OUT   UINT32   *   Count OPTIONAL
+);
+
+  Generated function parameters:
+  @param [in]  CfgMgrProtocol Pointer to the Configuration Manager protocol
+  interface.
+  @param [in]  Token  Reference token for the Object.
+  @param [out] List   Pointer to the Object list.
+  @param [out] Count  Count of the objects returned in the list.
+
+  Macro Parameters:
+  @param [in] CmObjectNameSpace The Object Namespace
+  @param [in] CmObjectIdObject Id.
+  @param [in] Type  Structure used to describe the Object.
+
+  @retval EFI_SUCCESS   Success.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND The required object information is not found.
+  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
+Manager is less than the Object size for the
+requested object.
+**/
+#define GET_OBJECT_LIST(CmObjectNameSpace, CmObjectId, Type)  \
+STATIC\
+EFI_STATUS\
+EFIAPI\
+Get##CmObjectId ( \
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST CfgMgrProtocol, \
+  IN  CONST CM_OBJECT_TOKEN   Token OPTIONAL, \
+  OUT   Type **   List,   \
+  OUT   UINT32* CONST Count OPTIONAL  \
+  )   \
+{ \
+  EFI_STATUS Status;  \
+  CM_OBJ_DESCRIPTOR  CmObjectDesc;\
+  UINT32 ObjCount = 0;\
+  if (List == NULL) { \
+Status = EFI_INVALID_PARAMETER;   \
+DEBUG ((  \
+  DEBUG_ERROR,\
+  "ERROR: Get" #CmObjectId ": Invalid out parameter for"  \
+  " object list. Status = %r\n",  \
+  Status  \
+  )); \
+goto error_handler;   \
+  }  

[edk2] [PATCH v2 15/22] DynamicTablesPkg: Arm Raw/DSDT/SSDT Generator

2019-01-24 Thread Sami Mujawar
A Raw generator is a simple generator. This generator provides
the ability to install a binary blob (that contains ACPI table
data) as an ACPI table. The binary blob could be pre-generated
ACPI table data or it may be the pre-compiled output from an
iAsl compiler for a DSDT or SSDT table.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc|   8 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf |  42 ++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c| 150 

 3 files changed, 199 insertions(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 
0c47e85b88d737a914514be123e23370ee69e311..1dde21f393e9717c1d5adfbebe8dd8840da418c3
 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -15,6 +15,9 @@
 
 [Defines]
 
+[BuildOptions]
+  *_*_*_ASL_FLAGS  = -tc -li -so
+
 [LibraryClasses.common]
   
TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
 
@@ -22,7 +25,10 @@ [Components.common]
   #
   # Dynamic Table Factory Dxe
   #
-  DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf
+  DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {
+
+  NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
+  }
 
   #
   # Dynamic Tables Manager Dxe
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
new file mode 100644
index 
..213dbd1cd7b69b3088afb09bdaaf1355c81d8f35
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
@@ -0,0 +1,42 @@
+## @file
+#  Raw Table Generator
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = AcpiRawLibArm
+  FILE_GUID  = 20F31568-D687-49BA-B326-CCD9D38EDE16
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiRawLibConstructor
+  DESTRUCTOR = AcpiRawLibDestructor
+
+[Sources]
+  RawGenerator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+
+[Pcd]
+
+[Protocols]
+
+[Guids]
+
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c
new file mode 100644
index 
..ae3d3eca1d2f64cfc101fdd0b18da5019bdfe32e
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c
@@ -0,0 +1,150 @@
+/** @file
+  MCFG Table Generator
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+  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 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** Construct the ACPI table using the ACPI table data provided.
+
+  This function invokes the Configuration Manager protocol interface
+  to get the required hardware information for generating the ACPI
+  table.
+
+  If this function allocates any resources then they must be freed
+  in the FreeTableResources function.
+
+  @param [in]  This   Pointer to the table generator.
+  @param [in]  AcpiTableInfo  Pointer to the ACPI Table Info.
+  @param [in]  CfgMgrProtocol Pointer to the Configuration Manager
+  Protocol Interface.
+  @param [out] Table  Pointer to the constructed ACPI Table.
+
+  @retval EFI_SUCCESS   Table generated successfully.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+BuildRawTable (
+  IN  CONST ACPI_TABLE_GENERATOR  * CONST This,
+  IN  CONST CM_STD_OBJ_ACPI_TABLE_INFO* CONST AcpiTab

[edk2] [PATCH v2 05/22] DynamicTablesPkg: DT Table Generator

2019-01-24 Thread Sami Mujawar
This patch introduces the interfaces and definitions for
implementing a Device Tree table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/DeviceTreeTableGenerator.h | 182 
 1 file changed, 182 insertions(+)

diff --git a/DynamicTablesPkg/Include/DeviceTreeTableGenerator.h 
b/DynamicTablesPkg/Include/DeviceTreeTableGenerator.h
new file mode 100644
index 
..c2066c9f46d12442dd7e8c0ad63bd44d31705dbc
--- /dev/null
+++ b/DynamicTablesPkg/Include/DeviceTreeTableGenerator.h
@@ -0,0 +1,182 @@
+/** @file
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+- Std or STD - Standard
+**/
+
+#ifndef DEVICETREE_TABLE_GENERATOR_H_
+#define DEVICETREE_TABLE_GENERATOR_H_
+
+#include 
+
+#pragma pack(1)
+
+/** The DT_TABLE_GENERATOR_ID type describes Device Tree table generator ID.
+*/
+typedef TABLE_GENERATOR_ID DT_TABLE_GENERATOR_ID;
+
+/** The ESTD_DT_TABLE_ID enum describes the DT table IDs reserved for
+  the standard generators.
+*/
+typedef enum StdDtTableId {
+  EStdDtTableIdReserved = 0x, ///< Reserved.
+  EStdDtTableIdRaw,   ///< RAW Generator.
+  EStdDtTableIdMax
+} ESTD_DT_TABLE_ID;
+
+/** This macro checks if the Table Generator ID is for an DT Table Generator.
+
+  @param [in] TableGeneratorId  The table generator ID.
+
+  @return TRUE if the table generator ID is for an DT Table
+Generator.
+**/
+#define IS_GENERATOR_TYPE_DT(TableGeneratorId) \
+  (GET_TABLE_TYPE(TableGeneratorId) == ETableGeneratorTypeDt)
+
+/** This macro checks if the Table Generator ID is for a standard DT
+Table Generator.
+
+  @param [in] TableGeneratorId  The table generator ID.
+
+  @return TRUE if the table generator ID is for a standard DT
+Table Generator.
+**/
+#define IS_VALID_STD_DT_GENERATOR_ID(TableGeneratorId)   \
+  (  \
+  IS_GENERATOR_NAMESPACE_STD(TableGeneratorId) &&\
+  IS_GENERATOR_TYPE_DT(TableGeneratorId)   &&\
+  ((GET_TABLE_ID(GeneratorId) >= EStdDtTableIdRaw) &&\
+   (GET_TABLE_ID(GeneratorId) < EStdDtTableIdMax))   \
+  )
+
+/** This macro creates a standard DT Table Generator ID.
+
+  @param [in] TableId  The table generator ID.
+
+  @return a standard DT table generator ID.
+**/
+#define CREATE_STD_DT_TABLE_GEN_ID(TableId) \
+  CREATE_TABLE_GEN_ID ( \
+ETableGeneratorTypeDt,  \
+ETableGeneratorNameSpaceStd,\
+TableId \
+)
+
+/** Forward declarations.
+*/
+typedef struct ConfigurationManagerProtocol 
EDKII_CONFIGURATION_MANAGER_PROTOCOL;
+typedef struct CmAStdObjDtTableInfo CM_STD_OBJ_DT_TABLE_INFO;
+typedef struct DtTableGenerator DT_TABLE_GENERATOR;
+
+/** This function pointer describes the interface to DT table build
+functions provided by the DT table generator and called by the
+Table Manager to build an DT table.
+
+  @param [in]  Generator   Pointer to the DT table generator.
+  @param [in]  DtTableInfo Pointer to the DT table information.
+  @param [in]  CfgMgrProtocol  Pointer to the Configuration Manager
+   Protocol interface.
+  @param [out] Table   Pointer to the generated DT table.
+
+  @return EFI_SUCCESS  If the table is generated successfully or other
+failure codes as returned by the generator.
+**/
+typedef EFI_STATUS (*DT_TABLE_GENERATOR_BUILD_TABLE) (
+  IN  CONST DT_TABLE_GENERATOR*   Generator,
+  IN  CONST CM_STD_OBJ_DT_TABLE_INFO  * CONST DtTableInfo,
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST CfgMgrProtocol,
+  OUT   VOID **   Table
+  );
+
+/** This function pointer describes the interface to used by the
+Table Manager to give the generator an opportunity to free
+any resources allocated for building the DT table.
+
+  @param [in]  Generator   Pointer to the DT table generator.
+  @param [in]  DtTableInfo Pointer to the DT table information.
+  @param [in]  CfgMgrProtocol  Pointer to the Configuration Manager
+   Protocol inte

Re: [edk2] [PATCH v1 1/1] ShellPkg/UefiShellAcpiViewCommandLib: Add support for PPTT

2019-01-24 Thread Sami Mujawar
Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar

-Original Message-
From: Carsey, Jaben  
Sent: 22 January 2019 05:47 PM
To: Krzysztof Koch ; edk2-devel@lists.01.org
Cc: leif.lindh...@linaro.org; Matteo Carlini ; 
Stephanie Hughes-Fitt ; Ni, Ray 
; Sami Mujawar ; nd 
Subject: RE: [PATCH v1 1/1] ShellPkg/UefiShellAcpiViewCommandLib: Add support 
for PPTT

Reviewed-by: Jaben Carsey 

Note: I am not pushing this to allow proper time for other to review/comment. 
The code looks good to me.

Jaben

> -Original Message-
> From: Krzysztof Koch [mailto:krzysztof.k...@arm.com]
> Sent: Tuesday, January 22, 2019 9:06 AM
> To: edk2-devel@lists.01.org
> Cc: leif.lindh...@linaro.org; matteo.carl...@arm.com; 
> Stephanie.Hughes- f...@arm.com; Carsey, Jaben 
> ; Ni, Ray ; 
> sami.muja...@arm.com; n...@arm.com
> Subject: [PATCH v1 1/1] ShellPkg/UefiShellAcpiViewCommandLib: Add 
> support for PPTT
> Importance: High
> 
> Added the acpiview parser for the PPTT table.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Krzysztof Koch 
> ---
> The changes can be seen at:
> https://github.com/KrzysztofKoch1/edk2/tree/woa_390_pptt_acpiview_v1
> 
> Notes:
> v1:
> - add PPTT parser to acpiview   [Krzysztof]
> 
>  ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> |  23
> +-
>  
> ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.c
> | 362 
> 
> ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComman
> dLib.c   |   4 +-
> 
> ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComman
> dLib.inf |   3 +-
> 
> ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComman
> dLib.uni |   3 +-
>  5 files changed, 391 insertions(+), 4 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> index
> ecf7dae9038a4ebcb3e3764964f0c16ca3ef51f6..a42450c1431be343870dabb4e
> 03f64ed1cf78afc 100644
> --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
> @@ -1,7 +1,7 @@
>  /** @file
>Header file for ACPI parser
> 
> -  Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
> +  Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.
>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 @@ -655,6 +655,27 @@ ParseAcpiMcfg (
>IN UINT8   AcpiTableRevision
>);
> 
> +/**
> +  This function parses the ACPI PPTT table.
> +  When trace is enabled this function parses the PPTT table and
> +  traces the ACPI table fields.
> +
> +  This function also performs validation of the ACPI table fields.
> +
> +  @param [in] Trace  If TRUE, trace the ACPI fields.
> +  @param [in] PtrPointer to the start of the buffer.
> +  @param [in] AcpiTableLengthLength of the ACPI table.
> +  @param [in] AcpiTableRevision  Revision of the ACPI table.
> +**/
> +VOID
> +EFIAPI
> +ParseAcpiPptt (
> +  IN BOOLEAN Trace,
> +  IN UINT8*  Ptr,
> +  IN UINT32  AcpiTableLength,
> +  IN UINT8   AcpiTableRevision
> +  );
> +
>  /**
>This function parses the ACPI RSDP table.
> 
> diff --git
> a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> c
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> c
> new file mode 100644
> index
> ..d97ddf8e925d30917f888bf33
> e2c1346cd330663
> --- /dev/null
> +++
> b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Pptt/PpttParser.
> c
> @@ -0,0 +1,362 @@
> +/** @file
> +  PPTT table parser
> +
> +  Copyright (c) 2019, ARM Limited. All rights reserved.
> +  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.
> +
> +  @par Reference(s):
> +- ACPI 6.2 Specification - Errata A, September 2017 **/
> +
> +#include 
> +#include 
> +#include "AcpiParser.h"
> +
> +// Local variables
> +STATIC CONST UINT8*  Proc

[edk2] [PATCH edk2-platforms v3 3/4] Platform/ARM: Configuration Manager for FVP

2019-01-24 Thread Sami Mujawar
The dynamic tables framework utilizes the configuration manager
protocol to get the platform specific information required for
building the firmware tables.

The configuration manager is a platform specific component that
collates the platform hardware information and builds an abstract
platform configuration repository. The configuration manager also
implements the configuration manager protocol which returns the
hardware information requested by the table generators.

This patch implements the configuration manager support for the
FVP platform.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
   |  31 +
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 684 
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
  | 181 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 |  79 +++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h
  |  99 +++
 Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
   |  73 +++
 
Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
   |  35 +
 7 files changed, 1182 insertions(+)

diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc
new file mode 100644
index 
..788b145b273fd49da7fb5d238491aef956977e61
--- /dev/null
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc
@@ -0,0 +1,31 @@
+## @file
+#  dsc include file for Configuration Manager
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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]
+
+[BuildOptions]
+# Required for pre-processing ASL files that include ArmPlatform.h
+  *_*_*_ASLPP_FLAGS= $(PLATFORM_FLAGS)
+
+[LibraryClasses.common]
+
+[Components.common]
+  # Configuration Manager
+  
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 {
+
+# Platform ASL Tables
+
PlatformAslTablesLib|Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
+  
+   *_*_*_PLATFORM_FLAGS = 
-I$(BIN_DIR)/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib/OUTPUT
+  }
diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
new file mode 100644
index 
..66ee79341dfeceff1dc70c32b308056d87b99540
--- /dev/null
+++ 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -0,0 +1,684 @@
+/** @file
+  Configuration Manager Dxe
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "ConfigurationManager.h"
+#include "Platform.h"
+
+// AML Code Include files generated by iASL Compiler
+#include 
+
+/** The platform configuration repository information.
+*/
+STATIC
+EDKII_PLATFORM_REPOSITORY_INFO VExpressPlatRepositoryInfo = {
+  /// Configuration Manager information
+  { CONFIGURATION_MANAGER_REVISION, CFG_MGR_OEM_ID },
+
+  // ACPI Table List
+  {
+// FADT Table
+{
+  EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
+  EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_REVISION,
+  CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdFadt),
+  NULL
+},
+// GTDT Table
+{
+  EFI_ACPI_6_2_G

[edk2] [PATCH edk2-platforms v3 1/4] Platform/ARM: Configuration Manager for Juno

2019-01-24 Thread Sami Mujawar
The dynamic tables framework utilizes the configuration manager
protocol to get the platform specific information required for
building the firmware tables.

The configuration manager is a platform specific component that
collates the platform hardware information and builds an abstract
platform configuration repository. The configuration manager also
implements the configuration manager protocol which returns the
hardware information requested by the table generators.

This patch implements the configuration manager support for the
Juno platform.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
   |  29 +
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 752 
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
  | 179 +
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 |  86 +++
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h   
   |  99 +++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
   | 276 +++
 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
   |  45 ++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtJunoUsb.asl 
   | 123 
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtPci.asl 
   | 201 ++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtUart.asl
   |  48 ++
 10 files changed, 1838 insertions(+)

diff --git 
a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
new file mode 100644
index 
..a5fe869483f4a005942006c8ba43d3a5aabad5bb
--- /dev/null
+++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
@@ -0,0 +1,29 @@
+## @file
+#  dsc include file for Configuration Manager
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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]
+
+[BuildOptions]
+
+[LibraryClasses.common]
+
+[Components.common]
+  # Configuration Manager
+  
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 {
+
+# Platform ASL Tables
+
PlatformAslTablesLib|Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
+  
+   *_*_*_PLATFORM_FLAGS = 
-I$(BIN_DIR)/Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib/OUTPUT
+  }
diff --git 
a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
new file mode 100644
index 
..55f0984ee6741f5434dd1ec673281c78e2a576f2
--- /dev/null
+++ 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -0,0 +1,752 @@
+/** @file
+  Configuration Manager Dxe
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "ConfigurationManager.h"
+#include "Platform.h"
+
+// AML Code Include files generated by iASL Compiler
+#include 
+#include 
+#include 
+#include 
+
+/** The platform configuration repository information.
+*/
+STATIC
+EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformRepositoryInfo = {
+  /// Configuration Manager information
+  { CONFIGURATION_MANAGER_REVISION, CFG_MGR_OEM_ID },
+
+  // ACPI Table List
+  {
+// FADT Table
+{
+  EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
+  EFI_ACPI_6

[edk2] [PATCH edk2-platforms v3 4/4] Platform/ARM: Dynamic Tables support for FVP

2019-01-24 Thread Sami Mujawar
The dynamic tables framework uses the platform hardware
information described by the configuration manager to
generate ACPI tables. This support is configurable and
can be enabled using the DYNAMIC_TABLES_FRAMEWORK build
option.

When DYNAMIC_TABLES_FRAMEWORK is defined, ACPI tables are
generated and installed by the dynamic table framework.
Therefore, installation of ACPI tables from the Firmware
Volume (FV) is disabled by this option.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 15 +++
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf | 16 ++--
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc 
b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
index 
0941edeaf53c236cd69fbb54e47df9bd407a56d8..1cf2ebb58f99899864e3bc90b7a22a75ea9fc29b
 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
@@ -38,6 +38,10 @@ [Defines]
   DT_SUPPORT = FALSE
 
 !include Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+!ifdef DYNAMIC_TABLES_FRAMEWORK
+  !include DynamicTablesPkg/DynamicTables.dsc.inc
+  !include 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc
+!endif
 
 [LibraryClasses.common]
   ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
@@ -128,6 +132,15 @@ [PcdsFixedAtBuild.common]
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x1c0a
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultReceiveFifoDepth|0
+  gArmPlatformTokenSpaceGuid.PL011UartInterrupt|0x25
+
+  ## PL011 Serial Debug UART (DBG2)
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase|0x1c0b
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgUartBaudRate|115200
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgUartClkInHz|2400
+
+  # SBSA Generic Watchdog
+  gArmTokenSpaceGuid.PcdGenericWatchdogEl2IntrNum|59
 
   ## PL031 RealTimeClock
   gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x1C17
@@ -257,8 +270,10 @@ [Components.common]
 !endif
   }
 
+!ifndef DYNAMIC_TABLES_FRAMEWORK
   MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
   Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf
+!endif
 
   ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf 
b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf
index 
c3e573e1bb4fcf7889fefec4d6c919b118b76653..fc998ec746913a98ac6f62c1109b809bb530fb16
 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2011 - 2015, ARM Limited. All rights reserved.
+#  Copyright (c) 2011 - 2018, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -97,9 +97,19 @@ [FV.FvMain]
 
   # ACPI Support
   #
-  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
   INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
+!ifndef DYNAMIC_TABLES_FRAMEWORK
+  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
   INF RuleOverride=ACPITABLE Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf
+!else
+  # Configuration Manager
+  INF 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+
+  #
+  # Dynamic Table fdf
+  #
+  !include DynamicTablesPkg/DynamicTables.fdf.inc
+!endif
 
   #
   # Multiple Console IO support
@@ -319,8 +329,10 @@ [Rule.Common.UEFI_APPLICATION.BINARY]
 VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
   }
 
+!ifndef DYNAMIC_TABLES_FRAMEWORK
 [Rule.Common.USER_DEFINED.ACPITABLE]
   FILE FREEFORM = $(NAMED_GUID) {
 RAW ACPI   |.acpi
 RAW ASL|.aml
   }
+!endif
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms v3 2/4] Platform/ARM: Dynamic Tables support for Juno

2019-01-24 Thread Sami Mujawar
The dynamic tables framework uses the platform hardware
information described by the configuration manager to
generate ACPI tables. This support is configurable and
can be enabled using the DYNAMIC_TABLES_FRAMEWORK build
option.

When DYNAMIC_TABLES_FRAMEWORK is defined, ACPI tables are
generated and installed by the dynamic table framework.
Therefore, installation of ACPI tables from the Firmware
Volume (FV) is disabled by this option.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 Platform/ARM/JunoPkg/ArmJuno.dsc | 12 +++-
 Platform/ARM/JunoPkg/ArmJuno.fdf | 12 
 Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c |  9 +++--
 3 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index 
3edde5b65be47fe14988940ce2ef31a60f38dd31..a355c1e1d983339b3b461eddbf60e4a31888a361
 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -33,6 +33,11 @@ [Defines]
 # On RTSM, most peripherals are VExpress Motherboard peripherals
 !include Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
 
+!ifdef DYNAMIC_TABLES_FRAMEWORK
+!include DynamicTablesPkg/DynamicTables.dsc.inc
+!include Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
+!endif
+
 [LibraryClasses.common]
   ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
   ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
@@ -79,6 +84,10 @@ [LibraryClasses.common.UEFI_DRIVER, 
LibraryClasses.common.UEFI_APPLICATION, Libr
 [BuildOptions]
   GCC:*_*_ARM_PLATFORM_FLAGS = -march=armv8-a
 
+!ifdef DYNAMIC_TABLES_FRAMEWORK
+  *_*_*_PLATFORM_FLAGS = -DDYNAMIC_TABLES_FRAMEWORK
+!endif
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
@@ -266,8 +275,9 @@ [Components.common]
   # ACPI Support
   #
   MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
+!ifndef DYNAMIC_TABLES_FRAMEWORK
   Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
-
+!endif
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 
   ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
diff --git a/Platform/ARM/JunoPkg/ArmJuno.fdf b/Platform/ARM/JunoPkg/ArmJuno.fdf
index 
0a8b636d0ebd10a7bceb3cbe6ca1bed8688da1a6..b1295a579b094db1433898589a282702ec854bfb
 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.fdf
+++ b/Platform/ARM/JunoPkg/ArmJuno.fdf
@@ -114,7 +114,17 @@ [FV.FvMain]
   # ACPI Support
   #
   INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
+!ifndef DYNAMIC_TABLES_FRAMEWORK
   INF RuleOverride=ACPITABLE Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
+!else
+  # Configuration Manager
+  INF 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+
+  #
+  # Dynamic Table fdf
+  #
+  !include DynamicTablesPkg/DynamicTables.fdf.inc
+!endif
 
   INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 
@@ -378,8 +388,10 @@ [Rule.Common.UEFI_APPLICATION.BINARY]
 VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
   }
 
+!ifndef DYNAMIC_TABLES_FRAMEWORK
 [Rule.Common.USER_DEFINED.ACPITABLE]
   FILE FREEFORM = $(NAMED_GUID) {
 RAW ACPI   |.acpi
 RAW ASL|.aml
   }
+!endif
diff --git a/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c 
b/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
index 
18491c7378523f365644658c270de95e711c5ac1..0a42d21d4e9b60824f1d313a4d5ad9e4bc6db3aa
 100644
--- a/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
+++ b/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2013-2015, ARM Limited. All rights reserved.
+*  Copyright (c) 2013-2017, ARM Limited. All rights reserved.
 *
 *  This program and the accompanying materials
 *  are licensed and made available under the terms and conditions of the BSD 
License
@@ -33,9 +33,10 @@
 #include 
 #include 
 
-
+#ifndef DYNAMIC_TABLES_FRAMEWORK
 // This GUID must match the FILE_GUID in 
ArmPlatformPkg/ArmJunoPkg/AcpiTables/AcpiTables.inf
 STATIC CONST EFI_GUID mJunoAcpiTableFile = { 0xa1dd808e, 0x1e95, 0x4399, { 
0xab, 0xc0, 0x65, 0x3c, 0x82, 0xe8, 0x53, 0x0c } };
+#endif
 
 typedef struct {
   ACPI_HID_DEVICE_PATH  AcpiDevicePath;
@@ -487,11 +488,13 @@ ArmJunoEntryPoint (
 
   GetJunoRevision(JunoRevision);
 
+#ifndef DYNAMIC_TABLES_FRAMEWORK
   //
   // Try to install the ACPI Tables
   //
   Status = LocateAndInstallAcpiFromFv ();
   ASSERT_EFI_ERROR (Status);
+#endif
 
   //
   // Setup R1/R2 options if not already done.
@@ -516,6 +519,7 @@ ArmJunoEntryPoint (
 
 );
 
+#ifndef DYNAMIC_TABLES_FRAMEWORK
 // Declare the related ACPI Tables
 EfiCreateProtocolNotifyEvent (
 ,
@@ -524,6 +528,7 @@ ArmJunoEntryPoint (
 NULL,
 
 );
+#endif
   }
 
   //
-- 
'Gui

[edk2] [PATCH edk2-platforms v3 0/4] Platform/ARM: Platform support for Dynamic Tables Framework

2019-01-24 Thread Sami Mujawar
Dynamic Tables Framework aims to reduce the amount of effort
required for porting firmware to new platforms by simplifying
the generation of firmware tables based on hardware description
provided by a platform specific component.
 
The Dynamic Tables Framework core queries the platform specific
component to retrieve the required hardware information for
generating standardised firmware tables at run-time.
 
The platform specific component responsible for collating the
hardware information is called the Configuration Manager. 
 
This patch series introduce the Configuration Manager that
provides the hardware description to Dynamic Tables Framework.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 

The changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/365_dynamic_tables_framework_v3

This v3 patch series incorporates:
  * updates corresponding to the dynamic tables framework's change
to support the newer versions of specifications.
  * support for describing the platform GT Block timers on Juno.
  * minor code improvements.

The corresponding edk2 code changes can be seen at:
https://github.com/samimujawar/edk2/tree/365_dynamic_tables_framework_v2

Sami Mujawar (4):
  Platform/ARM: Configuration Manager for Juno
  Platform/ARM: Dynamic Tables support for Juno
  Platform/ARM: Configuration Manager for FVP
  Platform/ARM: Dynamic Tables support for FVP

 Platform/ARM/JunoPkg/ArmJuno.dsc   
   |  12 +-
 Platform/ARM/JunoPkg/ArmJuno.fdf   
   |  12 +
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
   |  29 +
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 752 
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
  | 179 +
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 |  86 +++
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h   
   |  99 +++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
   | 276 +++
 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
   |  45 ++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtJunoUsb.asl 
   | 123 
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtPci.asl 
   | 201 ++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtUart.asl
   |  48 ++
 Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c   
   |   9 +-
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc   
   |  15 +
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf   
   |  16 +-
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
   |  31 +
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 684 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
  | 181 +
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 |  79 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h
  |  99 +++
 Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
   |  73 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
   |  35 +
 22 files changed, 3079 insertions(+), 5 deletions(-)
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtJunoUsb.asl
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtPci.asl
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtUart.asl
 create mode 100644 
Platform

[edk2] [PATCH v2 22/22] DynamicTablesPkg: Arm IORT Table Generator

2019-01-24 Thread Sami Mujawar
The IORT generator uses the configuration manager protocol
to obtain information about the PCI Root Complex, SMMU,
GIC ITS, Performance Monitoring counters etc. and generates
the IORT table.

The mappings between the components are represented using
tokens. The generator invokes the configuration manager
protocol interfaces and requests for objects referenced by
tokens to establish the link.

This table data is then used by the Table Manager to install
the IORT table.

The Table Manager then invokes the generator interface to free
any resources allocated by the IORT table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc  |1 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/AcpiIortLibArm.inf |   42 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c| 2081 

 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.h|   50 +
 4 files changed, 2174 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 
e60529f75dbce3d2ff6b7c193f134eaf9ee45428..89bb3dddba7ab9666a8aee199b7a7bde23a14dbc
 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -30,6 +30,7 @@ [Components.common]
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
+  NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/AcpiIortLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/AcpiIortLibArm.inf 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/AcpiIortLibArm.inf
new file mode 100644
index 
..ce828eb09147d8cc149902c852cc8eaac9b12dc4
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/AcpiIortLibArm.inf
@@ -0,0 +1,42 @@
+## @file
+#  IORT Table Generator
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = AcpiIortLibArm
+  FILE_GUID  = 25682BA8-B41D-4403-B034-253769E0DAD5
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiIortLibConstructor
+  DESTRUCTOR = AcpiIortLibDestructor
+
+[Sources]
+  IortGenerator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+
+[Pcd]
+
+[Protocols]
+
+[Guids]
+
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
new file mode 100644
index 
..a3ee60664ecbeb1b12b01683f838e11804884daf
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
@@ -0,0 +1,2081 @@
+/** @file
+  IORT Table Generator
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+  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.
+
+  @par Reference(s):
+  - IO Remapping Table, Platform Design Document,
+Document number: ARM DEN 0049D, Issue D, March 2018
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "IortGenerator.h"
+
+/** ARM standard IORT Generator
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjItsGroup
+  - EArmObjNamedComponent
+  - EArmObjRootComplex
+  - EArmObjSmmuV1SmmuV2
+  - EArmObjSmmuV3
+  - EArmObjPmcg
+  - EArmObjGicItsIdentifierArray
+  - EArmObjIdMapping
+  - EArmObjGicItsIdentifierArray

[edk2] [PATCH v2 20/22] DynamicTablesPkg: Arm DBG2 Table Generator

2019-01-24 Thread Sami Mujawar
The DBG2 generator uses the configuration manager protocol
to obtain the debug serial port information from the platform
configuration manager. It then updates a template DBG2 table
structure. This table data is used by the Table Manager to
install the DBG2 table.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc  |   1 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf |  48 ++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c| 463 

 3 files changed, 512 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 
069ce635e5150b5914b3d7ef58d9bcfef229879f..4a9e42728da2c211183be974215c04fdffd31fc4
 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -27,6 +27,7 @@ [Components.common]
   #
   DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {
 
+  NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf
new file mode 100644
index 
..4075862204c9a12cfd26002e359e054c36914ef0
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf
@@ -0,0 +1,48 @@
+## @file
+# DBG2 Table Generator
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = AcpiDbg2LibArm
+  FILE_GUID  = A17BA4F0-3DEB-4FE5-BD27-EC008E541B22
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiDbg2LibConstructor
+  DESTRUCTOR = AcpiDbg2LibDestructor
+
+[Sources]
+  Dbg2Generator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  SerialPortLib
+
+[FixedPcd]
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits
+
+[Protocols]
+
+[Guids]
+
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
new file mode 100644
index 
..e21e2b660634b1aedce8167b74573694d6df2a3b
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
@@ -0,0 +1,463 @@
+/** @file
+  DBG2 Table Generator
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+  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.
+
+  @par Reference(s):
+  - Microsoft Debug Port Table 2 (DBG2) Specification - December 10, 2015.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** ARM standard DBG2 Table Generator
+
+  Constructs the DBG2 table for PL011 or SBSA UART peripherals.
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjSerialDebugPortInfo
+*/
+
+#pragma pack(1)
+
+/** The number of debug ports represented by the Table.
+*/
+#define DBG2_NUM_DEBUG_PORTS   1
+
+/** The number of Generic Address Registers
+presented in the debug device information.
+*/
+#define DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS   1
+
+/** The index for the debug port 1 in the Debug port information list.
+*/
+#define DBG_PORT_INDEX_PORT1   0
+
+/** A string representing the name of the debug 

[edk2] [PATCH v2 13/22] DynamicTablesPkg: Dynamic Table Factory Dxe

2019-01-24 Thread Sami Mujawar
The dynamic table factory dxe implements the dynamic table
factory protocol. It also implements the ACPI, SMBIOS and
DT table factories. The table generators register themselves
with the respective table factories and the factories are
responsible for instantiating instances of the generators
to build the firmware tables.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 
DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/AcpiTableFactory/AcpiTableFactory.c
 | 226 
 
DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DeviceTreeTableFactory/DeviceTreeTableFactory.c
 | 225 +++
 DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactory.h  
 | 125 +++
 DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.c   
 |  90 
 DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf 
 |  60 ++
 
DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/SmbiosTableFactory/SmbiosTableFactory.c
 | 226 
 DynamicTablesPkg/DynamicTables.dsc.inc 
 |   6 +
 DynamicTablesPkg/{DynamicTables.dsc.inc => DynamicTables.fdf.inc}  
 |  10 +-
 DynamicTablesPkg/DynamicTablesPkg.dec  
 |  11 +
 9 files changed, 974 insertions(+), 5 deletions(-)

diff --git 
a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/AcpiTableFactory/AcpiTableFactory.c
 
b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/AcpiTableFactory/AcpiTableFactory.c
new file mode 100644
index 
..3ebbcda6d360ba7d1d49992e966fbf72bafb4976
--- /dev/null
+++ 
b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/AcpiTableFactory/AcpiTableFactory.c
@@ -0,0 +1,226 @@
+/** @file
+  ACPI Table Factory
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Std - Standard
+**/
+
+#include 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+
+#include "DynamicTableFactory.h"
+
+extern EDKII_DYNAMIC_TABLE_FACTORY_INFO TableFactoryInfo;
+
+/** Return a pointer to the ACPI table generator.
+
+  @param [in]  This Pointer to the Dynamic Table Factory Protocol.
+  @param [in]  GeneratorId  The ACPI table generator ID for the
+requested generator.
+  @param [out] GeneratorPointer to the requested ACPI table
+generator.
+
+  @retval EFI_SUCCESS   Success.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND The requested generator is not found
+in the list of registered generators.
+**/
+EFI_STATUS
+EFIAPI
+GetAcpiTableGenerator (
+  IN  CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL  * CONST This,
+  IN  CONST ACPI_TABLE_GENERATOR_ID   GeneratorId,
+  OUT CONST ACPI_TABLE_GENERATOR ** CONST Generator
+  )
+{
+  UINT16   TableId;
+  EDKII_DYNAMIC_TABLE_FACTORY_INFO * FactoryInfo;
+
+  ASSERT (This != NULL);
+
+  FactoryInfo = This->TableFactoryInfo;
+
+  if (Generator == NULL) {
+DEBUG ((DEBUG_ERROR, "ERROR: Invalid Generator pointer\n"));
+return EFI_INVALID_PARAMETER;
+  }
+
+  if (!IS_GENERATOR_TYPE_ACPI (GeneratorId)) {
+DEBUG ((DEBUG_ERROR, "ERROR: Generator Type is not ACPI\n"));
+return EFI_INVALID_PARAMETER;
+  }
+
+  *Generator = NULL;
+  TableId = GET_TABLE_ID (GeneratorId);
+  if (IS_GENERATOR_NAMESPACE_STD (GeneratorId)) {
+if (TableId >= EStdAcpiTableIdMax) {
+  ASSERT (TableId < EStdAcpiTableIdMax);
+  return EFI_INVALID_PARAMETER;
+}
+if (FactoryInfo->StdAcpiTableGeneratorList[TableId] != NULL) {
+  *Generator = FactoryInfo->StdAcpiTableGeneratorList[TableId];
+} else {
+  return EFI_NOT_FOUND;
+}
+  } else {
+if (TableId > FixedPcdGet16 (PcdMaxCustomACPIGenerators)) {
+  ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomACPIGenerators));
+  return EFI_INVALID_PARAMETER;
+}
+if (FactoryInfo->CustomAcpiTableGeneratorList[TableId] != NULL) {
+  *Generator = FactoryInfo->CustomAcpiTableGeneratorList[TableId];
+} else {
+  return EFI_NOT_FOUND;
+}
+  }
+  return EFI_SUCCESS;
+}
+
+/** Register ACPI table factory g

[edk2] [PATCH v2 21/22] DynamicTablesPkg: Arm PCI MCFG Table Generator

2019-01-24 Thread Sami Mujawar
The MCFG generator uses the configuration manager protocol
to obtain the PCI Configuration space information from the
platform configuration manager and builds the MCFG table.

This table data is then used by the Table Manager to install
the MCFG table.

The Table Manager then invokes the generator interface to free
any resources allocated by the MCFG table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc  |   1 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf |  42 +++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c| 370 

 3 files changed, 413 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 
4a9e42728da2c211183be974215c04fdffd31fc4..e60529f75dbce3d2ff6b7c193f134eaf9ee45428
 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -31,6 +31,7 @@ [Components.common]
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
+  NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
   }
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf
new file mode 100644
index 
..e491ad6b24faae24e473f0fd501e06a6f3b456b5
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf
@@ -0,0 +1,42 @@
+## @file
+#  MCFG Table Generator
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = AcpiMcfgLibArm
+  FILE_GUID  = 8C9BDCB2-72D4-4F30-A12D-1145C3807FF7
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiMcfgLibConstructor
+  DESTRUCTOR = AcpiMcfgLibDestructor
+
+[Sources]
+  McfgGenerator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+
+[Pcd]
+
+[Protocols]
+
+[Guids]
+
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c
new file mode 100644
index 
..29eb72bd917227e87b8f126aa098a6e0ff3918cc
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c
@@ -0,0 +1,370 @@
+/** @file
+  MCFG Table Generator
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+  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.
+
+  @par Reference(s):
+  - PCI Firmware Specification - Revision 3.2, January 26, 2015.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** ARM standard MCFG Generator
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjPciConfigSpaceInfo
+*/
+
+#pragma pack(1)
+
+/** This typedef is used to shorten the name of the MCFG Table
+header structure.
+*/
+typedef
+  EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER
+  MCFG_TABLE;
+
+/** This typedef is used to shorten the name of the Enhanced
+Configuration Space address structure.
+*/
+typedef
+  
EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_ADDRESS_ALLOCATION_STRUCTURE
+  MCFG_CFG_SPACE_ADDR;
+
+#pragma pack()
+
+/** Retrieve the PCI Configuration Space Information.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjPciConfigSpaceInfo,
+  CM_ARM_PCI_CONFIG_SPACE_INFO
+  );
+
+/** Add the PCI Enhanced

[edk2] [PATCH v2 18/22] DynamicTablesPkg: Arm ACPI GTDT Generator

2019-01-24 Thread Sami Mujawar
The GTDT generator uses the configuration manager protocol to
obtain information about the architectural and platform timers
available on the platform and generates the ACPI GTDT table.
This table data is then used by the Table Manager to install
the GTDT table.

The Table Manager then invokes the generator interface to free
any resources allocated by the GTDT table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc  |   1 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf |  42 ++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c| 700 

 3 files changed, 743 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 
cf86f2e6a05216236c4b773190d13779e86bbd3e..ad943bc55dea0c8e813750e6b122f6e899ba12a7
 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -28,6 +28,7 @@ [Components.common]
   DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {
 
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
+  NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
   }
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
new file mode 100644
index 
..da3db2b1ff882a9e3a71810eff3d76681ec9d208
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
@@ -0,0 +1,42 @@
+## @file
+#  GTDT Table Generator
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = AcpiGtdtLibArm
+  FILE_GUID  = 26490F7A-7FA2-423C-8939-C6206329BC37
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiGtdtLibConstructor
+  DESTRUCTOR = AcpiGtdtLibDestructor
+
+[Sources]
+  GtdtGenerator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+
+[FixedPcd]
+
+[Protocols]
+
+[Guids]
+
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
new file mode 100644
index 
..70f52507bc7f12a776f76271b3f378bc62e717ba
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
@@ -0,0 +1,700 @@
+/** @file
+  GTDT Table Generator
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+  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.
+
+  @par Reference(s):
+  - ACPI 6.2 Specification - Errata A, September 2017
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** ARM standard GTDT Generator
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjGenericTimerInfo
+  - EArmObjPlatformGenericWatchdogInfo (OPTIONAL)
+  - EArmObjPlatformGTBlockInfo (OPTIONAL)
+  - EArmObjGTBlockTimerFrameInfo (OPTIONAL)
+*/
+
+/** This macro expands to a function that retrieves the Generic
+Timer Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjGenericTimerInfo,
+  CM_ARM_GENERIC_TIMER_INFO
+  );
+
+/** This macro expands to a function that retrieves the SBSA Generic
+Watchdog Timer Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjPlatformGenericWatchdogInfo,
+  CM_ARM_GENERIC_WATCHDOG_INFO
+  );
+
+/** This macro expands to a function that retrieves the Platform Generic
+Timer Block Information from the C

[edk2] [PATCH v2 14/22] DynamicTablesPkg: Dynamic Table Manager Dxe

2019-01-24 Thread Sami Mujawar
The dynamic table manager implements the top level component
that drives the table generation and installation process.
It uses the configuration manager protocol to get the list
of tables to be installed from the configuration manager.
It iterates through the list of tables, requests the table
factories for corresponding generators and invokes the
generator interface to build the tables.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c   | 
735 
 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf |  
50 ++
 DynamicTablesPkg/DynamicTables.dsc.inc |   
5 +
 DynamicTablesPkg/DynamicTables.fdf.inc |   
4 +
 4 files changed, 794 insertions(+)

diff --git 
a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c 
b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c
new file mode 100644
index 
..33f26a2115e0eb7019fcba680ffe57633b69091c
--- /dev/null
+++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c
@@ -0,0 +1,735 @@
+/** @file
+  Dynamic Table Manager Dxe
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+
+  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 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** This macro expands to a function that retrieves the ACPI Table
+List from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceStandard,
+  EStdObjAcpiTableList,
+  CM_STD_OBJ_ACPI_TABLE_INFO
+  )
+
+/** A helper function to build and install a single ACPI table.
+
+  This is a helper function that invokes the Table generator interface
+  for building an ACPI table. It uses the AcpiTableProtocol to install the
+  table, then frees the resources allocated for generating it.
+
+  @param [in]  TableFactoryProtocol Pointer to the Table Factory Protocol
+interface.
+  @param [in]  CfgMgrProtocol   Pointer to the Configuration Manager
+Protocol Interface.
+  @param [in]  GeneratorPointer to the AcpiTable generator.
+  @param [in]  AcpiTableProtocolPointer to the AcpiTable protocol.
+  @param [in]  AcpiTableInfoPointer to the ACPI table Info.
+
+  @retval EFI_SUCCESS   Success.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND Required object is not found.
+  @retval EFI_BAD_BUFFER_SIZE   Size returned by the Configuration Manager
+is less than the Object size for the
+requested object.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+BuildAndInstallSingleAcpiTable (
+  IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL  * CONST TableFactoryProtocol,
+  IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST CfgMgrProtocol,
+  IN CONST ACPI_TABLE_GENERATOR  * CONST Generator,
+  IN   EFI_ACPI_TABLE_PROTOCOL   *   AcpiTableProtocol,
+  IN CONST CM_STD_OBJ_ACPI_TABLE_INFO* CONST AcpiTableInfo
+  )
+{
+  EFI_STATUSStatus;
+  EFI_STATUSStatus1;
+  EFI_ACPI_DESCRIPTION_HEADER * AcpiTable;
+  UINTN TableHandle;
+
+  AcpiTable = NULL;
+  Status = Generator->BuildAcpiTable (
+Generator,
+AcpiTableInfo,
+CfgMgrProtocol,
+
+);
+  if (EFI_ERROR (Status)) {
+DEBUG ((
+  DEBUG_ERROR,
+  "ERROR: Failed to Build Table." \
+  " TableGeneratorId = 0x%x. Status = %r\n",
+  AcpiTableInfo->TableGeneratorId,
+  Status
+  ));
+// Free any allocated resources.
+goto exit_handler;
+  }
+
+  if (AcpiTable == NULL) {
+Status = EFI_NOT_FOUND;
+goto exit_handler;
+  }
+
+  // Dump ACPI Table Header
+  DUMP_ACPI_TABLE_HEADER (AcpiTable);
+
+  // Install ACPI table
+  Status = AcpiTableProtocol->InstallAcpiTable (
+AcpiTableProtocol,
+AcpiTable,
+AcpiTable->Length,
+
+);
+  if (EFI_ERROR (Status)) {
+DEBUG ((
+  DEB

[edk2] [PATCH v2 07/22] DynamicTablesPkg: Arm NameSpace Objects

2019-01-24 Thread Sami Mujawar
The dynamic tables frameworks core communicates with the
platform specific implementation using the configuration
manager protocol interface. The dynamic tables framework
core uses this interface to retrieve information required
for generating the firmware tables. This information is
represented in the form of objects, which are classified
as standard namespace objects, Arm namespace objects or
as Custom/OEM namespace objects.

This patch introduces the definitions for the Arm namespace
objects.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 591 
 1 file changed, 591 insertions(+)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
new file mode 100644
index 
..93cb6949f0eb2ac2ad3524494e4a14c7a6fab4b8
--- /dev/null
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -0,0 +1,591 @@
+/** @file
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+- Std or STD - Standard
+**/
+
+#ifndef ARM_NAMESPACE_OBJECTS_H_
+#define ARM_NAMESPACE_OBJECTS_H_
+
+#include 
+
+#pragma pack(1)
+
+/** The EARM_OBJECT_ID enum describes the Object IDs
+in the ARM Namespace
+*/
+typedef enum ArmObjectID {
+  EArmObjReserved,///<  0 - Reserved
+  EArmObjBootArchInfo,///<  1 - Boot Architecture Info
+  EArmObjCpuInfo, ///<  2 - CPU Info
+  EArmObjPowerManagementProfileInfo,  ///<  3 - Power Management Profile Info
+  EArmObjGicCInfo,///<  4 - GIC CPU Interface Info
+  EArmObjGicDInfo,///<  5 - GIC Distributor Info
+  EArmObjGicMsiFrameInfo, ///<  6 - GIC MSI Frame Info
+  EArmObjGicRedistributorInfo,///<  7 - GIC Redistributor Info
+  EArmObjGicItsInfo,  ///<  8 - GIC ITS Info
+  EArmObjSerialConsolePortInfo,   ///<  9 - Serial Console Port Info
+  EArmObjSerialDebugPortInfo, ///< 10 - Serial Debug Port Info
+  EArmObjGenericTimerInfo,///< 11 - Generic Timer Info
+  EArmObjPlatformGTBlockInfo, ///< 12 - Platform GT Block Info
+  EArmObjGTBlockTimerFrameInfo,   ///< 13 - Generic Timer Block Frame Info
+  EArmObjPlatformGenericWatchdogInfo, ///< 14 - Platform Generic Watchdog
+  EArmObjPciConfigSpaceInfo,  ///< 15 - PCI Configuration Space Info
+  EArmObjHypervisorVendorIdentity,///< 16 - Hypervisor Vendor Id
+  EArmObjFixedFeatureFlags,   ///< 17 - Fixed feature flags for FADT
+  EArmObjItsGroup,///< 18 - ITS Group
+  EArmObjNamedComponent,  ///< 19 - Named Component
+  EArmObjRootComplex, ///< 20 - Root Complex
+  EArmObjSmmuV1SmmuV2,///< 21 - SMMUv1 or SMMUv2
+  EArmObjSmmuV3,  ///< 22 - SMMUv3
+  EArmObjPmcg,///< 23 - PMCG
+  EArmObjGicItsIdentifierArray,   ///< 24 - GIC ITS Identifier Array
+  EArmObjIdMapping,   ///< 25 - ID Mapping
+  EArmObjSmmuInterruptArray,  ///< 26 - SMMU Interrupt Array
+  EArmObjMax
+} EARM_OBJECT_ID;
+
+/** A structure that describes the
+ARM Boot Architecture flags.
+*/
+typedef struct CmArmBootArchInfo {
+  /** This is the ARM_BOOT_ARCH flags field of the FADT Table
+  described in the ACPI Table Specification.
+  */
+  UINT32  BootArchFlags;
+} CM_ARM_BOOT_ARCH_INFO;
+
+typedef struct CmArmCpuInfo {
+  // Reserved for use when SMBIOS tables are implemented
+} CM_ARM_CPU_INFO;
+
+typedef struct CmArmCpuInfoList {
+  UINT32 CpuCount;
+  CM_ARM_CPU_INFO  * CpuInfo;
+} CM_ARM_CPU_INFO_LIST;
+
+/** A structure that describes the
+Power Management Profile Information for the Platform.
+*/
+typedef struct CmArmPowerManagementProfileInfo {
+  /** This is the Preferred_PM_Profile field of the FADT Table
+  described in the ACPI Specification
+  */
+  UINT8  PowerManagementProfile;
+} CM_ARM_POWER_MANAGEMENT_PROFILE_INFO;
+
+/** A structure that describes the
+GIC CPU Interface for the Platform.
+*/
+typedef struct CmArmGicCInfo {
+  /// The GIC CPU Interface number.
+  UINT32  CPUInterfaceNumber;
+
+  /** The ACPI Processor UID. This must match the
+  _UID of the CPU Device object information described
+  in the DSDT

[edk2] [PATCH v2 19/22] DynamicTablesPkg: Arm SPCR Table Generator

2019-01-24 Thread Sami Mujawar
The SPCR generator uses the configuration manager protocol to
obtain the serial port information from the platform configuration
manager. It then updates a template SPCR table structure. This
table data is used by the Table Manager to install the SPCR table.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc  |   1 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf |  42 +++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c| 347 

 3 files changed, 390 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 
ad943bc55dea0c8e813750e6b122f6e899ba12a7..069ce635e5150b5914b3d7ef58d9bcfef229879f
 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -31,6 +31,7 @@ [Components.common]
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
+  NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
   }
 
   #
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
new file mode 100644
index 
..8dd94e550b8181dea13d5be81688cc35b8b80eac
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
@@ -0,0 +1,42 @@
+## @file
+#  SPCR Table Generator
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = AcpiSpcrLibArm
+  FILE_GUID  = 55088136-7B78-4974-B1EE-F630150D0DE7
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiSpcrLibConstructor
+  DESTRUCTOR = AcpiSpcrLibDestructor
+
+[Sources]
+  SpcrGenerator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+
+[Pcd]
+
+[Protocols]
+
+[Guids]
+
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c
new file mode 100644
index 
..23d3a50713d200321e3d93850c1b42e48da2faeb
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c
@@ -0,0 +1,347 @@
+/** @file
+  SPCR Table Generator
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+  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.
+
+  @par Reference(s):
+  - Microsoft Serial Port Console Redirection Table
+Specification - Version 1.03 - August 10, 2015.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** ARM standard SPCR Table Generator
+
+  Constructs the SPCR table for PL011 or SBSA UART peripherals.
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjSerialConsolePortInfo
+
+NOTE: This implementation ignores the possibility that the Serial settings may
+  be modified from the UEFI Shell.  A more complex handler would be needed
+  to (e.g.) recover serial port settings from the UART, or non-volatile
+  storage.
+*/
+
+#pragma pack(1)
+
+/** This macro defines the no flow control option.
+*/
+#define SPCR_FLOW_CONTROL_NONE   0
+
+/**A template for generating the SPCR Table.
+
+  Note: fields marked "{Template}" will be updated dynamically.
+*/
+STATIC
+EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE AcpiSpcr = {
+  ACPI_HEADER (
+EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,
+EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE,
+EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION
+),
+  0, // {

[edk2] [PATCH v2 02/22] DynamicTablesPkg: Table Generator definition

2019-01-24 Thread Sami Mujawar
A Table generator is a component that implements the logic
for building a firmware table. This is typically implemented
as a library and registers itself with a table factory.

Table generators are further classified based on type of table
it generates, a namespace that signifies if the implementation
is standard or an OEM specific implementation and a table Id.

This patch introduces the definitions used for describing a
table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTablesPkg.dec |  24 ++
 DynamicTablesPkg/Include/TableGenerator.h | 252 
 2 files changed, 276 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTablesPkg.dec 
b/DynamicTablesPkg/DynamicTablesPkg.dec
new file mode 100644
index 
..b1a6c64948d01426fc95b8599fc17adaa8c35f3d
--- /dev/null
+++ b/DynamicTablesPkg/DynamicTablesPkg.dec
@@ -0,0 +1,24 @@
+## @file
+# dec file for Dynamic Tables Framework.
+#
+# Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+# This program and the accompanying materials are licensed and made available 
under
+# the terms and conditions of the BSD License that 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]
+  DEC_SPECIFICATION  = 0x00010005
+  PACKAGE_NAME   = DynamicTablesPkg
+  PACKAGE_GUID   = 188EB346-8ABA-460E-A105-0F9D76F7324A
+  PACKAGE_VERSION= 1.0
+
+[Includes]
+  Include
+
diff --git a/DynamicTablesPkg/Include/TableGenerator.h 
b/DynamicTablesPkg/Include/TableGenerator.h
new file mode 100644
index 
..ea996085683ff6a783ec9a676efce6604b956d8e
--- /dev/null
+++ b/DynamicTablesPkg/Include/TableGenerator.h
@@ -0,0 +1,252 @@
+/** @file
+
+  Copyright (c) 2017, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- ACPI   - Advanced Configuration and Power Interface
+- SMBIOS - System Management BIOS
+- DT - Device Tree
+**/
+
+#ifndef TABLE_GENERATOR_H_
+#define TABLE_GENERATOR_H_
+
+/** The TABLE_GENERATOR_ID type describes the Table Generator ID
+
+  Table Generator ID
+
+___
+|  31 | 30 |29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17| 16|
+---
+|TNSID|  0 |   TT   |  0 |  0 |  0 |  0 |  0 |  0 |  0 |  0 |  0 |  0 |  0|  0|
+___
+___
+|15 | 14 | 13 | 12 | 11 | 10 |  9 |  8 |  7 |  6 |  5 |  4 |  3 |  2 |  1 |  0|
+---
+| Table ID|
+___
+
+  Bit [31] - Table NameSpace ID (TNSID)
+  0 - Standard
+  1 - Custom/OEM
+
+  Bit [30] - Reserved, Must be Zero
+
+  Bit [29:28] - Table Type (TT)
+   0 - ACPI Table
+   1 - SMBIOS Table
+   2 - DT (Device Tree) Table
+   3 - Reserved (INVALID)
+
+  Bit [27:16] - Reserved, Must Be Zero
+
+  Bit [15:0] - Table ID
+
+Standard ACPI Table IDs:
+   0 - Reserved
+   1 - RAW
+   2 - FADT
+   3 - DSDT
+   4 - SSDT
+   5 - MADT
+   6 - GTDT
+   7 - DBG2
+   8 - SPCR
+   9 - MCFG
+
+Standard SMBIOS Table IDs:
+   0 - Reserved
+   1 - RAW
+   2 - Table Type00
+   3 - Table Type01
+   4 - Table Type02
+   5 - Table Type03
+   6 - Table Type04
+   7 - Table Type05
+   8 - Table Type06
+   9 - Table Type07
+  10 - Table Type08
+  11 - Table Type09
+  12 - Table Type10
+  13 - Table Type11
+  14 - Table Type12
+  15 - Table Type13
+  16 - Table Type14
+  17 - Table Type15
+  18 - Table Type16
+  19 - Table Type17
+  20 - Table Type18
+  21 - Table Type19
+  22 - Table Type20
+  23 - Table Type21
+  24 - Table Type22
+  25 - Table Type23
+  26 - Table Type24
+  27 - Table Type25
+  28 - Table Type26
+   

[edk2] [PATCH v2 09/22] DynamicTablesPkg: Configuration Manager Protocol

2019-01-24 Thread Sami Mujawar
Introduce configuration manager protocol interface
that is used by the dynamic tables framework core
to communicate with configuration manager.

Configuration manager is a platform specific module
that implements the configuration manager protocol.

Table generators use this interface to retrieve the
hardware information from the configuration manager.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTablesPkg.dec|   5 +
 DynamicTablesPkg/Include/Protocol/ConfigurationManagerProtocol.h | 128 

 2 files changed, 133 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTablesPkg.dec 
b/DynamicTablesPkg/DynamicTablesPkg.dec
index 
b1a6c64948d01426fc95b8599fc17adaa8c35f3d..e5e731085a721f5f2a0129b4678dedbb0c7b985a
 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dec
+++ b/DynamicTablesPkg/DynamicTablesPkg.dec
@@ -22,3 +22,8 @@ [Defines]
 [Includes]
   Include
 
+[Protocols]
+
+  # Configuration Manager Protocol GUID
+  gEdkiiConfigurationManagerProtocolGuid = { 0xd85a4835, 0x5a82, 0x4894, { 
0xac, 0x2, 0x70, 0x6f, 0x43, 0xd5, 0x97, 0x8e } }
+
diff --git a/DynamicTablesPkg/Include/Protocol/ConfigurationManagerProtocol.h 
b/DynamicTablesPkg/Include/Protocol/ConfigurationManagerProtocol.h
new file mode 100644
index 
..02c3d22ca7e961058c2c157e7f5a981e1418535e
--- /dev/null
+++ b/DynamicTablesPkg/Include/Protocol/ConfigurationManagerProtocol.h
@@ -0,0 +1,128 @@
+/** @file
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+**/
+
+#ifndef CONFIGURATION_MANAGER_PROTOCOL_H_
+#define CONFIGURATION_MANAGER_PROTOCOL_H_
+
+#include 
+
+/** This macro defines the Configuration Manager Protocol GUID.
+
+  GUID: {D85A4835-5A82-4894-AC02-706F43D5978E}
+*/
+#define EDKII_CONFIGURATION_MANAGER_PROTOCOL_GUID   \
+  { 0xd85a4835, 0x5a82, 0x4894, \
+{ 0xac, 0x2, 0x70, 0x6f, 0x43, 0xd5, 0x97, 0x8e }   \
+  };
+
+/** This macro defines the Configuration Manager Protocol Revision.
+*/
+#define EDKII_CONFIGURATION_MANAGER_PROTOCOL_REVISION  CREATE_REVISION (1, 0)
+
+#pragma pack(1)
+
+/**
+  Forward declarations:
+*/
+typedef struct ConfigurationManagerProtocol 
EDKII_CONFIGURATION_MANAGER_PROTOCOL;
+typedef struct PlatformRepositoryInfo   EDKII_PLATFORM_REPOSITORY_INFO;
+
+/** The GetObject function defines the interface implemented by the
+Configuration Manager Protocol for returning the Configuration
+Manager Objects.
+
+  @param [in]  ThisPointer to the Configuration Manager Protocol.
+  @param [in]  CmObjectId  The Configuration Manager Object ID.
+  @param [in]  Token   An optional token identifying the object. If
+   unused this must be CM_NULL_TOKEN.
+  @param [out] CmObjectPointer to the Configuration Manager Object
+   descriptor describing the requested Object.
+
+  @retval EFI_SUCCESS   Success.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND The required object information is not found.
+  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration Manager
+is less than the Object size for the requested
+object.
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EDKII_CONFIGURATION_MANAGER_GET_OBJECT) (
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST This,
+  IN  CONST CM_OBJECT_ID  CmObjectId,
+  IN  CONST CM_OBJECT_TOKEN   Token OPTIONAL,
+  IN  OUT   CM_OBJ_DESCRIPTOR * CONST CmObject
+  );
+
+/** The SetObject function defines the interface implemented by the
+Configuration Manager Protocol for updating the Configuration
+Manager Objects.
+
+  @param [in]  ThisPointer to the Configuration Manager Protocol.
+  @param [in]  CmObjectId  The Configuration Manager Object ID.
+  @param [in]  Token   An optional token identifying the object. If
+   unused this must be CM_NULL_TOKEN.
+  @param [out] CmObjectPointer to the Configuration Manager Object
+   descriptor describing the Object.
+
+  @retval EFI_SUCCESS   The operation completed successfully.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND The required object i

[edk2] [PATCH v2 04/22] DynamicTablesPkg: SMBIOS Table Generator

2019-01-24 Thread Sami Mujawar
This patch introduces the required interfaces and definitions
for implementing a SMBIOS table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/SmbiosTableGenerator.h | 240 
 1 file changed, 240 insertions(+)

diff --git a/DynamicTablesPkg/Include/SmbiosTableGenerator.h 
b/DynamicTablesPkg/Include/SmbiosTableGenerator.h
new file mode 100644
index 
..82b9156ac331d93e31d4c82324a9b38311ddb848
--- /dev/null
+++ b/DynamicTablesPkg/Include/SmbiosTableGenerator.h
@@ -0,0 +1,240 @@
+/** @file
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+
+  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.
+
+**/
+
+#ifndef SMBIOS_TABLE_GENERATOR_H_
+#define SMBIOS_TABLE_GENERATOR_H_
+
+#include 
+
+#include 
+
+#pragma pack(1)
+
+/** The SMBIOS_TABLE_GENERATOR_ID type describes SMBIOS table generator ID.
+*/
+typedef TABLE_GENERATOR_ID SMBIOS_TABLE_GENERATOR_ID;
+
+/** The ESTD_SMBIOS_TABLE_ID enum describes the SMBIOS table IDs reserved for
+  the standard generators.
+
+  NOTE: The SMBIOS Generator IDs do not match the table type numbers!
+  This allows 0 to be used to catch invalid parameters.
+*/
+typedef enum StdSmbiosTableGeneratorId {
+  EStdSmbiosTableIdReserved = 0x,
+  EStdSmbiosTableIdRAW,
+  EStdSmbiosTableIdType00,
+  EStdSmbiosTableIdType01,
+  EStdSmbiosTableIdType02,
+  EStdSmbiosTableIdType03,
+  EStdSmbiosTableIdType04,
+  EStdSmbiosTableIdType05,
+  EStdSmbiosTableIdType06,
+  EStdSmbiosTableIdType07,
+  EStdSmbiosTableIdType08,
+  EStdSmbiosTableIdType09,
+  EStdSmbiosTableIdType10,
+  EStdSmbiosTableIdType11,
+  EStdSmbiosTableIdType12,
+  EStdSmbiosTableIdType13,
+  EStdSmbiosTableIdType14,
+  EStdSmbiosTableIdType15,
+  EStdSmbiosTableIdType16,
+  EStdSmbiosTableIdType17,
+  EStdSmbiosTableIdType18,
+  EStdSmbiosTableIdType19,
+  EStdSmbiosTableIdType20,
+  EStdSmbiosTableIdType21,
+  EStdSmbiosTableIdType22,
+  EStdSmbiosTableIdType23,
+  EStdSmbiosTableIdType24,
+  EStdSmbiosTableIdType25,
+  EStdSmbiosTableIdType26,
+  EStdSmbiosTableIdType27,
+  EStdSmbiosTableIdType28,
+  EStdSmbiosTableIdType29,
+  EStdSmbiosTableIdType30,
+  EStdSmbiosTableIdType31,
+  EStdSmbiosTableIdType32,
+  EStdSmbiosTableIdType33,
+  EStdSmbiosTableIdType34,
+  EStdSmbiosTableIdType35,
+  EStdSmbiosTableIdType36,
+  EStdSmbiosTableIdType37,
+  EStdSmbiosTableIdType38,
+  EStdSmbiosTableIdType39,
+  EStdSmbiosTableIdType40,
+  EStdSmbiosTableIdType41,
+  EStdSmbiosTableIdType42,
+
+  // IDs 43 - 125 are reserved
+
+  EStdSmbiosTableIdType126 = (EStdSmbiosTableIdType00 + 126),
+  EStdSmbiosTableIdType127,
+  EStdSmbiosTableIdMax
+} ESTD_SMBIOS_TABLE_ID;
+
+/** This macro checks if the Table Generator ID is for an SMBIOS Table
+Generator.
+
+  @param [in] TableGeneratorId  The table generator ID.
+
+  @return  TRUE if the table generator ID is for an SMBIOS Table
+Generator.
+**/
+#define IS_GENERATOR_TYPE_SMBIOS(TableGeneratorId) \
+  (\
+  GET_TABLE_TYPE (TableGeneratorId) == \
+  ETableGeneratorTypeSmbios\
+  )
+
+/** This macro checks if the Table Generator ID is for a standard SMBIOS
+Table Generator.
+
+  @param [in] TableGeneratorId  The table generator ID.
+
+  @return  TRUE if the table generator ID is for a standard SMBIOS
+Table Generator.
+**/
+#define IS_VALID_STD_SMBIOS_GENERATOR_ID(TableGeneratorId)  \
+  ( \
+  IS_GENERATOR_NAMESPACE_STD(TableGeneratorId) &&   \
+  IS_GENERATOR_TYPE_SMBIOS(TableGeneratorId)   &&   \
+  ((GET_TABLE_ID(GeneratorId) >= EStdSmbiosTableIdRaw) &&   \
+   (GET_TABLE_ID(GeneratorId) < EStdSmbiosTableIdMax))  \
+  )
+
+/** This macro creates a standard SMBIOS Table Generator ID.
+
+  @param [in] TableId  The table generator ID.
+
+  @return a standard SMBIOS table generator ID.
+**/
+#define CREATE_STD_SMBIOS_TABLE_GEN_ID(TableId) \
+  CREATE_TABLE_GEN_ID ( \
+ETableGeneratorTypeSmbios,  \
+ETableGeneratorNameSpaceStd,\
+TableId \
+)
+
+/** Forward declarations.
+*/
+typedef struct ConfigurationManagerProtocol 
EDKII_CONFIGURATION_MANAGER_PROTOCOL;
+typedef struct CmStdObjSmbiosTableInfo  CM_STD_OBJ_SMBIOS_TABLE_INFO;
+typedef struct SmbiosTable

[edk2] [PATCH v2 00/22] DynamicTablesPkg: Introduce Dynamic Tables Framework

2019-01-24 Thread Sami Mujawar
Dynamic Tables Framework aims to reduce the amount of effort
required for porting firmware to new platforms by simplifying
the generation of firmware tables based on hardware description
provided by a platform specific component.
 
The Dynamic Tables Framework core queries the platform specific
component to retrieve the required hardware information for
generating standardised firmware tables at run-time.
 
This patch series introduce the Dynamic Tables Framework.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 

The changes can be seen at:
https://github.com/samimujawar/edk2/tree/365_dynamic_tables_framework_v2

This v2 patch series incorporates:
  * provision for extending the framework to support newer
versions of specifications.
  * minor code improvements.

The corresponding edk2-platform changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/365_dynamic_tables_framework_v3

Sami Mujawar (22):
  DynamicTablesPkg: Dynamic Tables Framework
  DynamicTablesPkg: Table Generator definition
  DynamicTablesPkg: Acpi Table Generator
  DynamicTablesPkg: SMBIOS Table Generator
  DynamicTablesPkg: DT Table Generator
  DynamicTablesPkg: Standard NameSpace Objects
  DynamicTablesPkg: Arm NameSpace Objects
  DynamicTablesPkg: Configuration Manager Objects
  DynamicTablesPkg: Configuration Manager Protocol
  DynamicTablesPkg: Configuration Manager Helper
  DynamicTablesPkg: Table Helper Library
  DynamicTablesPkg: Dynamic Table Factory Protocol
  DynamicTablesPkg: Dynamic Table Factory Dxe
  DynamicTablesPkg: Dynamic Table Manager Dxe
  DynamicTablesPkg: Arm Raw/DSDT/SSDT Generator
  DynamicTablesPkg: Arm ACPI FADT Generator
  DynamicTablesPkg: Arm ACPI MADT Generator
  DynamicTablesPkg: Arm ACPI GTDT Generator
  DynamicTablesPkg: Arm SPCR Table Generator
  DynamicTablesPkg: Arm DBG2 Table Generator
  DynamicTablesPkg: Arm PCI MCFG Table Generator
  DynamicTablesPkg: Arm IORT Table Generator

 
DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/AcpiTableFactory/AcpiTableFactory.c
 |  226 +++
 
DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DeviceTreeTableFactory/DeviceTreeTableFactory.c
 |  225 +++
 DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactory.h  
 |  125 ++
 DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.c   
 |   90 +
 DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf 
 |   60 +
 
DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/SmbiosTableFactory/SmbiosTableFactory.c
 |  226 +++
 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c   
 |  735 +++
 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf 
 |   50 +
 DynamicTablesPkg/DynamicTables.dsc.inc 
 |   44 +
 DynamicTablesPkg/DynamicTables.fdf.inc 
 |   24 +
 DynamicTablesPkg/DynamicTablesPkg.dec  
 |   43 +
 DynamicTablesPkg/Include/AcpiTableGenerator.h  
 |  360 
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h 
 |  591 ++
 DynamicTablesPkg/Include/ConfigurationManagerHelper.h  
 |  132 ++
 DynamicTablesPkg/Include/ConfigurationManagerObject.h  
 |  182 ++
 DynamicTablesPkg/Include/DeviceTreeTableGenerator.h
 |  182 ++
 DynamicTablesPkg/Include/Library/TableHelperLib.h  
 |   68 +
 DynamicTablesPkg/Include/Protocol/ConfigurationManagerProtocol.h   
 |  128 ++
 DynamicTablesPkg/Include/Protocol/DynamicTableFactoryProtocol.h
 |  269 +++
 DynamicTablesPkg/Include/SmbiosTableGenerator.h
 |  240 +++
 DynamicTablesPkg/Include/StandardNameSpaceObjects.h
 |  119 ++
 DynamicTablesPkg/Include/TableGenerator.h  
 |  252 +++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf
 |   48 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c   
 |  463 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
 |   42 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c   
 |  689 +++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
 |   42 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c

[edk2] [PATCH v2 08/22] DynamicTablesPkg: Configuration Manager Objects

2019-01-24 Thread Sami Mujawar
The dynamic tables frameworks core communicates with the
platform specific implementation using the configuration
manager protocol interface. The dynamic tables framework
core uses this interface to retrieve information required
for generating the firmware tables. This information is
represented in the form of objects, which are classified
as standard namespace objects, Arm namespace objects or
as Custom/OEM namespace objects.

The configuration manager objects provides a convenient
way for wrapping up the namespaces using a well defined
configuration manager object Id.

The configuration manager is a platform specific component
that collates the platform information required for generating
firmware tables and represents them as configuration manager
objects.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/ConfigurationManagerObject.h | 182 

 1 file changed, 182 insertions(+)

diff --git a/DynamicTablesPkg/Include/ConfigurationManagerObject.h 
b/DynamicTablesPkg/Include/ConfigurationManagerObject.h
new file mode 100644
index 
..ad67e1ce4536170e8dab8a5453a8571e8af7
--- /dev/null
+++ b/DynamicTablesPkg/Include/ConfigurationManagerObject.h
@@ -0,0 +1,182 @@
+/** @file
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+**/
+
+#ifndef CONFIGURATION_MANAGER_OBJECT_H_
+#define CONFIGURATION_MANAGER_OBJECT_H_
+
+#include 
+#include 
+
+#pragma pack(1)
+
+/** The CM_OBJECT_ID type is used to identify the Configuration Manager
+objects.
+
+ Description of Configuration Manager Object ID
+___
+|31 |30 |29 |28 || 27 | 26 | 25 | 24 || 23 | 22 | 21 | 20 || 19 | 18 | 17 | 16|
+---
+| Name Space ID ||  0 |  0 |  0 |  0 ||  0 |  0 |  0 |  0 ||  0 |  0 |  0 |  0|
+___
+
+Bits: [31:28] - Name Space ID
+ - Standard
+0001 - ARM
+1000 - Custom/OEM
+All other values are reserved.
+
+Bits: [27:16] - Reserved.
+___
+|15 |14 |13 |12 || 11 | 10 |  9 |  8 ||  7 |  6 |  5 |  4 ||  3 |  2 |  1 |  0|
+---
+| 0 | 0 | 0 | 0 ||  0 |  0 |  0 |  0 || Object ID |
+___
+
+Bits: [15:8] - Are reserved and must be zero.
+
+Bits: [7:0] - Object ID
+
+Object ID's in the Standard Namespace:
+  0 - Configuration Manager Revision
+  1 - ACPI Table List
+  2 - SMBIOS Table List
+
+Object ID's in the ARM Namespace:
+   0 - Reserved
+   1 - Boot Architecture Info
+   2 - CPU Info
+   3 - Power Management Profile Info
+   4 - GICC Info
+   5 - GICD Info
+   6 - GIC MSI Frame Info
+   7 - GIC Redistributor Info
+   8 - GIC ITS Info
+   9 - Serial Console Port Info
+  10 - Serial Debug Port Info
+  11 - Generic Timer Info
+  12 - Platform GT Block Info
+  13 - Platform Generic Watchdog
+  14 - PCI Configuration Space Info
+  15 - Hypervisor Vendor Id
+  16 - Fixed feature flags for FADT
+*/
+typedef UINT32  CM_OBJECT_ID;
+
+/** A mask for Object ID
+*/
+#define OBJECT_ID_MASK0xFF
+
+/** A mask for Namespace ID
+*/
+#define NAMESPACE_ID_MASK 0xF
+
+/** Starting bit position for Namespace ID
+*/
+#define NAMESPACE_ID_BIT_SHIFT28
+
+/** The EOBJECT_NAMESPACE_ID enum describes the defined namespaces
+for the Configuration Manager Objects.
+*/
+typedef enum ObjectNameSpaceID {
+  EObjNameSpaceStandard,  ///< Standard Objects Namespace
+  EObjNameSpaceArm,   ///< ARM Objects Namespace
+  EObjNameSpaceOem = 0x8, ///< OEM Objects Namespace
+  EObjNameSpaceMax
+} EOBJECT_NAMESPACE_ID;
+
+/** A descriptor for Configuration Manager Objects.
+
+  The Configuration Manager Protocol interface uses this descriptor
+  to return the Configuration Manager Objects.
+*/
+typedef struct CmObjDescriptor {
+  /// Object Id
+  CM_OBJECT_ID  ObjectId;
+
+  /// Size of the described Object or Object List
+  UINT32Size;
+
+  /// Pointer to the described Object or Object List
+  VOID* Data;
+
+  /

[edk2] [PATCH v2 01/22] DynamicTablesPkg: Dynamic Tables Framework

2019-01-24 Thread Sami Mujawar
The dynamic tables framework is designed to generate standardised
firmware tables that describe the hardware information at
run-time. A goal of standardised firmware is to have a common
firmware for a platform capable of booting both Windows and Linux
operating systems.

Traditionally the firmware tables are handcrafted using ACPI
Source Language (ASL), Table Definition Language (TDL) and
C-code. This approach can be error prone and involves time
consuming debugging.

In addition, it may be desirable to configure platform hardware
at runtime such as: configuring the number of cores available
for use by the OS, or turning SoC features ON or OFF.

This patch introduces Dynamic Tables Framework which also provides
mechanisms to reduce the amount of effort required in porting
firmware to new platforms. A more detailed description is in
the Readme.md file.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Readme.md | 139 
 1 file changed, 139 insertions(+)

diff --git a/DynamicTablesPkg/Readme.md b/DynamicTablesPkg/Readme.md
new file mode 100644
index 
..93fd1f313aa5227df5c1ccc82dfe17cb4c8f9e0a
--- /dev/null
+++ b/DynamicTablesPkg/Readme.md
@@ -0,0 +1,139 @@
+Dynamic Tables Framework
+
+
+Dynamic Tables Framework provides mechanisms to reduce the amount
+of effort required in porting firmware to new platforms. The aim is
+to provide an implementation capable of generating the firmware
+tables from an external source.  This is potentially a management
+node, either local or remote, or, where suitable, a file that might
+be generated from the system construction.  This initial release
+does not fully implement that - the configuration is held in local
+UEFI modules.
+
+Feature Summary
+---
+The dynamic tables framework is designed to generate standardised
+firmware tables that describe the hardware information at
+run-time. A goal of standardised firmware is to have a common
+firmware for a platform capable of booting both Windows and Linux
+operating systems.
+
+Traditionally the firmware tables are handcrafted using ACPI
+Source Language (ASL), Table Definition Language (TDL) and
+C-code. This approach can be error prone and involves time
+consuming debugging. In addition, it may be desirable to configure
+platform hardware at runtime such as: configuring the number of
+cores available for use by the OS, or turning SoC features ON or
+OFF.
+
+The dynamic tables framework simplifies this by providing a set
+of standard table generators, that are implemented as libraries.
+These generators query a platform specific component, the
+'Configuration Manager', to collate the information required
+for generating the tables at run-time.
+
+The framework also provides the ability to implement custom/OEM
+generators; thereby facilitating support for custom tables. The
+custom generators can also utilize the existing standard generators
+and override any functionality if needed.
+
+The framework currently implements a set of standard ACPI table
+generators for ARM architecture, that can generate Server Base Boot
+Requirement (SBBR) compliant tables. Although, the set of standard
+generators implement the functionality required for ARM architecture;
+the framework is extensible, and support for other architectures can
+be added easily.
+
+The framework currently supports the following table generators for ARM:
+* DBG2 - Debug Port Table 2
+* DSDT - Differentiated system description table. This is essentially
+ a RAW table generator.
+* FADT - Fixed ACPI Description Table
+* GTDT - Generic Timer Description Table
+* IORT - IO Remapping Table
+* MADT - Multiple APIC Description Table
+* MCFG - PCI Express memory mapped configuration space base address
+ Description Table
+* SPCR - Serial Port Console Redirection Table
+* SSDT - Secondary System Description Table. This is essentially
+ a RAW table generator.
+
+Roadmap
+---
+The current implementation of the Configuration Manager populates the
+platform information statically as a C structure. Further enhancements
+to introduce runtime loading of platform information from a platform
+information file is planned.
+
+Also support for generating SMBIOS tables is planned and will be added
+subsequently.
+
+Related Modules
+---
+
+### ACPICA iASL compiler
+The RAW table generator, used to process the DSDT/SSDT files depends on
+the iASL compiler to convert the DSDT/SSDT ASL files to a C array containing
+the hex AML code. The "-tc" option of the iASL compiler has been enhanced to
+support generation of an AML hex file (C header) with a unique symbol name
+so that it is suitable for inclusion from a C source file.
+
+Related Links
+--
+
+<https://github.com/acpica/acpica.git>
+
+
+Supported Platforms
+---
+1. Juno
+2. FVP Models
+
+Bu

[edk2] [PATCH v2 06/22] DynamicTablesPkg: Standard NameSpace Objects

2019-01-24 Thread Sami Mujawar
The dynamic tables frameworks core communicates with the
platform specific implementation using the configuration
manager protocol interface. The dynamic tables framework
core uses this interface to retrieve information required
for generating the firmware tables. This information is
represented in the form of objects, which are classified
as standard namespace objects, Arm namespace objects or
as Custom/OEM namespace objects.

This patch introduces the definitions for standard
namespace objects.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/StandardNameSpaceObjects.h | 119 
 1 file changed, 119 insertions(+)

diff --git a/DynamicTablesPkg/Include/StandardNameSpaceObjects.h 
b/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
new file mode 100644
index 
..4377ee8f785399b02fec824f3a34d2f4ed3b1c01
--- /dev/null
+++ b/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
@@ -0,0 +1,119 @@
+/** @file
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+- Std or STD - Standard
+**/
+
+#ifndef STANDARD_NAMESPACE_OBJECTS_H_
+#define STANDARD_NAMESPACE_OBJECTS_H_
+
+#include 
+#include 
+
+#pragma pack(1)
+
+/** A macro defining a reserved zero/NULL token value that
+does not identify any object.
+*/
+#define CM_NULL_TOKEN  0
+
+/** A reference token that the Configuration Manager can use
+to identify a Configuration Manager object.
+
+  This can be used to differentiate between instances of
+  objects of the same types. The identification scheme is
+  implementation defined and is defined by the Configuration
+  Manager.
+
+  Typically the token is used to identify a specific instance
+  from a set of objects in a call to the GetObject()/SetObject(),
+  implemented by the Configuration Manager protocol.
+
+  Note: The token value 0 is reserved for a NULL token and does
+not identify any object.
+**/
+typedef UINTN   CM_OBJECT_TOKEN;
+
+/** The ESTD_OBJECT_ID enum describes the Object IDs
+in the Standard Namespace.
+*/
+typedef enum StdObjectID {
+  EStdObjCfgMgrInfo = 0x, ///< 0 - Configuration Manager Info
+  EStdObjAcpiTableList,   ///< 1 - ACPI table Info List
+  EStdObjSmbiosTableList, ///< 2 - SMBIOS table Info List
+  EStdObjMax
+} ESTD_OBJECT_ID;
+
+/** A structure that describes the Configuration Manager Information.
+*/
+typedef struct CmStdObjConfigurationManagerInfo {
+  /// The Configuration Manager Revision.
+  UINT32  Revision;
+
+  /** The OEM ID. This information is used to
+  populate the ACPI table header information.
+  */
+  UINT8   OemId[6];
+} CM_STD_OBJ_CONFIGURATION_MANAGER_INFO;
+
+/** A structure used to describe the ACPI table generators to be invoked.
+
+  The AcpiTableData member of this structure may be used to directly provide
+  the binary ACPI table data which is required by the following standard
+  generators:
+- RAW
+- DSDT
+- SSDT
+
+  Providing the ACPI table data is optional and depends on the generator
+  that is being invoked. If unused, set AcpiTableData to NULL.
+*/
+typedef struct CmAStdObjAcpiTableInfo {
+  /// The signature of the ACPI Table to be installed
+  UINT32 AcpiTableSignature;
+
+  /// The ACPI table revision
+  UINT32 AcpiTableRevision;
+
+  /// The ACPI Table Generator ID
+  ACPI_TABLE_GENERATOR_IDTableGeneratorId;
+
+  /// Optional pointer to the ACPI table data
+  EFI_ACPI_DESCRIPTION_HEADER  * AcpiTableData;
+
+} CM_STD_OBJ_ACPI_TABLE_INFO;
+
+/** A structure used to describe the SMBIOS table generators to be invoked.
+
+  The SmbiosTableData member of this structure is used to provide
+  the SMBIOS table data which is required by the following standard
+  generator(s):
+- RAW
+
+  Providing the SMBIOS table data is optional and depends on the
+  generator that is being invoked. If unused, set the SmbiosTableData
+  to NULL.
+*/
+typedef struct CmStdObjSmbiosTableInfo {
+  /// The SMBIOS Table Generator ID
+  SMBIOS_TABLE_GENERATOR_ID   TableGeneratorId;
+
+  /// Optional pointer to the SMBIOS table data
+  SMBIOS_STRUCTURE   * SmbiosTableData;
+} CM_STD_OBJ_SMBIOS_TABLE_INFO;
+
+#pragma pack()
+
+#endif // STANDARD_NAMESPACE_OBJECTS_H_
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing li

Re: [edk2] [PATCH edk2-platforms v1 5/6] Platform/ARM: Add OEM CPU generator for FVP

2019-01-22 Thread Sami Mujawar
Hi Ard,

Please see my response inline.

Regards,

Sami Mujawar
-Original Message-
From: Ard Biesheuvel  
Sent: 22 January 2019 09:22 AM
To: Sami Mujawar 
Cc: edk2-devel@lists.01.org; Arvind Chauhan ; Daniil 
Egranov ; Thomas Abraham ; Leif 
Lindholm ; Kinney, Michael D 
; Alexei Fedorov ; Matteo 
Carlini ; Stephanie Hughes-Fitt 
; nd 
Subject: Re: [PATCH edk2-platforms v1 5/6] Platform/ARM: Add OEM CPU generator 
for FVP

On Fri, 21 Dec 2018 at 19:14, Sami Mujawar  wrote:
>
> Hi Ard,
>
> Please see my response inline.
>
> Regards,
>
> Sami Mujawar
>
> -Original Message-
> From: Ard Biesheuvel 
> Sent: 21 December 2018 05:08 PM
> To: Sami Mujawar 
> Cc: edk2-devel@lists.01.org; Arvind Chauhan ; 
> Daniil Egranov ; Thomas Abraham 
> ; Leif Lindholm ; 
> Kinney, Michael D ; Alexei Fedorov 
> ; Matteo Carlini ; 
> Stephanie Hughes-Fitt ; nd 
> Subject: Re: [PATCH edk2-platforms v1 5/6] Platform/ARM: Add OEM CPU 
> generator for FVP
>
> Hi Sami,
>
> On Fri, 21 Dec 2018 at 18:01, Sami Mujawar  wrote:
> >
> > Add support for dynamic generation of ACPI CPU device information.
> > This generator uses the compiled data from a template asl file and 
> > patches it at runtime to generate the CPU information based on the 
> > number of CPUs and their ACPI UID. This patched data is then 
> > installed as a SSDT table.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Sami Mujawar 
> > ---
> >  
> > Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuASLLib.inf
> >|  27 ++
> >  
> > Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuGeneratorLib.inf
> >  |  42 ++
> >  
> > Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/OemCpuGenerator.c
> >   | 403 
> >  
> > Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/OemCpuGenerator.h
> >   |  23 ++
> >  
> > Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/SsdtCpuTemplate.asl
> > |  25 ++
> >  5 files changed, 520 insertions(+)
> >
> ...
> > diff --git
> > a/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorL
> > ib
> > /OemCpuGenerator.c
> > b/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorL
> > ib
> > /OemCpuGenerator.c
> > new file mode 100644
> > index
> > ..d544244bfbd566c128b57d80b0
> > c8
> > c2bdc0cca374
> > --- /dev/null
> > +++ b/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGenera
> > +++ to
> > +++ rLib/OemCpuGenerator.c
> > @@ -0,0 +1,403 @@
> > +/** @file
> > +  OEM CPU Table Generator
> > +
> > +  Copyright (c) 2018, ARM Limited. All rights reserved.
> > +  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 
> > +#include 
> > +#include 
> > +#include 
> > +#include  #include 
> > +
> > +#include 
> > +
> > +// Module specific include files.
> > +#include 
> > +#include  #include 
> > + #include  
> > +#include 
> > +#include 
> > +
> > +#include 
> > +
> > +// AML Code Include files generated by iASL Compiler #include 
> > +
> > +
> > +// AML Code offsets file generated by iASL Compiler #include 
> > +
> > +
>
> Apologies if I should have spotted this before, but this is a no-go.
> We are relying on intermediate output of some version of the IASL compiler 
> here, which [AFAIK] is not formally specified or documented.
> We cannot base an elaborate framework like DynamicTables on this.
>
> I guess this only affects DSDT/SSDT generation, right?
> [SAMI] Yes. The last 2 patches in this series add this feature. We probably 
> need more discussion on this topic.
> Until then can we proceed with review of the remaining patches, or should I 
> submit a new patch series that drops the last 2 patches?
>

Could you look into whether EFI's ACPI SDT protocol has what you need to 
manipulate AML at runtime?
[SAMI] Thank you for pointing me to the EFI_ACPI_SDT_PROTOCOL. I will 
experiment with this and let you know.
I am going to resubmit the patch series as I have done some changes based on 
internal feedback. I will drop this patch [5/6] and the next when I resubmit.

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms v2 3/6] Platform/ARM: Configuration Manager for FVP

2019-01-02 Thread Sami Mujawar
The dynamic tables framework utilizes the configuration manager
protocol to get the platform specific information required for
building the firmware tables.

The configuration manager is a platform specific component that
collates the platform hardware information and builds an abstract
platform configuration repository. The configuration manager also
implements the configuration manager protocol which returns the
hardware information requested by the table generators.

This patch implements the configuration manager support for the
FVP platform.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
The changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/365_dynamic_tables_framework_v2

Notes:
v2:
- Fixed flags for GT Timer Frame1 as non-secure [SAMI]

 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
   |  31 +
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 610 
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
  | 172 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 |  79 +++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h
  |  94 +++
 Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
   |  73 +++
 
Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
   |  35 ++
 7 files changed, 1094 insertions(+)

diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc
new file mode 100644
index 
..788b145b273fd49da7fb5d238491aef956977e61
--- /dev/null
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc
@@ -0,0 +1,31 @@
+## @file
+#  dsc include file for Configuration Manager
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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]
+
+[BuildOptions]
+# Required for pre-processing ASL files that include ArmPlatform.h
+  *_*_*_ASLPP_FLAGS= $(PLATFORM_FLAGS)
+
+[LibraryClasses.common]
+
+[Components.common]
+  # Configuration Manager
+  
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 {
+
+# Platform ASL Tables
+
PlatformAslTablesLib|Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
+  
+   *_*_*_PLATFORM_FLAGS = 
-I$(BIN_DIR)/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib/OUTPUT
+  }
diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
new file mode 100644
index 
..d7f64a53e47c6e09da9d21a4bf3d33e2d9294af2
--- /dev/null
+++ 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -0,0 +1,610 @@
+/** @file
+  Configuration Manager Dxe
+
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "ConfigurationManager.h"
+#include "Platform.h"
+
+// AML Code Include files generated by iASL Compiler
+#include 
+
+/** The platform configuration repository information.
+*/
+STATIC
+EDKII_PLATFORM_REPOSITORY_INFO VExpressPlatRepositoryInfo = {
+  /// Configuration Manager information
+  { CONFIGURATION_MANAGER_REVISION, CFG_MGR_OEM_ID },
+
+  // ACPI Table List
+  {
+// FADT Table
+{
+  EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
+  CREATE_STD_ACPI_TABLE_GEN_I

Re: [edk2] [PATCH edk2-platforms v1 3/6] Platform/ARM: Configuration Manager for FVP

2019-01-02 Thread Sami Mujawar
Hi Ard, Leif,

Please ignore this patch in the series. I am sending an updated (v2) patch that 
configures the GT Timer Frame 1 as non-secure. 

Regards,

Sami Mujawar

-Original Message-
From: edk2-devel  On Behalf Of Sami Mujawar
Sent: 21 December 2018 05:00 PM
To: edk2-devel@lists.01.org
Cc: nd ; Arvind Chauhan ; Alexei Fedorov 
; Stephanie Hughes-Fitt 
; michael.d.kin...@intel.com
Subject: [edk2] [PATCH edk2-platforms v1 3/6] Platform/ARM: Configuration 
Manager for FVP

The dynamic tables framework utilizes the configuration manager protocol to get 
the platform specific information required for building the firmware tables.

The configuration manager is a platform specific component that collates the 
platform hardware information and builds an abstract platform configuration 
repository. The configuration manager also implements the configuration manager 
protocol which returns the hardware information requested by the table 
generators.

This patch implements the configuration manager support for the FVP platform.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
   |  31 +
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 610 
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
  | 172 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 |  79 +++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h
  |  91 +++
 Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
   |  73 +++
 
Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
   |  35 ++
 7 files changed, 1091 insertions(+)

diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc
new file mode 100644
index 
..788b145b273fd49da7fb5d238491aef956977e61
--- /dev/null
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager
+++ .dsc.inc
@@ -0,0 +1,31 @@
+## @file
+#  dsc include file for Configuration Manager # #  Copyright (c) 2017 - 
+2018, ARM Limited. All rights reserved.
+#
+#  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]
+
+[BuildOptions]
+# Required for pre-processing ASL files that include ArmPlatform.h
+  *_*_*_ASLPP_FLAGS= $(PLATFORM_FLAGS)
+
+[LibraryClasses.common]
+
+[Components.common]
+  # Configuration Manager
+  
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 {
+
+# Platform ASL Tables
+
+PlatformAslTablesLib|Platform/ARM/VExpressPkg/ConfigurationManager/Plat
+formASLTablesLib/PlatformASLTablesLib.inf
+  
+   *_*_*_PLATFORM_FLAGS = 
+-I$(BIN_DIR)/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLT
+ablesLib/PlatformASLTablesLib/OUTPUT
+  }
diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
new file mode 100644
index 
..4f79f91ef32cad4a1967d969cb39f801c3593089
--- /dev/null
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager
+++ Dxe/ConfigurationManager.c
@@ -0,0 +1,610 @@
+/** @file
+  Configuration Manager Dxe
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "ConfigurationManager.h"
+#include "Platform.h"
+
+// AML Code Include files generated by iASL Compiler #include 
+
+
+/** The platform configuration repository information.
+*/

Re: [edk2] [PATCH edk2-platforms v1 5/6] Platform/ARM: Add OEM CPU generator for FVP

2018-12-21 Thread Sami Mujawar
Hi Ard,

Please see my response inline.

Regards,

Sami Mujawar

-Original Message-
From: Ard Biesheuvel  
Sent: 21 December 2018 05:08 PM
To: Sami Mujawar 
Cc: edk2-devel@lists.01.org; Arvind Chauhan ; Daniil 
Egranov ; Thomas Abraham ; Leif 
Lindholm ; Kinney, Michael D 
; Alexei Fedorov ; Matteo 
Carlini ; Stephanie Hughes-Fitt 
; nd 
Subject: Re: [PATCH edk2-platforms v1 5/6] Platform/ARM: Add OEM CPU generator 
for FVP

Hi Sami,

On Fri, 21 Dec 2018 at 18:01, Sami Mujawar  wrote:
>
> Add support for dynamic generation of ACPI CPU device information.
> This generator uses the compiled data from a template asl file and 
> patches it at runtime to generate the CPU information based on the 
> number of CPUs and their ACPI UID. This patched data is then installed 
> as a SSDT table.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Sami Mujawar 
> ---
>  
> Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuASLLib.inf
>|  27 ++
>  
> Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuGeneratorLib.inf
>  |  42 ++
>  
> Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/OemCpuGenerator.c
>   | 403 
>  
> Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/OemCpuGenerator.h
>   |  23 ++
>  
> Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/SsdtCpuTemplate.asl
> |  25 ++
>  5 files changed, 520 insertions(+)
>
...
> diff --git 
> a/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib
> /OemCpuGenerator.c 
> b/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib
> /OemCpuGenerator.c
> new file mode 100644
> index 
> ..d544244bfbd566c128b57d80b0c8
> c2bdc0cca374
> --- /dev/null
> +++ b/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGenerato
> +++ rLib/OemCpuGenerator.c
> @@ -0,0 +1,403 @@
> +/** @file
> +  OEM CPU Table Generator
> +
> +  Copyright (c) 2018, ARM Limited. All rights reserved.
> +  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 
> +#include 
> +#include 
> +#include 
> +#include  #include 
> +
> +#include 
> +
> +// Module specific include files.
> +#include 
> +#include  #include 
> + #include  
> +#include 
> +#include 
> +
> +#include 
> +
> +// AML Code Include files generated by iASL Compiler #include 
> +
> +
> +// AML Code offsets file generated by iASL Compiler #include 
> +
> +

Apologies if I should have spotted this before, but this is a no-go.
We are relying on intermediate output of some version of the IASL compiler 
here, which [AFAIK] is not formally specified or documented.
We cannot base an elaborate framework like DynamicTables on this.

I guess this only affects DSDT/SSDT generation, right?
[SAMI] Yes. The last 2 patches in this series add this feature. We probably 
need more discussion on this topic.
Until then can we proceed with review of the remaining patches, or should I 
submit a new patch series that drops the last 2 patches?

> +STATIC EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL  * mTableFactoryProtocol 
> += NULL;
> +
> +/** OEM CPU Generator
> +
> +Requirements:
> +  The following Configuration Manager Object(s) are required by
> +  this Generator:
> +  - EArmObjGicCInfo
> +*/
> +
> +/** This macro expands to a function that retrieves the GIC
> +CPU interface Information from the Configuration Manager.
> +*/
> +GET_OBJECT_LIST (
> +  EObjNameSpaceArm,
> +  EArmObjGicCInfo,
> +  CM_ARM_GICC_INFO
> +  );
> +
> +STATIC
> +CHAR8
> +AsciiFromHex (
> +  UINTN x
> +  )
> +{
> +  if (x < 10) {
> +return x + '0';
> +  }
> +
> +  if (x < 16) {
> +return x - 10 + 'A';
> +  }
> +
> +  ASSERT (FALSE);
> +  return -1;
> +}
> +
> +/** Free any resources allocated for constructing the tables.
> +
> +  @param [in]  This   Pointer to the ACPI table generator.
> +  @param [in]  AcpiTableInfo  Pointer to the ACPI Table Info.
> +  @param [in]  CfgMgrProtocol Pointer to the Configuration Manager
> +  Protocol Interface.
> +  @param [in, out] Table

[edk2] [PATCH edk2-platforms v1 1/6] Platform/ARM: Configuration Manager for Juno

2018-12-21 Thread Sami Mujawar
The dynamic tables framework utilizes the configuration manager
protocol to get the platform specific information required for
building the firmware tables.

The configuration manager is a platform specific component that
collates the platform hardware information and builds an abstract
platform configuration repository. The configuration manager also
implements the configuration manager protocol which returns the
hardware information requested by the table generators.

This patch implements the configuration manager support for the
Juno platform.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
   |  29 +
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 593 
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
  | 156 +
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 |  86 +++
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h   
   |  65 +++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
   | 276 +
 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
   |  45 ++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtJunoUsb.asl 
   | 122 
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtPci.asl 
   | 218 +++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtUart.asl
   |  48 ++
 10 files changed, 1638 insertions(+)

diff --git 
a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
new file mode 100644
index 
..a5fe869483f4a005942006c8ba43d3a5aabad5bb
--- /dev/null
+++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
@@ -0,0 +1,29 @@
+## @file
+#  dsc include file for Configuration Manager
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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]
+
+[BuildOptions]
+
+[LibraryClasses.common]
+
+[Components.common]
+  # Configuration Manager
+  
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 {
+
+# Platform ASL Tables
+
PlatformAslTablesLib|Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
+  
+   *_*_*_PLATFORM_FLAGS = 
-I$(BIN_DIR)/Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib/OUTPUT
+  }
diff --git 
a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
new file mode 100644
index 
..4dc87352888274273a3334f113c5d34beaf3abb2
--- /dev/null
+++ 
b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -0,0 +1,593 @@
+/** @file
+  Configuration Manager Dxe
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "ConfigurationManager.h"
+#include "Platform.h"
+
+// AML Code Include files generated by iASL Compiler
+#include 
+#include 
+#include 
+#include 
+
+/** The platform configuration repository information.
+*/
+STATIC
+EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformRepositoryInfo = {
+  /// Configuration Manager information
+  { CONFIGURATION_MANAGER_REVISION, CFG_MGR_OEM_ID },
+
+  // ACPI Table List
+  {
+// FADT Table
+{
+  EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
+  CREATE_STD_ACPI_TABLE_GEN_ID (ESTD_ACPI_TABLE_ID

[edk2] [PATCH edk2-platforms v1 3/6] Platform/ARM: Configuration Manager for FVP

2018-12-21 Thread Sami Mujawar
The dynamic tables framework utilizes the configuration manager
protocol to get the platform specific information required for
building the firmware tables.

The configuration manager is a platform specific component that
collates the platform hardware information and builds an abstract
platform configuration repository. The configuration manager also
implements the configuration manager protocol which returns the
hardware information requested by the table generators.

This patch implements the configuration manager support for the
FVP platform.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
   |  31 +
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 610 
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
  | 172 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 |  79 +++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h
  |  91 +++
 Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
   |  73 +++
 
Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
   |  35 ++
 7 files changed, 1091 insertions(+)

diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc
new file mode 100644
index 
..788b145b273fd49da7fb5d238491aef956977e61
--- /dev/null
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc
@@ -0,0 +1,31 @@
+## @file
+#  dsc include file for Configuration Manager
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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]
+
+[BuildOptions]
+# Required for pre-processing ASL files that include ArmPlatform.h
+  *_*_*_ASLPP_FLAGS= $(PLATFORM_FLAGS)
+
+[LibraryClasses.common]
+
+[Components.common]
+  # Configuration Manager
+  
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 {
+
+# Platform ASL Tables
+
PlatformAslTablesLib|Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
+  
+   *_*_*_PLATFORM_FLAGS = 
-I$(BIN_DIR)/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib/OUTPUT
+  }
diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
new file mode 100644
index 
..4f79f91ef32cad4a1967d969cb39f801c3593089
--- /dev/null
+++ 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -0,0 +1,610 @@
+/** @file
+  Configuration Manager Dxe
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "ConfigurationManager.h"
+#include "Platform.h"
+
+// AML Code Include files generated by iASL Compiler
+#include 
+
+/** The platform configuration repository information.
+*/
+STATIC
+EDKII_PLATFORM_REPOSITORY_INFO VExpressPlatRepositoryInfo = {
+  /// Configuration Manager information
+  { CONFIGURATION_MANAGER_REVISION, CFG_MGR_OEM_ID },
+
+  // ACPI Table List
+  {
+// FADT Table
+{
+  EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
+  CREATE_STD_ACPI_TABLE_GEN_ID (ESTD_ACPI_TABLE_ID_FADT),
+  NULL
+},
+// GTDT Table
+{
+  EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE,
+  CREATE_STD_ACPI_TABLE_GEN_ID (ESTD_ACPI_TABLE_ID_GTDT)

[edk2] [PATCH edk2-platforms v1 5/6] Platform/ARM: Add OEM CPU generator for FVP

2018-12-21 Thread Sami Mujawar
Add support for dynamic generation of ACPI CPU device information.
This generator uses the compiled data from a template asl file and
patches it at runtime to generate the CPU information based on the
number of CPUs and their ACPI UID. This patched data is then
installed as a SSDT table.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 
Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuASLLib.inf
   |  27 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuGeneratorLib.inf
 |  42 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/OemCpuGenerator.c
  | 403 
 
Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/OemCpuGenerator.h
  |  23 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/SsdtCpuTemplate.asl
|  25 ++
 5 files changed, 520 insertions(+)

diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuASLLib.inf
 
b/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuASLLib.inf
new file mode 100644
index 
..faa7183b89660435ac50d91df00ea56a28a7a11f
--- /dev/null
+++ 
b/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuASLLib.inf
@@ -0,0 +1,27 @@
+## @file
+#  OEM Cpu Table Generator
+#
+#  Copyright (c) 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x0001001B
+  BASE_NAME  = AcpiOemCpuASLLibArm
+  FILE_GUID  = 5392CA66-82AE-40E3-B130-3DD118421E87
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = AcpiOemCpuASLLibArm|DXE_DRIVER
+
+[Sources]
+  SsdtCpuTemplate.asl
+
+[Packages]
+  MdePkg/MdePkg.dec
diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuGeneratorLib.inf
 
b/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuGeneratorLib.inf
new file mode 100644
index 
..2c73a53cbf813fd0a4072b6473c9bddd56a88aaa
--- /dev/null
+++ 
b/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuGeneratorLib.inf
@@ -0,0 +1,42 @@
+## @file
+#  OEM Cpu Table Generator
+#
+#  Copyright (c) 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x0001001B
+  BASE_NAME  = AcpiOemCpuGeneratorLibArm
+  FILE_GUID  = 5062BCB8-80C9-4971-9AD4-2A159554C318
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiOemCpuGeneratorLibConstructor
+  DESTRUCTOR = AcpiOemCpuGeneratorLibDestructor
+
+[Sources]
+  OemCpuGenerator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+
+[Pcd]
+
+[Protocols]
+  gEdkiiDynamicTableFactoryProtocolGuid
+
+[Guids]
diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/OemCpuGenerator.c
 
b/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/OemCpuGenerator.c
new file mode 100644
index 
..d544244bfbd566c128b57d80b0c8c2bdc0cca374
--- /dev/null
+++ 
b/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/OemCpuGenerator.c
@@ -0,0 +1,403 @@
+/** @file
+  OEM CPU Table Generator
+
+  Copyright (c) 2018, ARM Limited. All rights reserved.
+  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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+

[edk2] [PATCH edk2-platforms v1 2/6] Platform/ARM: Dynamic Tables support for Juno

2018-12-21 Thread Sami Mujawar
The dynamic tables framework uses the platform hardware
information described by the configuration manager to
generate ACPI tables. This support is configurable and
can be enabled using the DYNAMIC_TABLES_FRAMEWORK build
option.

When DYNAMIC_TABLES_FRAMEWORK is defined, ACPI tables are
generated and installed by the dynamic table framework.
Therefore, installation of ACPI tables from the Firmware
Volume (FV) is disabled by this option.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 Platform/ARM/JunoPkg/ArmJuno.dsc | 12 +++-
 Platform/ARM/JunoPkg/ArmJuno.fdf | 12 
 Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c |  9 +++--
 3 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index 
3edde5b65be47fe14988940ce2ef31a60f38dd31..a355c1e1d983339b3b461eddbf60e4a31888a361
 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -33,6 +33,11 @@ [Defines]
 # On RTSM, most peripherals are VExpress Motherboard peripherals
 !include Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
 
+!ifdef DYNAMIC_TABLES_FRAMEWORK
+!include DynamicTablesPkg/DynamicTables.dsc.inc
+!include Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
+!endif
+
 [LibraryClasses.common]
   ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
   ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
@@ -79,6 +84,10 @@ [LibraryClasses.common.UEFI_DRIVER, 
LibraryClasses.common.UEFI_APPLICATION, Libr
 [BuildOptions]
   GCC:*_*_ARM_PLATFORM_FLAGS = -march=armv8-a
 
+!ifdef DYNAMIC_TABLES_FRAMEWORK
+  *_*_*_PLATFORM_FLAGS = -DDYNAMIC_TABLES_FRAMEWORK
+!endif
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
@@ -266,8 +275,9 @@ [Components.common]
   # ACPI Support
   #
   MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
+!ifndef DYNAMIC_TABLES_FRAMEWORK
   Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
-
+!endif
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 
   ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
diff --git a/Platform/ARM/JunoPkg/ArmJuno.fdf b/Platform/ARM/JunoPkg/ArmJuno.fdf
index 
0a8b636d0ebd10a7bceb3cbe6ca1bed8688da1a6..b1295a579b094db1433898589a282702ec854bfb
 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.fdf
+++ b/Platform/ARM/JunoPkg/ArmJuno.fdf
@@ -114,7 +114,17 @@ [FV.FvMain]
   # ACPI Support
   #
   INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
+!ifndef DYNAMIC_TABLES_FRAMEWORK
   INF RuleOverride=ACPITABLE Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
+!else
+  # Configuration Manager
+  INF 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+
+  #
+  # Dynamic Table fdf
+  #
+  !include DynamicTablesPkg/DynamicTables.fdf.inc
+!endif
 
   INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 
@@ -378,8 +388,10 @@ [Rule.Common.UEFI_APPLICATION.BINARY]
 VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
   }
 
+!ifndef DYNAMIC_TABLES_FRAMEWORK
 [Rule.Common.USER_DEFINED.ACPITABLE]
   FILE FREEFORM = $(NAMED_GUID) {
 RAW ACPI   |.acpi
 RAW ASL|.aml
   }
+!endif
diff --git a/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c 
b/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
index 
18491c7378523f365644658c270de95e711c5ac1..0a42d21d4e9b60824f1d313a4d5ad9e4bc6db3aa
 100644
--- a/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
+++ b/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2013-2015, ARM Limited. All rights reserved.
+*  Copyright (c) 2013-2017, ARM Limited. All rights reserved.
 *
 *  This program and the accompanying materials
 *  are licensed and made available under the terms and conditions of the BSD 
License
@@ -33,9 +33,10 @@
 #include 
 #include 
 
-
+#ifndef DYNAMIC_TABLES_FRAMEWORK
 // This GUID must match the FILE_GUID in 
ArmPlatformPkg/ArmJunoPkg/AcpiTables/AcpiTables.inf
 STATIC CONST EFI_GUID mJunoAcpiTableFile = { 0xa1dd808e, 0x1e95, 0x4399, { 
0xab, 0xc0, 0x65, 0x3c, 0x82, 0xe8, 0x53, 0x0c } };
+#endif
 
 typedef struct {
   ACPI_HID_DEVICE_PATH  AcpiDevicePath;
@@ -487,11 +488,13 @@ ArmJunoEntryPoint (
 
   GetJunoRevision(JunoRevision);
 
+#ifndef DYNAMIC_TABLES_FRAMEWORK
   //
   // Try to install the ACPI Tables
   //
   Status = LocateAndInstallAcpiFromFv ();
   ASSERT_EFI_ERROR (Status);
+#endif
 
   //
   // Setup R1/R2 options if not already done.
@@ -516,6 +519,7 @@ ArmJunoEntryPoint (
 
 );
 
+#ifndef DYNAMIC_TABLES_FRAMEWORK
 // Declare the related ACPI Tables
 EfiCreateProtocolNotifyEvent (
 ,
@@ -524,6 +528,7 @@ ArmJunoEntryPoint (
 NULL,
 
 );
+#endif
   }
 
   //
-- 
'Gui

[edk2] [PATCH edk2-platforms v1 4/6] Platform/ARM: Dynamic Tables support for FVP

2018-12-21 Thread Sami Mujawar
The dynamic tables framework uses the platform hardware
information described by the configuration manager to
generate ACPI tables. This support is configurable and
can be enabled using the DYNAMIC_TABLES_FRAMEWORK build
option.

When DYNAMIC_TABLES_FRAMEWORK is defined, ACPI tables are
generated and installed by the dynamic table framework.
Therefore, installation of ACPI tables from the Firmware
Volume (FV) is disabled by this option.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 15 +++
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf | 16 ++--
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc 
b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
index 
0941edeaf53c236cd69fbb54e47df9bd407a56d8..1cf2ebb58f99899864e3bc90b7a22a75ea9fc29b
 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
@@ -38,6 +38,10 @@ [Defines]
   DT_SUPPORT = FALSE
 
 !include Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+!ifdef DYNAMIC_TABLES_FRAMEWORK
+  !include DynamicTablesPkg/DynamicTables.dsc.inc
+  !include 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc
+!endif
 
 [LibraryClasses.common]
   ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
@@ -128,6 +132,15 @@ [PcdsFixedAtBuild.common]
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x1c0a
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultReceiveFifoDepth|0
+  gArmPlatformTokenSpaceGuid.PL011UartInterrupt|0x25
+
+  ## PL011 Serial Debug UART (DBG2)
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase|0x1c0b
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgUartBaudRate|115200
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgUartClkInHz|2400
+
+  # SBSA Generic Watchdog
+  gArmTokenSpaceGuid.PcdGenericWatchdogEl2IntrNum|59
 
   ## PL031 RealTimeClock
   gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x1C17
@@ -257,8 +270,10 @@ [Components.common]
 !endif
   }
 
+!ifndef DYNAMIC_TABLES_FRAMEWORK
   MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
   Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf
+!endif
 
   ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf 
b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf
index 
c3e573e1bb4fcf7889fefec4d6c919b118b76653..fc998ec746913a98ac6f62c1109b809bb530fb16
 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2011 - 2015, ARM Limited. All rights reserved.
+#  Copyright (c) 2011 - 2018, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -97,9 +97,19 @@ [FV.FvMain]
 
   # ACPI Support
   #
-  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
   INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
+!ifndef DYNAMIC_TABLES_FRAMEWORK
+  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
   INF RuleOverride=ACPITABLE Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf
+!else
+  # Configuration Manager
+  INF 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+
+  #
+  # Dynamic Table fdf
+  #
+  !include DynamicTablesPkg/DynamicTables.fdf.inc
+!endif
 
   #
   # Multiple Console IO support
@@ -319,8 +329,10 @@ [Rule.Common.UEFI_APPLICATION.BINARY]
 VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
   }
 
+!ifndef DYNAMIC_TABLES_FRAMEWORK
 [Rule.Common.USER_DEFINED.ACPITABLE]
   FILE FREEFORM = $(NAMED_GUID) {
 RAW ACPI   |.acpi
 RAW ASL|.aml
   }
+!endif
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 13/22] DynamicTablesPkg: Dynamic Table Factory Dxe

2018-12-21 Thread Sami Mujawar
The dynamic table factory dxe implements the dynamic table
factory protocol. It also implements the ACPI, SMBIOS and
DT table factories. The table generators register themselves
with the respective table factories and the factories are
responsible for instantiating instances of the generators
to build the firmware tables.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 
DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/AcpiTableFactory/AcpiTableFactory.c
 | 226 
 
DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DeviceTreeTableFactory/DeviceTreeTableFactory.c
 | 225 +++
 DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactory.h  
 | 125 +++
 DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.c   
 |  90 
 DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf 
 |  60 ++
 
DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/SmbiosTableFactory/SmbiosTableFactory.c
 | 226 
 DynamicTablesPkg/DynamicTables.dsc.inc 
 |   6 +
 DynamicTablesPkg/{DynamicTables.dsc.inc => DynamicTables.fdf.inc}  
 |  10 +-
 DynamicTablesPkg/DynamicTablesPkg.dec  
 |  11 +
 9 files changed, 974 insertions(+), 5 deletions(-)

diff --git 
a/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/AcpiTableFactory/AcpiTableFactory.c
 
b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/AcpiTableFactory/AcpiTableFactory.c
new file mode 100644
index 
..f60d9f495150e1a2876eb1fa519ac6b6d16a421b
--- /dev/null
+++ 
b/DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/AcpiTableFactory/AcpiTableFactory.c
@@ -0,0 +1,226 @@
+/** @file
+  ACPI Table Factory
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Std - Standard
+**/
+
+#include 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+
+#include "DynamicTableFactory.h"
+
+extern EDKII_DYNAMIC_TABLE_FACTORY_INFO TableFactoryInfo;
+
+/** Return a pointer to the ACPI table generator.
+
+  @param [in]  This Pointer to the Dynamic Table Factory Protocol.
+  @param [in]  GeneratorId  The ACPI table generator ID for the
+requested generator.
+  @param [out] GeneratorPointer to the requested ACPI table
+generator.
+
+  @retval EFI_SUCCESS   Success.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND The requested generator is not found
+in the list of registered generators.
+**/
+EFI_STATUS
+EFIAPI
+GetAcpiTableGenerator (
+  IN  CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL  * CONST This,
+  IN  CONST ACPI_TABLE_GENERATOR_ID   GeneratorId,
+  OUT CONST ACPI_TABLE_GENERATOR ** CONST Generator
+  )
+{
+  UINT16   TableId;
+  EDKII_DYNAMIC_TABLE_FACTORY_INFO * FactoryInfo;
+
+  ASSERT (This != NULL);
+
+  FactoryInfo = This->TableFactoryInfo;
+
+  if (Generator == NULL) {
+DEBUG ((DEBUG_ERROR, "ERROR: Invalid Generator pointer\n"));
+return EFI_INVALID_PARAMETER;
+  }
+
+  if (!IS_GENERATOR_TYPE_ACPI (GeneratorId)) {
+DEBUG ((DEBUG_ERROR, "ERROR: Generator Type is not ACPI\n"));
+return EFI_INVALID_PARAMETER;
+  }
+
+  *Generator = NULL;
+  TableId = GET_TABLE_ID (GeneratorId);
+  if (IS_GENERATOR_NAMESPACE_STD (GeneratorId)) {
+if (TableId >= (ESTD_ACPI_TABLE_ID_MAX)) {
+  ASSERT (TableId < (ESTD_ACPI_TABLE_ID_MAX));
+  return EFI_INVALID_PARAMETER;
+}
+if (FactoryInfo->StdAcpiTableGeneratorList[TableId] != NULL) {
+  *Generator = FactoryInfo->StdAcpiTableGeneratorList[TableId];
+} else {
+  return EFI_NOT_FOUND;
+}
+  } else {
+if (TableId > FixedPcdGet16 (PcdMaxCustomACPIGenerators)) {
+  ASSERT (TableId <= FixedPcdGet16 (PcdMaxCustomACPIGenerators));
+  return EFI_INVALID_PARAMETER;
+}
+if (FactoryInfo->CustomAcpiTableGeneratorList[TableId] != NULL) {
+  *Generator = FactoryInfo->CustomAcpiTableGeneratorList[TableId];
+} else {
+  return EFI_NOT_FOUND;
+}
+  }
+  return EFI_SUCCESS;
+}
+
+/** Register ACPI

[edk2] [PATCH v1 11/22] DynamicTablesPkg: Table Helper Library

2018-12-21 Thread Sami Mujawar
A helper library that implements common functionality
for use by table generators.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc|  20 +++
 DynamicTablesPkg/Include/Library/TableHelperLib.h |  66 

 DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c  | 164 

 DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf |  36 +
 4 files changed, 286 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
new file mode 100644
index 
..1cac3e649afebb06190fb5bf6387857437706404
--- /dev/null
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -0,0 +1,20 @@
+## @file
+#  Dsc include file for Dynamic Tables Framework.
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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]
+
+[LibraryClasses.common]
+  
TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
+
diff --git a/DynamicTablesPkg/Include/Library/TableHelperLib.h 
b/DynamicTablesPkg/Include/Library/TableHelperLib.h
new file mode 100644
index 
..f17a0b23ddfc0aea39b08acd2c874dbfe8a0749d
--- /dev/null
+++ b/DynamicTablesPkg/Include/Library/TableHelperLib.h
@@ -0,0 +1,66 @@
+/** @file
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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.
+
+**/
+
+#ifndef TABLE_HELPER_LIB_H_
+#define TABLE_HELPER_LIB_H_
+
+/** The GetCgfMgrInfo function gets the CM_STD_OBJ_CONFIGURATION_MANAGER_INFO
+object from the Configuration Manager.
+
+  @param [in]  CfgMgrProtocol Pointer to the Configuration Manager protocol
+  interface.
+  @param [out] CfgMfrInfo Pointer to the Configuration Manager Info
+  object structure.
+
+  @retval EFI_SUCCESS   The object is returned.
+  @retval EFI_INVALID_PARAMETER The Object ID is invalid.
+  @retval EFI_NOT_FOUND The requested Object is not found.
+  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
+Manager is less than the Object size.
+**/
+EFI_STATUS
+EFIAPI
+GetCgfMgrInfo (
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST  CfgMgrProtocol,
+  OUT   CM_STD_OBJ_CONFIGURATION_MANAGER_INFO**CfgMfrInfo
+  );
+
+/** The AddAcpiHeader function updates the ACPI header structure. It uses the
+ACPI table Generator and the Configuration Manager protocol to obtain the
+information required for constructing the header.
+
+  @param [in] CfgMgrProtocol Pointer to the Configuration Manager
+ protocol interface.
+  @param [in] Generator  Pointer to the ACPI table Generator.
+  @param [in,out] AcpiHeader Pointer to the ACPI table header to be
+ updated.
+  @param [in] Length Length of the ACPI table.
+
+  @retval EFI_SUCCESS   The ACPI table is updated successfully.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND The required object information is not found.
+  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
+Manager is less than the Object size for the
+requested object.
+**/
+EFI_STATUS
+EFIAPI
+AddAcpiHeader (
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST CfgMgrProtocol,
+  IN  CONST ACPI_TABLE_GENERATOR  * CONST Generator,
+  IN OUT  EFI_ACPI_DESCRIPTION_HEADER * CONST AcpiHeader,
+  IN  CONST UINT32Length
+  );
+
+#endif // TABLE_HELPER_LIB_H_
diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c 
b/DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c
new file mode 100644
index 
..5a7a44f20690d93891384024b3ac197e37a470cc
--- /dev/null
+++ b/DynamicTabl

[edk2] [PATCH v1 12/22] DynamicTablesPkg: Dynamic Table Factory Protocol

2018-12-21 Thread Sami Mujawar
This patch introduces the dynamic table factory protocol
that provides an interface to register and retrieve
registered generators.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTablesPkg.dec   |   3 +
 DynamicTablesPkg/Include/Protocol/DynamicTableFactoryProtocol.h | 269 

 2 files changed, 272 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTablesPkg.dec 
b/DynamicTablesPkg/DynamicTablesPkg.dec
index 
e5e731085a721f5f2a0129b4678dedbb0c7b985a..3137c14247920974082bd74173cab4e7ac02b3f7
 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dec
+++ b/DynamicTablesPkg/DynamicTablesPkg.dec
@@ -27,3 +27,6 @@ [Protocols]
   # Configuration Manager Protocol GUID
   gEdkiiConfigurationManagerProtocolGuid = { 0xd85a4835, 0x5a82, 0x4894, { 
0xac, 0x2, 0x70, 0x6f, 0x43, 0xd5, 0x97, 0x8e } }
 
+  # Dynamic Table Factory Protocol GUID
+  gEdkiiDynamicTableFactoryProtocolGuid = { 0x91d1e327, 0xfe5a, 0x49b8, { 
0xab, 0x65, 0xe, 0xce, 0x2d, 0xdb, 0x45, 0xec } }
+
diff --git a/DynamicTablesPkg/Include/Protocol/DynamicTableFactoryProtocol.h 
b/DynamicTablesPkg/Include/Protocol/DynamicTableFactoryProtocol.h
new file mode 100644
index 
..55d62c9e7244c1cca35aaa6c7e3b1dbf9125c3b5
--- /dev/null
+++ b/DynamicTablesPkg/Include/Protocol/DynamicTableFactoryProtocol.h
@@ -0,0 +1,269 @@
+/** @file
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- ACPI   - Advanced Configuration and Power Interface
+- SMBIOS - System Management BIOS
+- DT - Device Tree
+**/
+
+#ifndef DYNAMIC_TABLE_FACTORY_PROTOCOL_H_
+#define DYNAMIC_TABLE_FACTORY_PROTOCOL_H_
+
+#include 
+#include 
+#include 
+
+/** This macro defines the Dynamic Table Factory Protocol GUID.
+
+  GUID: {91D1E327-FE5A-49B8-AB65-0ECE2DDB45EC}
+*/
+#define EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL_GUID   \
+  { 0x91d1e327, 0xfe5a, 0x49b8, \
+{ 0xab, 0x65, 0xe, 0xce, 0x2d, 0xdb, 0x45, 0xec }   \
+  };
+
+/** This macro defines the Configuration Manager Protocol Revision.
+*/
+#define EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL_REVISION  CREATE_REVISION (1, 0)
+
+#pragma pack(1)
+
+/**
+  Forward declarations:
+*/
+typedef struct DynamicTableFactoryProtocol 
EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL;
+typedef struct DynamicTableFactoryInfo EDKII_DYNAMIC_TABLE_FACTORY_INFO;
+
+/** Return a pointer to the ACPI table generator.
+
+  @param [in]  This   Pointer to the Dynamic Table Factory Protocol.
+  @param [in]  TableIdThe ACPI table generator ID for the
+  requested generator.
+  @param [out] Generator  Pointer to the requested ACPI table
+  generator.
+
+  @retval EFI_SUCCESS   Success.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND The requested generator is not found
+in the list of registered generators.
+**/
+typedef
+EFI_STATUS
+EFIAPI
+(EFIAPI * EDKII_DYNAMIC_TABLE_FACTORY_GET_ACPI_TABLE_GENERATOR) (
+  IN  CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL  * CONST This,
+  IN  CONST ACPI_TABLE_GENERATOR_ID   GeneratorId,
+  OUT CONST ACPI_TABLE_GENERATOR ** CONST Generator
+  );
+
+/** Registers an ACPI table generator.
+
+  @param [in]  GeneratorPointer to the ACPI table generator.
+
+  @retval EFI_SUCCESS   The Generator was registered
+successfully.
+  @retval EFI_INVALID_PARAMETER The Generator ID is invalid or
+the Generator pointer is NULL.
+  @retval EFI_ALREADY_STARTED   The Generator for the Table ID is
+already registered.
+**/
+typedef
+EFI_STATUS
+EFIAPI
+(EFIAPI * EDKII_DYNAMIC_TABLE_FACTORY_REGISTER_ACPI_TABLE_GENERATOR) (
+  IN  CONST ACPI_TABLE_GENERATOR* CONST Generator
+  );
+
+/** Deregister an ACPI table generator.
+
+  @param [in]  Generator   Pointer to the ACPI table generator.
+
+  @retval EFI_SUCCESS   Success.
+  @retval EFI_INVALID_PARAMETER The generator is invalid.
+  @retval EFI_NOT_FOUND The requested generator is not found
+in the list of registered generators.
+**/
+typedef
+EFI_STATUS
+EFIAPI
+(EFIAPI * EDKII_DYNAMIC_TABLE_FACTORY_DEREGISTER_ACPI_TABLE_GENERATOR) (
+  IN  CONST ACPI_TABLE_GENERATOR* CONST Generator
+  );
+
+/** Return

[edk2] [PATCH v1 10/22] DynamicTablesPkg: Configuration Manager Helper

2018-12-21 Thread Sami Mujawar
This patch defines a helper macro 'GET_OBJECT_LIST()' that
expands to a function that uses the configuration manager
protocol to retrieve configuration manager object(s).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/ConfigurationManagerHelper.h | 119 

 1 file changed, 119 insertions(+)

diff --git a/DynamicTablesPkg/Include/ConfigurationManagerHelper.h 
b/DynamicTablesPkg/Include/ConfigurationManagerHelper.h
new file mode 100644
index 
..0630afc5ad755a613c273bfd02cf53fefcedccc5
--- /dev/null
+++ b/DynamicTablesPkg/Include/ConfigurationManagerHelper.h
@@ -0,0 +1,119 @@
+/** @file
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+**/
+
+#ifndef CONFIGURATION_MANAGER_HELPER_H_
+#define CONFIGURATION_MANAGER_HELPER_H_
+
+/** The GET_OBJECT_LIST macro expands to a function that is used to retrieve
+an object or an object list from the Configuration Manager using the
+Configuration Manager Protocol interface.
+
+  The macro expands to a function which has the following prototype:
+
+  STATIC
+  EFI_STATUS
+  EFIAPI
+  Get (
+IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
+IN  CONST CM_OBJECT_TOKEN  Token OPTIONAL,
+OUT   Type**   List,
+OUT   UINT32   *   Count OPTIONAL
+);
+
+  Generated function parameters:
+  @param [in]  CfgMgrProtocol Pointer to the Configuration Manager protocol
+  interface.
+  @param [in]  Token  Reference token for the Object.
+  @param [out] List   Pointer to the Object list.
+  @param [out] Count  Count of the objects returned in the list.
+
+  Macro Parameters:
+  @param [in] CmObjectNameSpace The Object Namespace
+  @param [in] CmObjectIdObject Id.
+  @param [in] Type  Structure used to describe the Object.
+
+  @retval EFI_SUCCESS   Success.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND The required object information is not found.
+  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration
+Manager is less than the Object size for the
+requested object.
+**/
+#define GET_OBJECT_LIST(CmObjectNameSpace, CmObjectId, Type)  \
+STATIC\
+EFI_STATUS\
+EFIAPI\
+Get##CmObjectId ( \
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST CfgMgrProtocol, \
+  IN  CONST CM_OBJECT_TOKEN   Token OPTIONAL, \
+  OUT   Type **   List,   \
+  OUT   UINT32* CONST Count OPTIONAL  \
+  )   \
+{ \
+  EFI_STATUS Status;  \
+  CM_OBJ_DESCRIPTOR  CmObjectDesc;\
+  UINT32 ObjCount = 0;\
+  if (List == NULL) { \
+Status = EFI_INVALID_PARAMETER;   \
+DEBUG ((  \
+  DEBUG_ERROR,\
+  "ERROR: Get" #CmObjectId ": Invalid out parameter for"  \
+  " object list. Status = %r\n",  \
+  Status  \
+  )); \
+goto error_handler;   \
+  }  

[edk2] [PATCH v1 09/22] DynamicTablesPkg: Configuration Manager Protocol

2018-12-21 Thread Sami Mujawar
Introduce configuration manager protocol interface
that is used by the dynamic tables framework core
to communicate with configuration manager.

Configuration manager is a platform specific module
that implements the configuration manager protocol.

Table generators use this interface to retrieve the
hardware information from the configuration manager.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTablesPkg.dec|   5 +
 DynamicTablesPkg/Include/Protocol/ConfigurationManagerProtocol.h | 128 

 2 files changed, 133 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTablesPkg.dec 
b/DynamicTablesPkg/DynamicTablesPkg.dec
index 
b1a6c64948d01426fc95b8599fc17adaa8c35f3d..e5e731085a721f5f2a0129b4678dedbb0c7b985a
 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dec
+++ b/DynamicTablesPkg/DynamicTablesPkg.dec
@@ -22,3 +22,8 @@ [Defines]
 [Includes]
   Include
 
+[Protocols]
+
+  # Configuration Manager Protocol GUID
+  gEdkiiConfigurationManagerProtocolGuid = { 0xd85a4835, 0x5a82, 0x4894, { 
0xac, 0x2, 0x70, 0x6f, 0x43, 0xd5, 0x97, 0x8e } }
+
diff --git a/DynamicTablesPkg/Include/Protocol/ConfigurationManagerProtocol.h 
b/DynamicTablesPkg/Include/Protocol/ConfigurationManagerProtocol.h
new file mode 100644
index 
..02c3d22ca7e961058c2c157e7f5a981e1418535e
--- /dev/null
+++ b/DynamicTablesPkg/Include/Protocol/ConfigurationManagerProtocol.h
@@ -0,0 +1,128 @@
+/** @file
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+**/
+
+#ifndef CONFIGURATION_MANAGER_PROTOCOL_H_
+#define CONFIGURATION_MANAGER_PROTOCOL_H_
+
+#include 
+
+/** This macro defines the Configuration Manager Protocol GUID.
+
+  GUID: {D85A4835-5A82-4894-AC02-706F43D5978E}
+*/
+#define EDKII_CONFIGURATION_MANAGER_PROTOCOL_GUID   \
+  { 0xd85a4835, 0x5a82, 0x4894, \
+{ 0xac, 0x2, 0x70, 0x6f, 0x43, 0xd5, 0x97, 0x8e }   \
+  };
+
+/** This macro defines the Configuration Manager Protocol Revision.
+*/
+#define EDKII_CONFIGURATION_MANAGER_PROTOCOL_REVISION  CREATE_REVISION (1, 0)
+
+#pragma pack(1)
+
+/**
+  Forward declarations:
+*/
+typedef struct ConfigurationManagerProtocol 
EDKII_CONFIGURATION_MANAGER_PROTOCOL;
+typedef struct PlatformRepositoryInfo   EDKII_PLATFORM_REPOSITORY_INFO;
+
+/** The GetObject function defines the interface implemented by the
+Configuration Manager Protocol for returning the Configuration
+Manager Objects.
+
+  @param [in]  ThisPointer to the Configuration Manager Protocol.
+  @param [in]  CmObjectId  The Configuration Manager Object ID.
+  @param [in]  Token   An optional token identifying the object. If
+   unused this must be CM_NULL_TOKEN.
+  @param [out] CmObjectPointer to the Configuration Manager Object
+   descriptor describing the requested Object.
+
+  @retval EFI_SUCCESS   Success.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND The required object information is not found.
+  @retval EFI_BAD_BUFFER_SIZE   The size returned by the Configuration Manager
+is less than the Object size for the requested
+object.
+**/
+typedef
+EFI_STATUS
+(EFIAPI * EDKII_CONFIGURATION_MANAGER_GET_OBJECT) (
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST This,
+  IN  CONST CM_OBJECT_ID  CmObjectId,
+  IN  CONST CM_OBJECT_TOKEN   Token OPTIONAL,
+  IN  OUT   CM_OBJ_DESCRIPTOR * CONST CmObject
+  );
+
+/** The SetObject function defines the interface implemented by the
+Configuration Manager Protocol for updating the Configuration
+Manager Objects.
+
+  @param [in]  ThisPointer to the Configuration Manager Protocol.
+  @param [in]  CmObjectId  The Configuration Manager Object ID.
+  @param [in]  Token   An optional token identifying the object. If
+   unused this must be CM_NULL_TOKEN.
+  @param [out] CmObjectPointer to the Configuration Manager Object
+   descriptor describing the Object.
+
+  @retval EFI_SUCCESS   The operation completed successfully.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND The required object i

[edk2] [PATCH edk2-platforms v1 6/6] Platform/ARM: Dynamic CPU Device info for FVP

2018-12-21 Thread Sami Mujawar
Integrate the OEM CPU Generator support for FVP to
dynamically generate the ACPI CPU device information.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc   
  |  3 +-
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
  |  3 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 |  7 
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
 |  2 +-
 Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
  | 39 ++--
 5 files changed, 16 insertions(+), 38 deletions(-)

diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc 
b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
index 
1cf2ebb58f99899864e3bc90b7a22a75ea9fc29b..295fea1f45401fdb80a8327955b73388655434fb
 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
@@ -74,7 +74,8 @@ [LibraryClasses.common.UEFI_DRIVER, 
LibraryClasses.common.UEFI_APPLICATION, Libr
 
 [BuildOptions]
   GCC:*_*_AARCH64_PLATFORM_FLAGS == 
-I$(WORKSPACE)/Platform/ARM/VExpressPkg/Include/Platform/RTSM
-
+  *_*_*_PLATFORM_FLAGS = 
-I$(BIN_DIR)/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib/OUTPUT
+  *_*_*_PLATFORM_FLAGS = 
-I$(BIN_DIR)/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuASLLib/OUTPUT
 
 

 #
diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc
index 
788b145b273fd49da7fb5d238491aef956977e61..4264eadde01b66a5c2c4a9267debcbed5ed3800b
 100644
--- a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc
@@ -26,6 +26,9 @@ [Components.common]
 
 # Platform ASL Tables
 
PlatformAslTablesLib|Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
+
NULL|Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuASLLib.inf
+
NULL|Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuGeneratorLib.inf
   
*_*_*_PLATFORM_FLAGS = 
-I$(BIN_DIR)/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib/OUTPUT
+   *_*_*_PLATFORM_FLAGS = 
-I$(WORKSPACE)/Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib
   }
diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
index 
4f79f91ef32cad4a1967d969cb39f801c3593089..7a7a2199477bbd4edaeacb8622b54e4a62466bc2
 100644
--- 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
+++ 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -26,6 +26,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include "ConfigurationManager.h"
@@ -78,6 +79,12 @@ EDKII_PLATFORM_REPOSITORY_INFO VExpressPlatRepositoryInfo = {
   EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_SIGNATURE,
   CREATE_STD_ACPI_TABLE_GEN_ID (ESTD_ACPI_TABLE_ID_DBG2),
   NULL
+},
+// OEM CPU Table
+{
+  0, // Unused
+  CREATE_OEM_ACPI_TABLE_GEN_ID (OEM_ACPI_TABLE_ID_CPU),
+  NULL
 }
   },
 
diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
index 
bb457077d2329041aa5e5eaa6feec6f486a0114e..d1ced89ddc6902695b0d345086046d819604076d
 100644
--- 
a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
+++ 
b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
@@ -105,7 +105,7 @@
 
 /** The number of ACPI tables to install
 */
-#define PLAT_ACPI_TABLE_COUNT   6
+#define PLAT_ACPI_TABLE_COUNT   7
 
 /** The number of platform generic timer blocks
 */
diff --git 
a/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl 
b/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
index 
625930db4d88d9e966eea990ea2b293842f011ea..2d6767b35c87f91fd56febabb3644c91617f53ed
 100644
--- 
a/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
+++ 
b/Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
@@ -1,7 +1,7 @@
 /** @file
   Differentiated System Description Table Fields (DSDT)
 
-  Copyright (c) 2014-2017, AR

[edk2] [PATCH v1 22/22] DynamicTablesPkg: Arm IORT Table Generator

2018-12-21 Thread Sami Mujawar
The IORT generator uses the configuration manager protocol
to obtain information about the PCI Root Complex, SMMU,
GIC ITS, Performance Monitoring counters etc. and generates
the IORT table.

The mappings between the components are represented using
tokens. The generator invokes the configuration manager
protocol interfaces and requests for objects referenced by
tokens to establish the link.

This table data is then used by the Table Manager to install
the IORT table.

The Table Manager then invokes the generator interface to free
any resources allocated by the IORT table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc  |1 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/AcpiIortLibArm.inf |   42 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c| 2055 

 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.h|   50 +
 4 files changed, 2148 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 
98a37efa5d567942a18163c44961bd4c86552bb6..a6bb9d3c71a548161af48b45812a233afd2bd0ef
 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -30,6 +30,7 @@ [Components.common]
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
+  NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/AcpiIortLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/AcpiIortLibArm.inf 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/AcpiIortLibArm.inf
new file mode 100644
index 
..ce828eb09147d8cc149902c852cc8eaac9b12dc4
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/AcpiIortLibArm.inf
@@ -0,0 +1,42 @@
+## @file
+#  IORT Table Generator
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = AcpiIortLibArm
+  FILE_GUID  = 25682BA8-B41D-4403-B034-253769E0DAD5
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiIortLibConstructor
+  DESTRUCTOR = AcpiIortLibDestructor
+
+[Sources]
+  IortGenerator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+
+[Pcd]
+
+[Protocols]
+
+[Guids]
+
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
new file mode 100644
index 
..979024493dfd47b45eb621b44616076e4b883231
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
@@ -0,0 +1,2055 @@
+/** @file
+  IORT Table Generator
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+  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.
+
+  @par Reference(s):
+  - IO Remapping Table, Platform Design Document,
+Document number: ARM DEN 0049D, Issue D, March 2018
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "IortGenerator.h"
+
+/** ARM standard IORT Generator
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjItsGroup
+  - EArmObjNamedComponent
+  - EArmObjRootComplex
+  - EArmObjSmmuV1SmmuV2
+  - EArmObjSmmuV3
+  - EArmObjPmcg
+  - EArmObjGicItsIdentifierArray
+  - EArmObjIdMapping
+  - EArmObjGicItsIdentifierArray

[edk2] [PATCH edk2-platforms v1 0/6] Platform/ARM: Platform support for Dynamic Tables Framework

2018-12-21 Thread Sami Mujawar
Dynamic Tables Framework aims to reduce the amount of effort
required for porting firmware to new platforms by simplifying
the generation of firmware tables based on hardware description
provided by a platform specific component.
 
The Dynamic Tables Framework core queries the platform specific
component to retrieve the required hardware information for
generating standardised firmware tables at run-time.
 
The platform specific component responsible for collating the
hardware information is called the Configuration Manager. 
 
This patch series introduce the Configuration Manager that
provides the hardware description to Dynamic Tables Framework.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 

The changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/365_dynamic_tables_framework_v1

Sami Mujawar (6):
  Platform/ARM: Configuration Manager for Juno
  Platform/ARM: Dynamic Tables support for Juno
  Platform/ARM: Configuration Manager for FVP
  Platform/ARM: Dynamic Tables support for FVP
  Platform/ARM: Add OEM CPU generator for FVP
  Platform/ARM: Dynamic CPU Device info for FVP

 Platform/ARM/JunoPkg/ArmJuno.dsc   
   |  12 +-
 Platform/ARM/JunoPkg/ArmJuno.fdf   
   |  12 +
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
   |  29 +
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 593 +++
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
  | 156 +
 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 |  86 +++
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h   
   |  65 +++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
   | 276 +
 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
   |  45 ++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtJunoUsb.asl 
   | 122 
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtPci.asl 
   | 218 +++
 Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/SsdtUart.asl
   |  48 ++
 Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c   
   |   9 +-
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc   
   |  18 +-
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf   
   |  16 +-
 
Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuASLLib.inf
 |  27 +
 
Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/AcpiOemCpuGeneratorLib.inf
   |  42 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/OemCpuGenerator.c
| 403 +
 
Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/OemCpuGenerator.h
|  23 +
 
Platform/ARM/VExpressPkg/ConfigurationManager/AcpiOemCpuGeneratorLib/SsdtCpuTemplate.asl
  |  25 +
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManager.dsc.inc 
   |  34 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
  | 617 
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
  | 172 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 |  79 +++
 
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h
  |  91 +++
 Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
   |  40 ++
 
Platform/ARM/VExpressPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
   |  35 ++
 27 files changed, 3287 insertions(+), 6 deletions(-)
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/Platform.h
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/Dsdt.asl
 create mode 100644 
Platform/ARM/JunoPkg/ConfigurationManager/PlatformASLTablesLib/PlatformASLTablesLib.inf
 create mode 100644 
Platform/ARM

[edk2] [PATCH v1 21/22] DynamicTablesPkg: Arm PCI MCFG Table Generator

2018-12-21 Thread Sami Mujawar
The MCFG generator uses the configuration manager protocol
to obtain the PCI Configuration space information from the
platform configuration manager and builds the MCFG table.

This table data is then used by the Table Manager to install
the MCFG table.

The Table Manager then invokes the generator interface to free
any resources allocated by the MCFG table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc  |   1 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf |  42 +++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c| 344 

 3 files changed, 387 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 
5ff981619fcd3a579afc50faff41e474a5d604ad..98a37efa5d567942a18163c44961bd4c86552bb6
 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -31,6 +31,7 @@ [Components.common]
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
+  NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
   }
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf
new file mode 100644
index 
..e491ad6b24faae24e473f0fd501e06a6f3b456b5
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf
@@ -0,0 +1,42 @@
+## @file
+#  MCFG Table Generator
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = AcpiMcfgLibArm
+  FILE_GUID  = 8C9BDCB2-72D4-4F30-A12D-1145C3807FF7
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiMcfgLibConstructor
+  DESTRUCTOR = AcpiMcfgLibDestructor
+
+[Sources]
+  McfgGenerator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+
+[Pcd]
+
+[Protocols]
+
+[Guids]
+
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c
new file mode 100644
index 
..1be27160c12b51b36b90cd5f5c9e01efecd8cc03
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c
@@ -0,0 +1,344 @@
+/** @file
+  MCFG Table Generator
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+  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.
+
+  @par Reference(s):
+  - PCI Firmware Specification - Revision 3.2, January 26, 2015.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** ARM standard MCFG Generator
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjPciConfigSpaceInfo
+*/
+
+#pragma pack(1)
+
+/** This typedef is used to shorten the name of the MCFG Table
+header structure.
+*/
+typedef
+  EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER
+  MCFG_TABLE;
+
+/** This typedef is used to shorten the name of the Enhanced
+Configuration Space address structure.
+*/
+typedef
+  
EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_ADDRESS_ALLOCATION_STRUCTURE
+  MCFG_CFG_SPACE_ADDR;
+
+#pragma pack()
+
+/** Retrieve the PCI Configuration Space Information.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjPciConfigSpaceInfo,
+  CM_ARM_PCI_CONFIG_SPACE_INFO
+  );
+
+/** Add the PCI Enhanced

[edk2] [PATCH v1 20/22] DynamicTablesPkg: Arm DBG2 Table Generator

2018-12-21 Thread Sami Mujawar
The DBG2 generator uses the configuration manager protocol
to obtain the debug serial port information from the platform
configuration manager. It then updates a template DBG2 table
structure. This table data is used by the Table Manager to
install the DBG2 table.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc  |   1 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf |  48 +++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c| 442 

 3 files changed, 491 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 
cfefd57d451155880e6b0e62f1f0605160e6a9aa..5ff981619fcd3a579afc50faff41e474a5d604ad
 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -27,6 +27,7 @@ [Components.common]
   #
   DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {
 
+  NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf
new file mode 100644
index 
..4075862204c9a12cfd26002e359e054c36914ef0
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/AcpiDbg2LibArm.inf
@@ -0,0 +1,48 @@
+## @file
+# DBG2 Table Generator
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = AcpiDbg2LibArm
+  FILE_GUID  = A17BA4F0-3DEB-4FE5-BD27-EC008E541B22
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiDbg2LibConstructor
+  DESTRUCTOR = AcpiDbg2LibDestructor
+
+[Sources]
+  Dbg2Generator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  SerialPortLib
+
+[FixedPcd]
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits
+
+[Protocols]
+
+[Guids]
+
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
new file mode 100644
index 
..2c41afd8a50ca6fbea6950fa59af74b528111840
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c
@@ -0,0 +1,442 @@
+/** @file
+  DBG2 Table Generator
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+  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.
+
+  @par Reference(s):
+  - Microsoft Debug Port Table 2 (DBG2) Specification - December 10, 2015.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** ARM standard DBG2 Table Generator
+
+  Constructs the DBG2 table for PL011 or SBSA UART peripherals.
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjSerialDebugPortInfo
+*/
+
+#pragma pack(1)
+
+/** The number of debug ports represented by the Table.
+*/
+#define DBG2_NUM_DEBUG_PORTS   1
+
+/** The number of Generic Address Registers
+presented in the debug device information.
+*/
+#define DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS   1
+
+/** The index for the debug port 1 in the Debug port information list.
+*/
+#define DBG_PORT_INDEX_PORT1   0
+
+/** A string representing the name of the debug 

[edk2] [PATCH v1 19/22] DynamicTablesPkg: Arm SPCR Table Generator

2018-12-21 Thread Sami Mujawar via edk2-devel
The SPCR generator uses the configuration manager protocol to
obtain the serial port information from the platform configuration
manager. It then updates a template SPCR table structure. This
table data is used by the Table Manager to install the SPCR table.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc  |   1 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf |  42 +++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c| 326 

 3 files changed, 369 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 
056a1293c93268a6203fc3711079880d11cbc1bc..cfefd57d451155880e6b0e62f1f0605160e6a9aa
 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -31,6 +31,7 @@ [Components.common]
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
+  NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
   }
 
   #
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
new file mode 100644
index 
..8dd94e550b8181dea13d5be81688cc35b8b80eac
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf
@@ -0,0 +1,42 @@
+## @file
+#  SPCR Table Generator
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = AcpiSpcrLibArm
+  FILE_GUID  = 55088136-7B78-4974-B1EE-F630150D0DE7
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiSpcrLibConstructor
+  DESTRUCTOR = AcpiSpcrLibDestructor
+
+[Sources]
+  SpcrGenerator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+
+[Pcd]
+
+[Protocols]
+
+[Guids]
+
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c
new file mode 100644
index 
..52c7e475baf511c0abf1442113e88248c5d035b3
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c
@@ -0,0 +1,326 @@
+/** @file
+  SPCR Table Generator
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+  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.
+
+  @par Reference(s):
+  - Microsoft Serial Port Console Redirection Table
+Specification - Version 1.03 - August 10, 2015.
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** ARM standard SPCR Table Generator
+
+  Constructs the SPCR table for PL011 or SBSA UART peripherals.
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjSerialConsolePortInfo
+
+NOTE: This implementation ignores the possibility that the Serial settings may
+  be modified from the UEFI Shell.  A more complex handler would be needed
+  to (e.g.) recover serial port settings from the UART, or non-volatile
+  storage.
+*/
+
+#pragma pack(1)
+
+/** This macro defines the no flow control option.
+*/
+#define SPCR_FLOW_CONTROL_NONE   0
+
+/**A template for generating the SPCR Table.
+
+  Note: fields marked "{Template}" will be updated dynamically.
+*/
+STATIC
+EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE AcpiSpcr = {
+  ACPI_HEADER (
+EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,
+EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE,
+EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION
+),
+  0, // {

[edk2] [PATCH v1 08/22] DynamicTablesPkg: Configuration Manager Objects

2018-12-21 Thread Sami Mujawar
The dynamic tables frameworks core communicates with the
platform specific implementation using the configuration
manager protocol interface. The dynamic tables framework
core uses this interface to retrieve information required
for generating the firmware tables. This information is
represented in the form of objects, which are classified
as standard namespace objects, Arm namespace objects or
as Custom/OEM namespace objects.

The configuration manager objects provides a convenient
way for wrapping up the namespaces using a well defined
configuration manager object Id.

The configuration manager is a platform specific component
that collates the platform information required for generating
firmware tables and represents them as configuration manager
objects.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/ConfigurationManagerObject.h | 176 

 1 file changed, 176 insertions(+)

diff --git a/DynamicTablesPkg/Include/ConfigurationManagerObject.h 
b/DynamicTablesPkg/Include/ConfigurationManagerObject.h
new file mode 100644
index 
..d1682c7066365bee6206f7de2b801be53a971750
--- /dev/null
+++ b/DynamicTablesPkg/Include/ConfigurationManagerObject.h
@@ -0,0 +1,176 @@
+/** @file
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+**/
+
+#ifndef CONFIGURATION_MANAGER_OBJECT_H_
+#define CONFIGURATION_MANAGER_OBJECT_H_
+
+#include 
+#include 
+
+#pragma pack(1)
+
+/** The CM_OBJECT_ID type is used to identify the Configuration Manager
+objects.
+
+ Description of Configuration Manager Object ID
+___
+|31 |30 |29 |28 || 27 | 26 | 25 | 24 || 23 | 22 | 21 | 20 || 19 | 18 | 17 | 16|
+---
+| Name Space ID ||  0 |  0 |  0 |  0 ||  0 |  0 |  0 |  0 ||  0 |  0 |  0 |  0|
+___
+
+Bits: [31:28] - Name Space ID
+ - Standard
+0001 - ARM
+1000 - Custom/OEM
+All other values are reserved.
+
+Bits: [27:16] - Reserved.
+___
+|15 |14 |13 |12 || 11 | 10 |  9 |  8 ||  7 |  6 |  5 |  4 ||  3 |  2 |  1 |  0|
+---
+| 0 | 0 | 0 | 0 ||  0 |  0 |  0 |  0 || Object ID |
+___
+
+Bits: [15:8] - Are reserved and must be zero.
+
+Bits: [7:0] - Object ID
+
+Object ID's in the Standard Namespace:
+  0 - Configuration Manager Revision
+  1 - ACPI Table List
+  2 - SMBIOS Table List
+
+Object ID's in the ARM Namespace:
+   0 - Reserved
+   1 - Boot Architecture Info
+   2 - CPU Info
+   3 - Power Management Profile Info
+   4 - GICC Info
+   5 - GICD Info
+   6 - GIC MSI Frame Info
+   7 - GIC Redistributor Info
+   8 - GIC ITS Info
+   9 - Serial Console Port Info
+  10 - Serial Debug Port Info
+  11 - Generic Timer Info
+  12 - Platform GT Block Info
+  13 - Platform Generic Watchdog
+  14 - PCI Configuration Space Info
+  15 - Hypervisor Vendor Id
+  16 - Fixed feature flags for FADT
+*/
+typedef UINT32  CM_OBJECT_ID;
+
+/** A mask for Object ID
+*/
+#define OBJECT_ID_MASK0xFF
+
+/** A mask for Namespace ID
+*/
+#define NAMESPACE_ID_MASK 0xF
+
+/** Starting bit position for Namespace ID
+*/
+#define NAMESPACE_ID_BIT_SHIFT28
+
+/** The EOBJECT_NAMESPACE_ID enum describes the defined namespaces
+for the Configuration Manager Objects.
+*/
+typedef enum ObjectNameSpaceID {
+  EObjNameSpaceStandard,  ///< Standard Objects Namespace
+  EObjNameSpaceArm,   ///< ARM Objects Namespace
+  EObjNameSpaceOem = 0x8, ///< OEM Objects Namespace
+  EObjNameSpaceMax
+} EOBJECT_NAMESPACE_ID;
+
+/** A descriptor for Configuration Manager Objects.
+
+  The Configuration Manager Protocol interface uses this descriptor
+  to return the Configuration Manager Objects.
+*/
+typedef struct CmObjDescriptor {
+  /// sizeof the described Object or Object List.
+  UINT32   Size;
+
+  /// Pointer to the described Object or Object List.
+  VOID   * Data;
+} CM_OBJ_DESCRIPTOR;
+
+#pragma pack()
+
+/** This macro returns th

[edk2] [PATCH v1 16/22] DynamicTablesPkg: Arm ACPI FADT Generator

2018-12-21 Thread Sami Mujawar via edk2-devel
The FADT generator collates the relevant information required
for generating a FADT table from configuration manager using
the configuration manager protocol. It then updates a template
FADT table structure. This table data is used by the Table
Manager to install the FADT table.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc  |   1 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf |  42 ++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c| 668 

 3 files changed, 711 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 
9b733d39776d183122815aa850747fba8110b643..742bd1e1d87f9c2ce82abd705ef0a501fd294fba
 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -27,6 +27,7 @@ [Components.common]
   #
   DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {
 
+  NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
   }
 
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
new file mode 100644
index 
..e772409069caad8563e37be43ec2841f9d22e62d
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
@@ -0,0 +1,42 @@
+## @file
+#  FADT Table Generator
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = AcpiFadtLibArm
+  FILE_GUID  = 686FE5FE-B944-485F-8B1C-7D60E0056487
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiFadtLibConstructor
+  DESTRUCTOR = AcpiFadtLibDestructor
+
+[Sources]
+  FadtGenerator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+
+[Pcd]
+
+[Protocols]
+
+[Guids]
+
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c
new file mode 100644
index 
..07bedfc14fd2f14bbebc72bd4b4be9eb5b8682eb
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c
@@ -0,0 +1,668 @@
+/** @file
+  FADT Table Generator
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+  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.
+
+  @par Reference(s):
+  - ACPI 6.2 Specification - Errata A, September 2017
+
+**/
+
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** ARM standard FADT Generator
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjPowerManagementProfileInfo
+  - EArmObjBootArchInfo
+  - EArmObjHypervisorVendorIdentity (OPTIONAL)
+*/
+
+/** This macro defines the FADT flag options for ARM Platforms.
+*/
+#define FADT_FLAGS  (EFI_ACPI_6_2_HW_REDUCED_ACPI |  \
+ EFI_ACPI_6_2_LOW_POWER_S0_IDLE_CAPABLE)
+
+/** This macro defines the valid mask for the FADT flag option
+if HW_REDUCED_ACPI flag in the table is set.
+
+  Invalid bits are: 1, 2, 3,7, 8, 13, 14,16, 17 and
+22-31 (reserved).
+
+  Valid bits are:
+EFI_ACPI_6_2_WBINVD   BIT0
+EFI_ACPI_6_2_PWR_BUTTON   BIT4
+EFI_ACPI_6_2_SLP_BUTTON   BIT5
+EFI_ACPI_6_2_FIX_RTC  BIT6
+EFI_ACPI_6_2_DCK_CAP  BIT9
+EFI_ACPI_6_2_RESET_REG_SUPBIT10
+EFI_ACPI_6_2_SEALED_CASE  BIT11
+EFI_ACPI_6_2_HEADLESS BIT12
+EFI_ACPI_6_

[edk2] [PATCH v1 18/22] DynamicTablesPkg: Arm ACPI GTDT Generator

2018-12-21 Thread Sami Mujawar via edk2-devel
The GTDT generator uses the configuration manager protocol to
obtain information about the architectural and platform timers
available on the platform and generates the ACPI GTDT table.
This table data is then used by the Table Manager to install
the GTDT table.

The Table Manager then invokes the generator interface to free
any resources allocated by the GTDT table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc  |   1 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf |  42 ++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c| 674 

 3 files changed, 717 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 
43e0f564af51cd6327b210af363488ed2a788cc4..056a1293c93268a6203fc3711079880d11cbc1bc
 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -28,6 +28,7 @@ [Components.common]
   DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {
 
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
+  NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
   }
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
new file mode 100644
index 
..da3db2b1ff882a9e3a71810eff3d76681ec9d208
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/AcpiGtdtLibArm.inf
@@ -0,0 +1,42 @@
+## @file
+#  GTDT Table Generator
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = AcpiGtdtLibArm
+  FILE_GUID  = 26490F7A-7FA2-423C-8939-C6206329BC37
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiGtdtLibConstructor
+  DESTRUCTOR = AcpiGtdtLibDestructor
+
+[Sources]
+  GtdtGenerator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+
+[FixedPcd]
+
+[Protocols]
+
+[Guids]
+
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
new file mode 100644
index 
..8414225291a68a888f13799e92e0c39b7f3bffc2
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
@@ -0,0 +1,674 @@
+/** @file
+  GTDT Table Generator
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+  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.
+
+  @par Reference(s):
+  - ACPI 6.2 Specification - Errata A, September 2017
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** ARM standard GTDT Generator
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjGenericTimerInfo
+  - EArmObjPlatformGenericWatchdogInfo (OPTIONAL)
+  - EArmObjPlatformGTBlockInfo (OPTIONAL)
+  - EArmObjGTBlockTimerFrameInfo (OPTIONAL)
+*/
+
+/** This macro expands to a function that retrieves the Generic
+Timer Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjGenericTimerInfo,
+  CM_ARM_GENERIC_TIMER_INFO
+  );
+
+/** This macro expands to a function that retrieves the SBSA Generic
+Watchdog Timer Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjPlatformGenericWatchdogInfo,
+  CM_ARM_GENERIC_WATCHDOG_INFO
+  );
+
+/** This macro expands to a function that retrieves the Platform Generic
+Timer Block Information from the C

[edk2] [PATCH v1 17/22] DynamicTablesPkg: Arm ACPI MADT Generator

2018-12-21 Thread Sami Mujawar via edk2-devel
The MADT generator uses the configuration manager protocol to
obtain information about the Arm interrupt controllers (GICC,
GICD, etc.) and generates the ACPI MADT table. This table data
is then used by the Table Manager to install the MADT table.

The Table Manager then invokes the generator interface to free
any resources allocated by the MADT table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc  |   1 +
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf |  42 ++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c| 719 

 3 files changed, 762 insertions(+)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 
742bd1e1d87f9c2ce82abd705ef0a501fd294fba..43e0f564af51cd6327b210af363488ed2a788cc4
 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -28,6 +28,7 @@ [Components.common]
   DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {
 
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/AcpiFadtLibArm.inf
+  NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
   NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
   }
 
diff --git 
a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
new file mode 100644
index 
..6ba8af4632c25e97b948893c344517ac447ce01a
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf
@@ -0,0 +1,42 @@
+## @file
+#  MADT Table Generator
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = AcpiMadtLibArm
+  FILE_GUID  = AF76C93B-41B5-454D-83CD-D2A80A1C1E38
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiMadtLibConstructor
+  DESTRUCTOR = AcpiMadtLibDestructor
+
+[Sources]
+  MadtGenerator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+
+[Pcd]
+
+[Protocols]
+
+[Guids]
+
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
new file mode 100644
index 
..76e1712c3bf7f9343ac56d2534ba53b4bdc6d71f
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
@@ -0,0 +1,719 @@
+/** @file
+  MADT Table Generator
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+  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.
+
+  @par Reference(s):
+  - ACPI 6.2 Specification - Errata A, September 2017
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** ARM standard MADT Generator
+
+Requirements:
+  The following Configuration Manager Object(s) are required by
+  this Generator:
+  - EArmObjGicCInfo
+  - EArmObjGicDInfo
+  - EArmObjGicMsiFrameInfo (OPTIONAL)
+  - EArmObjGicRedistributorInfo (OPTIONAL)
+  - EArmObjGicItsInfo (OPTIONAL)
+*/
+
+/** This macro expands to a function that retrieves the GIC
+CPU interface Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjGicCInfo,
+  CM_ARM_GICC_INFO
+  );
+
+/** This macro expands to a function that retrieves the GIC
+Distributor Information from the Configuration Manager.
+*/
+
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjGicDInfo,
+  CM_ARM_GICD_INFO
+  );
+
+/** This macro expands to a function that retrieves the GIC
+MSI Frame Information from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceArm,
+  EArmObjGicMsiFrameInfo,
+  CM_ARM_GIC_MSI_FRAME_INFO
+  );
+
+/** This macro expands to a function th

[edk2] [PATCH v1 14/22] DynamicTablesPkg: Dynamic Table Manager Dxe

2018-12-21 Thread Sami Mujawar via edk2-devel
The dynamic table manager implements the top level component
that drives the table generation and installation process.
It uses the configuration manager protocol to get the list
of tables to be installed from the configuration manager.
It iterates through the list of tables, requests the table
factories for corresponding generators and invokes the
generator interface to build the tables.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c   | 
735 
 DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf |  
50 ++
 DynamicTablesPkg/DynamicTables.dsc.inc |   
4 +
 DynamicTablesPkg/DynamicTables.fdf.inc |   
4 +
 4 files changed, 793 insertions(+)

diff --git 
a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c 
b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c
new file mode 100644
index 
..090f102fae0d45040ae2a60003dc84bab1271416
--- /dev/null
+++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c
@@ -0,0 +1,735 @@
+/** @file
+  Dynamic Table Manager Dxe
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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 
+#include 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** This macro expands to a function that retrieves the ACPI Table
+List from the Configuration Manager.
+*/
+GET_OBJECT_LIST (
+  EObjNameSpaceStandard,
+  EStdObjAcpiTableList,
+  CM_STD_OBJ_ACPI_TABLE_INFO
+  )
+
+/** A helper function to build and install a single ACPI table.
+
+  This is a helper function that invokes the Table generator interface
+  for building an ACPI table. It uses the AcpiTableProtocol to install the
+  table, then frees the resources allocated for generating it.
+
+  @param [in]  TableFactoryProtocol Pointer to the Table Factory Protocol
+interface.
+  @param [in]  CfgMgrProtocol   Pointer to the Configuration Manager
+Protocol Interface.
+  @param [in]  GeneratorPointer to the AcpiTable generator.
+  @param [in]  AcpiTableProtocolPointer to the AcpiTable protocol.
+  @param [in]  AcpiTableInfoPointer to the ACPI table Info.
+
+  @retval EFI_SUCCESS   Success.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+  @retval EFI_NOT_FOUND Required object is not found.
+  @retval EFI_BAD_BUFFER_SIZE   Size returned by the Configuration Manager
+is less than the Object size for the
+requested object.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+BuildAndInstallSingleAcpiTable (
+  IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL  * CONST TableFactoryProtocol,
+  IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST CfgMgrProtocol,
+  IN CONST ACPI_TABLE_GENERATOR  * CONST Generator,
+  IN   EFI_ACPI_TABLE_PROTOCOL   *   AcpiTableProtocol,
+  IN CONST CM_STD_OBJ_ACPI_TABLE_INFO* CONST AcpiTableInfo
+  )
+{
+  EFI_STATUSStatus;
+  EFI_STATUSStatus1;
+  EFI_ACPI_DESCRIPTION_HEADER * AcpiTable;
+  UINTN TableHandle;
+
+  AcpiTable = NULL;
+  Status = Generator->BuildAcpiTable (
+Generator,
+AcpiTableInfo,
+CfgMgrProtocol,
+
+);
+  if (EFI_ERROR (Status)) {
+DEBUG ((
+  DEBUG_ERROR,
+  "ERROR: Failed to Build Table." \
+  " TableGeneratorId = 0x%x. Status = %r\n",
+  AcpiTableInfo->TableGeneratorId,
+  Status
+  ));
+// Free any allocated resources.
+goto exit_handler;
+  }
+
+  if (AcpiTable == NULL) {
+Status = EFI_NOT_FOUND;
+goto exit_handler;
+  }
+
+  // Dump ACPI Table Header
+  DUMP_ACPI_TABLE_HEADER (AcpiTable);
+
+  // Install ACPI table
+  Status = AcpiTableProtocol->InstallAcpiTable (
+AcpiTableProtocol,
+AcpiTable,
+AcpiTable->Length,
+
+);
+  if (EFI_ERROR (Status)) {
+DEBUG ((
+  DEB

[edk2] [PATCH v1 15/22] DynamicTablesPkg: Arm Raw/DSDT/SSDT Generator

2018-12-21 Thread Sami Mujawar via edk2-devel
A Raw generator is a simple generator. This generator provides
the ability to install a binary blob (that contains ACPI table
data) as an ACPI table. The binary blob could be pre-generated
ACPI table data or it may be the pre-compiled output from an
iAsl compiler for a DSDT or SSDT table.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/DynamicTables.dsc.inc|   8 +-
 DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf |  42 ++
 DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c| 143 

 3 files changed, 192 insertions(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc 
b/DynamicTablesPkg/DynamicTables.dsc.inc
index 
c419c63bc1b2a6a5efa549061837adaf4ed6e8a3..9b733d39776d183122815aa850747fba8110b643
 100644
--- a/DynamicTablesPkg/DynamicTables.dsc.inc
+++ b/DynamicTablesPkg/DynamicTables.dsc.inc
@@ -15,6 +15,9 @@
 
 [Defines]
 
+[BuildOptions]
+  *_*_*_ASL_FLAGS  = -tc -li -so
+
 [LibraryClasses.common]
   
TableHelperLib|DynamicTablesPkg/Library/Common/TableHelperLib/TableHelperLib.inf
 
@@ -22,7 +25,10 @@ [Components.common]
   #
   # Dynamic Table Factory Dxe
   #
-  DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf
+  DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.inf {
+
+  NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
+  }
 
   #
   # Dynamic Tables Manager Dxe
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
new file mode 100644
index 
..213dbd1cd7b69b3088afb09bdaaf1355c81d8f35
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf
@@ -0,0 +1,42 @@
+## @file
+#  Raw Table Generator
+#
+#  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = AcpiRawLibArm
+  FILE_GUID  = 20F31568-D687-49BA-B326-CCD9D38EDE16
+  VERSION_STRING = 1.0
+  MODULE_TYPE= DXE_DRIVER
+  LIBRARY_CLASS  = NULL|DXE_DRIVER
+  CONSTRUCTOR= AcpiRawLibConstructor
+  DESTRUCTOR = AcpiRawLibDestructor
+
+[Sources]
+  RawGenerator.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  DynamicTablesPkg/DynamicTablesPkg.dec
+
+[LibraryClasses]
+  BaseLib
+
+[Pcd]
+
+[Protocols]
+
+[Guids]
+
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c 
b/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c
new file mode 100644
index 
..5059af5bb054853fb391ff7af3c43162cfb13614
--- /dev/null
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c
@@ -0,0 +1,143 @@
+/** @file
+  MCFG Table Generator
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+  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 
+#include 
+#include 
+
+// Module specific include files.
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** Construct the ACPI table using the ACPI table data provided.
+
+  This function invokes the Configuration Manager protocol interface
+  to get the required hardware information for generating the ACPI
+  table.
+
+  If this function allocates any resources then they must be freed
+  in the FreeTableResources function.
+
+  @param [in]  This   Pointer to the table generator.
+  @param [in]  AcpiTableInfo  Pointer to the ACPI Table Info.
+  @param [in]  CfgMgrProtocol Pointer to the Configuration Manager
+  Protocol Interface.
+  @param [out] Table  Pointer to the constructed ACPI Table.
+
+  @retval EFI_SUCCESS   Table generated successfully.
+  @retval EFI_INVALID_PARAMETER A parameter is invalid.
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+BuildRawTable (
+  IN  CONST ACPI_TABLE_GENERATOR  * CONST This,
+  IN  CONST CM_STD_OBJ_ACPI_TABLE_INFO* CONST AcpiTab

[edk2] [PATCH v1 07/22] DynamicTablesPkg: Arm NameSpace Objects

2018-12-21 Thread Sami Mujawar
The dynamic tables frameworks core communicates with the
platform specific implementation using the configuration
manager protocol interface. The dynamic tables framework
core uses this interface to retrieve information required
for generating the firmware tables. This information is
represented in the form of objects, which are classified
as standard namespace objects, Arm namespace objects or
as Custom/OEM namespace objects.

This patch introduces the definitions for the Arm namespace
objects.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 591 
 1 file changed, 591 insertions(+)

diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h 
b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
new file mode 100644
index 
..93cb6949f0eb2ac2ad3524494e4a14c7a6fab4b8
--- /dev/null
+++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h
@@ -0,0 +1,591 @@
+/** @file
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+- Std or STD - Standard
+**/
+
+#ifndef ARM_NAMESPACE_OBJECTS_H_
+#define ARM_NAMESPACE_OBJECTS_H_
+
+#include 
+
+#pragma pack(1)
+
+/** The EARM_OBJECT_ID enum describes the Object IDs
+in the ARM Namespace
+*/
+typedef enum ArmObjectID {
+  EArmObjReserved,///<  0 - Reserved
+  EArmObjBootArchInfo,///<  1 - Boot Architecture Info
+  EArmObjCpuInfo, ///<  2 - CPU Info
+  EArmObjPowerManagementProfileInfo,  ///<  3 - Power Management Profile Info
+  EArmObjGicCInfo,///<  4 - GIC CPU Interface Info
+  EArmObjGicDInfo,///<  5 - GIC Distributor Info
+  EArmObjGicMsiFrameInfo, ///<  6 - GIC MSI Frame Info
+  EArmObjGicRedistributorInfo,///<  7 - GIC Redistributor Info
+  EArmObjGicItsInfo,  ///<  8 - GIC ITS Info
+  EArmObjSerialConsolePortInfo,   ///<  9 - Serial Console Port Info
+  EArmObjSerialDebugPortInfo, ///< 10 - Serial Debug Port Info
+  EArmObjGenericTimerInfo,///< 11 - Generic Timer Info
+  EArmObjPlatformGTBlockInfo, ///< 12 - Platform GT Block Info
+  EArmObjGTBlockTimerFrameInfo,   ///< 13 - Generic Timer Block Frame Info
+  EArmObjPlatformGenericWatchdogInfo, ///< 14 - Platform Generic Watchdog
+  EArmObjPciConfigSpaceInfo,  ///< 15 - PCI Configuration Space Info
+  EArmObjHypervisorVendorIdentity,///< 16 - Hypervisor Vendor Id
+  EArmObjFixedFeatureFlags,   ///< 17 - Fixed feature flags for FADT
+  EArmObjItsGroup,///< 18 - ITS Group
+  EArmObjNamedComponent,  ///< 19 - Named Component
+  EArmObjRootComplex, ///< 20 - Root Complex
+  EArmObjSmmuV1SmmuV2,///< 21 - SMMUv1 or SMMUv2
+  EArmObjSmmuV3,  ///< 22 - SMMUv3
+  EArmObjPmcg,///< 23 - PMCG
+  EArmObjGicItsIdentifierArray,   ///< 24 - GIC ITS Identifier Array
+  EArmObjIdMapping,   ///< 25 - ID Mapping
+  EArmObjSmmuInterruptArray,  ///< 26 - SMMU Interrupt Array
+  EArmObjMax
+} EARM_OBJECT_ID;
+
+/** A structure that describes the
+ARM Boot Architecture flags.
+*/
+typedef struct CmArmBootArchInfo {
+  /** This is the ARM_BOOT_ARCH flags field of the FADT Table
+  described in the ACPI Table Specification.
+  */
+  UINT32  BootArchFlags;
+} CM_ARM_BOOT_ARCH_INFO;
+
+typedef struct CmArmCpuInfo {
+  // Reserved for use when SMBIOS tables are implemented
+} CM_ARM_CPU_INFO;
+
+typedef struct CmArmCpuInfoList {
+  UINT32 CpuCount;
+  CM_ARM_CPU_INFO  * CpuInfo;
+} CM_ARM_CPU_INFO_LIST;
+
+/** A structure that describes the
+Power Management Profile Information for the Platform.
+*/
+typedef struct CmArmPowerManagementProfileInfo {
+  /** This is the Preferred_PM_Profile field of the FADT Table
+  described in the ACPI Specification
+  */
+  UINT8  PowerManagementProfile;
+} CM_ARM_POWER_MANAGEMENT_PROFILE_INFO;
+
+/** A structure that describes the
+GIC CPU Interface for the Platform.
+*/
+typedef struct CmArmGicCInfo {
+  /// The GIC CPU Interface number.
+  UINT32  CPUInterfaceNumber;
+
+  /** The ACPI Processor UID. This must match the
+  _UID of the CPU Device object information described
+  in the DSDT

[edk2] [PATCH v1 06/22] DynamicTablesPkg: Standard NameSpace Objects

2018-12-21 Thread Sami Mujawar
The dynamic tables frameworks core communicates with the
platform specific implementation using the configuration
manager protocol interface. The dynamic tables framework
core uses this interface to retrieve information required
for generating the firmware tables. This information is
represented in the form of objects, which are classified
as standard namespace objects, Arm namespace objects or
as Custom/OEM namespace objects.

This patch introduces the definitions for standard
namespace objects.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/StandardNameSpaceObjects.h | 116 
 1 file changed, 116 insertions(+)

diff --git a/DynamicTablesPkg/Include/StandardNameSpaceObjects.h 
b/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
new file mode 100644
index 
..4f682a52dad4059b0d768d7765c4dbd875cc5d53
--- /dev/null
+++ b/DynamicTablesPkg/Include/StandardNameSpaceObjects.h
@@ -0,0 +1,116 @@
+/** @file
+
+  Copyright (c) 2017, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+- Std or STD - Standard
+**/
+
+#ifndef STANDARD_NAMESPACE_OBJECTS_H_
+#define STANDARD_NAMESPACE_OBJECTS_H_
+
+#include 
+#include 
+
+#pragma pack(1)
+
+/** A macro defining a reserved zero/NULL token value that
+does not identify any object.
+*/
+#define CM_NULL_TOKEN  0
+
+/** A reference token that the Configuration Manager can use
+to identify a Configuration Manager object.
+
+  This can be used to differentiate between instances of
+  objects of the same types. The identification scheme is
+  implementation defined and is defined by the Configuration
+  Manager.
+
+  Typically the token is used to identify a specific instance
+  from a set of objects in a call to the GetObject()/SetObject(),
+  implemented by the Configuration Manager protocol.
+
+  Note: The token value 0 is reserved for a NULL token and does
+not identify any object.
+**/
+typedef UINTN   CM_OBJECT_TOKEN;
+
+/** The ESTD_OBJECT_ID enum describes the Object IDs
+in the Standard Namespace.
+*/
+typedef enum StdObjectID {
+  EStdObjCfgMgrInfo = 0x, ///< 0 - Configuration Manager Info
+  EStdObjAcpiTableList,   ///< 1 - ACPI table Info List
+  EStdObjSmbiosTableList, ///< 2 - SMBIOS table Info List
+  EStdObjMax
+} ESTD_OBJECT_ID;
+
+/** A structure that describes the Configuration Manager Information.
+*/
+typedef struct CmStdObjConfigurationManagerInfo {
+  /// The Configuration Manager Revision.
+  UINT32  Revision;
+
+  /** The OEM ID. This information is used to
+  populate the ACPI table header information.
+  */
+  UINT8   OemId[6];
+} CM_STD_OBJ_CONFIGURATION_MANAGER_INFO;
+
+/** A structure used to describe the ACPI table generators to be invoked.
+
+  The AcpiTableData member of this structure may be used to directly provide
+  the binary ACPI table data which is required by the following standard
+  generators:
+- RAW
+- DSDT
+- SSDT
+
+  Providing the ACPI table data is optional and depends on the generator
+  that is being invoked. If unused, set AcpiTableData to NULL.
+*/
+typedef struct CmAStdObjAcpiTableInfo {
+  /// The signature of the ACPI Table to be installed.
+  UINT32 AcpiTableSignature;
+
+  /// The ACPI Table Generator ID.
+  ACPI_TABLE_GENERATOR_IDTableGeneratorId;
+
+  /// Optional pointer to the ACPI table data.
+  EFI_ACPI_DESCRIPTION_HEADER  * AcpiTableData;
+
+} CM_STD_OBJ_ACPI_TABLE_INFO;
+
+/** A structure used to describe the SMBIOS table generators to be invoked.
+
+  The SmbiosTableData member of this structure is used to provide
+  the SMBIOS table data which is required by the following standard
+  generator(s):
+- RAW
+
+  Providing the SMBIOS table data is optional and depends on the
+  generator that is being invoked. If unused, set the SmbiosTableData
+  to NULL.
+*/
+typedef struct CmStdObjSmbiosTableInfo {
+  /// The SMBIOS Table Generator ID.
+  SMBIOS_TABLE_GENERATOR_ID   TableGeneratorId;
+
+  /// Optional pointer to the SMBIOS table data.
+  SMBIOS_STRUCTURE   * SmbiosTableData;
+} CM_STD_OBJ_SMBIOS_TABLE_INFO;
+
+#pragma pack()
+
+#endif // STANDARD_NAMESPACE_OBJECTS_H_
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 05/22] DynamicTablesPkg: DT Table Generator

2018-12-21 Thread Sami Mujawar
This patch introduces the interfaces and definitions for
implementing a Device Tree table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/DeviceTreeTableGenerator.h | 182 
 1 file changed, 182 insertions(+)

diff --git a/DynamicTablesPkg/Include/DeviceTreeTableGenerator.h 
b/DynamicTablesPkg/Include/DeviceTreeTableGenerator.h
new file mode 100644
index 
..458b0578e7e872ac61aef792f220db4b3fea0384
--- /dev/null
+++ b/DynamicTablesPkg/Include/DeviceTreeTableGenerator.h
@@ -0,0 +1,182 @@
+/** @file
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+- Std or STD - Standard
+**/
+
+#ifndef DEVICETREE_TABLE_GENERATOR_H_
+#define DEVICETREE_TABLE_GENERATOR_H_
+
+#include 
+
+#pragma pack(1)
+
+/** The DT_TABLE_GENERATOR_ID type describes Device Tree table generator ID.
+*/
+typedef TABLE_GENERATOR_ID DT_TABLE_GENERATOR_ID;
+
+/** The ESTD_DT_TABLE_ID enum describes the DT table IDs reserved for
+  the standard generators.
+*/
+typedef enum StdDtTableId {
+  ESTD_DT_TABLE_ID_RESERVED = 0x, ///< Reserved.
+  ESTD_DT_TABLE_ID_RAW,   ///< RAW Generator.
+  ESTD_DT_TABLE_ID_MAX
+} ESTD_DT_TABLE_ID;
+
+/** This macro checks if the Table Generator ID is for an DT Table Generator.
+
+  @param [in] TableGeneratorId  The table generator ID.
+
+  @return TRUE if the table generator ID is for an DT Table
+Generator.
+**/
+#define IS_GENERATOR_TYPE_DT(TableGeneratorId) \
+  (GET_TABLE_TYPE(TableGeneratorId) == ETableGeneratorTypeDt)
+
+/** This macro checks if the Table Generator ID is for a standard DT
+Table Generator.
+
+  @param [in] TableGeneratorId  The table generator ID.
+
+  @return TRUE if the table generator ID is for a standard DT
+Table Generator.
+**/
+#define IS_VALID_STD_DT_GENERATOR_ID(TableGeneratorId)   \
+  (  \
+  IS_GENERATOR_NAMESPACE_STD(TableGeneratorId) &&\
+  IS_GENERATOR_TYPE_DT(TableGeneratorId)   &&\
+  ((GET_TABLE_ID(GeneratorId) >= ESTD_DT_TABLE_ID_RAW) &&\
+   (GET_TABLE_ID(GeneratorId) < ESTD_DT_TABLE_ID_MAX))   \
+  )
+
+/** This macro creates a standard DT Table Generator ID.
+
+  @param [in] TableId  The table generator ID.
+
+  @return a standard DT table generator ID.
+**/
+#define CREATE_STD_DT_TABLE_GEN_ID(TableId) \
+  CREATE_TABLE_GEN_ID ( \
+ETableGeneratorTypeDt,  \
+ETableGeneratorNameSpaceStd,\
+TableId \
+)
+
+/** Forward declarations.
+*/
+typedef struct ConfigurationManagerProtocol 
EDKII_CONFIGURATION_MANAGER_PROTOCOL;
+typedef struct CmAStdObjDtTableInfo CM_STD_OBJ_DT_TABLE_INFO;
+typedef struct DtTableGenerator DT_TABLE_GENERATOR;
+
+/** This function pointer describes the interface to DT table build
+functions provided by the DT table generator and called by the
+Table Manager to build an DT table.
+
+  @param [in]  Generator   Pointer to the DT table generator.
+  @param [in]  DtTableInfo Pointer to the DT table information.
+  @param [in]  CfgMgrProtocol  Pointer to the Configuration Manager
+   Protocol interface.
+  @param [out] Table   Pointer to the generated DT table.
+
+  @return EFI_SUCCESS  If the table is generated successfully or other
+failure codes as returned by the generator.
+**/
+typedef EFI_STATUS (*DT_TABLE_GENERATOR_BUILD_TABLE) (
+  IN  CONST DT_TABLE_GENERATOR*   Generator,
+  IN  CONST CM_STD_OBJ_DT_TABLE_INFO  * CONST DtTableInfo,
+  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST CfgMgrProtocol,
+  OUT   VOID **   Table
+  );
+
+/** This function pointer describes the interface to used by the
+Table Manager to give the generator an opportunity to free
+any resources allocated for building the DT table.
+
+  @param [in]  Generator   Pointer to the DT table generator.
+  @param [in]  DtTableInfo Pointer to the DT table information.
+  @param [in]  CfgMgrProtocol  Pointer to the Configuration Manager
+  

[edk2] [PATCH v1 04/22] DynamicTablesPkg: SMBIOS Table Generator

2018-12-21 Thread Sami Mujawar
This patch introduces the required interfaces and definitions
for implementing a SMBIOS table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/SmbiosTableGenerator.h | 240 
 1 file changed, 240 insertions(+)

diff --git a/DynamicTablesPkg/Include/SmbiosTableGenerator.h 
b/DynamicTablesPkg/Include/SmbiosTableGenerator.h
new file mode 100644
index 
..4e9193e381d051f60689e27daf84c382835d2c9f
--- /dev/null
+++ b/DynamicTablesPkg/Include/SmbiosTableGenerator.h
@@ -0,0 +1,240 @@
+/** @file
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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.
+
+**/
+
+#ifndef SMBIOS_TABLE_GENERATOR_H_
+#define SMBIOS_TABLE_GENERATOR_H_
+
+#include 
+
+#include 
+
+#pragma pack(1)
+
+/** The SMBIOS_TABLE_GENERATOR_ID type describes SMBIOS table generator ID.
+*/
+typedef TABLE_GENERATOR_ID SMBIOS_TABLE_GENERATOR_ID;
+
+/** The ESTD_SMBIOS_TABLE_ID enum describes the SMBIOS table IDs reserved for
+  the standard generators.
+
+  NOTE: The SMBIOS Generator IDs do not match the table type numbers!
+  This allows 0 to be used to catch invalid parameters.
+*/
+typedef enum StdSmbiosTableGeneratorId {
+  ESTD_SMBIOS_TABLE_ID_RESERVED = 0x,
+  ESTD_SMBIOS_TABLE_ID_RAW,
+  ESTD_SMBIOS_TABLE_ID_TYPE00,
+  ESTD_SMBIOS_TABLE_ID_TYPE01,
+  ESTD_SMBIOS_TABLE_ID_TYPE02,
+  ESTD_SMBIOS_TABLE_ID_TYPE03,
+  ESTD_SMBIOS_TABLE_ID_TYPE04,
+  ESTD_SMBIOS_TABLE_ID_TYPE05,
+  ESTD_SMBIOS_TABLE_ID_TYPE06,
+  ESTD_SMBIOS_TABLE_ID_TYPE07,
+  ESTD_SMBIOS_TABLE_ID_TYPE08,
+  ESTD_SMBIOS_TABLE_ID_TYPE09,
+  ESTD_SMBIOS_TABLE_ID_TYPE10,
+  ESTD_SMBIOS_TABLE_ID_TYPE11,
+  ESTD_SMBIOS_TABLE_ID_TYPE12,
+  ESTD_SMBIOS_TABLE_ID_TYPE13,
+  ESTD_SMBIOS_TABLE_ID_TYPE14,
+  ESTD_SMBIOS_TABLE_ID_TYPE15,
+  ESTD_SMBIOS_TABLE_ID_TYPE16,
+  ESTD_SMBIOS_TABLE_ID_TYPE17,
+  ESTD_SMBIOS_TABLE_ID_TYPE18,
+  ESTD_SMBIOS_TABLE_ID_TYPE19,
+  ESTD_SMBIOS_TABLE_ID_TYPE20,
+  ESTD_SMBIOS_TABLE_ID_TYPE21,
+  ESTD_SMBIOS_TABLE_ID_TYPE22,
+  ESTD_SMBIOS_TABLE_ID_TYPE23,
+  ESTD_SMBIOS_TABLE_ID_TYPE24,
+  ESTD_SMBIOS_TABLE_ID_TYPE25,
+  ESTD_SMBIOS_TABLE_ID_TYPE26,
+  ESTD_SMBIOS_TABLE_ID_TYPE27,
+  ESTD_SMBIOS_TABLE_ID_TYPE28,
+  ESTD_SMBIOS_TABLE_ID_TYPE29,
+  ESTD_SMBIOS_TABLE_ID_TYPE30,
+  ESTD_SMBIOS_TABLE_ID_TYPE31,
+  ESTD_SMBIOS_TABLE_ID_TYPE32,
+  ESTD_SMBIOS_TABLE_ID_TYPE33,
+  ESTD_SMBIOS_TABLE_ID_TYPE34,
+  ESTD_SMBIOS_TABLE_ID_TYPE35,
+  ESTD_SMBIOS_TABLE_ID_TYPE36,
+  ESTD_SMBIOS_TABLE_ID_TYPE37,
+  ESTD_SMBIOS_TABLE_ID_TYPE38,
+  ESTD_SMBIOS_TABLE_ID_TYPE39,
+  ESTD_SMBIOS_TABLE_ID_TYPE40,
+  ESTD_SMBIOS_TABLE_ID_TYPE41,
+  ESTD_SMBIOS_TABLE_ID_TYPE42,
+
+  // IDs 43 - 125 are reserved
+
+  ESTD_SMBIOS_TABLE_ID_TYPE126 = (ESTD_SMBIOS_TABLE_ID_TYPE00 + 126),
+  ESTD_SMBIOS_TABLE_ID_TYPE127,
+  ESTD_SMBIOS_TABLE_ID_MAX
+} ESTD_SMBIOS_TABLE_ID;
+
+/** This macro checks if the Table Generator ID is for an SMBIOS Table
+Generator.
+
+  @param [in] TableGeneratorId  The table generator ID.
+
+  @return  TRUE if the table generator ID is for an SMBIOS Table
+Generator.
+**/
+#define IS_GENERATOR_TYPE_SMBIOS(TableGeneratorId) \
+  (\
+  GET_TABLE_TYPE (TableGeneratorId) == \
+  ETableGeneratorTypeSmbios\
+  )
+
+/** This macro checks if the Table Generator ID is for a standard SMBIOS
+Table Generator.
+
+  @param [in] TableGeneratorId  The table generator ID.
+
+  @return  TRUE if the table generator ID is for a standard SMBIOS
+Table Generator.
+**/
+#define IS_VALID_STD_SMBIOS_GENERATOR_ID(TableGeneratorId)\
+  (   \
+  IS_GENERATOR_NAMESPACE_STD(TableGeneratorId) && \
+  IS_GENERATOR_TYPE_SMBIOS(TableGeneratorId)   && \
+  ((GET_TABLE_ID(GeneratorId) >= ESTD_SMBIOS_TABLE_ID_RAW) && \
+   (GET_TABLE_ID(GeneratorId) < ESTD_SMIOS_TABLE_ID_MAX)) \
+  )
+
+/** This macro creates a standard SMBIOS Table Generator ID.
+
+  @param [in] TableId  The table generator ID.
+
+  @return a standard SMBIOS table generator ID.
+**/
+#define CREATE_STD_SMBIOS_TABLE_GEN_ID(TableId) \
+  CREATE_TABLE_GEN_ID ( \
+ETableGeneratorTypeSmbios,  \
+ETableGeneratorNameSpaceStd,\
+TableId \
+)
+
+/** F

[edk2] [PATCH v1 03/22] DynamicTablesPkg: Acpi Table Generator

2018-12-21 Thread Sami Mujawar
This patch introduces the required interfaces and definitions
for implementing an ACPI table generator.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
---
 DynamicTablesPkg/Include/AcpiTableGenerator.h | 357 
 1 file changed, 357 insertions(+)

diff --git a/DynamicTablesPkg/Include/AcpiTableGenerator.h 
b/DynamicTablesPkg/Include/AcpiTableGenerator.h
new file mode 100644
index 
..ad4d0732197f25bf43f3fb3cdf0cc9321e9d2030
--- /dev/null
+++ b/DynamicTablesPkg/Include/AcpiTableGenerator.h
@@ -0,0 +1,357 @@
+/** @file
+
+  Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
+
+  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.
+
+  @par Glossary:
+- Cm or CM   - Configuration Manager
+- Obj or OBJ - Object
+- Std or STD - Standard
+**/
+
+#ifndef ACPI_TABLE_GENERATOR_H_
+#define ACPI_TABLE_GENERATOR_H_
+
+#include 
+
+// Module specific include files.
+#include 
+
+#pragma pack(1)
+
+/**
+The Dynamic Tables Framework provisions two classes of ACPI table
+generators.
+ - Standard generators: The ACPI table generators implemented by the
+Dynamic Tables Framework.
+ - OEM generators:  The ACPI table generators customized by the OEM.
+
+The Dynamic Tables Framework implements the following ACPI table generators:
+  - RAW   : This is the simplest ACPI table generator. It simply installs
+the ACPI table provided in the AcpiTableData member of the
+CM_STD_OBJ_ACPI_TABLE_INFO. The ACPI table data is provided by
+the Configuration Manager and is generated using an implementation
+defined mechanism.
+  - DSDT  : The DSDT generator is a clone of the RAW generator. The difference
+is in the way the ACPI Table Data is generated from an AML file.
+  - SSDT  : The SSDT generator is a clone of the RAW generator. The difference
+is in the way the ACPI Table Data is generated from an AML file.
+  - FADT  : The FADT generator collates the required platform information from
+the Configuration Manager and builds the FADT table.
+  - MADT  : The MADT generator collates the GIC information  from the
+Configuration Manager and builds the MADT table.
+  - GTDT  : The GTDT generator collates the Timer information from the
+Configuration Manager and builds the GTDT table.
+  - DBG2  : The DBG2 generator collates the debug serial port information from
+the Configuration Manager and builds the DBG2 table.
+  - SPCR  : The SPCR generator collates the serial port information from the
+Configuration Manager and builds the SPCR table.
+  - MCFG  : The MCFG generator collates the PCI configuration space information
+from the Configuration Manager and builds the MCFG table.
+  - IORT  : The IORT generator collates the IO Topology information from the
+Configuration Manager and builds the IORT table.
+*/
+
+/** The ACPI_TABLE_GENERATOR_ID type describes ACPI table generator ID.
+*/
+typedef TABLE_GENERATOR_ID ACPI_TABLE_GENERATOR_ID;
+
+/** The ESTD_ACPI_TABLE_ID enum describes the ACPI table IDs reserved for
+  the standard generators.
+*/
+typedef enum StdAcpiTableId {
+  ESTD_ACPI_TABLE_ID_RESERVED = 0x, ///< Reserved
+  ESTD_ACPI_TABLE_ID_RAW,   ///< RAW Generator
+  ESTD_ACPI_TABLE_ID_DSDT = ESTD_ACPI_TABLE_ID_RAW, ///< DSDT Generator
+  ESTD_ACPI_TABLE_ID_SSDT = ESTD_ACPI_TABLE_ID_RAW, ///< SSDT Generator
+  ESTD_ACPI_TABLE_ID_FADT,  ///< FADT Generator
+  ESTD_ACPI_TABLE_ID_MADT,  ///< MADT Generator
+  ESTD_ACPI_TABLE_ID_GTDT,  ///< GTDT Generator
+  ESTD_ACPI_TABLE_ID_DBG2,  ///< DBG2 Generator
+  ESTD_ACPI_TABLE_ID_SPCR,  ///< SPCR Generator
+  ESTD_ACPI_TABLE_ID_MCFG,  ///< MCFG Generator
+  ESTD_ACPI_TABLE_ID_IORT,  ///< IORT Generator
+  ESTD_ACPI_TABLE_ID_MAX
+} ESTD_ACPI_TABLE_ID;
+
+/** This macro checks if the Table Generator ID is for an ACPI Table Generator.
+
+  @param [in] TableGeneratorId  The table generator ID.
+
+  @return TRUE if the table generator ID is for an ACPI Table
+Generator.
+**/
+#define IS_GENERATOR_TYPE_ACPI(TableGeneratorId) \
+  (GET_TABLE_TYPE (TableGeneratorId) == ETableGeneratorTypeAcpi)
+
+/** This macro checks if the Table Generator ID is for a standard ACPI
+Table G

  1   2   >