public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH edk2-platforms v1-resend 0/7] Updates to support Dynamic AML
@ 2020-08-13 13:06 Sami Mujawar
  2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 1/7] Platform/ARM/Juno: Remove SSDT UART table Sami Mujawar
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Sami Mujawar @ 2020-08-13 13:06 UTC (permalink / raw)
  To: devel
  Cc: Sami Mujawar, ard.biesheuvel, leif, Alexei.Fedorov,
	Pierre.Gondois, Matteo.Carlini, Ben.Adderson, thomas.abraham,
	Hemendra.Dassanayake, Samer.El-Haj-Mahmoud, nd

Resending the patch series after dropping gerrit change IDs.

Dynamic Tables Framework has been updated to add support for Dynamic AML
at https://edk2.groups.io/g/devel/topic/patch_v1_00_30_add_dynamic/76149133

The SPCR and DBG2 generators have been updated to use the Serial Port
Fixup Library to dynamically generate the corresponding Serial ports
as Definition Block tables. This makes the static description of the
SPCR and DBG2 Serial Port definition blocks redundant.

To dynamically describe the platform serial ports a SSDT Serial Port
generator has also been introduced. 

In light of the above, the patches in this series:
 - Remove the redundant static Serial port definition blocks.
 - Use the SSDT Serial Port generator to describe the FVP
   platform Serial ports.
 - Fix an issue with incorrect interrupt assignment on FVP
   platform.
 - Remove unnecessary libraries linked with the Configuration
   Manager.
 - Increase the Juno FD size to accommodate AmlLib.

Note: This patch series is dependent on the patch series at
https://edk2.groups.io/g/devel/message/63246, which must be
merged before this series can be integrated.

The changes for this patch series can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/675_dynamic_aml_v1

Pierre Gondois (1):
  ArmPlatformPkg: Juno: Increase FD size

Sami Mujawar (6):
  Platform/ARM/Juno: Remove SSDT UART table
  Platform/ARM: FVP: Fix serial port interrupt
  Platform/ARM: FVP: Add UART base address length
  Platform/ARM: FVP: Enable SSDT Serial generation
  Platform/ARM: Juno: Configuration Mgr lib linkage
  Platform/ARM: FVP: Configuration Mgr lib linkage

 Platform/ARM/JunoPkg/ArmJuno.fdf                                                                  |  8 ++--
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/AslTables/SsdtUart.asl          | 42 -------------------
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c          |  7 ----
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h          |  3 +-
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf     |  4 +-
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc                                              |  4 +-
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/AslTables/Dsdt.asl          | 25 ++---------
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c      | 44 ++++++++++++++++++--
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h      |  5 ++-
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf |  2 -
 10 files changed, 56 insertions(+), 88 deletions(-)
 delete mode 100644 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/AslTables/SsdtUart.asl

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH edk2-platforms v1-resend 1/7] Platform/ARM/Juno: Remove SSDT UART table
  2020-08-13 13:06 [PATCH edk2-platforms v1-resend 0/7] Updates to support Dynamic AML Sami Mujawar
