From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) by mx.groups.io with SMTP id smtpd.web11.1285.1663002829346115139 for ; Mon, 12 Sep 2022 10:13:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EN3hgX21; spf=pass (domain: gmail.com, ip: 209.85.222.169, mailfrom: benjamin.doron00@gmail.com) Received: by mail-qk1-f169.google.com with SMTP id 3so6120498qka.5 for ; Mon, 12 Sep 2022 10:13:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=PCNBPWo2ye8P9L9aqIjKQ4F3TwKC94JFiqM+tR4Kyvk=; b=EN3hgX21lQt3N03pcC6DI1UConxf9jMTTssLcOIZIsJDqIA5lvgQiQBxSmR3I3+9Nq 01uXFDxr3wCYdXRc0XfJx6NRUsjb4XsUho65QqTjqvwHR/nu7CizX5fsZfWkvfWMYlnE Deq/OiAsSgYCrt0AzE77uI2PARYFF4aQ+OLh6wY7ERE42bR8Jb0MVZZYxduyCPuHtwTR IsVT5xpGCtE6vWc3SGfTouFt3Tr1F07ZQ8bbsGsYjVnElDz0PEoDlVnUjU72csBuqN8X PBnehWQehmF1AfzfNCyl4Ci0QGbwjNrWriO0a9JQ1fZ4093YGsGJ6e+lVKgcAsLqWD6G 4+9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=PCNBPWo2ye8P9L9aqIjKQ4F3TwKC94JFiqM+tR4Kyvk=; b=MwY2DRLCCco4XtMgquCApTsmnR2LVsWqL2EvF0h+Lr+KT/KdMPSx7P2vAOWFuJMfvi HX50RjEHq54fGBi3i5QjCH9H5p0HE1vR1W8RCLU1YAGQcreMtuVjfkxzvBAxtYTOyFUb KpgsVOAENykSAmu9v26n6kabnzr11arH2SNr4h1R1Xcxv467H/k/LcoWNVomFdJ3eHfY whqAjLgTBylvwV899Z1elmenRQpTF7KkGQPPBiscBOQsAtigSmBv8ZgIN5GW9sVVLzid 1fGhf3/hHQHm+KQvrukWUSZ3QAX4NQXkqrnjRlK9Duh46YS82vgCOM6HKmjYnUaXAKet hkGQ== X-Gm-Message-State: ACgBeo0ZxQbi1X7p2ubp0lkG2NjoVkjc0e9WcPZ95ulU7VWv5mdyqiX2 cKucFmepD1c4Gkg41LYGDEm7TfLt9RE= X-Google-Smtp-Source: AA6agR4wf1wR4hqp5mAvSoOVD5jCci43gl4iyFr0VUkvzgtbDcvSUtpUopA8sU+qfszNemPDPapPBA== X-Received: by 2002:a05:620a:3192:b0:6cb:b2cd:f3a2 with SMTP id bi18-20020a05620a319200b006cbb2cdf3a2mr18603662qkb.2.1663002828039; Mon, 12 Sep 2022 10:13:48 -0700 (PDT) Return-Path: Received: from aturtleortwo-benjamindomain.. ([2607:f2c0:e98c:e:579e:d875:fc8f:d092]) by smtp.gmail.com with ESMTPSA id s5-20020ac87585000000b00346414a0ca1sm6863540qtq.1.2022.09.12.10.13.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 10:13:47 -0700 (PDT) From: "Benjamin Doron" To: devel@edk2.groups.io Cc: Nate DeSimone , Ankit Sinha , Chasel Chiu , Jeremy Soller , Sai Chaganty , Isaac Oram Subject: [edk2-platforms][PATCH v3 4/4] KabylakeOpenBoardPkg: Example of board S3 Date: Mon, 12 Sep 2022 13:12:50 -0400 Message-Id: <20220912171250.1515536-5-benjamin.doron00@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220912171250.1515536-1-benjamin.doron00@gmail.com> References: <20220912171250.1515536-1-benjamin.doron00@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Use silicon code to detect S3 resume state. Apply some relevant policy modifications. PcdPeiMemSize must be in common scope, for a DXE module to allocate required memory. Libraries that produce required PPIs are defined. BootScriptExecutorDxe should only be linked against a functionally compatible debug stack. Cc: Nate DeSimone Cc: Ankit Sinha Cc: Chasel Chiu Cc: Jeremy Soller Cc: Sai Chaganty Cc: Isaac Oram Signed-off-by: Benjamin Doron --- .../PeiFspMiscUpdUpdateLib.c | 12 +++++- .../PeiSaPolicyUpdate.c | 12 +++++- .../PeiAspireVn7Dash572GInitPreMemLib.c | 38 +++++++++++-------- .../BoardInitLib/PeiBoardInitPreMemLib.inf | 3 ++ .../AspireVn7Dash572G/OpenBoardPkg.dsc | 21 ++++++++++ .../AspireVn7Dash572G/OpenBoardPkgPcd.dsc | 16 ++------ .../PeiSiliconPolicyUpdateLib.c | 11 +++++- .../PeiSiliconPolicyUpdateLib.inf | 1 + .../PeiFspMiscUpdUpdateLib.c | 11 +++++- .../PeiSaPolicyUpdate.c | 12 +++++- .../BoardInitLib/PeiBoardInitPreMemLib.inf | 1 + .../BoardInitLib/PeiGalagoPro3InitPreMemLib.c | 27 ++++++++++++- .../PeiMultiBoardInitPreMemLib.inf | 1 + .../GalagoPro3/OpenBoardPkg.dsc | 15 ++++++++ .../GalagoPro3/OpenBoardPkgPcd.dsc | 2 +- .../PeiFspMiscUpdUpdateLib.c | 12 +++++- .../PeiSaPolicyUpdate.c | 12 +++++- .../BoardInitLib/PeiBoardInitPreMemLib.inf | 1 + .../PeiKabylakeRvp3InitPreMemLib.c | 27 ++++++++++++- .../PeiMultiBoardInitPreMemLib.inf | 1 + .../KabylakeRvp3/OpenBoardPkg.dsc | 12 ++++++ .../KabylakeRvp3/OpenBoardPkgPcd.dsc | 2 +- .../PeiSiliconPolicyUpdateLib.c | 11 +++++- .../PeiSiliconPolicyUpdateLib.inf | 1 + 24 files changed, 222 insertions(+), 40 deletions(-) diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapp= er/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform= /Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSilicon= PolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c index a9b7e446c8d6..7e4194bf4fe6 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Libr= ary/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Libr= ary/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c @@ -11,6 +11,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include =0D #include =0D #include =0D +#include =0D +=0D #include =0D #include =0D #include =0D @@ -32,11 +34,15 @@ PeiFspMiscUpdUpdatePreMem ( )=0D {=0D EFI_STATUS Status;=0D + EFI_BOOT_MODE BootMode;=0D UINTN VariableSize;=0D VOID *FspNvsBufferPtr;=0D UINT8 MorControl;=0D VOID *MorControlPtr;=0D =0D + Status =3D PeiServicesGetBootMode (&BootMode);=0D + ASSERT_EFI_ERROR (Status);=0D +=0D //=0D // Initialize S3 Data variable (S3DataPtr). It may be used for warm and = fast boot paths.=0D //=0D @@ -70,7 +76,11 @@ PeiFspMiscUpdUpdatePreMem ( &VariableSize=0D );=0D DEBUG ((DEBUG_INFO, "MorControl - 0x%x (%r)\n", MorControl, Status));=0D - if (MOR_CLEAR_MEMORY_VALUE (MorControl)) {=0D + //=0D + // Do not set CleanMemory on S3 resume=0D + // TODO: Handle advanced features later - capsule update is in-memory li= st=0D + //=0D + if (MOR_CLEAR_MEMORY_VALUE (MorControl) && BootMode !=3D BOOT_ON_S3_RESU= ME) {=0D FspmUpd->FspmConfig.CleanMemory =3D (BOOLEAN)(MorControl & MOR_CLEAR_M= EMORY_BIT_MASK);=0D }=0D =0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapp= er/Library/PeiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdate.c b/Platform/Inte= l/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolic= yUpdateLibFsp/PeiSaPolicyUpdate.c index 4621cbd3ca3a..98db86570368 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Libr= ary/PeiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdate.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Libr= ary/PeiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdate.c @@ -11,6 +11,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include =0D #include =0D #include =0D +#include =0D =0D /**=0D Performs FSP SA PEI Policy initialization.=0D @@ -27,12 +28,17 @@ PeiFspSaPolicyUpdate ( IN OUT FSPS_UPD *FspsUpd=0D )=0D {=0D + EFI_STATUS Status;=0D + EFI_BOOT_MODE BootMode;=0D VOID *Buffer;=0D VOID *MemBuffer;=0D UINT32 Size;=0D =0D DEBUG((DEBUG_INFO, "\nUpdating SA Policy in Post Mem\n"));=0D =0D + Status =3D PeiServicesGetBootMode (&BootMode);=0D + ASSERT_EFI_ERROR (Status);=0D +=0D FspsUpd->FspsConfig.PeiGraphicsPeimInit =3D 1;=0D =0D Size =3D 0;=0D @@ -40,7 +46,11 @@ PeiFspSaPolicyUpdate ( PeiGetSectionFromAnyFv (PcdGetPtr (PcdGraphicsVbtGuid), EFI_SECTION_RA= W, 0, &Buffer, &Size);=0D if (Buffer =3D=3D NULL) {=0D DEBUG((DEBUG_WARN, "Could not locate VBT\n"));=0D - } else {=0D + //=0D + // Graphics initialization is unnecessary,=0D + // OS has present framebuffer.=0D + //=0D + } else if (BootMode !=3D BOOT_ON_S3_RESUME) {=0D MemBuffer =3D (VOID *)AllocatePages (EFI_SIZE_TO_PAGES ((UINTN)Size)= );=0D if ((MemBuffer !=3D NULL) && (Buffer !=3D NULL)) {=0D CopyMem (MemBuffer, (VOID *)Buffer, (UINTN)Size);=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Library/= BoardInitLib/PeiAspireVn7Dash572GInitPreMemLib.c b/Platform/Intel/KabylakeO= penBoardPkg/AspireVn7Dash572G/Library/BoardInitLib/PeiAspireVn7Dash572GInit= PreMemLib.c index 1c9a65399b54..3029354b96cd 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Library/BoardIn= itLib/PeiAspireVn7Dash572GInitPreMemLib.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Library/BoardIn= itLib/PeiAspireVn7Dash572GInitPreMemLib.c @@ -11,7 +11,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include =0D #include =0D #include =0D +#include =0D #include =0D +#include =0D #include =0D #include =0D #include =0D @@ -267,25 +269,31 @@ AspireVn7Dash572GBoardBootModeDetect ( VOID=0D )=0D {=0D - UINT16 ABase;=0D + EFI_BOOT_MODE BootMode;=0D UINT32 SleepType;=0D =0D DEBUG ((DEBUG_INFO, "Performing boot mode detection\n"));=0D =0D - // TODO: Perform advanced detection (recovery/capsule)=0D - // FIXME: This violates PI specification? But BOOT_WITH* would always ta= ke precedence=0D - // over BOOT_ON_S{4,5}...=0D - PchAcpiBaseGet (&ABase);=0D - SleepType =3D IoRead32 (ABase + R_PCH_ACPI_PM1_CNT) & B_PCH_ACPI_PM1_CNT= _SLP_TYP;=0D + // Known sane defaults; TODO: Consider "default"?=0D + BootMode =3D BOOT_WITH_FULL_CONFIGURATION;=0D =0D - switch (SleepType) {=0D - case V_PCH_ACPI_PM1_CNT_S3:=0D - return BOOT_ON_S3_RESUME;=0D - case V_PCH_ACPI_PM1_CNT_S4:=0D - return BOOT_ON_S4_RESUME;=0D -// case V_PCH_ACPI_PM1_CNT_S5:=0D -// return BOOT_ON_S5_RESUME;=0D - default:=0D - return BOOT_WITH_FULL_CONFIGURATION;=0D + // TODO: Perform advanced detection (capsule/recovery)=0D + // TODO: Perform "IsFirstBoot" test with VariablePpi for "minimal"/"assu= me"=0D + if (GetSleepTypeAfterWakeup (&SleepType)) {=0D + switch (SleepType) {=0D + case V_PCH_ACPI_PM1_CNT_S3:=0D + BootMode =3D BOOT_ON_S3_RESUME;=0D + break;=0D + case V_PCH_ACPI_PM1_CNT_S4:=0D + BootMode =3D BOOT_ON_S4_RESUME;=0D + break;=0D + case V_PCH_ACPI_PM1_CNT_S5:=0D + BootMode =3D BOOT_ON_S5_RESUME;=0D + break;=0D + }=0D }=0D +=0D + DEBUG ((DEBUG_INFO, "BootMode is 0x%x\n", BootMode));=0D +=0D + return BootMode;=0D }=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Library/= BoardInitLib/PeiBoardInitPreMemLib.inf b/Platform/Intel/KabylakeOpenBoardPk= g/AspireVn7Dash572G/Library/BoardInitLib/PeiBoardInitPreMemLib.inf index cd9f979d313c..c53114e15450 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Library/BoardIn= itLib/PeiBoardInitPreMemLib.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Library/BoardIn= itLib/PeiBoardInitPreMemLib.inf @@ -25,11 +25,14 @@ TimerLib=0D PchCycleDecodingLib=0D PchResetLib=0D + PciLib=0D IoLib=0D EcLib=0D BoardEcLib=0D GpioLib=0D PeiLib=0D + PeiServicesLib=0D + PchPmcLib=0D =0D [Packages]=0D MinPlatformPkg/MinPlatformPkg.dec=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoar= dPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardP= kg.dsc index efe29c617a02..20c42a7c1c20 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc @@ -249,6 +249,7 @@ # Silicon Package=0D #######################################=0D ReportCpuHobLib|IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.= inf=0D + SmmAccessLib|IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLibSm= ramc/PeiSmmAccessLib.inf=0D =0D #######################################=0D # Platform Package=0D @@ -712,6 +713,26 @@ !endif=0D }=0D =0D +!if gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable =3D=3D TRUE=0D + MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.= inf {=0D + =0D + # On S3 resume, RSC is in end-of-BS state=0D + # - Moreover: Library cannot effectively use some end-of-BS events=0D + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPor= t.inf=0D + SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLib= Null.inf=0D + # Reverse-ranked priority list=0D +# TODO: Requires testing=0D +# - Strongly suspect DebugLibSerialPort constructor presents PeiDxeSerialP= ortLibMem dependency on services as a bug=0D +!if FALSE # $(USE_MEMORY_LOGGING) =3D=3D TRUE=0D + SerialPortLib|MdeModulePkg/Library/PeiDxeSerialPortLibMem/DxeSerialP= ortLibMem.inf=0D +!endif=0D + # Also, can debug CpuExceptionHandlerLib=0D +!if $(USE_HDMI_DEBUG_PORT) =3D=3D TRUE=0D + SerialPortLib|$(PLATFORM_BOARD_PACKAGE)/Library/I2cHdmiDebugSerialPo= rtLib/BootScriptExecutorDxeI2cHdmiDebugSerialPortLib.inf=0D +!endif=0D + }=0D +!endif=0D +=0D !endif=0D =0D #######################################=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoar= dPkgPcd.dsc b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoa= rdPkgPcd.dsc index 3ed7aa0a2b10..490c3ee6bf76 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkgPcd= .dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkgPcd= .dsc @@ -127,10 +127,7 @@ # PcdIpmiFeatureEnable will not be enabled (no BMC)=0D # TODO: Can be build-time (user) choice=0D gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable = |FALSE=0D - # TODO: Continue developing support. Broken at present.=0D - # - PeiSmmAccessLib in IntelSiliconPkg seems like a stub=0D - # - May require a PeiSmmControlLib to SMM communicate=0D - gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable = |FALSE=0D + gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable = |TRUE=0D # TODO: Definitions (now added SmbiosDxe)=0D gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable = |TRUE=0D # Requires actual hook-up=0D @@ -335,6 +332,7 @@ gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuCoreCount|4=0D gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuThreadCount|2=0D gMinPlatformPkgTokenSpaceGuid.PcdPciExpressRegionLength|0x10000000=0D + gIntelFsp2WrapperTokenSpaceGuid.PcdPeiMinMemSize|0x3800000=0D =0D #=0D # The PCDs are used to control the Windows SMM Security Mitigations Tabl= e - Protection Flags=0D @@ -360,13 +358,8 @@ # 0x7F, 0xFF, 0x04, 0x00}
=0D gMinPlatformPkgTokenSpaceGuid.PcdTrustedConsoleInputDevicePath|{0x02, 0x= 01, 0x0C, 0x00, 0xd0, 0x41, 0x03, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01= , 0x06, 0x00, 0x00, 0x1F, 0x02, 0x01, 0x0C, 0x00, 0xd0, 0x41, 0x03, 0x03,= 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0x04, 0x00}=0D =0D -!if $(TARGET) =3D=3D RELEASE=0D - gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiReservedMemorySize|0x800=0D -!else=0D - gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiReservedMemorySize|0x188B #= TODO=0D -!endif=0D - # TODO: Consider using reserved space instead for debug log=0D - gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiRtDataMemorySize|0x200=0D + gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiAcpiNvsMemorySize|0x4800=0D + gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiRtDataMemorySize|0x100=0D !if $(TARGET) =3D=3D RELEASE=0D gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiRtCodeMemorySize|0x70=0D !else=0D @@ -447,7 +440,6 @@ # Edk2 Configuration=0D ######################################=0D gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress|0xFED00148=0D - gIntelFsp2WrapperTokenSpaceGuid.PcdPeiMinMemSize|0x3800000=0D =0D ######################################=0D # Platform Configuration=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/L= ibrary/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c b/Platform/Int= el/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUp= dateLib/PeiSiliconPolicyUpdateLib.c index 3764f7c3ac09..04cd2e741489 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/= PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/= PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c @@ -20,6 +20,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include =0D #include =0D #include =0D +#include =0D #include =0D #include =0D #include =0D @@ -549,6 +550,7 @@ SiliconPolicyUpdatePostMem ( )=0D {=0D EFI_STATUS Status;=0D + EFI_BOOT_MODE BootMode;=0D VOID *Buffer;=0D VOID *MemBuffer;=0D UINT32 Size;=0D @@ -557,6 +559,9 @@ SiliconPolicyUpdatePostMem ( =0D DEBUG((DEBUG_INFO, "\nUpdating Policy in Post Mem\n"));=0D =0D + Status =3D PeiServicesGetBootMode (&BootMode);=0D + ASSERT_EFI_ERROR (Status);=0D +=0D GtConfig =3D NULL;=0D Status =3D GetConfigBlock ((VOID *) Policy, &gGraphicsPeiConfigGuid, (VO= ID *)&GtConfig);=0D ASSERT_EFI_ERROR (Status);=0D @@ -571,7 +576,11 @@ SiliconPolicyUpdatePostMem ( PeiGetSectionFromAnyFv (PcdGetPtr (PcdGraphicsVbtGuid), EFI_SECTION_RA= W, 0, &Buffer, &Size);=0D if (Buffer =3D=3D NULL) {=0D DEBUG((DEBUG_WARN, "Could not locate VBT\n"));=0D - } else {=0D + //=0D + // Graphics initialization is unnecessary,=0D + // OS has present framebuffer.=0D + //=0D + } else if (BootMode !=3D BOOT_ON_S3_RESUME) {=0D MemBuffer =3D (VOID *)AllocatePages (EFI_SIZE_TO_PAGES ((UINTN)Size)= );=0D if ((MemBuffer !=3D NULL) && (Buffer !=3D NULL)) {=0D CopyMem (MemBuffer, (VOID *)Buffer, (UINTN)Size);=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/L= ibrary/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf b/Platform/I= ntel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicy= UpdateLib/PeiSiliconPolicyUpdateLib.inf index 1ce26fc3dcec..31a45292209d 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/= PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/= PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf @@ -23,6 +23,7 @@ BaseMemoryLib=0D MemoryAllocationLib=0D PeiLib=0D + PeiServicesLib=0D CpuPlatformLib=0D PchPcieRpLib=0D PchInfoLib=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Libr= ary/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform/Intel/= KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLi= bFsp/PeiFspMiscUpdUpdateLib.c index dbc84631acaa..ce309bd378d2 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/Pei= SiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/Pei= SiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c @@ -11,6 +11,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include =0D #include =0D #include =0D +#include =0D =0D #include =0D #include =0D @@ -36,11 +37,15 @@ PeiFspMiscUpdUpdatePreMem ( )=0D {=0D EFI_STATUS Status;=0D + EFI_BOOT_MODE BootMode;=0D UINTN VariableSize;=0D VOID *FspNvsBufferPtr;=0D UINT8 MorControl;=0D VOID *MorControlPtr;=0D =0D + Status =3D PeiServicesGetBootMode (&BootMode);=0D + ASSERT_EFI_ERROR (Status);=0D +=0D //=0D // Initialize S3 Data variable (S3DataPtr). It may be used for warm and = fast boot paths.=0D //=0D @@ -75,7 +80,11 @@ PeiFspMiscUpdUpdatePreMem ( &VariableSize=0D );=0D DEBUG ((DEBUG_INFO, "MorControl - 0x%x (%r)\n", MorControl, Status));=0D - if (MOR_CLEAR_MEMORY_VALUE (MorControl)) {=0D + //=0D + // Do not set CleanMemory on S3 resume=0D + // TODO: Handle advanced features later - capsule update is in-memory li= st=0D + //=0D + if (MOR_CLEAR_MEMORY_VALUE (MorControl) && BootMode !=3D BOOT_ON_S3_RESU= ME) {=0D FspmUpd->FspmConfig.CleanMemory =3D (BOOLEAN)(MorControl & MOR_CLEAR_M= EMORY_BIT_MASK);=0D }=0D =0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Libr= ary/PeiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdate.c b/Platform/Intel/Kabyl= akeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/= PeiSaPolicyUpdate.c index 133b8c963f65..6fd45cc79f61 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/Pei= SiliconPolicyUpdateLibFsp/PeiSaPolicyUpdate.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/Pei= SiliconPolicyUpdateLibFsp/PeiSaPolicyUpdate.c @@ -17,6 +17,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include =0D #include =0D #include =0D +#include =0D =0D /**=0D Performs FSP SA PEI Policy initialization.=0D @@ -33,12 +34,17 @@ PeiFspSaPolicyUpdate ( IN OUT FSPS_UPD *FspsUpd=0D )=0D {=0D + EFI_STATUS Status;=0D + EFI_BOOT_MODE BootMode;=0D VOID *Buffer;=0D VOID *MemBuffer;=0D UINT32 Size;=0D =0D DEBUG((DEBUG_INFO, "\nUpdating SA Policy in Post Mem\n"));=0D =0D + Status =3D PeiServicesGetBootMode (&BootMode);=0D + ASSERT_EFI_ERROR (Status);=0D +=0D FspsUpd->FspsConfig.PeiGraphicsPeimInit =3D 1;=0D =0D Size =3D 0;=0D @@ -46,7 +52,11 @@ PeiFspSaPolicyUpdate ( PeiGetSectionFromAnyFv (PcdGetPtr (PcdGraphicsVbtGuid), EFI_SECTION_RA= W, 0, &Buffer, &Size);=0D if (Buffer =3D=3D NULL) {=0D DEBUG((DEBUG_WARN, "Could not locate VBT\n"));=0D - } else {=0D + //=0D + // Graphics initialization is unnecessary,=0D + // OS has present framebuffer.=0D + //=0D + } else if (BootMode !=3D BOOT_ON_S3_RESUME) {=0D MemBuffer =3D (VOID *)AllocatePages (EFI_SIZE_TO_PAGES ((UINTN)Size)= );=0D if ((MemBuffer !=3D NULL) && (Buffer !=3D NULL)) {=0D CopyMem (MemBuffer, (VOID *)Buffer, (UINTN)Size);=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardIn= itLib/PeiBoardInitPreMemLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/Galag= oPro3/Library/BoardInitLib/PeiBoardInitPreMemLib.inf index d6c91cd2b94b..5b3a6921d0ee 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/P= eiBoardInitPreMemLib.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/P= eiBoardInitPreMemLib.inf @@ -23,6 +23,7 @@ PcdLib=0D SiliconInitLib=0D PchResetLib=0D + PchPmcLib=0D =0D [Packages]=0D MinPlatformPkg/MinPlatformPkg.dec=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardIn= itLib/PeiGalagoPro3InitPreMemLib.c b/Platform/Intel/KabylakeOpenBoardPkg/Ga= lagoPro3/Library/BoardInitLib/PeiGalagoPro3InitPreMemLib.c index 051dac0b204d..1cd2baf4a4dd 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/P= eiGalagoPro3InitPreMemLib.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/P= eiGalagoPro3InitPreMemLib.c @@ -14,6 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include =0D #include =0D #include =0D +#include =0D #include =0D #include =0D #include =0D @@ -236,5 +237,29 @@ GalagoPro3BoardBootModeDetect ( VOID=0D )=0D {=0D - return BOOT_WITH_FULL_CONFIGURATION;=0D + EFI_BOOT_MODE BootMode;=0D + UINT32 SleepType;=0D +=0D + DEBUG ((DEBUG_INFO, "Performing boot mode detection\n"));=0D +=0D + // Known sane defaults=0D + BootMode =3D BOOT_WITH_FULL_CONFIGURATION;=0D +=0D + if (GetSleepTypeAfterWakeup (&SleepType)) {=0D + switch (SleepType) {=0D + case V_PCH_ACPI_PM1_CNT_S3:=0D + BootMode =3D BOOT_ON_S3_RESUME;=0D + break;=0D + case V_PCH_ACPI_PM1_CNT_S4:=0D + BootMode =3D BOOT_ON_S4_RESUME;=0D + break;=0D + case V_PCH_ACPI_PM1_CNT_S5:=0D + BootMode =3D BOOT_ON_S5_RESUME;=0D + break;=0D + }=0D + }=0D +=0D + DEBUG ((DEBUG_INFO, "BootMode is 0x%x\n", BootMode));=0D +=0D + return BootMode;=0D }=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardIn= itLib/PeiMultiBoardInitPreMemLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/= GalagoPro3/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf index fe31f421356e..20ddac1d994d 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/P= eiMultiBoardInitPreMemLib.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/P= eiMultiBoardInitPreMemLib.inf @@ -25,6 +25,7 @@ SiliconInitLib=0D MultiBoardInitSupportLib=0D PchResetLib=0D + PchPmcLib=0D =0D [Packages]=0D MinPlatformPkg/MinPlatformPkg.dec=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.ds= c b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc index f0e9a21ccad9..219ef20e55f0 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc @@ -180,6 +180,7 @@ # Silicon Package=0D #######################################=0D ReportCpuHobLib|IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.= inf=0D + SmmAccessLib|IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLibSm= ramc/PeiSmmAccessLib.inf=0D =0D #######################################=0D # Platform Package=0D @@ -494,6 +495,20 @@ !endif=0D }=0D =0D +!if gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable =3D=3D TRUE=0D + MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.= inf {=0D + =0D + # On S3 resume, RSC is in end-of-BS state=0D + # - Moreover: Libraries cannot effectively use some end-of-BS events= =0D + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPor= t.inf=0D + SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLib= Null.inf=0D + # Reverse-ranked priority list=0D +!if gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortEnable =3D=3D T= RUE=0D + SerialPortLib|$(PLATFORM_BOARD_PACKAGE)/Library/I2cHdmiDebugSerialPo= rtLib/BootScriptExecutorDxeI2cHdmiDebugSerialPortLib.inf=0D +!endif=0D + }=0D +!endif=0D +=0D !endif=0D =0D #######################################=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd= .dsc b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc index 8180312f5ca5..7a73f5a831c6 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc @@ -279,6 +279,7 @@ gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuCoreCount|8=0D gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuThreadCount|2=0D gMinPlatformPkgTokenSpaceGuid.PcdPciExpressRegionLength|0x10000000=0D + gIntelFsp2WrapperTokenSpaceGuid.PcdPeiMinMemSize|0x3800000=0D =0D #=0D # The PCDs are used to control the Windows SMM Security Mitigations Tabl= e - Protection Flags=0D @@ -380,7 +381,6 @@ ######################################=0D gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0=0D gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress|0xFED00148=0D - gIntelFsp2WrapperTokenSpaceGuid.PcdPeiMinMemSize|0x3800000=0D =0D ######################################=0D # Platform Configuration=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Li= brary/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c b/Platform/Inte= l/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpda= teLibFsp/PeiFspMiscUpdUpdateLib.c index 699f4297fad6..71b03f2da464 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/P= eiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/P= eiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c @@ -11,11 +11,11 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include =0D #include =0D #include =0D +#include =0D =0D #include =0D #include =0D #include =0D -=0D #include =0D #include =0D #include =0D @@ -36,11 +36,15 @@ PeiFspMiscUpdUpdatePreMem ( )=0D {=0D EFI_STATUS Status;=0D + EFI_BOOT_MODE BootMode;=0D UINTN VariableSize;=0D VOID *FspNvsBufferPtr;=0D UINT8 MorControl;=0D VOID *MorControlPtr;=0D =0D + Status =3D PeiServicesGetBootMode (&BootMode);=0D + ASSERT_EFI_ERROR (Status);=0D +=0D //=0D // Initialize S3 Data variable (S3DataPtr). It may be used for warm and = fast boot paths.=0D //=0D @@ -73,7 +77,11 @@ PeiFspMiscUpdUpdatePreMem ( &VariableSize=0D );=0D DEBUG ((DEBUG_INFO, "MorControl - 0x%x (%r)\n", MorControl, Status));=0D - if (MOR_CLEAR_MEMORY_VALUE (MorControl)) {=0D + //=0D + // Do not set CleanMemory on S3 resume=0D + // TODO: Handle advanced features later - capsule update is in-memory li= st=0D + //=0D + if (MOR_CLEAR_MEMORY_VALUE (MorControl) && BootMode !=3D BOOT_ON_S3_RESU= ME) {=0D FspmUpd->FspmConfig.CleanMemory =3D (BOOLEAN)(MorControl & MOR_CLEAR_M= EMORY_BIT_MASK);=0D }=0D =0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Li= brary/PeiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdate.c b/Platform/Intel/Kab= ylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLib= Fsp/PeiSaPolicyUpdate.c index d6ec3e38dd7e..e855207af0d1 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/P= eiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdate.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/P= eiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdate.c @@ -17,6 +17,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include =0D #include =0D #include =0D +#include =0D =0D /**=0D Performs FSP SA PEI Policy initialization.=0D @@ -33,12 +34,17 @@ PeiFspSaPolicyUpdate ( IN OUT FSPS_UPD *FspsUpd=0D )=0D {=0D + EFI_STATUS Status;=0D + EFI_BOOT_MODE BootMode;=0D VOID *Buffer;=0D VOID *MemBuffer;=0D UINT32 Size;=0D =0D DEBUG((DEBUG_INFO, "\nUpdating SA Policy in Post Mem\n"));=0D =0D + Status =3D PeiServicesGetBootMode (&BootMode);=0D + ASSERT_EFI_ERROR (Status);=0D +=0D FspsUpd->FspsConfig.PeiGraphicsPeimInit =3D 1;=0D =0D Size =3D 0;=0D @@ -46,7 +52,11 @@ PeiFspSaPolicyUpdate ( PeiGetSectionFromAnyFv (PcdGetPtr (PcdGraphicsVbtGuid), EFI_SECTION_RA= W, 0, &Buffer, &Size);=0D if (Buffer =3D=3D NULL) {=0D DEBUG((DEBUG_WARN, "Could not locate VBT\n"));=0D - } else {=0D + //=0D + // Graphics initialization is unnecessary,=0D + // OS has present framebuffer.=0D + //=0D + } else if (BootMode !=3D BOOT_ON_S3_RESUME) {=0D MemBuffer =3D (VOID *)AllocatePages (EFI_SIZE_TO_PAGES ((UINTN)Size)= );=0D if ((MemBuffer !=3D NULL) && (Buffer !=3D NULL)) {=0D CopyMem (MemBuffer, (VOID *)Buffer, (UINTN)Size);=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/Board= InitLib/PeiBoardInitPreMemLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/Kab= ylakeRvp3/Library/BoardInitLib/PeiBoardInitPreMemLib.inf index 850fc514188b..e0022e8d6118 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib= /PeiBoardInitPreMemLib.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib= /PeiBoardInitPreMemLib.inf @@ -24,6 +24,7 @@ SiliconInitLib=0D EcLib=0D PchResetLib=0D + PchPmcLib=0D =0D [Packages]=0D MinPlatformPkg/MinPlatformPkg.dec=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/Board= InitLib/PeiKabylakeRvp3InitPreMemLib.c b/Platform/Intel/KabylakeOpenBoardPk= g/KabylakeRvp3/Library/BoardInitLib/PeiKabylakeRvp3InitPreMemLib.c index 87ae3b531ed6..02cd37227e50 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib= /PeiKabylakeRvp3InitPreMemLib.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib= /PeiKabylakeRvp3InitPreMemLib.c @@ -13,6 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include =0D #include =0D #include =0D +#include =0D #include =0D #include =0D #include =0D @@ -330,5 +331,29 @@ KabylakeRvp3BoardBootModeDetect ( VOID=0D )=0D {=0D - return BOOT_WITH_FULL_CONFIGURATION;=0D + EFI_BOOT_MODE BootMode;=0D + UINT32 SleepType;=0D +=0D + DEBUG ((DEBUG_INFO, "Performing boot mode detection\n"));=0D +=0D + // Known sane defaults=0D + BootMode =3D BOOT_WITH_FULL_CONFIGURATION;=0D +=0D + if (GetSleepTypeAfterWakeup (&SleepType)) {=0D + switch (SleepType) {=0D + case V_PCH_ACPI_PM1_CNT_S3:=0D + BootMode =3D BOOT_ON_S3_RESUME;=0D + break;=0D + case V_PCH_ACPI_PM1_CNT_S4:=0D + BootMode =3D BOOT_ON_S4_RESUME;=0D + break;=0D + case V_PCH_ACPI_PM1_CNT_S5:=0D + BootMode =3D BOOT_ON_S5_RESUME;=0D + break;=0D + }=0D + }=0D +=0D + DEBUG ((DEBUG_INFO, "BootMode is 0x%x\n", BootMode));=0D +=0D + return BootMode;=0D }=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/Board= InitLib/PeiMultiBoardInitPreMemLib.inf b/Platform/Intel/KabylakeOpenBoardPk= g/KabylakeRvp3/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf index 23fe6b6f03c5..0112bf84a193 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib= /PeiMultiBoardInitPreMemLib.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib= /PeiMultiBoardInitPreMemLib.inf @@ -26,6 +26,7 @@ MultiBoardInitSupportLib=0D EcLib=0D PchResetLib=0D + PchPmcLib=0D =0D [Packages]=0D MinPlatformPkg/MinPlatformPkg.dec=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.= dsc b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc index 37837eeb04bf..1634d9b31f00 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc @@ -202,6 +202,7 @@ # Silicon Package=0D #######################################=0D ReportCpuHobLib|IntelSiliconPkg/Library/ReportCpuHobLib/ReportCpuHobLib.= inf=0D + SmmAccessLib|IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLibSm= ramc/PeiSmmAccessLib.inf=0D =0D #######################################=0D # Platform Package=0D @@ -506,6 +507,17 @@ !endif=0D }=0D =0D +!if gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable =3D=3D TRUE=0D + MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.= inf {=0D + =0D + # On S3 resume, RSC is in end-of-BS state=0D + # - Moreover: Libraries cannot effectively use some end-of-BS events= =0D + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPor= t.inf=0D + SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLib= Null.inf=0D + # TODO: Insert a reverse-ranked priority list of compatible librarie= s here=0D + }=0D +!endif=0D +=0D !endif=0D =0D #######################################=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgP= cd.dsc b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.d= sc index cfd032814850..87510748783f 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc @@ -279,6 +279,7 @@ gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuCoreCount|8=0D gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuThreadCount|2=0D gMinPlatformPkgTokenSpaceGuid.PcdPciExpressRegionLength|0x10000000=0D + gIntelFsp2WrapperTokenSpaceGuid.PcdPeiMinMemSize|0x3800000=0D =0D #=0D # The PCDs are used to control the Windows SMM Security Mitigations Tabl= e - Protection Flags=0D @@ -349,7 +350,6 @@ ######################################=0D gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0=0D gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress|0xFED00148=0D - gIntelFsp2WrapperTokenSpaceGuid.PcdPeiMinMemSize|0x3800000=0D =0D ######################################=0D # Platform Configuration=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Librar= y/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c b/Platform/Intel/Ka= bylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/Pe= iSiliconPolicyUpdateLib.c index 22aadc0221df..bd3da7f38416 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSi= liconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSi= liconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c @@ -20,6 +20,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include =0D #include =0D #include =0D +#include =0D #include =0D #include =0D #include =0D @@ -513,6 +514,7 @@ SiliconPolicyUpdatePostMem ( )=0D {=0D EFI_STATUS Status;=0D + EFI_BOOT_MODE BootMode;=0D VOID *Buffer;=0D VOID *MemBuffer;=0D UINT32 Size;=0D @@ -521,6 +523,9 @@ SiliconPolicyUpdatePostMem ( =0D DEBUG((DEBUG_INFO, "\nUpdating Policy in Post Mem\n"));=0D =0D + Status =3D PeiServicesGetBootMode (&BootMode);=0D + ASSERT_EFI_ERROR (Status);=0D +=0D GtConfig =3D NULL;=0D Status =3D GetConfigBlock ((VOID *) Policy, &gGraphicsPeiConfigGuid, (VO= ID *)&GtConfig);=0D ASSERT_EFI_ERROR (Status);=0D @@ -535,7 +540,11 @@ SiliconPolicyUpdatePostMem ( PeiGetSectionFromAnyFv (PcdGetPtr (PcdGraphicsVbtGuid), EFI_SECTION_RA= W, 0, &Buffer, &Size);=0D if (Buffer =3D=3D NULL) {=0D DEBUG((DEBUG_WARN, "Could not locate VBT\n"));=0D - } else {=0D + //=0D + // Graphics initialization is unnecessary,=0D + // OS has present framebuffer.=0D + //=0D + } else if (BootMode !=3D BOOT_ON_S3_RESUME) {=0D MemBuffer =3D (VOID *)AllocatePages (EFI_SIZE_TO_PAGES ((UINTN)Size)= );=0D if ((MemBuffer !=3D NULL) && (Buffer !=3D NULL)) {=0D CopyMem (MemBuffer, (VOID *)Buffer, (UINTN)Size);=0D diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Librar= y/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf b/Platform/Intel/= KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/= PeiSiliconPolicyUpdateLib.inf index 25eae88f5989..e9a23593e133 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSi= liconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSi= liconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf @@ -23,6 +23,7 @@ BaseMemoryLib=0D MemoryAllocationLib=0D PeiLib=0D + PeiServicesLib=0D CpuPlatformLib=0D PchPcieRpLib=0D PchInfoLib=0D --=20 2.37.2