public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Isaac Oram" <isaac.w.oram@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Oram, Isaac W" <isaac.w.oram@intel.com>,
	"Attar, AbdulLateef (Abdul Lateef)" <AbdulLateef.Attar@amd.com>
Cc: "Chang, Abner" <Abner.Chang@amd.com>,
	"Chaganty, Rangasai V" <rangasai.v.chaganty@intel.com>,
	"Desimone, Nathaniel L" <nathaniel.l.desimone@intel.com>,
	"Gao, Liming" <gaoliming@byosoft.com.cn>
Subject: Re: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values
Date: Tue, 2 May 2023 00:12:27 +0000	[thread overview]
Message-ID: <SA1PR11MB5801347169239E0D378C81B3D06F9@SA1PR11MB5801.namprd11.prod.outlook.com> (raw)
In-Reply-To: <175B2AF24675592E.29517@groups.io>

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@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Isaac Oram
Sent: Monday, May 1, 2023 5:08 PM
To: Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@amd.com>; devel@edk2.groups.io
Cc: Chang, Abner <Abner.Chang@amd.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Gao, Liming <gaoliming@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@intel.com>

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

From: Abdul Lateef Attar <AbdulLateef.Attar@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@amd.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@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







  parent reply	other threads:[~2023-05-02  0:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-10 10:25 [PATCH v1 0/1] PCD based ACPI SPCR table Abdul Lateef Attar
2023-04-10 10:25 ` [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values Abdul Lateef Attar
2023-04-28  9:45   ` Attar, AbdulLateef (Abdul Lateef)
2023-05-02  0:08     ` Isaac Oram
     [not found]     ` <175B2AF24675592E.29517@groups.io>
2023-05-02  0:12       ` Isaac Oram [this message]
2023-05-02  4:18         ` [edk2-devel] " Attar, AbdulLateef (Abdul Lateef)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SA1PR11MB5801347169239E0D378C81B3D06F9@SA1PR11MB5801.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox