[edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

Isaac Oram isaac.w.oram at intel.com
Tue May 2 00:12:27 UTC 2023


Pushed as 64b06a4d19..d39c665fe3

Note I had trouble extracting the patch.  I had to ignore whitespace and then fixup line endings to pass
python \edk2\BaseTools\Scripts\PatchCheck.py -1

Regards,
Isaac

-----Original Message-----
From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Isaac Oram
Sent: Monday, May 1, 2023 5:08 PM
To: Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar at amd.com>; devel at edk2.groups.io
Cc: Chang, Abner <Abner.Chang at amd.com>; Chaganty, Rangasai V <rangasai.v.chaganty at intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone at intel.com>; Gao, Liming <gaoliming at byosoft.com.cn>
Subject: Re: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

Reviewed-by: Isaac Oram <isaac.w.oram at intel.com>

-----Original Message-----
From: Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar at amd.com>
Sent: Friday, April 28, 2023 2:46 AM
To: Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar at amd.com>; devel at edk2.groups.io
Cc: Chang, Abner <Abner.Chang at amd.com>; Chaganty, Rangasai V <rangasai.v.chaganty at intel.com>; Oram, Isaac W <isaac.w.oram at intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone at intel.com>; Gao, Liming <gaoliming at byosoft.com.cn>
Subject: RE: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

[Public]

Hi Maintainers,
        Please review the patch.
Thanks
AbduL

-----Original Message-----
From: Abdul Lateef Attar <abdattar at amd.com>
Sent: 10 April 2023 15:56
To: devel at edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar at amd.com>; Chang, Abner <Abner.Chang at amd.com>; Sai Chaganty <rangasai.v.chaganty at intel.com>; Isaac Oram <isaac.w.oram at intel.com>; Nate DeSimone <nathaniel.l.desimone at intel.com>; Liming Gao <gaoliming at byosoft.com.cn>
Subject: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

From: Abdul Lateef Attar <AbdulLateef.Attar at amd.com>

Update the SPCR table based on PCD values, such as base address, register bit width, access size and address space id etc, along with OEM data.

Cc: Abner Chang <abner.chang at amd.com>
Cc: Sai Chaganty <rangasai.v.chaganty at intel.com>
Cc: Isaac Oram <isaac.w.oram at intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone at intel.com>
Cc: Liming Gao <gaoliming at byosoft.com.cn>
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar at amd.com>
---
 .../SpcrAcpiDxe/SpcrAcpiDxe.inf               | 13 ++++++++++
 .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c     | 26 +++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
index 3fc84959a015..9a4f95e86bbf 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ AcpiDxe.inf
@@ -2,6 +2,7 @@
 # SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).
 #
 # Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.<BR>
+#  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved.<BR>
 # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ## @@ -26,6 +27,7 @@ [LibraryClasses]

 [Packages]
   MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
   SpcrFeaturePkg/SpcrFeaturePkg.dec

 [Sources]
@@ -38,5 +40,16 @@ [Protocols]
   gEfiSerialIoProtocolGuid                      ## SOMETIMES_CONSUMES
   gEfiPciIoProtocolGuid                         ## SOMETIMES_CONSUMES

+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterAccessWidth
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio
+
 [Depex]
   TRUE
diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
index 7ad0c058c844..51449d0fad9e 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ Acpi.c
@@ -3,6 +3,7 @@
   SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).

   Copyright (c) 2004 - 2020, Intel Corporation. All rights reserved.<BR>
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+ reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent

 **/
@@ -368,6 +369,7 @@ OutOfBandACPITableConstruction (
   UINT32                   FlowControl;
   VENDOR_DEVICE_PATH       *Vendor;
   UINT8                    Index;
+  UINT64                   AcpiTableOemId;

   Handle          = NULL;

@@ -456,6 +458,30 @@ OutOfBandACPITableConstruction (
     goto out;
   }

+  // Base register details
+  gSpcrInfo.BaseAddress.Address = PcdGet64 (PcdSerialRegisterBase); 
+ gSpcrInfo.BaseAddress.RegisterBitWidth = PcdGet8 
+ (PcdSerialRegisterAccessWidth);  gSpcrInfo.BaseAddress.AccessSize =
+ (UINT8)PcdGet32 (PcdSerialRegisterStride);  if (PcdGetBool (PcdSerialUseMmio)) {
+    gSpcrInfo.BaseAddress.AddressSpaceId = EFI_ACPI_3_0_SYSTEM_MEMORY; 
+ }
+
+  // OEM info
+  CopyMem (
+    (VOID *) &gSpcrInfo.Header.OemId,
+    PcdGetPtr (PcdAcpiDefaultOemId),
+    sizeof (gSpcrInfo.Header.OemId)
+    );
+  AcpiTableOemId = PcdGet64 (PcdAcpiDefaultOemTableId);  CopyMem (
+    (VOID *) &gSpcrInfo.Header.OemTableId,
+    (VOID *) &AcpiTableOemId,
+    sizeof (gSpcrInfo.Header.OemTableId)
+    );
+  gSpcrInfo.Header.OemRevision     = PcdGet32 (PcdAcpiDefaultOemRevision);
+  gSpcrInfo.Header.CreatorId       = PcdGet32 (PcdAcpiDefaultCreatorId);
+  gSpcrInfo.Header.CreatorRevision = PcdGet32 
+ (PcdAcpiDefaultCreatorRevision);
+
   //
   // Add table
   //
--
2.25.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#103831): https://edk2.groups.io/g/devel/message/103831
Mute This Topic: https://groups.io/mt/98172595/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