[edk2-devel] [PATCH] MinPlatformPkg: Check if the Acpi table is already installed.

2021-11-30 Thread kavya
Check if Acpi table is already installed by locating Acpi system description
table protocol. If protocol is not installed then continue to install
the acpi table.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: kavya 
---
 Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 24 

 1 file changed, 24 insertions(+)

diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c 
b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
index 785cf4c2f9..03193c99fa 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
@@ -1053,6 +1053,18 @@ InstallMcfgFromScratch (
   UINTN
 SegmentCount;
   PCI_SEGMENT_INFO 
 *PciSegmentInfo;
   UINTN
 TableHandle;
+  UINTN
 Handle;
+  EFI_ACPI_DESCRIPTION_HEADER  
 *Table;
+
+  Handle = 0;
+  Status = LocateAcpiTableBySignature (
+  
EFI_ACPI_3_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE,
+  (EFI_ACPI_DESCRIPTION_HEADER **) &Table,
+  &Handle
+  );
+  if (!EFI_ERROR (Status)) {
+return EFI_SUCCESS;
+  }
 
   PciSegmentInfo = GetPciSegmentInfo (&SegmentCount);
 
@@ -1368,10 +1380,22 @@ UpdateLocalTable (
   EFI_ACPI_TABLE_VERSIONVersion;
   UINTN TableHandle;
   UINTN Index;
+  UINTN Handle;
+  EFI_ACPI_DESCRIPTION_HEADER   *Table;
 
   for (Index = 0; Index < sizeof(mLocalTable)/sizeof(mLocalTable[0]); Index++) 
{
 CurrentTable = mLocalTable[Index];
 
+Handle = 0;
+Status = LocateAcpiTableBySignature (
+CurrentTable->Signature,
+(EFI_ACPI_DESCRIPTION_HEADER **) &Table,
+&Handle
+);
+if (!EFI_ERROR (Status)) {
+  continue;
+}
+
 PlatformUpdateTables (CurrentTable, &Version);
 
 TableHandle = 0;
-- 
2.16.2.windows.1



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




[edk2-devel] [PATCH] MinPlatformPkg: Check if Acpi table is already installed.

2021-12-05 Thread kavya
Check if Acpi table is already installed by locating the first ACPI table
in XSDT/RSDT based on Signature

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: kavya 
---
 Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 18 
++
 1 file changed, 18 insertions(+)

diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c 
b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
index 785cf4c2f9..db58cbe6ce 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
@@ -1048,12 +1048,21 @@ InstallMcfgFromScratch (
 {
   EFI_STATUS   
 Status;
   EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER   
 *McfgTable;
+  EFI_ACPI_COMMON_HEADER   
 *Mcfg;
   
EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_ADDRESS_ALLOCATION_STRUCTURE
 *Segment;
   UINTN
 Index;
   UINTN
 SegmentCount;
   PCI_SEGMENT_INFO 
 *PciSegmentInfo;
   UINTN
 TableHandle;
 
+  Mcfg = (EFI_ACPI_COMMON_HEADER *) EfiLocateFirstAcpiTable (
+  
EFI_ACPI_3_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE
+  );
+  if (Mcfg != NULL) {
+DEBUG ((DEBUG_ERROR, "MCFG table already installed\n"));
+return EFI_SUCCESS;
+  }
+
   PciSegmentInfo = GetPciSegmentInfo (&SegmentCount);
 
   McfgTable = AllocateZeroPool (
@@ -1365,6 +1374,7 @@ UpdateLocalTable (
 {
   EFI_STATUSStatus;
   EFI_ACPI_COMMON_HEADER*CurrentTable;
+  EFI_ACPI_COMMON_HEADER*Table;
   EFI_ACPI_TABLE_VERSIONVersion;
   UINTN TableHandle;
   UINTN Index;
@@ -1372,6 +1382,14 @@ UpdateLocalTable (
   for (Index = 0; Index < sizeof(mLocalTable)/sizeof(mLocalTable[0]); Index++) 
{
 CurrentTable = mLocalTable[Index];
 
+Table = (EFI_ACPI_COMMON_HEADER *) EfiLocateFirstAcpiTable 
(CurrentTable->Signature);
+if (Table != NULL) {
+  DEBUG ((DEBUG_ERROR, "Acpi table with signature=%c%c%c%c already 
installed\n",
+((CHAR8*)&CurrentTable->Signature)[0], 
((CHAR8*)&CurrentTable->Signature)[1],
+((CHAR8*)&CurrentTable->Signature)[2], 
((CHAR8*)&CurrentTable->Signature)[3]));
+  continue;
+}
+
 PlatformUpdateTables (CurrentTable, &Version);
 
 TableHandle = 0;
-- 
2.16.2.windows.1



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




[edk2-devel] [Patch V2] MinPlatformPkg: Check if Acpi table is already installed.

2021-12-05 Thread kavya
Check if Acpi table is already installed by locating the first ACPI table
in XSDT/RSDT based on Signature

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: kavya 
Reviewed-by: Zhiguang Liu 
---
 Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 18 
++
 1 file changed, 18 insertions(+)

diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c 
b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
index 785cf4c2f9..dcbb8b7c7f 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
@@ -1048,12 +1048,21 @@ InstallMcfgFromScratch (
 {
   EFI_STATUS   
 Status;
   EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER   
 *McfgTable;
+  EFI_ACPI_COMMON_HEADER   
 *Mcfg;
   
EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_ADDRESS_ALLOCATION_STRUCTURE
 *Segment;
   UINTN
 Index;
   UINTN
 SegmentCount;
   PCI_SEGMENT_INFO 
 *PciSegmentInfo;
   UINTN
 TableHandle;
 
+  Mcfg = (EFI_ACPI_COMMON_HEADER *) EfiLocateFirstAcpiTable (
+  
EFI_ACPI_3_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE
+  );
+  if (Mcfg != NULL) {
+DEBUG ((DEBUG_INFO, "MCFG table already installed\n"));
+return EFI_SUCCESS;
+  }
+
   PciSegmentInfo = GetPciSegmentInfo (&SegmentCount);
 
   McfgTable = AllocateZeroPool (
@@ -1365,6 +1374,7 @@ UpdateLocalTable (
 {
   EFI_STATUSStatus;
   EFI_ACPI_COMMON_HEADER*CurrentTable;
+  EFI_ACPI_COMMON_HEADER*Table;
   EFI_ACPI_TABLE_VERSIONVersion;
   UINTN TableHandle;
   UINTN Index;
@@ -1372,6 +1382,14 @@ UpdateLocalTable (
   for (Index = 0; Index < sizeof(mLocalTable)/sizeof(mLocalTable[0]); Index++) 
{
 CurrentTable = mLocalTable[Index];
 
+Table = (EFI_ACPI_COMMON_HEADER *) EfiLocateFirstAcpiTable 
(CurrentTable->Signature);
+if (Table != NULL) {
+  DEBUG ((DEBUG_INFO, "Acpi table with signature=%c%c%c%c already 
installed\n",
+((CHAR8*)&CurrentTable->Signature)[0], 
((CHAR8*)&CurrentTable->Signature)[1],
+((CHAR8*)&CurrentTable->Signature)[2], 
((CHAR8*)&CurrentTable->Signature)[3]));
+  continue;
+}
+
 PlatformUpdateTables (CurrentTable, &Version);
 
 TableHandle = 0;
-- 
2.16.2.windows.1



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




[edk2-devel] [PATCH] UefiPayloadPkg/SerialPortLib: Enhance multi port behaviour

2022-12-13 Thread Kavya
Add condition to return success if mUartCount is greater
than zero in SerialPortInitialize() to avoid filling mUartInfo
with the same hob data when SerialPortInitialize() is called
multiple times. Also add proper conditions in SerialPortRead
function to read the data properly from multiple UART's.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c | 37 
-
 1 file changed, 32 insertions(+), 5 deletions(-)

diff --git a/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c 
b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
index 809fa2e9c9..84c56bd24d 100644
--- a/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
+++ b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
@@ -138,6 +138,10 @@ SerialPortInitialize (
   BOOLEAN MmioEnable;
   UINT8   Value;
 
+  if (mUartCount > 0) {
+return RETURN_SUCCESS;
+  }
+
   GuidHob = GetFirstGuidHob (&gUniversalPayloadSerialPortInfoGuid);
   while (GuidHob != NULL) {
 SerialPortInfo = (UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO 
*)GET_GUID_HOB_DATA (GuidHob);
@@ -329,6 +333,7 @@ SerialPortRead (
 {
   UINTNBaseAddress;
   BOOLEAN  UseMmio;
+  BOOLEAN  IsNextPort;
   UINT8*DataBuffer;
   UINTNBytesLeft;
   UINTNResult;
@@ -353,6 +358,7 @@ SerialPortRead (
 
 DataBuffer = Buffer;
 BytesLeft  = NumberOfBytes;
+IsNextPort = FALSE;
 
 Mcr = (UINT8)(SerialPortReadRegister (BaseAddress, R_UART_MCR, UseMmio, 
Stride) & ~B_UART_MCR_RTS);
 
@@ -367,6 +373,12 @@ SerialPortRead (
   //
   SerialPortWriteRegister (BaseAddress, R_UART_MCR, (UINT8)(Mcr | 
B_UART_MCR_RTS), UseMmio, Stride);
 }
+IsNextPort = TRUE;
+break;
+  }
+
+  if (IsNextPort) {
+break;
   }
 
   if (PcdGetBool (PcdSerialUseHardwareFlowControl)) {
@@ -382,6 +394,10 @@ SerialPortRead (
   *DataBuffer = SerialPortReadRegister (BaseAddress, R_UART_RXBUF, 
UseMmio, Stride);
 }
 
+if ((!IsNextPort) && (*(--DataBuffer) != '\0')) {
+  return Result;
+}
+
 Count++;
   }
 
@@ -409,10 +425,9 @@ SerialPortPoll (
   BOOLEAN  UseMmio;
   UINT8Stride;
   UINT8Count;
-  BOOLEAN  Status;
+  BOOLEAN  IsDataReady;
 
   Count  = 0;
-  Status = FALSE;
   while (Count < mUartCount) {
 BaseAddress = mUartInfo[Count].BaseAddress;
 UseMmio = mUartInfo[Count].UseMmio;
@@ -423,7 +438,7 @@ SerialPortPoll (
   continue;
 }
 
-Status = FALSE;
+IsDataReady = FALSE;
 
 //
 // Read the serial port status
@@ -436,7 +451,7 @@ SerialPortPoll (
 SerialPortWriteRegister (BaseAddress, R_UART_MCR, 
(UINT8)(SerialPortReadRegister (BaseAddress, R_UART_MCR, UseMmio, Stride) & 
~B_UART_MCR_RTS), UseMmio, Stride);
   }
 
-  Status = TRUE;
+  IsDataReady = TRUE;
 }
 
 if (PcdGetBool (PcdSerialUseHardwareFlowControl)) {
@@ -446,10 +461,14 @@ SerialPortPoll (
   SerialPortWriteRegister (BaseAddress, R_UART_MCR, 
(UINT8)(SerialPortReadRegister (BaseAddress, R_UART_MCR, UseMmio, Stride) | 
B_UART_MCR_RTS), UseMmio, Stride);
 }
 
+if (IsDataReady) {
+  return IsDataReady;
+}
+
 Count++;
   }
 
-  return Status;
+  return IsDataReady;
 }
 
 /**
@@ -603,6 +622,14 @@ SerialPortGetControl (
   *Control |= EFI_SERIAL_INPUT_BUFFER_EMPTY;
 }
 
+if *Control & EFI_SERIAL_OUTPUT_BUFFER_EMPTY) == 
EFI_SERIAL_OUTPUT_BUFFER_EMPTY) &&
+((*Control & EFI_SERIAL_INPUT_BUFFER_EMPTY) != 
EFI_SERIAL_INPUT_BUFFER_EMPTY)) ||
+((*Control & (EFI_SERIAL_DATA_SET_READY | EFI_SERIAL_CLEAR_TO_SEND |
+EFI_SERIAL_CARRIER_DETECT)) == (EFI_SERIAL_DATA_SET_READY | 
EFI_SERIAL_CLEAR_TO_SEND |
+EFI_SERIAL_CARRIER_DETECT))) {
+return RETURN_SUCCESS;
+}
+
 Count++;
   }
 
-- 
2.30.2.windows.1



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




[edk2-devel] [PATCH 1/3] UefiPayloadPkg: Implement a new DebugLib instance

2022-07-13 Thread kavya
Add new Debug library instance to support multiple channel debug message.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/Library/BaseDebugLibHob/BaseDebugLibHob.c   | 295 
+++
 UefiPayloadPkg/Library/BaseDebugLibHob/BaseDebugLibHob.inf |  37 
+
 2 files changed, 332 insertions(+)

diff --git a/UefiPayloadPkg/Library/BaseDebugLibHob/BaseDebugLibHob.c 
b/UefiPayloadPkg/Library/BaseDebugLibHob/BaseDebugLibHob.c
new file mode 100644
index 00..0fd9e795a3
--- /dev/null
+++ b/UefiPayloadPkg/Library/BaseDebugLibHob/BaseDebugLibHob.c
@@ -0,0 +1,295 @@
+/** @file
+  Instance of Debug Library based on Serial Port Library.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+//
+// Define the maximum debug and assert message length that this library 
supports
+//
+#define MAX_DEBUG_MESSAGE_LENGTH  0x100
+
+/**
+  Initialize the serial device hardware.
+
+  If no initialization is required, then return RETURN_SUCCESS.
+  If the serial device was successfully initialized, then return 
RETURN_SUCCESS.
+  If the serial device could not be initialized, then return 
RETURN_DEVICE_ERROR.
+  If gUniversalPayloadSerialPortInfoGuid not found, then return 
RETURN_NOT_FOUND.
+
+  @retval RETURN_SUCCESSThe serial device was initialized.
+  @retval RETURN_DEVICE_ERROR   The serial device could not be initialized.
+  @retval RETURN_NOT_FOUND  GuidHob not found.
+
+**/
+RETURN_STATUS
+EFIAPI
+SerialPortInitialize (
+  VOID
+  );
+
+/**
+  Write data from buffer to serial device.
+
+  Writes NumberOfBytes data bytes from Buffer to the serial device.
+  The number of bytes actually written to the serial device is returned.
+  If the return value is less than NumberOfBytes, then the write operation 
failed.
+  If Buffer is NULL, then return 0.
+  If NumberOfBytes is zero, then return 0.
+
+  @param  Buffer   Pointer to the data buffer to be written.
+  @param  NumberOfBytesNumber of bytes to written to the serial device.
+
+  @retval 0NumberOfBytes is 0.
+  @retval >0   The number of bytes written to the serial device.
+   If this value is less than NumberOfBytes, then the 
write operation failed.
+
+**/
+UINTN
+EFIAPI
+SerialPortWrite (
+  IN UINT8  *Buffer,
+  IN UINTN  NumberOfBytes
+  );
+
+/**
+  Prints a debug message to the debug output device if the specified error 
level is enabled.
+
+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function
+  GetDebugPrintErrorLevel (), then print the message specified by Format and 
the
+  associated variable argument list to the debug output device.
+
+  If Format is NULL, then ASSERT().
+
+  @param  ErrorLevel  The error level of the debug message.
+  @param  Format  Format string for the debug message to print.
+  @param  ... Variable argument list whose contents are accessed
+  based on the format string specified by Format.
+
+**/
+VOID
+EFIAPI
+DebugPrint (
+  IN  UINTNErrorLevel,
+  IN  CONST CHAR8  *Format,
+  ...
+  )
+{
+  CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
+  VA_LIST   Marker;
+
+  //
+  // If Format is NULL, then ASSERT().
+  //
+  ASSERT (Format != NULL);
+
+  //
+  // Check driver debug mask value and global mask
+  //
+  if ((ErrorLevel & GetDebugPrintErrorLevel ()) == 0) {
+return;
+  }
+
+  //
+  // Convert the DEBUG() message to an ASCII String
+  //
+  VA_START (Marker, Format);
+  AsciiVSPrint (Buffer, sizeof (Buffer), Format, Marker);
+  VA_END (Marker);
+
+  SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer));
+}
+
+/**
+  Prints an assert message containing a filename, line number, and description.
+  This may be followed by a breakpoint or a dead loop.
+
+  Print a message of the form "ASSERT (): 
\n"
+  to the debug output device.  If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit 
of
+  PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if
+  DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then
+  CpuDeadLoop() is called.  If neither of these bits are set, then this 
function
+  returns immediately after the message is printed to the debug output device.
+  DebugAssert() must actively prevent recursion.  If DebugAssert() is called 
while
+  processing another DebugAssert(), then DebugAssert() must return immediately.
+
+  If FileName is NULL, then a  string of "(NULL) Filena

[edk2-devel] [PATCH 2/3] UefiPayloadPkg: Implement a new SerialPortLib instance

2022-07-13 Thread kavya
Add new Serial port library instance that consumes the HOB defined
in MdeModulePkg/Include/UniversalPayload/SerialPortInfo.h to support
multiple UART's.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c   | 802 
++
 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf |  39 
+++
 2 files changed, 841 insertions(+)

diff --git a/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c 
b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
new file mode 100644
index 00..6f62b2a5d2
--- /dev/null
+++ b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
@@ -0,0 +1,802 @@
+/** @file
+  UART Serial Port library functions.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+//
+// 16550 UART register offsets and bitfields
+//
+#define R_UART_RXBUF 0// LCR_DLAB = 0
+#define R_UART_TXBUF 0// LCR_DLAB = 0
+#define R_UART_BAUD_LOW  0// LCR_DLAB = 1
+#define R_UART_BAUD_HIGH 1// LCR_DLAB = 1
+#define R_UART_IER   1// LCR_DLAB = 0
+#define R_UART_FCR   2
+#define   B_UART_FCR_FIFOE   BIT0
+#define   B_UART_FCR_FIFO64  BIT5
+#define R_UART_LCR   3
+#define   B_UART_LCR_DLABBIT7
+#define R_UART_MCR   4
+#define   B_UART_MCR_DTRCBIT0
+#define   B_UART_MCR_RTS BIT1
+#define R_UART_LSR   5
+#define   B_UART_LSR_RXRDY   BIT0
+#define   B_UART_LSR_TXRDY   BIT5
+#define   B_UART_LSR_TEMTBIT6
+#define R_UART_MSR   6
+#define   B_UART_MSR_CTS BIT4
+#define   B_UART_MSR_DSR BIT5
+#define   B_UART_MSR_RI  BIT6
+#define   B_UART_MSR_DCD BIT7
+
+/**
+  Reads an 8-bit register. If UseMmio is TRUE, then the value is read from
+  MMIO space. If UseMmio is FALSE, then the value is read from I/O space. The
+  parameter Offset is added to the base address of the register.
+
+  @param  Base The base address register of UART device.
+  @param  Offset   The offset of the register to read.
+  @param  UseMmio  Check if value has to be read from MMIO space or IO space.
+
+  @return The value read from the register.
+
+**/
+UINT8
+SerialPortReadRegister (
+  UINTNBase,
+  UINTNOffset,
+  BOOLEAN  UseMmio
+  )
+{
+  if (UseMmio) {
+return MmioRead8 (Base + Offset/4);
+  } else {
+return IoRead8 (Base + Offset);
+  }
+}
+
+/**
+  Writes an 8-bit register.. If UseMmio is TRUE, then the value is written to
+  MMIO space. If UseMmio is FALSE, then the value is written to I/O space. The
+  parameter Offset is added to the base address of the registers.
+
+  @param  Base The base address register of UART device.
+  @param  Offset   The offset of the register to write.
+  @param  ValueValue to be written.
+  @param  UseMmio  Check if value has to be written to MMIO space or IO space.
+
+  @return The value written to the register.
+
+**/
+UINT8
+SerialPortWriteRegister (
+  UINTNBase,
+  UINTNOffset,
+  UINT8Value,
+  BOOLEAN  UseMmio
+  )
+{
+  if (UseMmio) {
+return MmioWrite8 (Base + Offset/4, Value);
+  } else {
+return IoWrite8 (Base + Offset, Value);
+  }
+}
+
+/**
+  Initialize the serial device hardware.
+
+  If no initialization is required, then return RETURN_SUCCESS.
+  If the serial device was successfully initialized, then return 
RETURN_SUCCESS.
+  If the serial device could not be initialized, then return 
RETURN_DEVICE_ERROR.
+  If gUniversalPayloadSerialPortInfoGuid not found, then return 
RETURN_NOT_FOUND.
+
+  @retval RETURN_SUCCESSThe serial device was initialized.
+  @retval RETURN_DEVICE_ERROR   The serial device could not be initialized.
+  @retval RETURN_NOT_FOUND  GuidHob not found.
+
+**/
+RETURN_STATUS
+EFIAPI
+SerialPortInitialize (
+  VOID
+  )
+{
+  UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO  *SerialPortInfo;
+  EFI_HOB_GUID_TYPE   *GuidHob;
+  

[edk2-devel] [PATCH 3/3] UefiPayloadPkg: Allow DxeMain.inf to consume the new DebugLib and SerialPortLib

2022-07-13 Thread kavya
Let DxeMain.inf consume new DebugLib and SerialPortLib to support
multiple channel debug message on early DXE.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 2428bb2ce9..b781cee744 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -573,6 +573,8 @@
   #
   MdeModulePkg/Core/Dxe/DxeMain.inf {
 
+  DebugLib|UefiPayloadPkg/Library/BaseDebugLibHob/BaseDebugLibHob.inf
+  
SerialPortLib|UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf
   
NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
   }
 
-- 
2.30.2.windows.1



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




[edk2-devel] [PATCH v2 1/2] UefiPayloadPkg: Implement a new SerialPortLib instance

2022-07-19 Thread kavya
Add new Serial port library instance that consumes the HOB defined
in MdeModulePkg/Include/UniversalPayload/SerialPortInfo.h to support
multiple UART's.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c   | 794 
++
 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf |  40 

 2 files changed, 834 insertions(+)

diff --git a/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c 
b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
new file mode 100644
index 00..8c39befafe
--- /dev/null
+++ b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
@@ -0,0 +1,794 @@
+/** @file
+  UART Serial Port library functions.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+//
+// 16550 UART register offsets and bitfields
+//
+#define R_UART_RXBUF 0// LCR_DLAB = 0
+#define R_UART_TXBUF 0// LCR_DLAB = 0
+#define R_UART_BAUD_LOW  0// LCR_DLAB = 1
+#define R_UART_BAUD_HIGH 1// LCR_DLAB = 1
+#define R_UART_IER   1// LCR_DLAB = 0
+#define R_UART_FCR   2
+#define   B_UART_FCR_FIFOE   BIT0
+#define   B_UART_FCR_FIFO64  BIT5
+#define R_UART_LCR   3
+#define   B_UART_LCR_DLABBIT7
+#define R_UART_MCR   4
+#define   B_UART_MCR_DTRCBIT0
+#define   B_UART_MCR_RTS BIT1
+#define R_UART_LSR   5
+#define   B_UART_LSR_RXRDY   BIT0
+#define   B_UART_LSR_TXRDY   BIT5
+#define   B_UART_LSR_TEMTBIT6
+#define R_UART_MSR   6
+#define   B_UART_MSR_CTS BIT4
+#define   B_UART_MSR_DSR BIT5
+#define   B_UART_MSR_RI  BIT6
+#define   B_UART_MSR_DCD BIT7
+
+typedef struct {
+  UINTNBaseAddress;
+  BOOLEAN  UseMmio;
+  UINT32   BaudRate;
+} UART_INFO;
+
+UART_INFO   **mUartInfo;
+UINT8   mUartCount;
+
+/**
+  Reads an 8-bit register. If UseMmio is TRUE, then the value is read from
+  MMIO space. If UseMmio is FALSE, then the value is read from I/O space. The
+  parameter Offset is added to the base address of the register.
+
+  @param  Base The base address register of UART device.
+  @param  Offset   The offset of the register to read.
+  @param  UseMmio  Check if value has to be read from MMIO space or IO space.
+
+  @return The value read from the register.
+
+**/
+UINT8
+SerialPortReadRegister (
+  UINTNBase,
+  UINTNOffset,
+  BOOLEAN  UseMmio
+  )
+{
+  if (UseMmio) {
+return MmioRead8 (Base + Offset/4);
+  } else {
+return IoRead8 (Base + Offset);
+  }
+}
+
+/**
+  Writes an 8-bit register.. If UseMmio is TRUE, then the value is written to
+  MMIO space. If UseMmio is FALSE, then the value is written to I/O space. The
+  parameter Offset is added to the base address of the registers.
+
+  @param  Base The base address register of UART device.
+  @param  Offset   The offset of the register to write.
+  @param  ValueValue to be written.
+  @param  UseMmio  Check if value has to be written to MMIO space or IO space.
+
+  @return The value written to the register.
+
+**/
+UINT8
+SerialPortWriteRegister (
+  UINTNBase,
+  UINTNOffset,
+  UINT8Value,
+  BOOLEAN  UseMmio
+  )
+{
+  if (UseMmio) {
+return MmioWrite8 (Base + Offset/4, Value);
+  } else {
+return IoWrite8 (Base + Offset, Value);
+  }
+}
+
+/**
+  Initialize the serial device hardware.
+
+  If no initialization is required, then return RETURN_SUCCESS.
+  If the serial device was successfully initialized, then return 
RETURN_SUCCESS.
+  If the serial device could not be initialized, then return 
RETURN_DEVICE_ERROR.
+
+  @retval RETURN_SUCCESSThe serial device was initialized.
+  @retval RETURN_DEVICE_ERROR   The serial device could not be initialized.
+
+**/
+RETURN_STATUS
+EFIAPI
+SerialPortInitialize (
+  VOID
+  )
+{
+  UNIVERSAL_PAYLOAD_SERIAL_PORT

[edk2-devel] [PATCH v2 2/2] UefiPayloadPkg: Allow DxeMain.inf to consume the new SerialPortLib

2022-07-19 Thread kavya
Let DxeMain.inf consume new SerialPortLib to support
multiple channel debug message on early DXE.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 5e947526b7..33eed40370 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -582,6 +582,8 @@
   #
   MdeModulePkg/Core/Dxe/DxeMain.inf {
 
+  DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+  
SerialPortLib|UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf
   
NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
   }
 
-- 
2.30.2.windows.1



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




[edk2-devel] [PATCH v3 1/2] UefiPayloadPkg: Implement a new SerialPortLib instance

2022-07-21 Thread kavya
Add new Serial port library instance that consumes the HOB defined
in MdeModulePkg/Include/UniversalPayload/SerialPortInfo.h to support
multiple UART's.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c   | 814 
++
 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf |  40 

 2 files changed, 854 insertions(+)

diff --git a/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c 
b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
new file mode 100644
index 00..13eddf0934
--- /dev/null
+++ b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
@@ -0,0 +1,814 @@
+/** @file
+  UART Serial Port library functions.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+//
+// 16550 UART register offsets and bitfields
+//
+#define R_UART_RXBUF 0// LCR_DLAB = 0
+#define R_UART_TXBUF 0// LCR_DLAB = 0
+#define R_UART_BAUD_LOW  0// LCR_DLAB = 1
+#define R_UART_BAUD_HIGH 1// LCR_DLAB = 1
+#define R_UART_IER   1// LCR_DLAB = 0
+#define R_UART_FCR   2
+#define   B_UART_FCR_FIFOE   BIT0
+#define   B_UART_FCR_FIFO64  BIT5
+#define R_UART_LCR   3
+#define   B_UART_LCR_DLABBIT7
+#define R_UART_MCR   4
+#define   B_UART_MCR_DTRCBIT0
+#define   B_UART_MCR_RTS BIT1
+#define R_UART_LSR   5
+#define   B_UART_LSR_RXRDY   BIT0
+#define   B_UART_LSR_TXRDY   BIT5
+#define   B_UART_LSR_TEMTBIT6
+#define R_UART_MSR   6
+#define   B_UART_MSR_CTS BIT4
+#define   B_UART_MSR_DSR BIT5
+#define   B_UART_MSR_RI  BIT6
+#define   B_UART_MSR_DCD BIT7
+
+typedef struct {
+  UINTNBaseAddress;
+  BOOLEAN  UseMmio;
+  UINT32   BaudRate;
+  UINT8RegisterStride;
+} UART_INFO;
+
+UART_INFO   **mUartInfo;
+UINT8   mUartCount;
+
+/**
+  Reads an 8-bit register. If UseMmio is TRUE, then the value is read from
+  MMIO space. If UseMmio is FALSE, then the value is read from I/O space. The
+  parameter Offset is added to the base address of the register.
+
+  @param  Base The base address register of UART device.
+  @param  Offset   The offset of the register to read.
+  @param  UseMmio  Check if value has to be read from MMIO space or IO 
space.
+  @param  RegisterStride   Number of bytes between registers in serial device.
+
+  @return The value read from the register.
+
+**/
+UINT8
+SerialPortReadRegister (
+  UINTNBase,
+  UINTNOffset,
+  BOOLEAN  UseMmio,
+  UINT8RegisterStride
+  )
+{
+  if (UseMmio) {
+return MmioRead8 (Base + Offset * RegisterStride);
+  } else {
+return IoRead8 (Base + Offset * RegisterStride);
+  }
+}
+
+/**
+  Writes an 8-bit register.. If UseMmio is TRUE, then the value is written to
+  MMIO space. If UseMmio is FALSE, then the value is written to I/O space. The
+  parameter Offset is added to the base address of the registers.
+
+  @param  Base The base address register of UART device.
+  @param  Offset   The offset of the register to write.
+  @param  ValueValue to be written.
+  @param  UseMmio  Check if value has to be written to MMIO space or 
IO space.
+  @param  RegisterStride   Number of bytes between registers in serial device.
+
+  @return The value written to the register.
+
+**/
+UINT8
+SerialPortWriteRegister (
+  UINTNBase,
+  UINTNOffset,
+  UINT8Value,
+  BOOLEAN  UseMmio,
+  UINT8RegisterStride
+  )
+{
+  if (UseMmio) {
+return MmioWrite8 (Base + Offset * RegisterStride, Value);
+  } else {
+return IoWrite8 (Base + Offset * RegisterStride, Value);
+  }
+}
+
+/**
+  Initialize the serial device hardware.
+
+  If no initialization is required, then return RETURN_SUCCESS.
+  If the serial device was successfully initialized,

[edk2-devel] [PATCH v3 2/2] UefiPayloadPkg: Allow DxeMain.inf to consume the new SerialPortLib

2022-07-21 Thread kavya
Let DxeMain.inf consume new SerialPortLib to support multiple
channel debug message on early DXE.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 5e947526b7..33eed40370 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -582,6 +582,8 @@
   #
   MdeModulePkg/Core/Dxe/DxeMain.inf {
 
+  DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+  
SerialPortLib|UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf
   
NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
   }
 
-- 
2.30.2.windows.1



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




[edk2-devel] [PATCH v4 1/2] UefiPayloadPkg: Implement a new SerialPortLib instance

2022-07-25 Thread kavya
Add new Serial port library instance that consumes the HOB defined
in MdeModulePkg/Include/UniversalPayload/SerialPortInfo.h to support
multiple UART's.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c   | 808 

 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf |  39 
+++
 2 files changed, 847 insertions(+)

diff --git a/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c 
b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
new file mode 100644
index 00..140ecf5f4d
--- /dev/null
+++ b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
@@ -0,0 +1,808 @@
+/** @file
+  UART Serial Port library functions.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+//
+// 16550 UART register offsets and bitfields
+//
+#define R_UART_RXBUF 0// LCR_DLAB = 0
+#define R_UART_TXBUF 0// LCR_DLAB = 0
+#define R_UART_BAUD_LOW  0// LCR_DLAB = 1
+#define R_UART_BAUD_HIGH 1// LCR_DLAB = 1
+#define R_UART_IER   1// LCR_DLAB = 0
+#define R_UART_FCR   2
+#define   B_UART_FCR_FIFOE   BIT0
+#define   B_UART_FCR_FIFO64  BIT5
+#define R_UART_LCR   3
+#define   B_UART_LCR_DLABBIT7
+#define R_UART_MCR   4
+#define   B_UART_MCR_DTRCBIT0
+#define   B_UART_MCR_RTS BIT1
+#define R_UART_LSR   5
+#define   B_UART_LSR_RXRDY   BIT0
+#define   B_UART_LSR_TXRDY   BIT5
+#define   B_UART_LSR_TEMTBIT6
+#define R_UART_MSR   6
+#define   B_UART_MSR_CTS BIT4
+#define   B_UART_MSR_DSR BIT5
+#define   B_UART_MSR_RI  BIT6
+#define   B_UART_MSR_DCD BIT7
+
+#define MAX_SIZE 16
+
+typedef struct {
+  UINTNBaseAddress;
+  BOOLEAN  UseMmio;
+  UINT32   BaudRate;
+  UINT8RegisterStride;
+} UART_INFO;
+
+UART_INFO   mUartInfo[MAX_SIZE];
+UINT8   mUartCount = 0;
+
+/**
+  Reads an 8-bit register. If UseMmio is TRUE, then the value is read from
+  MMIO space. If UseMmio is FALSE, then the value is read from I/O space. The
+  parameter Offset is added to the base address of the register.
+
+  @param  Base The base address register of UART device.
+  @param  Offset   The offset of the register to read.
+  @param  UseMmio  Check if value has to be read from MMIO space or IO 
space.
+  @param  RegisterStride   Number of bytes between registers in serial device.
+
+  @return The value read from the register.
+
+**/
+UINT8
+SerialPortReadRegister (
+  UINTNBase,
+  UINTNOffset,
+  BOOLEAN  UseMmio,
+  UINT8RegisterStride
+  )
+{
+  if (UseMmio) {
+return MmioRead8 (Base + Offset * RegisterStride);
+  } else {
+return IoRead8 (Base + Offset * RegisterStride);
+  }
+}
+
+/**
+  Writes an 8-bit register.. If UseMmio is TRUE, then the value is written to
+  MMIO space. If UseMmio is FALSE, then the value is written to I/O space. The
+  parameter Offset is added to the base address of the registers.
+
+  @param  Base The base address register of UART device.
+  @param  Offset   The offset of the register to write.
+  @param  ValueValue to be written.
+  @param  UseMmio  Check if value has to be written to MMIO space or 
IO space.
+  @param  RegisterStride   Number of bytes between registers in serial device.
+
+  @return The value written to the register.
+
+**/
+UINT8
+SerialPortWriteRegister (
+  UINTNBase,
+  UINTNOffset,
+  UINT8Value,
+  BOOLEAN  UseMmio,
+  UINT8RegisterStride
+  )
+{
+  if (UseMmio) {
+return MmioWrite8 (Base + Offset * RegisterStride, Value);
+  } else {
+return IoWrite8 (Base + Offset * RegisterStride, Value);
+  }
+}
+
+/**
+  Initialize the serial device hardware.
+
+  If no initialization is required, then return RETURN_SUCCESS.
+  If the serial devic

[edk2-devel] [PATCH v4 2/2] UefiPayloadPkg: Allow DxeMain.inf to consume the new SerialPortLib

2022-07-25 Thread kavya
Let DxeMain.inf consume new SerialPortLib to support multiple
channel debug message on early DXE.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 862d440b16..de3684fa22 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -590,6 +590,8 @@
   #
   MdeModulePkg/Core/Dxe/DxeMain.inf {
 
+  DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+  
SerialPortLib|UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf
   
NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
   }
 
-- 
2.30.2.windows.1



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




[edk2-devel] [PATCH] UefiPayloadPkg: Add macro to control NvmExpressDxe

2022-08-10 Thread kavya
Add NVME_ENABLE macro to control NvmExpressDxe driver.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 3 +++
 UefiPayloadPkg/UefiPayloadPkg.fdf | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 91cd78dbf1..1b23ff3dbc 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -43,6 +43,7 @@
   DEFINE SD_MMC_TIMEOUT   = 100
   DEFINE USE_CBMEM_FOR_CONSOLE= FALSE
   DEFINE BOOTSPLASH_IMAGE = FALSE
+  DEFINE NVME_ENABLE  = TRUE
 
   #
   # NULL:NullMemoryTestDxe
@@ -713,7 +714,9 @@
   MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
   MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
   MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
+!if $(NVME_ENABLE) == TRUE
   MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+!endif
 
 !if $(RAM_DISK_ENABLE) == TRUE
   MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf 
b/UefiPayloadPkg/UefiPayloadPkg.fdf
index 27534f445d..9c9e2f2741 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -215,7 +215,9 @@ INF MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
 INF MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
 INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
 INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
+!if $(NVME_ENABLE) == TRUE
 INF MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+!endif
 !if $(RAM_DISK_ENABLE) == TRUE
 INF MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
 !endif
-- 
2.30.2.windows.1



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




[edk2-devel] [PATCH] UefiPayloadPkg: Return PciRootBridges instead of NULL

2022-08-11 Thread kavya
Return PciRootBridges instead of NULL and set PcdPciDisableBusEnumeration
to FALSE when root bridge count is zero.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c 
b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
index e1faa24ae7..fb76853072 100644
--- a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
+++ b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
@@ -549,6 +549,7 @@ RetrieveRootBridgeInfoFromHob (
   }
 
   if (PciRootBridgeInfo->Count == 0) {
+PcdSetBoolS (PcdPciDisableBusEnumeration, FALSE);
 return NULL;
   }
 
@@ -589,9 +590,8 @@ RetrieveRootBridgeInfoFromHob (
   if (PciRootBridgeInfo->ResourceAssigned) {
 PcdSetBoolS (PcdPciDisableBusEnumeration, TRUE);
   } else {
-DEBUG ((DEBUG_ERROR, "There is root bridge whose ResourceAssigned is 
FALSE\n"));
+DEBUG ((DEBUG_INFO, "There is root bridge whose ResourceAssigned is 
FALSE\n"));
 PcdSetBoolS (PcdPciDisableBusEnumeration, FALSE);
-return NULL;
   }
 
   return PciRootBridges;
-- 
2.30.2.windows.1



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




[edk2-devel] [PATCH v5 1/2] UefiPayloadPkg: Implement a new SerialPortLib instance

2022-08-29 Thread Kavya
Add new Serial port library instance that consumes the HOB defined
in MdeModulePkg/Include/UniversalPayload/SerialPortInfo.h to support
multiple UART's.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c   | 805 
+
 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf |  39 
+++
 2 files changed, 844 insertions(+)

diff --git a/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c 
b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
new file mode 100644
index 00..875f4307f7
--- /dev/null
+++ b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
@@ -0,0 +1,805 @@
+/** @file
+  UART Serial Port library functions.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+//
+// 16550 UART register offsets and bitfields
+//
+#define R_UART_RXBUF 0// LCR_DLAB = 0
+#define R_UART_TXBUF 0// LCR_DLAB = 0
+#define R_UART_BAUD_LOW  0// LCR_DLAB = 1
+#define R_UART_BAUD_HIGH 1// LCR_DLAB = 1
+#define R_UART_IER   1// LCR_DLAB = 0
+#define R_UART_FCR   2
+#define   B_UART_FCR_FIFOE   BIT0
+#define   B_UART_FCR_FIFO64  BIT5
+#define R_UART_LCR   3
+#define   B_UART_LCR_DLABBIT7
+#define R_UART_MCR   4
+#define   B_UART_MCR_DTRCBIT0
+#define   B_UART_MCR_RTS BIT1
+#define R_UART_LSR   5
+#define   B_UART_LSR_RXRDY   BIT0
+#define   B_UART_LSR_TXRDY   BIT5
+#define   B_UART_LSR_TEMTBIT6
+#define R_UART_MSR   6
+#define   B_UART_MSR_CTS BIT4
+#define   B_UART_MSR_DSR BIT5
+#define   B_UART_MSR_RI  BIT6
+#define   B_UART_MSR_DCD BIT7
+
+#define MAX_SIZE 16
+
+typedef struct {
+  UINTNBaseAddress;
+  BOOLEAN  UseMmio;
+  UINT32   BaudRate;
+  UINT8RegisterStride;
+} UART_INFO;
+
+UART_INFO   mUartInfo[MAX_SIZE];
+UINT8   mUartCount = 0;
+
+/**
+  Reads an 8-bit register. If UseMmio is TRUE, then the value is read from
+  MMIO space. If UseMmio is FALSE, then the value is read from I/O space. The
+  parameter Offset is added to the base address of the register.
+
+  @param  Base The base address register of UART device.
+  @param  Offset   The offset of the register to read.
+  @param  UseMmio  Check if value has to be read from MMIO space or IO 
space.
+  @param  RegisterStride   Number of bytes between registers in serial device.
+
+  @return The value read from the register.
+
+**/
+UINT8
+SerialPortReadRegister (
+  UINTNBase,
+  UINTNOffset,
+  BOOLEAN  UseMmio,
+  UINT8RegisterStride
+  )
+{
+  if (UseMmio) {
+return MmioRead8 (Base + Offset * RegisterStride);
+  } else {
+return IoRead8 (Base + Offset * RegisterStride);
+  }
+}
+
+/**
+  Writes an 8-bit register.. If UseMmio is TRUE, then the value is written to
+  MMIO space. If UseMmio is FALSE, then the value is written to I/O space. The
+  parameter Offset is added to the base address of the registers.
+
+  @param  Base The base address register of UART device.
+  @param  Offset   The offset of the register to write.
+  @param  ValueValue to be written.
+  @param  UseMmio  Check if value has to be written to MMIO space or 
IO space.
+  @param  RegisterStride   Number of bytes between registers in serial device.
+
+  @return The value written to the register.
+
+**/
+UINT8
+SerialPortWriteRegister (
+  UINTNBase,
+  UINTNOffset,
+  UINT8Value,
+  BOOLEAN  UseMmio,
+  UINT8RegisterStride
+  )
+{
+  if (UseMmio) {
+return MmioWrite8 (Base + Offset * RegisterStride, Value);
+  } else {
+return IoWrite8 (Base + Offset * RegisterStride, Value);
+  }
+}
+
+/**
+  Initialize the serial device hardware.
+
+  If no initialization is required, then return RETURN_SUCCESS.
+  If the serial devic

[edk2-devel] [PATCH v5 2/2] UefiPayloadPkg: Allow DxeMain.inf to consume the new SerialPortLib

2022-08-29 Thread Kavya
Let DxeMain.inf consume new SerialPortLib to support multiple
channel debug message on early DXE if DEBUG_REAL_INSTANCE_SUPPORT
is true.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1b23ff3dbc..24aa66006f 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -132,6 +132,8 @@
   # Note: for emulation platform such as QEMU, this may not work and should 
set it as FALSE
   DEFINE CPU_TIMER_LIB_ENABLE  = TRUE
 
+  DEFINE DEBUG_REAL_INSTANCE_SUPPORT = FALSE
+
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
 !if $(USE_CBMEM_FOR_CONSOLE) == FALSE
@@ -615,6 +617,10 @@
   #
   MdeModulePkg/Core/Dxe/DxeMain.inf {
 
+  !if $(DEBUG_REAL_INSTANCE_SUPPORT) == TRUE
+
DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+
SerialPortLib|UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf
+  !endif
   
NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
   }
 
-- 
2.30.2.windows.1



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




[edk2-devel] [PATCH v6 1/2] UefiPayloadPkg: Implement a new SerialPortLib instance

2022-09-01 Thread Kavya
Add new Serial port library instance that consumes the HOB defined
in MdeModulePkg/Include/UniversalPayload/SerialPortInfo.h to support
multiple UART's.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c   | 808 

 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf |  39 
+++
 2 files changed, 847 insertions(+)

diff --git a/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c 
b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
new file mode 100644
index 00..90634cc602
--- /dev/null
+++ b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
@@ -0,0 +1,808 @@
+/** @file
+  UART Serial Port library functions.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+//
+// 16550 UART register offsets and bitfields
+//
+#define R_UART_RXBUF 0// LCR_DLAB = 0
+#define R_UART_TXBUF 0// LCR_DLAB = 0
+#define R_UART_BAUD_LOW  0// LCR_DLAB = 1
+#define R_UART_BAUD_HIGH 1// LCR_DLAB = 1
+#define R_UART_IER   1// LCR_DLAB = 0
+#define R_UART_FCR   2
+#define   B_UART_FCR_FIFOE   BIT0
+#define   B_UART_FCR_FIFO64  BIT5
+#define R_UART_LCR   3
+#define   B_UART_LCR_DLABBIT7
+#define R_UART_MCR   4
+#define   B_UART_MCR_DTRCBIT0
+#define   B_UART_MCR_RTS BIT1
+#define R_UART_LSR   5
+#define   B_UART_LSR_RXRDY   BIT0
+#define   B_UART_LSR_TXRDY   BIT5
+#define   B_UART_LSR_TEMTBIT6
+#define R_UART_MSR   6
+#define   B_UART_MSR_CTS BIT4
+#define   B_UART_MSR_DSR BIT5
+#define   B_UART_MSR_RI  BIT6
+#define   B_UART_MSR_DCD BIT7
+
+#define MAX_SIZE 16
+
+typedef struct {
+  UINTNBaseAddress;
+  BOOLEAN  UseMmio;
+  UINT32   BaudRate;
+  UINT8RegisterStride;
+} UART_INFO;
+
+UART_INFO   mUartInfo[MAX_SIZE];
+UINT8   mUartCount = 0;
+
+/**
+  Reads an 8-bit register. If UseMmio is TRUE, then the value is read from
+  MMIO space. If UseMmio is FALSE, then the value is read from I/O space. The
+  parameter Offset is added to the base address of the register.
+
+  @param  Base The base address register of UART device.
+  @param  Offset   The offset of the register to read.
+  @param  UseMmio  Check if value has to be read from MMIO space or IO 
space.
+  @param  RegisterStride   Number of bytes between registers in serial device.
+
+  @return The value read from the register.
+
+**/
+UINT8
+SerialPortReadRegister (
+  UINTNBase,
+  UINTNOffset,
+  BOOLEAN  UseMmio,
+  UINT8RegisterStride
+  )
+{
+  if (UseMmio) {
+return MmioRead8 (Base + Offset * RegisterStride);
+  } else {
+return IoRead8 (Base + Offset * RegisterStride);
+  }
+}
+
+/**
+  Writes an 8-bit register.. If UseMmio is TRUE, then the value is written to
+  MMIO space. If UseMmio is FALSE, then the value is written to I/O space. The
+  parameter Offset is added to the base address of the registers.
+
+  @param  Base The base address register of UART device.
+  @param  Offset   The offset of the register to write.
+  @param  ValueValue to be written.
+  @param  UseMmio  Check if value has to be written to MMIO space or 
IO space.
+  @param  RegisterStride   Number of bytes between registers in serial device.
+
+  @return The value written to the register.
+
+**/
+UINT8
+SerialPortWriteRegister (
+  UINTNBase,
+  UINTNOffset,
+  UINT8Value,
+  BOOLEAN  UseMmio,
+  UINT8RegisterStride
+  )
+{
+  if (UseMmio) {
+return MmioWrite8 (Base + Offset * RegisterStride, Value);
+  } else {
+return IoWrite8 (Base + Offset * RegisterStride, Value);
+  }
+}
+
+/**
+  Initialize the serial device hardware.
+
+  If no initialization is required, then return RETURN_SUCCESS.
+  I

[edk2-devel] [PATCH v6 2/2] UefiPayloadPkg: Allow DxeMain.inf to consume the new SerialPortLib

2022-09-01 Thread Kavya
Let DxeMain.inf consume new SerialPortLib to support multiple
channel debug message on early DXE if the macro
MULTIPLE_DEBUG_PORT_SUPPORT is TRUE.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1b23ff3dbc..70828ea633 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -132,6 +132,8 @@
   # Note: for emulation platform such as QEMU, this may not work and should 
set it as FALSE
   DEFINE CPU_TIMER_LIB_ENABLE  = TRUE
 
+  DEFINE MULTIPLE_DEBUG_PORT_SUPPORT = FALSE
+
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
 !if $(USE_CBMEM_FOR_CONSOLE) == FALSE
@@ -615,6 +617,10 @@
   #
   MdeModulePkg/Core/Dxe/DxeMain.inf {
 
+  !if $(MULTIPLE_DEBUG_PORT_SUPPORT) == TRUE
+
DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+
SerialPortLib|UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf
+  !endif
   
NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
   }
 
-- 
2.30.2.windows.1



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




[edk2-devel] [PATCH 2/2] UefiPayloadPkg: Include Network modules in UefiPayloadPkg.

2021-09-02 Thread kavya
From: Sravanthi 

Include Network modules in UefiPayloadPkg.dsc and UefiPayloadPkg.fdf

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sravanthi 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 14 ++
 UefiPayloadPkg/UefiPayloadPkg.fdf | 11 +--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 6859d2aeb8..b0054c8914 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -90,6 +90,7 @@
 
   DEFINE EMU_VARIABLE_ENABLE   = TRUE
   DEFINE DISABLE_RESET_SYSTEM  = FALSE
+  DEFINE NETWORK_DRIVER_ENABLE = FALSE
 
   # Dfine the maximum size of the capsule image without a reset flag that the 
platform can support.
   DEFINE MAX_SIZE_NON_POPULATE_CAPSULE = 0xa0
@@ -161,6 +162,11 @@
   
CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
   SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
   DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLib/DxeHobListLib.inf
+  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+  TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
+  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
+  RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf
 
 !if $(UNIVERSAL_PAYLOAD) == TRUE
   HobLib|UefiPayloadPkg/Library/DxeHobLib/DxeHobLib.inf
@@ -316,6 +322,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable|TRUE
 
   gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 0xcf, 0x80, 
0xab, 0x87, 0xf9, 0x47, 0xa3, 0xfe, 0xD5, 0x0B, 0x76, 0xd8, 0x95, 0x41 }
+  gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE
 
 !if $(SOURCE_DEBUG_ENABLE)
   gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2
@@ -431,6 +438,13 @@
   !endif
 !endif
 
+#
+# UEFI network modules
+#
+!if $(NETWORK_DRIVER_ENABLE) == TRUE
+  !include NetworkPkg/Network.dsc.inc
+!endif
+
 [Components.X64]
   #
   # DXE Core
diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf 
b/UefiPayloadPkg/UefiPayloadPkg.fdf
index bb6279bead..a089892d03 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -17,8 +17,8 @@ DEFINE FD_SIZE = 0x0085
 DEFINE NUM_BLOCKS  = 0x850
 !else
 
-DEFINE FD_SIZE = 0x0041
-DEFINE NUM_BLOCKS  = 0x410
+DEFINE FD_SIZE = 0x0059
+DEFINE NUM_BLOCKS  = 0x590
 !endif
 
 

@@ -198,6 +198,13 @@ INF MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
 #
 INF  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
 
+#
+# UEFI network modules
+#
+!if $(NETWORK_DRIVER_ENABLE) == TRUE
+  !include NetworkPkg/Network.fdf.inc
+!endif
+
 #
 # Shell
 #
-- 
2.30.2.windows.1



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




[edk2-devel] [PATCH 1/2] UefiPayloadPkg: Include more modules in UefiPayloadPkg.

2021-09-02 Thread kavya
From: Sravanthi 

Include core modules in UefiPayloadPkg.dsc and UefiPayloadPkg.fdf

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sravanthi 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 6 ++
 UefiPayloadPkg/UefiPayloadPkg.fdf | 6 ++
 2 files changed, 12 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index b4a30be381..6859d2aeb8 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -452,6 +452,7 @@
   NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf
   
NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf
   }
+  MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
 
   PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf
   MdeModulePkg/Universal/Metronome/Metronome.inf
@@ -482,6 +483,8 @@
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
   MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
   MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
+  MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf
+  MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
 
   UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
 
@@ -517,6 +520,7 @@
   MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
   MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
   MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
 
   #
   # SD/eMMC Support
@@ -534,6 +538,7 @@
   MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
   MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
   MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
+  MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
 
   #
   # ISA Support
@@ -545,6 +550,7 @@
   OvmfPkg/SioBusDxe/SioBusDxe.inf
   MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
 !endif
+  MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf
 
   #
   # Console Support
diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf 
b/UefiPayloadPkg/UefiPayloadPkg.fdf
index b2cfb6b405..bb6279bead 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -101,6 +101,7 @@ INF 
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
 INF UefiCpuPkg/CpuDxe/CpuDxe.inf
 INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
 INF MdeModulePkg/Application/UiApp/UiApp.inf
+INF MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
 INF PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf
 INF MdeModulePkg/Universal/Metronome/Metronome.inf
 INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
@@ -124,6 +125,8 @@ INF 
MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf
 INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
 INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
+INF MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf
+INF MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
 INF UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
 
 INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
@@ -143,6 +146,7 @@ INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
 INF OvmfPkg/SioBusDxe/SioBusDxe.inf
 INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
 !endif
+INF MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf
 
 #
 # Console Support
@@ -167,6 +171,7 @@ INF 
MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
 INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
 INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
 INF MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+INF MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
 
 INF FatPkg/EnhancedFatDxe/Fat.inf
 
@@ -186,6 +191,7 @@ INF MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
 INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
 INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
 INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
+INF MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
 
 #
 # ACPI Support
-- 
2.30.2.windows.1



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




[edk2-devel] [PATCH 1/2] UefiPayloadPkg: Include more modules in UefiPayloadPkg.

2021-09-09 Thread kavya
From: Sravanthi 

Include core modules in UefiPayloadPkg.dsc and UefiPayloadPkg.fdf

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Zhiguang Liu 
Signed-off-by: Sravanthi 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 6 ++
 UefiPayloadPkg/UefiPayloadPkg.fdf | 6 ++
 2 files changed, 12 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index b4a30be381..6859d2aeb8 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -452,6 +452,7 @@
   NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf
   
NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf
   }
+  MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
 
   PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf
   MdeModulePkg/Universal/Metronome/Metronome.inf
@@ -482,6 +483,8 @@
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
   MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
   MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
+  MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf
+  MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
 
   UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
 
@@ -517,6 +520,7 @@
   MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
   MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
   MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
 
   #
   # SD/eMMC Support
@@ -534,6 +538,7 @@
   MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
   MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
   MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
+  MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
 
   #
   # ISA Support
@@ -545,6 +550,7 @@
   OvmfPkg/SioBusDxe/SioBusDxe.inf
   MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
 !endif
+  MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf
 
   #
   # Console Support
diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf 
b/UefiPayloadPkg/UefiPayloadPkg.fdf
index b2cfb6b405..bb6279bead 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -101,6 +101,7 @@ INF 
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
 INF UefiCpuPkg/CpuDxe/CpuDxe.inf
 INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
 INF MdeModulePkg/Application/UiApp/UiApp.inf
+INF MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
 INF PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf
 INF MdeModulePkg/Universal/Metronome/Metronome.inf
 INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
@@ -124,6 +125,8 @@ INF 
MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf
 INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
 INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
+INF MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf
+INF MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
 INF UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
 
 INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
@@ -143,6 +146,7 @@ INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
 INF OvmfPkg/SioBusDxe/SioBusDxe.inf
 INF MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
 !endif
+INF MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf
 
 #
 # Console Support
@@ -167,6 +171,7 @@ INF 
MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
 INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
 INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
 INF MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+INF MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
 
 INF FatPkg/EnhancedFatDxe/Fat.inf
 
@@ -186,6 +191,7 @@ INF MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
 INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
 INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
 INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
+INF MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
 
 #
 # ACPI Support
-- 
2.30.2.windows.1



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




[edk2-devel] [PATCH 2/2] UefiPayloadPkg: Include Network modules in UefiPayloadPkg.

2021-09-09 Thread kavya
From: Sravanthi 

Include Network modules in UefiPayloadPkg.dsc and UefiPayloadPkg.fdf

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Zhiguang Liu 
Signed-off-by: Sravanthi 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 14 ++
 UefiPayloadPkg/UefiPayloadPkg.fdf | 11 +--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 6859d2aeb8..e716e8d0b2 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -90,6 +90,7 @@
 
   DEFINE EMU_VARIABLE_ENABLE   = TRUE
   DEFINE DISABLE_RESET_SYSTEM  = FALSE
+  DEFINE NETWORK_DRIVER_ENABLE = FALSE
 
   # Dfine the maximum size of the capsule image without a reset flag that the 
platform can support.
   DEFINE MAX_SIZE_NON_POPULATE_CAPSULE = 0xa0
@@ -161,6 +162,11 @@
   
CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
   SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
   DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLib/DxeHobListLib.inf
+  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+  TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
+  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
+  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
+  RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf
 
 !if $(UNIVERSAL_PAYLOAD) == TRUE
   HobLib|UefiPayloadPkg/Library/DxeHobLib/DxeHobLib.inf
@@ -355,6 +361,7 @@
 
   
gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|$(MAX_LOGICAL_PROCESSORS)
   gUefiCpuPkgTokenSpaceGuid.PcdCpuNumberOfReservedVariableMtrrs|0
+  gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE
 
 

 #
@@ -431,6 +438,13 @@
   !endif
 !endif
 
+#
+# UEFI network modules
+#
+!if $(NETWORK_DRIVER_ENABLE) == TRUE
+  !include NetworkPkg/Network.dsc.inc
+!endif
+
 [Components.X64]
   #
   # DXE Core
diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf 
b/UefiPayloadPkg/UefiPayloadPkg.fdf
index bb6279bead..a089892d03 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -17,8 +17,8 @@ DEFINE FD_SIZE = 0x0085
 DEFINE NUM_BLOCKS  = 0x850
 !else
 
-DEFINE FD_SIZE = 0x0041
-DEFINE NUM_BLOCKS  = 0x410
+DEFINE FD_SIZE = 0x0059
+DEFINE NUM_BLOCKS  = 0x590
 !endif
 
 

@@ -198,6 +198,13 @@ INF MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
 #
 INF  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
 
+#
+# UEFI network modules
+#
+!if $(NETWORK_DRIVER_ENABLE) == TRUE
+  !include NetworkPkg/Network.fdf.inc
+!endif
+
 #
 # Shell
 #
-- 
2.30.2.windows.1



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