public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 0/1] PCD based ACPI SPCR table
@ 2023-04-10 10:25 Abdul Lateef Attar
  2023-04-10 10:25 ` [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values Abdul Lateef Attar
  0 siblings, 1 reply; 6+ messages in thread
From: Abdul Lateef Attar @ 2023-04-10 10:25 UTC (permalink / raw)
  To: devel
  Cc: Abdul Lateef Attar, Abner Chang, Sai Chaganty, Isaac Oram,
	Nate DeSimone, Liming Gao, Abdul Lateef Attar

Update the ACPI SPCR tabled based on PCD values.

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>
Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>

Abdul Lateef Attar (1):
  SpcrFeaturePkg: Updated SPCR table based on PCD values

 .../SpcrAcpiDxe/SpcrAcpiDxe.inf               | 13 ++++++++++
 .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c     | 26 +++++++++++++++++++
 2 files changed, 39 insertions(+)

-- 
2.25.1


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

* [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values
  2023-04-10 10:25 [PATCH v1 0/1] PCD based ACPI SPCR table Abdul Lateef Attar
@ 2023-04-10 10:25 ` Abdul Lateef Attar
  2023-04-28  9:45   ` Attar, AbdulLateef (Abdul Lateef)
  0 siblings, 1 reply; 6+ messages in thread
From: Abdul Lateef Attar @ 2023-04-10 10:25 UTC (permalink / raw)
  To: devel
  Cc: Abdul Lateef Attar, Abner Chang, Sai Chaganty, Isaac Oram,
	Nate DeSimone, Liming Gao

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/SpcrAcpiDxe.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/SpcrAcpi.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


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

* Re: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values
  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>
  0 siblings, 2 replies; 6+ messages in thread
From: Attar, AbdulLateef (Abdul Lateef) @ 2023-04-28  9:45 UTC (permalink / raw)
  To: Attar, AbdulLateef (Abdul Lateef), devel@edk2.groups.io
  Cc: Chang, Abner, Sai Chaganty, Isaac Oram, Nate DeSimone, Liming Gao

[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


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

* Re: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values
  2023-04-28  9:45   ` Attar, AbdulLateef (Abdul Lateef)
@ 2023-05-02  0:08     ` Isaac Oram
       [not found]     ` <175B2AF24675592E.29517@groups.io>
  1 sibling, 0 replies; 6+ messages in thread
From: Isaac Oram @ 2023-05-02  0:08 UTC (permalink / raw)
  To: Attar, AbdulLateef (Abdul Lateef), devel@edk2.groups.io
  Cc: Chang, Abner, Chaganty, Rangasai V, Desimone, Nathaniel L,
	Gao, Liming

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


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

* Re: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values
       [not found]     ` <175B2AF24675592E.29517@groups.io>
@ 2023-05-02  0:12       ` Isaac Oram
  2023-05-02  4:18         ` Attar, AbdulLateef (Abdul Lateef)
  0 siblings, 1 reply; 6+ messages in thread
From: Isaac Oram @ 2023-05-02  0:12 UTC (permalink / raw)
  To: devel@edk2.groups.io, Oram, Isaac W,
	Attar, AbdulLateef (Abdul Lateef)
  Cc: Chang, Abner, Chaganty, Rangasai V, Desimone, Nathaniel L,
	Gao, Liming

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







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

* Re: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values
  2023-05-02  0:12       ` [edk2-devel] " Isaac Oram
@ 2023-05-02  4:18         ` Attar, AbdulLateef (Abdul Lateef)
  0 siblings, 0 replies; 6+ messages in thread
From: Attar, AbdulLateef (Abdul Lateef) @ 2023-05-02  4:18 UTC (permalink / raw)
  To: Oram, Isaac W, devel@edk2.groups.io
  Cc: Chang, Abner, Chaganty, Rangasai V, Desimone, Nathaniel L,
	Gao, Liming

[Public]

Thanks Isaac for correcting and pushing the patch.

-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@intel.com>
Sent: 02 May 2023 05:42
To: 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

[Public]

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.


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







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

end of thread, other threads:[~2023-05-02  4:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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       ` [edk2-devel] " Isaac Oram
2023-05-02  4:18         ` Attar, AbdulLateef (Abdul Lateef)

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