@ 2020-08-13 13:06 ` Sami Mujawar
  2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 2/7] ArmPlatformPkg: Juno: Increase FD size Sami Mujawar
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Sami Mujawar @ 2020-08-13 13:06 UTC (permalink / raw)
  To: devel
  Cc: Sami Mujawar, ard.biesheuvel, leif, Alexei.Fedorov,
	Pierre.Gondois, Matteo.Carlini, Ben.Adderson, thomas.abraham, nd

With the introduction of Dynamic AML the DBG2 and SPCR port
generators have been updates to generate the AML code for
describing the Serial ports.

This makes the UART description in the SSDT table redundant.
This patch removes the SsdtUart.asl and makes the corresponding
changes to the configuration manager.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
---
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/AslTables/SsdtUart.asl      | 42 --------------------
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c      |  7 ----
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h      |  3 +-
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf |  1 -
 4 files changed, 1 insertion(+), 52 deletions(-)

diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/AslTables/SsdtUart.asl b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/AslTables/SsdtUart.asl
deleted file mode 100644
index 55a7ffc83fd6bb44ed9b9ca8b0a53e757aa2dd58..0000000000000000000000000000000000000000
--- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/AslTables/SsdtUart.asl
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
-  SSDT for UART
-
-  Copyright (c) 2014 - 2019, ARM Ltd. All rights reserved.<BR>
-    SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-#include "ArmPlatform.h"
-
-DefinitionBlock("SsdtUart.aml", "SSDT", 1, "ARMLTD", "ARM-JUNO", EFI_ACPI_ARM_OEM_REVISION) {
-  Scope(_SB) {
-    // UART PL011
-    Device(COM2) {
-      Name(_HID, "ARMH0011")
-      Name(_CID, "PL011")
-      Name(_UID, Zero)
-
-      Method(_STA) {
-        Return (0xF)
-      }
-
-      Method(_CRS, 0x0, NotSerialized) {
-        Name(RBUF, ResourceTemplate() {
-          Memory32Fixed(
-            ReadWrite,
-            FixedPcdGet64 (PcdSerialRegisterBase),
-            0x1000
-            )
-          Interrupt(
-            ResourceConsumer,
-            Level,
-            ActiveHigh,
-            Exclusive
-            ) {
-              FixedPcdGet32 (PL011UartInterrupt)
-            }
-          })
-        Return (RBUF)
-      }
-    }
-  }
-}
diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
index 913cffc9b994319065b5292b0d28970a0a0d8320..1d0bcc20b325911d4f1079e8394b20bfb4492507 100644
--- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
+++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -83,13 +83,6 @@ EDKII_PLATFORM_REPOSITORY_INFO ArmJunoPlatformRepositoryInfo = {
       CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdSsdt),
       (EFI_ACPI_DESCRIPTION_HEADER*)ssdtjunousb_aml_code
     },
-    // SSDT table describing the PL011 UART
-    {
-      EFI_ACPI_6_2_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE,
-      0, // Unused
-      CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdSsdt),
-      (EFI_ACPI_DESCRIPTION_HEADER*)ssdtuart_aml_code
-    },
     // PPTT Table
     {
       EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_STRUCTURE_SIGNATURE,
diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
index 2073ae4902e540de869612353bfaf0ebacaea50d..b6e15015b6edd65a53ea842ac05b5a2e63186b95 100644
--- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
+++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
@@ -19,7 +19,6 @@
 extern CHAR8  dsdt_aml_code[];
 extern CHAR8  ssdtjunousb_aml_code[];
 extern CHAR8  ssdtpci_aml_code[];
-extern CHAR8  ssdtuart_aml_code[];
 
 /** The configuration manager version
 */
@@ -186,7 +185,7 @@ extern CHAR8  ssdtuart_aml_code[];
 
 /** The number of ACPI tables to install
 */
-#define PLAT_ACPI_TABLE_COUNT   11
+#define PLAT_ACPI_TABLE_COUNT   10
 
 /** The number of platform generic timer blocks
 */
diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
index a3e7db12f8c913f7111b5ff4ad724a5bdcc35956..59e2410d255d71067319204575e9050b6e452427 100644
--- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
@@ -25,7 +25,6 @@ [Sources]
   AslTables/Dsdt.asl
   AslTables/SsdtJunoUsb.asl
   AslTables/SsdtPci.asl
-  AslTables/SsdtUart.asl
 
 [Packages]
   ArmPkg/ArmPkg.dec
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH edk2-platforms v1-resend 2/7] ArmPlatformPkg: Juno: Increase FD size
  2020-08-13 13:06 [PATCH edk2-platforms v1-resend 0/7] Updates to support Dynamic AML Sami Mujawar
  2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 1/7] Platform/ARM/Juno: Remove SSDT UART table Sami Mujawar
@ 2020-08-13 13:06 ` Sami Mujawar
  2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 3/7] Platform/ARM: FVP: Fix serial port interrupt Sami Mujawar
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Sami Mujawar @ 2020-08-13 13:06 UTC (permalink / raw)
  To: devel
  Cc: Sami Mujawar, ard.biesheuvel, leif, Alexei.Fedorov,
	Pierre.Gondois, Matteo.Carlini, Ben.Adderson, thomas.abraham, nd

