public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Attar, AbdulLateef (Abdul Lateef)" <AbdulLateef.Attar@amd.com>
To: "Attar, AbdulLateef (Abdul Lateef)" <AbdulLateef.Attar@amd.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "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: Re: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values
Date: Fri, 28 Apr 2023 09:45:54 +0000	[thread overview]
Message-ID: <IA1PR12MB645802447D10C9FFC7C83AE6E06B9@IA1PR12MB6458.namprd12.prod.outlook.com> (raw)
In-Reply-To: <7e573a1e75f5f61a453f099edbf846e59b0b162e.1681122267.git.abdattar@amd.com>

[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


  reply	other threads:[~2023-04-28  9:45 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) [this message]
2023-05-02  0:08     ` Isaac Oram
     [not found]     ` <175B2AF24675592E.29517@groups.io>
2023-05-02  0:12       ` [edk2-devel] " Isaac Oram
2023-05-02  4:18         ` 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=IA1PR12MB645802447D10C9FFC7C83AE6E06B9@IA1PR12MB6458.namprd12.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