Reviewed-by: Nate DeSimone <nathaniel.l.desim...@intel.com>

-----Original Message-----
From: Abdul Lateef Attar <abdat...@amd.com> 
Sent: Wednesday, August 2, 2023 11:35 PM
To: devel@edk2.groups.io
Cc: Abdul Lateef Attar <abdullateef.at...@amd.com>; Chaganty, Rangasai V 
<rangasai.v.chaga...@intel.com>; Oram, Isaac W <isaac.w.o...@intel.com>; 
Desimone, Nathaniel L <nathaniel.l.desim...@intel.com>; Gao, Liming 
<gaolim...@byosoft.com.cn>; Abner Chang <abner.ch...@amd.com>
Subject: [PATCH 1/1] OutOfBandManagement/SpcrFeaturePkg: PCD based IRQ/GSI

From: Abdul Lateef Attar <abdullateef.at...@amd.com>

Create a new PCD to hold the IRQ or GSI number for SPCR, with default values of 
4.
Update the ACPI SPCR table's IRQ value based on PCD.

Cc: Sai Chaganty <rangasai.v.chaga...@intel.com>
Cc: Isaac Oram <isaac.w.o...@intel.com>
Cc: Nate DeSimone <nathaniel.l.desim...@intel.com>
Cc: Liming Gao <gaolim...@byosoft.com.cn>
Cc: Abner Chang <abner.ch...@amd.com>
Signed-off-by: Abdul Lateef Attar <abdullateef.at...@amd.com>

Change-Id: I7218903fa5572f8139ad45db598ab085f079713b
---
 .../OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dec  | 5 +++++
 .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf             | 4 ++++
 .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.h                  | 3 +++
 .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c                  | 7 ++++---
 4 files changed, 16 insertions(+), 3 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dec 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dec
index b084fad89220..d69d650f3f20 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dec
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.d
+++ ec
@@ -7,6 +7,7 @@
 # for the build infrastructure.
 #
 # Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -24,6 +25,10 @@ 
[Includes]  [Guids]
   gSpcrFeaturePkgTokenSpaceGuid = { 0xe978c988, 0xeeba, 0x4671, { 0xb8, 0x0d, 
0xcc, 0x8b, 0x89, 0xb5, 0xd1, 0xef }}
 
+[PcdsFixedAtBuild]
+  # SPCR default IRQ set to 4
+  gSpcrFeaturePkgTokenSpaceGuid.PcdSpcrInterrupt|4|UINT8|0x00000010
+
 [PcdsFeatureFlag]
   gSpcrFeaturePkgTokenSpaceGuid.PcdSpcrFeatureEnable|FALSE|BOOLEAN|0x00000001
 
diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
index 9a4f95e86bbf..cd43afea5242 100644
--- 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ AcpiDxe.inf
@@ -24,6 +24,7 @@ [LibraryClasses]
   UefiDriverEntryPoint
   UefiLib
   SpcrDeviceLib
+  PcdLib
 
 [Packages]
   MdePkg/MdePkg.dec
@@ -51,5 +52,8 @@ [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio
 
+[FixedPcd]
+  gSpcrFeaturePkgTokenSpaceGuid.PcdSpcrInterrupt
+
 [Depex]
   TRUE
diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.h 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.h
index c11da439fcb8..245a847762c5 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.h
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ Acpi.h
@@ -3,6 +3,8 @@
   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.
+
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -23,6 +25,7 @@
 #include <Library/BaseMemoryLib.h>
 #include <Library/MemoryAllocationLib.h>  #include <Library/SpcrDeviceLib.h>
+#include <Library/PcdLib.h>
 
 #include <Protocol/AcpiTable.h>
 #include <Protocol/SerialIo.h>
diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
index 51449d0fad9e..e92db96caaa9 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ Acpi.c
@@ -3,7 +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>
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -83,8 +83,8 @@ EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE gSpcrInfo = {
   },
 
   0x03,               //INTERRUPT_TYPE,
-  0x04,               //IRQ,
-  0x04,               //GLOBAL_SYSTEM_INTERRUPT,
+  FixedPcdGet8 (PcdSpcrInterrupt), // IRQ,
+  FixedPcdGet8 (PcdSpcrInterrupt), // GLOBAL_SYSTEM_INTERRUPT,
   0x07,               //BAUD_RATE,
   0x00,               //PARITY,
   0x01,               //STOP_BITS,
@@ -441,6 +441,7 @@ OutOfBandACPITableConstruction (
     gSpcrInfo.FlowControl = UART_FLOW_CONTROL_HARDWARE;
   }
 
+
   if (HasIsaSerialNode(SavedDevicePath)) {
     GetIsaTypeInfo (SavedDevicePath);
   } else {
--
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112330): https://edk2.groups.io/g/devel/message/112330
Mute This Topic: https://groups.io/mt/100521521/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to