From: Pierre Gondois <pierre.gondois@arm.com>

Dynamic Tables Framework has been updated to include
support for SSDT Serial Port generator. The SSDT Serial
port generator uses AmlLib library to parse, iterate
and update AML nodes.

The addition of these libraries to the Dynamic Tables
Framework have increased the size requirement of the
Firmware Device (FD) Image.

The current FD size is not sufficient due to which the
Juno firmware builds are failing. This patch adds one
additional block to accommodate the increase in FD size.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
---
 Platform/ARM/JunoPkg/ArmJuno.fdf | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Platform/ARM/JunoPkg/ArmJuno.fdf b/Platform/ARM/JunoPkg/ArmJuno.fdf
index 5d791a4e16075073992a5646db34d094677837d2..f70d30c6a9d9d6eb73087dc673f0c9287d23d666 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.fdf
+++ b/Platform/ARM/JunoPkg/ArmJuno.fdf
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2013-2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2013-2019, Arm Limited. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -20,12 +20,12 @@
 
 [FD.BL33_AP_UEFI]
 BaseAddress   = 0xE0000000|gArmTokenSpaceGuid.PcdFdBaseAddress  # The base address of the Firmware in NOR Flash.
-Size          = 0x000F8000|gArmTokenSpaceGuid.PcdFdSize         # The size in bytes of the FLASH Device
+Size          = 0x000F9000|gArmTokenSpaceGuid.PcdFdSize         # The size in bytes of the FLASH Device
 ErasePolarity = 1
 
 # This one is tricky, it must be: BlockSize * NumBlocks = Size
 BlockSize     = 0x00001000
-NumBlocks     = 0xF8
+NumBlocks     = 0xF9
 
 ################################################################################
 #
@@ -43,7 +43,7 @@ [FD.BL33_AP_UEFI]
 #
 ################################################################################
 
-0x00000000|0x000F8000
+0x00000000|0x000F9000
 gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
 FV = FVMAIN_COMPACT
 
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH edk2-platforms v1-resend 3/7] Platform/ARM: FVP: Fix serial port interrupt
  2020-08-13 13:06 [PATCH edk2-platforms v1-resend 0/7] Updates to support Dynamic AML Sami Mujawar
  2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 1/7] Platform/ARM/Juno: Remove SSDT UART table Sami Mujawar
  2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 2/7] ArmPlatformPkg: Juno: Increase FD size Sami Mujawar
