[edk2-devel] [PATCH edk2-platforms v1-resend 5/7] Platform/ARM: FVP: Enable SSDT Serial generation

Sami Mujawar sami.mujawar at arm.com
Thu Aug 13 13:06:50 UTC 2020


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 at arm.com>
Signed-off-by: Sami Mujawar <sami.mujawar at arm.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel at 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)'


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#64174): https://edk2.groups.io/g/devel/message/64174
Mute This Topic: https://groups.io/mt/76166642/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list