public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Abdul Lateef Attar via groups.io" <abdattar=amd.com@groups.io>
To: <devel@edk2.groups.io>
Cc: Abdul Lateef Attar <AbdulLateef.Attar@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>,
	Abner Chang <abner.chang@amd.com>
Subject: [edk2-devel] [PATCH 1/1] OutOfBandManagement/SpcrFeaturePkg: PCD based IRQ/GSI
Date: Thu, 3 Aug 2023 12:05:12 +0530	[thread overview]
Message-ID: <91291c25394aa9b63d1c5865e3137328903dfb87.1691044467.git.abdattar@amd.com> (raw)
In-Reply-To: <cover.1691044467.git.abdattar@amd.com>

From: Abdul Lateef Attar <AbdulLateef.Attar@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.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: Abner Chang <abner.chang@amd.com>
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@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.dec
@@ -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/SpcrAcpiDxe.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/SpcrAcpi.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/SpcrAcpi.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 (#107519): https://edk2.groups.io/g/devel/message/107519
Mute This Topic: https://groups.io/mt/100521521/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



       reply	other threads:[~2023-08-03  6:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1691044467.git.abdattar@amd.com>
2023-08-03  6:35 ` Abdul Lateef Attar via groups.io [this message]
2023-08-03  6:42   ` [edk2-devel] [PATCH 1/1] OutOfBandManagement/SpcrFeaturePkg: PCD based IRQ/GSI Chang, Abner via groups.io
2023-08-17  6:44     ` Attar, AbdulLateef (Abdul Lateef) via groups.io
2023-12-07  4:25       ` Abdul Lateef Attar via groups.io
2023-12-11 21:19   ` Nate DeSimone
2023-12-11 21:21   ` Nate DeSimone

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=91291c25394aa9b63d1c5865e3137328903dfb87.1691044467.git.abdattar@amd.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