@ 2020-08-13 13:06 ` Sami Mujawar
  2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 4/7] Platform/ARM: FVP: Add UART base address length Sami Mujawar
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Sami Mujawar @ 2020-08-13 13:06 UTC (permalink / raw)
  To: devel
  Cc: Sami Mujawar, ard.biesheuvel, leif, Alexei.Fedorov,
	Pierre.Gondois, Matteo.Carlini, Ben.Adderson, thomas.abraham, nd

The UART base address and IRQ assignment for FVP platform
is as below:
  UART    BASE ADDRESS    IRQ ID
  UART0   0x1C09_0000     37
  UART1   0x1C0A_0000     38
  UART2   0x1C0B_0000     39
  UART3   0x1C0C_0000     40

Reference:
https://developer.arm.com/documentation/100964/1111/Base-Platform

Fix the IRQ IDs assignment in the firmware for UART1 and UART2.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
---
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc                                         | 4 ++--
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
index a6f536a332281a624403dac2e4bf18aa9ba96d0b..dc4735c025e969e17d24184abf77e6dbb28ef581 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2011-2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2011-2020, Arm Limited. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -126,7 +126,7 @@ [PcdsFixedAtBuild.common]
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x1c0a0000
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultReceiveFifoDepth|0
-  gArmPlatformTokenSpaceGuid.PL011UartInterrupt|0x25
+  gArmPlatformTokenSpaceGuid.PL011UartInterrupt|0x26
 
   ## PL011 Serial Debug UART (DBG2)
   gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase|0x1c0b0000
diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
index a48eb0285c60177078324bdbcd8fa29c308e6a13..48559cb6af46309b13e2f8746f883875c3c0cc8b 100644
--- a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -204,7 +204,7 @@ EDKII_PLATFORM_REPOSITORY_INFO VExpressPlatRepositoryInfo = {
   // Debug Serial Port
   {
     FixedPcdGet64 (PcdSerialDbgRegisterBase),                 // BaseAddress
-    38,                                                       // Interrupt
+    39,                                                       // Interrupt
     FixedPcdGet64 (PcdSerialDbgUartBaudRate),                 // BaudRate
     FixedPcdGet32 (PcdSerialDbgUartClkInHz),                  // Clock
     EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART   // Port subtype
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH edk2-platforms v1-resend 4/7] Platform/ARM: FVP: Add UART base address length
  2020-08-13 13:06 [PATCH edk2-platforms v1-resend 0/7] Updates to support Dynamic AML Sami Mujawar
                   ` (2 preceding siblings ...)
  2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 3/7] Platform/ARM: FVP: Fix serial port interrupt Sami Mujawar
@ 2020-08-13 13:06 ` Sami Mujawar
  2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 5/7] Platform/ARM: FVP: Enable SSDT Serial generation Sami Mujawar
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Sami Mujawar @ 2020-08-13 13:06 UTC (permalink / raw)
  To: devel
  Cc: Sami Mujawar, ard.biesheuvel, leif, Alexei.Fedorov,
	Pierre.Gondois, Matteo.Carlini, Ben.Adderson, thomas.abraham, nd

The SPCR and DBG2 generators have been updated to
generate SSDT serial port tables representing the
SPCR and DBG2 serial ports. This is done using the
Dynamic AML feature. The Base address range for the
serial device is required so that it can be fixed-up
in the SSDT serial port template AML code.

To facilitate this the serial port information
structure CM_ARM_SERIAL_PORT_INFO has been updated
to include the Base address length for the serial
port.

Update the Configuration Manager repository to
populate the serial port Base Address Length field
in the CM_ARM_SERIAL_PORT_INFO structure.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
---
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
index 48559cb6af46309b13e2f8746f883875c3c0cc8b..76ea46023250d244205a5d8bc715e6e49e37b673 100644
--- a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -199,7 +199,8 @@ EDKII_PLATFORM_REPOSITORY_INFO VExpressPlatRepositoryInfo = {
     FixedPcdGet32 (PL011UartInterrupt),                       // Interrupt
     FixedPcdGet64 (PcdUartDefaultBaudRate),                   // BaudRate
     FixedPcdGet32 (PL011UartClkInHz),                         // Clock
-    EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART   // Port subtype
+    EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART,  // Port subtype
+    0x1000                                                    // BaseAddressLen
   },
   // Debug Serial Port
   {
@@ -207,7 +208,8 @@ EDKII_PLATFORM_REPOSITORY_INFO VExpressPlatRepositoryInfo = {
     39,                                                       // Interrupt
     FixedPcdGet64 (PcdSerialDbgUartBaudRate),                 // BaudRate
     FixedPcdGet32 (PcdSerialDbgUartClkInHz),                  // Clock
-    EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART   // Port subtype
+    EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART,  // Port subtype
+    0x1000                                                    // BaseAddressLen
   },
 
   // GIC ITS
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH edk2-platforms v1-resend 5/7] Platform/ARM: FVP: Enable SSDT Serial generation
  2020-08-13 13:06 [PATCH edk2-platforms v1-resend 0/7] Updates to support Dynamic AML Sami Mujawar
                   ` (3 preceding siblings ...)
  2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 4/7] Platform/ARM: FVP: Add UART base address length Sami Mujawar
