From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.7422.1684931339636052825 for ; Wed, 24 May 2023 05:29:06 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=ZVQAMzCI; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684931345; x=1716467345; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pjfkUw3ew9oOX0O4rXJ4vj9XuNdxtDM8JR3JvOUydac=; b=ZVQAMzCIPner4XtZF0vh/pmdY/PoqMVNRoVegYEMQJ1at/58JOIUZR9+ aqucc0fLlk+/8ltihATjLgTt5EsQ/jyEUKZjgZtMwa4Yc5D8fme/0lQU3 g5w5dF5XoeeEYQrcblsirMmomSk0LXfV6k1JSb9qyHkrIp/NsxWTljQ2J yZz3BK4XSmDjXYMMKEL4cAYFxfo/hMwS3Vh5I2U44wTZrctlnYj5YH9pV MH+5D3pwPgpTIdH5ZJORV8BNt0MgTCUYzDhI2TnsAXzbVu4O/caS3R+2x T/in8Rl0v/mS4OHu+C4hYVohNhHANnW/ShnbxHVOmxlZFsbu9gravsLg2 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10720"; a="419259534" X-IronPort-AV: E=Sophos;i="6.00,189,1681196400"; d="scan'208";a="419259534" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2023 05:29:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10720"; a="704328081" X-IronPort-AV: E=Sophos;i="6.00,189,1681196400"; d="scan'208";a="704328081" Received: from shwdeopenlab706.ccr.corp.intel.com ([10.239.55.95]) by orsmga002.jf.intel.com with ESMTP; 24 May 2023 05:29:04 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Nate DeSimone , Zhiguang Liu , Michael D Kinney Subject: [PATCH 3/6] SimicsOpenBoardPkg: Enable serial terminal Date: Wed, 24 May 2023 20:28:49 +0800 Message-Id: <20230524122852.2047-4-ray.ni@intel.com> X-Mailer: git-send-email 2.39.1.windows.1 In-Reply-To: <20230524122852.2047-1-ray.ni@intel.com> References: <20230524122852.2047-1-ray.ni@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Signed-off-by: Ray Ni Cc: Nate DeSimone Cc: Zhiguang Liu Cc: Michael D Kinney --- .../BoardX58Ich10/OpenBoardPkg.fdf | 1 - .../BoardX58Ich10/OpenBoardPkgPcd.dsc | 1 + .../Library/BoardBdsHookLib/BoardBdsHookLib.c | 56 ++++++++----------- 3 files changed, 24 insertions(+), 34 deletions(-) diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.f= df b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf index 6ecff76362..aa44c01784 100644 --- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf +++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf @@ -198,7 +198,6 @@ INF UefiCpuPkg/CpuDxe/CpuDxe.inf INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf=0D INF MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorD= xe.inf=0D INF UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf=0D -INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf=0D INF MdeModulePkg/Universal/PrintDxe/PrintDxe.inf=0D INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf=0D INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf=0D diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPc= d.dsc b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc index 732d95e44f..b6672d1a78 100644 --- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc +++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc @@ -69,6 +69,7 @@ ######################################=0D gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable|TRUE=0D gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable|TRUE=0D + gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|TRUE=0D =0D [PcdsFeatureFlag.X64]=0D ######################################=0D diff --git a/Platform/Intel/SimicsOpenBoardPkg/Library/BoardBdsHookLib/Boar= dBdsHookLib.c b/Platform/Intel/SimicsOpenBoardPkg/Library/BoardBdsHookLib/B= oardBdsHookLib.c index 3c6385c12f..238513f666 100644 --- a/Platform/Intel/SimicsOpenBoardPkg/Library/BoardBdsHookLib/BoardBdsHoo= kLib.c +++ b/Platform/Intel/SimicsOpenBoardPkg/Library/BoardBdsHookLib/BoardBdsHoo= kLib.c @@ -837,45 +837,35 @@ PlatformInitializeConsole ( )=0D {=0D UINTN Index;=0D - EFI_DEVICE_PATH_PROTOCOL *VarConout;=0D - EFI_DEVICE_PATH_PROTOCOL *VarConin;=0D =0D //=0D - // Connect RootBridge=0D + // Do platform specific PCI Device check and add them to ConOut, ConIn, = ErrOut=0D + // Note: Why perform the ConIn/ConOut/ErrOut variables update without ch= ecking=0D + // whether "ConIn", "ConOut" or "ErrOut" is present in the vari= able store?=0D + // Because SerialPortTerminalLib.constructor() adds the serial ter= minal device=0D + // to "ConIn", "ConOut" and "ErrOut" variables always, checking= presence of=0D + // the three variables will lead to the following update logic = never runs.=0D //=0D - GetEfiGlobalVariable2 (EFI_CON_OUT_VARIABLE_NAME, (VOID **) &VarConout, = NULL);=0D - GetEfiGlobalVariable2 (EFI_CON_IN_VARIABLE_NAME, (VOID **) &VarConin, NU= LL);=0D -=0D - if (VarConout =3D=3D NULL || VarConin =3D=3D NULL) {=0D - //=0D - // Do platform specific PCI Device check and add them to ConOut, ConIn= , ErrOut=0D - //=0D - DetectAndPreparePlatformPciDevicePaths (FALSE);=0D - DetectAndPreparePlatformPciDevicePaths(TRUE);=0D + DetectAndPreparePlatformPciDevicePaths (FALSE);=0D + DetectAndPreparePlatformPciDevicePaths(TRUE);=0D + //=0D + // Have chance to connect the platform default console,=0D + // the platform default console is the minimue device group=0D + // the platform should support=0D + //=0D + for (Index =3D 0; PlatformConsole[Index].DevicePath !=3D NULL; ++Index) = {=0D //=0D - // Have chance to connect the platform default console,=0D - // the platform default console is the minimue device group=0D - // the platform should support=0D + // Update the console variable with the connect type=0D //=0D - for (Index =3D 0; PlatformConsole[Index].DevicePath !=3D NULL; ++Index= ) {=0D - //=0D - // Update the console variable with the connect type=0D - //=0D - if ((PlatformConsole[Index].ConnectType & CONSOLE_IN) =3D=3D CONSOLE= _IN) {=0D - EfiBootManagerUpdateConsoleVariable (ConIn, PlatformConsole[Index]= .DevicePath, NULL);=0D - }=0D - if ((PlatformConsole[Index].ConnectType & CONSOLE_OUT) =3D=3D CONSOL= E_OUT) {=0D - EfiBootManagerUpdateConsoleVariable (ConOut, PlatformConsole[Index= ].DevicePath, NULL);=0D - }=0D - if ((PlatformConsole[Index].ConnectType & STD_ERROR) =3D=3D STD_ERRO= R) {=0D - EfiBootManagerUpdateConsoleVariable (ErrOut, PlatformConsole[Index= ].DevicePath, NULL);=0D - }=0D + if ((PlatformConsole[Index].ConnectType & CONSOLE_IN) =3D=3D CONSOLE_I= N) {=0D + EfiBootManagerUpdateConsoleVariable (ConIn, PlatformConsole[Index].D= evicePath, NULL);=0D + }=0D + if ((PlatformConsole[Index].ConnectType & CONSOLE_OUT) =3D=3D CONSOLE_= OUT) {=0D + EfiBootManagerUpdateConsoleVariable (ConOut, PlatformConsole[Index].= DevicePath, NULL);=0D + }=0D + if ((PlatformConsole[Index].ConnectType & STD_ERROR) =3D=3D STD_ERROR)= {=0D + EfiBootManagerUpdateConsoleVariable (ErrOut, PlatformConsole[Index].= DevicePath, NULL);=0D }=0D - } else {=0D - //=0D - // Only detect VGA device and add them to ConOut=0D - //=0D - DetectAndPreparePlatformPciDevicePaths (TRUE);=0D }=0D }=0D =0D --=20 2.39.1.windows.1