@ 2020-08-13 13:06 ` Sami Mujawar
  2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 6/7] Platform/ARM: Juno: Configuration Mgr lib linkage Sami Mujawar
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Sami Mujawar @ 2020-08-13 13:06 UTC (permalink / raw)
  To: devel
  Cc: Sami Mujawar, ard.biesheuvel, leif, Alexei.Fedorov,
	Pierre.Gondois, Matteo.Carlini, Ben.Adderson, thomas.abraham, nd

The SSDT Serial Port Generator queries the
Configuration Manager for a list of serial
port devices. It uses the SerialPortFixupLib
to build SSDT AML tables describing the
serial ports.

The SerialPortFixupLib uses the AmlLib library
interfaces to load a Serial Port AML template
code and represents it as an AML tree. It then
traverses the AML tree to locate and fixup the
Base address and Interrupt information for the
serial port devices. The AML tree is then
serialized to a buffer representing the
definition block which is returned as an ACPI
SSDT table.

The SSDT Serial Port Generator returns a list
of SSDT AML tables representing the serial port
devices to the Table Manager for installing.

This patch enables dynamic SSDT Serial Port
generation for FVP platform and adds support
to the Configuration Manager to return the
CM_ARM_SERIAL_PORT_INFO objects that represents
the serial port devices on the platform.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
---
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/AslTables/Dsdt.asl     | 25 ++------------
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c | 36 ++++++++++++++++++++
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h |  5 ++-
 3 files changed, 43 insertions(+), 23 deletions(-)

diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/AslTables/Dsdt.asl b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/AslTables/Dsdt.asl
index 9192a0070772209e5cec8d7d9a71ea7a9e10aa69..3475f976b59fc68384ed11f7de23f552efe441e9 100644
--- a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/AslTables/Dsdt.asl
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/AslTables/Dsdt.asl
@@ -1,8 +1,9 @@
 /** @file
   Differentiated System Description Table Fields (DSDT)
 
-  Copyright (c) 2014-2017, ARM Ltd. All rights reserved.<BR>
-    SPDX-License-Identifier: BSD-2-Clause-Patent
+  Copyright (c) 2014-2020, Arm Ltd. All rights reserved.<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
@@ -43,25 +44,5 @@ DefinitionBlock("DsdtTable.aml", "DSDT", 1, "ARMLTD", "ARM-VEXP", 1) {
       Name(_HID, "ACPI0007")
       Name(_UID, 7)
     }
-
-    // UART PL011
-    Device(COM2) {
-      Name(_HID, "ARMH0011")
-      Name(_CID, "PL011")
-      Name(_UID, Zero)
-
-      Method(_STA) {
-        Return(0xF)
-      }
-
-      Method(_CRS, 0x0, NotSerialized) {
-        Name(RBUF, ResourceTemplate() {
-          Memory32Fixed(ReadWrite, 0x1c090000, 0x1000)
-          Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 0x25 }
-        })
-        Return (RBUF)
-      }
-    }
-
   } // Scope(_SB)
 }
diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
index 76ea46023250d244205a5d8bc715e6e49e37b673..d49da52634cf70228852e4351c5538b85aab60e0 100644
--- a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -74,6 +74,13 @@ EDKII_PLATFORM_REPOSITORY_INFO VExpressPlatRepositoryInfo = {
       EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION,
       CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdDbg2),
       NULL
+    },
+    // SSDT Serial Port Table
+    {
+      EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE,
+      0,  // Not used.
+      CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdSsdtSerialPort),
+      NULL
     }
   },
 
@@ -212,6 +219,28 @@ EDKII_PLATFORM_REPOSITORY_INFO VExpressPlatRepositoryInfo = {
     0x1000                                                    // BaseAddressLen
   },
 
+  // Standard Serial Ports
+  {
+    // Serial Port - UART0
+    {
+      0x1C090000,                                             // BaseAddress
+      37,                                                     // Interrupt
+      FixedPcdGet64 (PcdSerialDbgUartBaudRate),               // BaudRate
+      FixedPcdGet32 (PcdSerialDbgUartClkInHz),                // Clock
+      EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART,       // Port subtype
+      0x1000                                                  // BaseAddressLen
+    },
+    // Serial Port - UART3
+    {
+      0x1C0C0000,                                             // BaseAddress
+      40,                                                     // Interrupt
+      FixedPcdGet64 (PcdSerialDbgUartBaudRate),               // BaudRate
+      FixedPcdGet32 (PcdSerialDbgUartClkInHz),                // Clock
+      EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART,       // Port subtype
+      0x1000                                                  // BaseAddressLen
+    },
+  },
+
   // GIC ITS
   {
     // The GIC ITS ID.
@@ -457,6 +486,13 @@ GetArmNameSpaceObject (
       1
       );
     HANDLE_CM_OBJECT (
+      EArmObjSerialPortInfo,
+      CmObjectId,
+      PlatformRepo->StdSerialPort,
+      (sizeof (PlatformRepo->StdSerialPort) /
+          sizeof (PlatformRepo->StdSerialPort[0]))
+      );
+    HANDLE_CM_OBJECT (
       EArmObjGicItsInfo,
       CmObjectId,
       PlatformRepo->GicItsInfo,
diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
index 6fb959ab7ae2c77f750781d05660957488fae8cd..65561aa487dac95c1c870eb109238cdc88213205 100644
--- a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
@@ -114,7 +114,7 @@ extern CHAR8  dsdt_aml_code[];
 
 /** 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
 */
@@ -174,6 +174,9 @@ typedef struct PlatformRepositoryInfo {
   /// Serial port information for the DBG2 UART port
   CM_ARM_SERIAL_PORT_INFO               DbgSerialPort;
 
+  /// Standard Serial Ports
+  CM_ARM_SERIAL_PORT_INFO               StdSerialPort[2];
+
   /// GIC ITS information
   CM_ARM_GIC_ITS_INFO                   GicItsInfo;
 } EDKII_PLATFORM_REPOSITORY_INFO;
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH edk2-platforms v1-resend 6/7] Platform/ARM: Juno: Configuration Mgr lib linkage
  2020-08-13 13:06 [PATCH edk2-platforms v1-resend 0/7] Updates to support Dynamic AML Sami Mujawar
                   ` (4 preceding siblings ...)
  2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 5/7] Platform/ARM: FVP: Enable SSDT Serial generation Sami Mujawar
@ 2020-08-13 13:06 ` Sami Mujawar
  2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 7/7] Platform/ARM: FVP: " Sami Mujawar
  2020-08-13 15:39 ` [edk2-devel] [PATCH edk2-platforms v1-resend 0/7] Updates to support Dynamic AML Alexei Fedorov
  7 siblings, 0 replies; 9+ messages in thread
From: Sami Mujawar @ 2020-08-13 13:06 UTC (permalink / raw)
  To: devel
  Cc: Sami Mujawar, ard.biesheuvel, leif, Alexei.Fedorov,
	Pierre.Gondois, Matteo.Carlini, Ben.Adderson, thomas.abraham, nd

Rationalise the libraries linked with the Juno Configuration
Manager.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
---
 Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
index 59e2410d255d71067319204575e9050b6e452427..8e1f4a8fece304e9992e67e91948038b9774095b 100644
--- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
@@ -35,11 +35,10 @@ [Packages]
   Platform/ARM/JunoPkg/ArmJuno.dec
 
 [LibraryClasses]
-  ArmPlatformLib
+  IoLib
   PrintLib
   UefiBootServicesTableLib
   UefiDriverEntryPoint
-  UefiRuntimeServicesTableLib
 
 [Protocols]
   gEdkiiConfigurationManagerProtocolGuid
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH edk2-platforms v1-resend 7/7] Platform/ARM: FVP: Configuration Mgr lib linkage
  2020-08-13 13:06 [PATCH edk2-platforms v1-resend 0/7] Updates to support Dynamic AML Sami Mujawar
                   ` (5 preceding siblings ...)
  2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 6/7] Platform/ARM: Juno: Configuration Mgr lib linkage Sami Mujawar
@ 2020-08-13 13:06 ` Sami Mujawar
  2020-08-13 15:39 ` [edk2-devel] [PATCH edk2-platforms v1-resend 0/7] Updates to support Dynamic AML Alexei Fedorov
  7 siblings, 0 replies; 9+ messages in thread
From: Sami Mujawar @ 2020-08-13 13:06 UTC (permalink / raw)
  To: devel
  Cc: Sami Mujawar, ard.biesheuvel, leif, Alexei.Fedorov,
	Pierre.Gondois, Matteo.Carlini, Ben.Adderson, thomas.abraham, nd

Rationalise the libraries linked with the FVP Configuration
Manager.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
---
 Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf | 2 --
 1 file changed, 2 deletions(-)

diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
index c17595b7ec37cdd1c99b258cd32d1bde6c76a5ed..359c37166a50daacdd2d2f5371060870ddcfe629 100644
--- a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
@@ -33,11 +33,9 @@ [Packages]
   Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
 
 [LibraryClasses]
-  ArmPlatformLib
   PrintLib
   UefiBootServicesTableLib
   UefiDriverEntryPoint
-  UefiRuntimeServicesTableLib
 
 [Protocols]
   gEdkiiConfigurationManagerProtocolGuid
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [edk2-devel] [PATCH edk2-platforms v1-resend 0/7] Updates to support Dynamic AML
  2020-08-13 13:06 [PATCH edk2-platforms v1-resend 0/7] Updates to support Dynamic AML Sami Mujawar
                   ` (6 preceding siblings ...)
  2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 7/7] Platform/ARM: FVP: " Sami Mujawar
@ 2020-08-13 15:39 ` Alexei Fedorov
  7 siblings, 0 replies; 9+ messages in thread
From: Alexei Fedorov @ 2020-08-13 15:39 UTC (permalink / raw)
  To: Sami Mujawar, devel

[-- Attachment #1: Type: text/plain, Size: 54 bytes --]

Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>

[-- Attachment #2: Type: text/html, Size: 60 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-08-13 15:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-13 13:06 [PATCH edk2-platforms v1-resend 0/7] Updates to support Dynamic AML Sami Mujawar
2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 1/7] Platform/ARM/Juno: Remove SSDT UART table Sami Mujawar
2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 2/7] ArmPlatformPkg: Juno: Increase FD size Sami Mujawar
2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 3/7] Platform/ARM: FVP: Fix serial port interrupt Sami Mujawar
2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 4/7] Platform/ARM: FVP: Add UART base address length Sami Mujawar
2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 5/7] Platform/ARM: FVP: Enable SSDT Serial generation Sami Mujawar
2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 6/7] Platform/ARM: Juno: Configuration Mgr lib linkage Sami Mujawar
2020-08-13 13:06 ` [PATCH edk2-platforms v1-resend 7/7] Platform/ARM: FVP: " Sami Mujawar
2020-08-13 15:39 ` [edk2-devel] [PATCH edk2-platforms v1-resend 0/7] Updates to support Dynamic AML Alexei Fedorov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox