public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE issues
@ 2016-10-06 19:12 Michael Kinney
  2016-10-06 19:12 ` [Patch 1/5] QuarkPlatformPkg/ForceRecovery: Add UEFI application to force recovery Michael Kinney
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Michael Kinney @ 2016-10-06 19:12 UTC (permalink / raw)
  To: edk2-devel

This patch series addresses the following 3 issues in Bugzilla:

https://bugzilla.tianocore.org/show_bug.cgi?id=137
https://bugzilla.tianocore.org/show_bug.cgi?id=138
https://bugzilla.tianocore.org/show_bug.cgi?id=139

It also removes a function and library that are no longer used.

Cc: Kelly Steele <kelly.steele@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>

Michael Kinney (5):
  QuarkPlatformPkg/ForceRecovery: Add UEFI application to force recovery
  QuarkPlatformPkg/PlatformInit: Fix recovery detection issues
  QuarkPlatformPkg/PlatformHelperLib: Remove PlatformDebugPortGetChar8()
  QuarkPlatformPkg: Add ForceRecovery UEFI application
  QuarkPlatformPkg/RecoveryOemHookLib: Remove RecoveryOemHookLib

 .../Application/ForceRecovery/ForceRecovery.c      |  53 ++++++++++
 .../Application/ForceRecovery/ForceRecovery.inf    |  39 +++++++
 .../Include/Library/PlatformHelperLib.h            |  16 +--
 .../Include/Library/RecoveryOemHookLib.h           |  45 ---------
 .../Library/PlatformHelperLib/PlatformHelperLib.c  |  27 -----
 .../Library/RecoveryOemHookLib/CommonHeader.h      |  30 ------
 .../RecoveryOemHookLib/RecoveryOemHookLib.c        |  61 -----------
 .../RecoveryOemHookLib/RecoveryOemHookLib.inf      |  49 ---------
 .../Platform/Pei/PlatformInit/BootMode.c           |  89 ++++++----------
 .../Platform/Pei/PlatformInit/CommonHeader.h       |   4 +-
 .../Platform/Pei/PlatformInit/MrcWrapper.c         | 112 +--------------------
 .../Platform/Pei/PlatformInit/MrcWrapper.h         |  11 +-
 .../Platform/Pei/PlatformInit/PlatformEarlyInit.c  |  67 +++++++++++-
 .../Pei/PlatformInit/PlatformEarlyInit.inf         |   1 -
 QuarkPlatformPkg/Quark.dsc                         |   6 +-
 QuarkPlatformPkg/QuarkMin.dsc                      |   1 -
 16 files changed, 196 insertions(+), 415 deletions(-)
 create mode 100644 QuarkPlatformPkg/Application/ForceRecovery/ForceRecovery.c
 create mode 100644 QuarkPlatformPkg/Application/ForceRecovery/ForceRecovery.inf
 delete mode 100644 QuarkPlatformPkg/Include/Library/RecoveryOemHookLib.h
 delete mode 100644 QuarkPlatformPkg/Library/RecoveryOemHookLib/CommonHeader.h
 delete mode 100644 QuarkPlatformPkg/Library/RecoveryOemHookLib/RecoveryOemHookLib.c
 delete mode 100644 QuarkPlatformPkg/Library/RecoveryOemHookLib/RecoveryOemHookLib.inf

-- 
2.6.3.windows.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Patch 1/5] QuarkPlatformPkg/ForceRecovery: Add UEFI application to force recovery
  2016-10-06 19:12 [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE issues Michael Kinney
@ 2016-10-06 19:12 ` Michael Kinney
  2016-10-06 19:12 ` [Patch 2/5] QuarkPlatformPkg/PlatformInit: Fix recovery detection issues Michael Kinney
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Michael Kinney @ 2016-10-06 19:12 UTC (permalink / raw)
  To: edk2-devel

https://bugzilla.tianocore.org/show_bug.cgi?id=138

This UEFI Application sets a sticky bit that persists across reset
to force a boot mode of BOOT_IN_RECOVERY_MODE.  It then performs
a warm reset using the UEFI Runtime Service ResetSystem().

Cc: Kelly Steele <kelly.steele@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
---
 .../Application/ForceRecovery/ForceRecovery.c      | 53 ++++++++++++++++++++++
 .../Application/ForceRecovery/ForceRecovery.inf    | 39 ++++++++++++++++
 2 files changed, 92 insertions(+)
 create mode 100644 QuarkPlatformPkg/Application/ForceRecovery/ForceRecovery.c
 create mode 100644 QuarkPlatformPkg/Application/ForceRecovery/ForceRecovery.inf

diff --git a/QuarkPlatformPkg/Application/ForceRecovery/ForceRecovery.c b/QuarkPlatformPkg/Application/ForceRecovery/ForceRecovery.c
new file mode 100644
index 0000000..82912b9
--- /dev/null
+++ b/QuarkPlatformPkg/Application/ForceRecovery/ForceRecovery.c
@@ -0,0 +1,53 @@
+/** @file
+  Application that sets a sticky bit to force recovery on next reset.
+
+  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD License
+  which accompanies this distribution.  The full text of the license may be found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <Uefi.h>
+
+#include <Library/UefiRuntimeServicesTableLib.h>
+#include <Library/QNCAccessLib.h>
+
+/**
+  The user Entry Point for Application. The user code starts with this function
+  as the real entry point for the application.
+
+  @param[in] ImageHandle    The firmware allocated handle for the EFI image.
+  @param[in] SystemTable    A pointer to the EFI System Table.
+
+  @retval EFI_SUCCESS       The entry point is executed successfully.
+  @retval other             Some error occurs when executing this entry point.
+
+**/
+EFI_STATUS
+EFIAPI
+UefiMain (
+  IN EFI_HANDLE        ImageHandle,
+  IN EFI_SYSTEM_TABLE  *SystemTable
+  )
+{
+  //
+  // Set 'B_CFG_STICKY_RW_FORCE_RECOVERY' sticky bit so we know we need to do a recovery following warm reset
+  //
+  QNCAltPortWrite (
+    QUARK_SCSS_SOC_UNIT_SB_PORT_ID,
+    QUARK_SCSS_SOC_UNIT_CFG_STICKY_RW,
+    QNCAltPortRead (QUARK_SCSS_SOC_UNIT_SB_PORT_ID, QUARK_SCSS_SOC_UNIT_CFG_STICKY_RW) | B_CFG_STICKY_RW_FORCE_RECOVERY
+    );
+
+  //
+  // Do a warm reset
+  //
+  gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
+
+  return EFI_SUCCESS;
+}
diff --git a/QuarkPlatformPkg/Application/ForceRecovery/ForceRecovery.inf b/QuarkPlatformPkg/Application/ForceRecovery/ForceRecovery.inf
new file mode 100644
index 0000000..e0d174e
--- /dev/null
+++ b/QuarkPlatformPkg/Application/ForceRecovery/ForceRecovery.inf
@@ -0,0 +1,39 @@
+## @file
+#  Application that sets a sticky bit to force recovery on next reset.
+#
+#  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD License
+#  which accompanies this distribution. The full text of the license may be found at
+#  http://opensource.org/licenses/bsd-license.php
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = ForceRecovery
+  FILE_GUID                      = 3A61FD45-69A0-42AD-B261-24DA451BF442
+  MODULE_TYPE                    = UEFI_APPLICATION
+  VERSION_STRING                 = 1.0
+  ENTRY_POINT                    = UefiMain
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+#  VALID_ARCHITECTURES           = IA32
+#
+
+[Sources]
+  ForceRecovery.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  QuarkSocPkg/QuarkSocPkg.dec
+
+[LibraryClasses]
+  UefiApplicationEntryPoint
+  UefiRuntimeServicesTableLib
+  QNCAccessLib
-- 
2.6.3.windows.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Patch 2/5] QuarkPlatformPkg/PlatformInit: Fix recovery detection issues
  2016-10-06 19:12 [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE issues Michael Kinney
  2016-10-06 19:12 ` [Patch 1/5] QuarkPlatformPkg/ForceRecovery: Add UEFI application to force recovery Michael Kinney
@ 2016-10-06 19:12 ` Michael Kinney
  2016-10-06 19:12 ` [Patch 3/5] QuarkPlatformPkg/PlatformHelperLib: Remove PlatformDebugPortGetChar8() Michael Kinney
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Michael Kinney @ 2016-10-06 19:12 UTC (permalink / raw)
  To: edk2-devel

https://bugzilla.tianocore.org/show_bug.cgi?id=137
https://bugzilla.tianocore.org/show_bug.cgi?id=139

There are four supported methods to generate a boot mode of
BOOT_IN_RECOVERY_MODE on the Galileo platforms:

* Detect a corrupt FV
* Detect a forced recovery from the ForceRecovery UEFI application
  that sets a bit in a sticky R/W register
* The RESET button for the Arduino shield is held while the system
  is powered up
* The RESET button for the Arduino shield is held while the system
  is rebooted using the REBOOT button.

The logic in the PlatformInit module is cleaned up and updated to
support all three of the recovery detection methods.  The clean
ups include:

* Remove extra debug messages
* Remove user input from serial port

In addition, once one of the recovery methods is detected and a
boot mode of BOOT_IN_RECOVERY_MODE is set, the Galileo platforms
would get an error attempting to use the USB host controller to
detect and read a recovery image from a USB drive.  The issue is
the IMR protection registers are programmed to prevent DMA to
memory owned by the PEI Core. The IMR register programming is
updated to allow DMA to memory that is allocated by the recovery
modules using the PEI AllocatePages() service.

Cc: Kelly Steele <kelly.steele@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
---
 .../Platform/Pei/PlatformInit/BootMode.c           |  89 ++++++----------
 .../Platform/Pei/PlatformInit/CommonHeader.h       |   4 +-
 .../Platform/Pei/PlatformInit/MrcWrapper.c         | 112 +--------------------
 .../Platform/Pei/PlatformInit/MrcWrapper.h         |  11 +-
 .../Platform/Pei/PlatformInit/PlatformEarlyInit.c  |  67 +++++++++++-
 .../Pei/PlatformInit/PlatformEarlyInit.inf         |   1 -
 6 files changed, 98 insertions(+), 186 deletions(-)

diff --git a/QuarkPlatformPkg/Platform/Pei/PlatformInit/BootMode.c b/QuarkPlatformPkg/Platform/Pei/PlatformInit/BootMode.c
index 0dd3d24..215f8f0 100644
--- a/QuarkPlatformPkg/Platform/Pei/PlatformInit/BootMode.c
+++ b/QuarkPlatformPkg/Platform/Pei/PlatformInit/BootMode.c
@@ -120,19 +120,6 @@ ValidateFvHeader (
 }
 
 /**
-
-  Check whether go to recovery path
-  @retval TRUE  Go to recovery path
-  @retval FALSE Go to normal path
-
-**/
-BOOLEAN
-OemRecoveryBootMode ()
-{
-  return PlatformIsBootWithRecoveryStage1 ();
-}
-
-/**
   Peform the boot mode determination logic
   If the box is closed, then
     1. If it's first time to boot, it's boot with full config .
@@ -154,31 +141,35 @@ UpdateBootMode (
   EFI_STATUS          Status;
   EFI_BOOT_MODE       NewBootMode;
   PEI_CAPSULE_PPI     *Capsule;
-  CHAR8               UserSelection;
-  UINT32              Straps32;
+  UINT32              RegValue;
+
+  NewBootMode = *BootMode;
 
   //
-  // Read Straps. Used later if recovery boot.
+  // Read Sticky R/W Bits
   //
-  Straps32 = QNCAltPortRead (QUARK_SCSS_SOC_UNIT_SB_PORT_ID, QUARK_SCSS_SOC_UNIT_STPDDRCFG);
+  RegValue = QNCAltPortRead (QUARK_SCSS_SOC_UNIT_SB_PORT_ID, QUARK_SCSS_SOC_UNIT_CFG_STICKY_RW);
+  DEBUG ((EFI_D_ERROR, "RegValue = %08x\n", RegValue));
 
   //
   // Check if we need to boot in recovery mode
   //
-  if ((ValidateFvHeader (BootMode) != EFI_SUCCESS)) {
-    DEBUG ((EFI_D_INFO, "Force Boot mode recovery\n"));
+  if ((RegValue & B_CFG_STICKY_RW_FORCE_RECOVERY) != 0) {
     NewBootMode = BOOT_IN_RECOVERY_MODE;
-    Status = PeiServicesInstallPpi (&mPpiListRecoveryBootMode);
-    ASSERT_EFI_ERROR (Status);
-    if (OemRecoveryBootMode () == FALSE) {
-      DEBUG ((EFI_D_INFO, "Recovery stage1 not Active, reboot to activate recovery stage1 image\n"));
-      OemInitiateRecoveryAndWait ();
-    }
-  } else if (OemRecoveryBootMode ()) {
-    DEBUG ((EFI_D_INFO, "Boot mode recovery\n"));
+    DEBUG ((EFI_D_ERROR, "RECOVERY from sticky bit\n"));;
+
+    //
+    // Clear force recovery sticky bit
+    //
+    QNCAltPortWrite (
+      QUARK_SCSS_SOC_UNIT_SB_PORT_ID,
+      QUARK_SCSS_SOC_UNIT_CFG_STICKY_RW,
+      RegValue &(~B_CFG_STICKY_RW_FORCE_RECOVERY)
+      );
+
+  } else if (ValidateFvHeader (BootMode) != EFI_SUCCESS) {
     NewBootMode = BOOT_IN_RECOVERY_MODE;
-    Status = PeiServicesInstallPpi (&mPpiListRecoveryBootMode);
-    ASSERT_EFI_ERROR (Status);
+    DEBUG ((EFI_D_ERROR, "RECOVERY from corrupt FV\n"));;
   } else if (QNCCheckS3AndClearState ()) {
     //
     // Determine if we're in capsule update mode
@@ -217,41 +208,17 @@ UpdateBootMode (
       NewBootMode = BOOT_WITH_FULL_CONFIGURATION;
     }
   }
-  *BootMode = NewBootMode;
-  Status = PeiServicesSetBootMode (NewBootMode);
-  ASSERT_EFI_ERROR (Status);
 
-  //
-  // If Recovery Boot then prompt the user to insert a USB key with recovery nodule and
-  // continue with the recovery. Also give the user a chance to retry a normal boot.
-  //
   if (NewBootMode == BOOT_IN_RECOVERY_MODE) {
-    if ((Straps32 & B_STPDDRCFG_FORCE_RECOVERY) == 0) {
-      DEBUG ((EFI_D_ERROR, "*****************************************************************\n"));
-      DEBUG ((EFI_D_ERROR, "*****           Force Recovery Jumper Detected.             *****\n"));
-      DEBUG ((EFI_D_ERROR, "*****      Attempting auto recovery of system flash.        *****\n"));
-      DEBUG ((EFI_D_ERROR, "*****   Expecting USB key with recovery module connected.   *****\n"));
-      DEBUG ((EFI_D_ERROR, "*****         PLEASE REMOVE FORCE RECOVERY JUMPER.          *****\n"));
-      DEBUG ((EFI_D_ERROR, "*****************************************************************\n"));
-    } else {
-      DEBUG ((EFI_D_ERROR, "*****************************************************************\n"));
-      DEBUG ((EFI_D_ERROR, "*****           ERROR: System boot failure!!!!!!!           *****\n"));
-      DEBUG ((EFI_D_ERROR, "***** - Press 'R' if you wish to force system recovery      *****\n"));
-      DEBUG ((EFI_D_ERROR, "*****     (connect USB key with recovery module first)      *****\n"));
-      DEBUG ((EFI_D_ERROR, "***** - Press any other key to attempt another boot         *****\n"));
-      DEBUG ((EFI_D_ERROR, "*****************************************************************\n"));
-
-      UserSelection = PlatformDebugPortGetChar8 ();
-      if ((UserSelection != 'R') && (UserSelection != 'r')) {
-        DEBUG ((EFI_D_ERROR, "New boot attempt selected........\n"));
-        //
-        // Initialte the cold reset
-        //
-        ResetCold ();
-      }
-      DEBUG ((EFI_D_ERROR, "Recovery boot selected..........\n"));
-    }
+    DEBUG ((EFI_D_INFO, "Boot mode recovery\n"));
+    Status = PeiServicesInstallPpi (&mPpiListRecoveryBootMode);
+    ASSERT_EFI_ERROR (Status);
   }
 
+  Status = PeiServicesSetBootMode (NewBootMode);
+  ASSERT_EFI_ERROR (Status);
+
+  *BootMode = NewBootMode;
+
   return EFI_SUCCESS;
 }
diff --git a/QuarkPlatformPkg/Platform/Pei/PlatformInit/CommonHeader.h b/QuarkPlatformPkg/Platform/Pei/PlatformInit/CommonHeader.h
index 9828495..983095a 100644
--- a/QuarkPlatformPkg/Platform/Pei/PlatformInit/CommonHeader.h
+++ b/QuarkPlatformPkg/Platform/Pei/PlatformInit/CommonHeader.h
@@ -67,7 +67,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/IntelQNCLib.h>
 #include <Library/PcdLib.h>
 #include <Library/SmbusLib.h>
-#include <Library/RecoveryOemHookLib.h>
 #include <Library/TimerLib.h>
 #include <Library/PrintLib.h>
 #include <Library/ResetSystemLib.h>
@@ -82,4 +81,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 #include <Register/Cpuid.h>
 
+#include <Pcal9555.h>
+#include <QNCAccess.h>
+
 #endif
diff --git a/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.c b/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.c
index 6b07d78..7b7ca61 100644
--- a/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.c
+++ b/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.c
@@ -554,7 +554,6 @@ InstallEfiMemory (
   UINT64                                PeiMemoryLength;
   UINTN                                 BufferSize;
   UINTN                                 PeiMemoryIndex;
-  UINTN                                 RequiredMemSize;
   EFI_RESOURCE_ATTRIBUTE_TYPE           Attribute;
   EFI_PHYSICAL_ADDRESS                  BadMemoryAddress;
   EFI_SMRAM_DESCRIPTOR                  DescriptorAcpiVariable;
@@ -614,12 +613,6 @@ InstallEfiMemory (
   ASSERT_EFI_ERROR (Status);
 
   //
-  // Get required memory size for ACPI use. This helps to put ACPI memory on the topest
-  //
-  RequiredMemSize = 0;
-  RetriveRequiredMemorySize (PeiServices, &RequiredMemSize);
-
-  //
   // Detect MOR request by the OS.
   //
   MorControl = 0;
@@ -735,15 +728,14 @@ InstallEfiMemory (
   //
   Status = SetPlatformImrPolicy (
               PeiMemoryBaseAddress,
-              PeiMemoryLength,
-              RequiredMemSize
+              PeiMemoryLength
               );
   ASSERT_EFI_ERROR (Status);
 
   //
   // Carve out the top memory reserved for ACPI
   //
-  Status        = PeiServicesInstallPeiMemory (PeiMemoryBaseAddress, (PeiMemoryLength - RequiredMemSize));
+  Status        = PeiServicesInstallPeiMemory (PeiMemoryBaseAddress, PeiMemoryLength);
   ASSERT_EFI_ERROR (Status);
 
   BuildResourceDescriptorHob (
@@ -1075,69 +1067,6 @@ InstallS3Memory (
 
 /**
 
-  This function returns the size, in bytes, required for the DXE phase.
-
-  @param  PeiServices    PEI Services table.
-  @param  Size           Pointer to the size, in bytes, required for the DXE phase.
-
-  @return  None
-
-**/
-VOID
-RetriveRequiredMemorySize (
-  IN      EFI_PEI_SERVICES                  **PeiServices,
-  OUT     UINTN                             *Size
-  )
-{
-  EFI_PEI_HOB_POINTERS           Hob;
-  EFI_MEMORY_TYPE_INFORMATION    *MemoryData;
-  UINT8                          Index;
-  UINTN                          TempPageNum;
-
-  MemoryData  = NULL;
-  TempPageNum = 0;
-  Index       = 0;
-
-  PeiServicesGetHobList ((VOID **)&Hob.Raw);
-  while (!END_OF_HOB_LIST (Hob)) {
-    if (Hob.Header->HobType == EFI_HOB_TYPE_GUID_EXTENSION &&
-        CompareGuid (&Hob.Guid->Name, &gEfiMemoryTypeInformationGuid)
-          ) {
-      MemoryData = (EFI_MEMORY_TYPE_INFORMATION *) (Hob.Raw + sizeof (EFI_HOB_GENERIC_HEADER) + sizeof (EFI_GUID));
-      break;
-    }
-
-    Hob.Raw = GET_NEXT_HOB (Hob);
-  }
-  //
-  // Platform PEIM should supply such a information. Generic PEIM doesn't assume any default value
-  //
-  if (!MemoryData) {
-    return ;
-  }
-
-  while (MemoryData[Index].Type != EfiMaxMemoryType) {
-    //
-    // Accumulate default memory size requirements
-    //
-    TempPageNum += MemoryData[Index].NumberOfPages;
-    Index++;
-  }
-
-  if (TempPageNum == 0) {
-    return ;
-  }
-
-  //
-  // Add additional pages used by DXE memory manager
-  //
-  (*Size) = (TempPageNum + EDKII_DXE_MEM_SIZE_PAGES) * EFI_PAGE_SIZE;
-
-  return ;
-}
-
-/**
-
   This function returns the memory ranges to be enabled, along with information
   describing how the range should be used.
 
@@ -1481,7 +1410,6 @@ Done:
 
   @param  PeiMemoryBaseAddress  Base address of memory allocated for PEI.
   @param  PeiMemoryLength       Length in bytes of the PEI memory (includes ACPI memory).
-  @param  RequiredMemSize       Size in bytes of the ACPI/Runtime memory
 
   @return EFI_SUCCESS           The function completed successfully.
           EFI_ACCESS_DENIED     Access to IMRs failed.
@@ -1490,8 +1418,7 @@ Done:
 EFI_STATUS
 SetPlatformImrPolicy (
   IN      EFI_PHYSICAL_ADDRESS    PeiMemoryBaseAddress,
-  IN      UINT64                  PeiMemoryLength,
-  IN      UINTN                   RequiredMemSize
+  IN      UINT64                  PeiMemoryLength
   )
 {
   UINT8         Index;
@@ -1515,17 +1442,6 @@ SetPlatformImrPolicy (
   }
 
   //
-  // Add IMR0 protection for the 'PeiMemory'
-  //
-  QncImrWrite (
-            QUARK_NC_MEMORY_MANAGER_IMR0,
-            (UINT32)(((RShiftU64(PeiMemoryBaseAddress, 8)) & IMRL_MASK) | IMR_EN),
-            (UINT32)((RShiftU64((PeiMemoryBaseAddress+PeiMemoryLength-RequiredMemSize + EFI_PAGES_TO_SIZE(EDKII_DXE_MEM_SIZE_PAGES-1) - 1), 8)) & IMRL_MASK),
-            (UINT32)(CPU_SNOOP + CPU0_NON_SMM),
-            (UINT32)(CPU_SNOOP + CPU0_NON_SMM)
-        );
-
-  //
   // Add IMR2 protection for shadowed RMU binary.
   //
   QncImrWrite (
@@ -1548,28 +1464,6 @@ SetPlatformImrPolicy (
         );
 
   //
-  // Add IMR5 protection for the legacy S3 and AP Startup Vector region (below 1MB).
-  //
-  QncImrWrite (
-            QUARK_NC_MEMORY_MANAGER_IMR5,
-            (UINT32)(((RShiftU64(AP_STARTUP_VECTOR, 8)) & IMRL_MASK) | IMR_EN),
-            (UINT32)((RShiftU64((AP_STARTUP_VECTOR + EFI_PAGE_SIZE - 1), 8)) & IMRH_MASK),
-            (UINT32)(CPU_SNOOP + CPU0_NON_SMM),
-            (UINT32)(CPU_SNOOP + CPU0_NON_SMM)
-        );
-
-  //
-  // Add IMR6 protection for the ACPI Reclaim/ACPI/Runtime Services.
-  //
-  QncImrWrite (
-            QUARK_NC_MEMORY_MANAGER_IMR6,
-            (UINT32)(((RShiftU64((PeiMemoryBaseAddress+PeiMemoryLength-RequiredMemSize+EFI_PAGES_TO_SIZE(EDKII_DXE_MEM_SIZE_PAGES-1)), 8)) & IMRL_MASK) | IMR_EN),
-            (UINT32)((RShiftU64((PeiMemoryBaseAddress+PeiMemoryLength-EFI_PAGE_SIZE-1), 8)) & IMRH_MASK),
-            (UINT32)(CPU_SNOOP + CPU0_NON_SMM),
-            (UINT32)(CPU_SNOOP + CPU0_NON_SMM)
-        );
-
-  //
   // Enable IMR4 protection of eSRAM.
   //
   QncImrWrite (
diff --git a/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.h b/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.h
index d2bcf57..2bb845f 100644
--- a/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.h
+++ b/QuarkPlatformPkg/Platform/Pei/PlatformInit/MrcWrapper.h
@@ -29,8 +29,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define ACPI_RECLAIM_SIZE_PAGES           0x20
 #define EDKII_DXE_MEM_SIZE_PAGES          0x20
 
-#define AP_STARTUP_VECTOR                 0x00097000
-
 //
 // Maximum number of "Socket Sets", where a "Socket Set is a set of matching
 // DIMM's from the various channels
@@ -185,12 +183,6 @@ SaveConfig (
   IN      MRCParams_t                      *MrcData
   );
 
-VOID
-RetriveRequiredMemorySize (
-  IN      EFI_PEI_SERVICES                  **PeiServices,
-  OUT     UINTN                             *Size
-  );
-
 EFI_STATUS
 GetMemoryMap (
   IN     EFI_PEI_SERVICES                                    **PeiServices,
@@ -225,8 +217,7 @@ BaseMemoryTest (
 EFI_STATUS
 SetPlatformImrPolicy (
   IN      EFI_PHYSICAL_ADDRESS    PeiMemoryBaseAddress,
-  IN      UINT64                  PeiMemoryLength,
-  IN      UINTN                   RequiredMemSize
+  IN      UINT64                  PeiMemoryLength
   );
 
 VOID
diff --git a/QuarkPlatformPkg/Platform/Pei/PlatformInit/PlatformEarlyInit.c b/QuarkPlatformPkg/Platform/Pei/PlatformInit/PlatformEarlyInit.c
index 756cc4a..0f71b1f 100644
--- a/QuarkPlatformPkg/Platform/Pei/PlatformInit/PlatformEarlyInit.c
+++ b/QuarkPlatformPkg/Platform/Pei/PlatformInit/PlatformEarlyInit.c
@@ -200,7 +200,8 @@ SetLanControllerMacAddr (
 **/
 EFI_STATUS
 EarlyPlatformConfigGpioExpanders (
-  IN CONST EFI_PLATFORM_TYPE              PlatformType
+  IN CONST EFI_PLATFORM_TYPE              PlatformType,
+  EFI_BOOT_MODE                           BootMode
   )
 {
   EFI_STATUS              Status;
@@ -266,6 +267,30 @@ EarlyPlatformConfigGpioExpanders (
       GALILEO_GEN2_IOEXP2_7BIT_SLAVE_ADDR,  // IO Expander 2.
       15                                    // P1-7.
       );
+
+    if (BootMode != BOOT_IN_RECOVERY_MODE) {
+      //
+      // Read state of Reset Button - EXP2.P1_7
+      // This GPIO is pulled high when the button is not pressed
+      // This GPIO reads low when button is pressed
+      //
+      if (!PlatformPcal9555GpioGetState (
+             GALILEO_GEN2_IOEXP2_7BIT_SLAVE_ADDR,  // IO Expander 2
+             15                                    // P1-7
+             )) {
+        DEBUG ((EFI_D_INFO, "  Force Recovery mode and reset\n"));
+
+        //
+        // Set 'B_CFG_STICKY_RW_FORCE_RECOVERY' sticky bit so we know we need to do a recovery following warm reset
+        //
+        QNCAltPortWrite (
+          QUARK_SCSS_SOC_UNIT_SB_PORT_ID,
+          QUARK_SCSS_SOC_UNIT_CFG_STICKY_RW,
+          QNCAltPortRead (QUARK_SCSS_SOC_UNIT_SB_PORT_ID, QUARK_SCSS_SOC_UNIT_CFG_STICKY_RW) | B_CFG_STICKY_RW_FORCE_RECOVERY
+          );
+        ResetWarm();
+      }
+    }
   }
 
   //
@@ -393,6 +418,40 @@ EarlyPlatformConfigGpioExpanders (
       &Buffer
       );
     ASSERT_EFI_ERROR (Status);
+
+    if (BootMode != BOOT_IN_RECOVERY_MODE) {
+      //
+      // Read state of RESET_N_SHLD (GPORT5_BIT0)
+      //
+      Buffer[1] = 5;
+      Length = 1;
+      ReadLength = 1;
+      Status = I2cReadMultipleByte (
+                 I2CSlaveAddress,
+                 EfiI2CSevenBitAddrMode,
+                 &Length,
+                 &ReadLength,
+                 &Buffer[1]
+                 );
+      ASSERT_EFI_ERROR (Status);
+
+      //
+      // Return the state of GPORT5_BIT0
+      //
+      if ((Buffer[1] & BIT0) == 0) {
+        DEBUG ((EFI_D_INFO, "  Force Recovery mode and reset\n"));
+
+        //
+        // Set 'B_CFG_STICKY_RW_FORCE_RECOVERY' sticky bit so we know we need to do a recovery following warm reset
+        //
+        QNCAltPortWrite (
+          QUARK_SCSS_SOC_UNIT_SB_PORT_ID,
+          QUARK_SCSS_SOC_UNIT_CFG_STICKY_RW,
+          QNCAltPortRead (QUARK_SCSS_SOC_UNIT_SB_PORT_ID, QUARK_SCSS_SOC_UNIT_CFG_STICKY_RW) | B_CFG_STICKY_RW_FORCE_RECOVERY
+          );
+        ResetWarm();
+      }
+    }
   }
 
   return EFI_SUCCESS;
@@ -514,7 +573,7 @@ PeiInitPlatform (
   //
   //
   DEBUG ((EFI_D_INFO, "EarlyPlatformConfigGpioExpanders ()\n"));
-  EarlyPlatformConfigGpioExpanders (PlatformType);
+  EarlyPlatformConfigGpioExpanders (PlatformType, BootMode);
 
   //
   // Now that all of the pre-permanent memory activities have
@@ -791,8 +850,8 @@ EarlyPlatformInit (
   //
   if (CheckForResetDueToErrors (TRUE)) {
     if(FeaturePcdGet (WaitIfResetDueToError)) {
-      DEBUG ((EFI_D_ERROR, "Press any key to continue.\n"));
-      PlatformDebugPortGetChar8 ();
+      DEBUG ((EFI_D_ERROR, "Wait 10 seconds.\n"));
+      MicroSecondDelay(10000000);
     }
   }
 
diff --git a/QuarkPlatformPkg/Platform/Pei/PlatformInit/PlatformEarlyInit.inf b/QuarkPlatformPkg/Platform/Pei/PlatformInit/PlatformEarlyInit.inf
index 1de8efd..5fc85d3 100644
--- a/QuarkPlatformPkg/Platform/Pei/PlatformInit/PlatformEarlyInit.inf
+++ b/QuarkPlatformPkg/Platform/Pei/PlatformInit/PlatformEarlyInit.inf
@@ -88,7 +88,6 @@
   ResetSystemLib
   PrintLib
   TimerLib
-  RecoveryOemHookLib
   PcdLib
   IntelQNCLib
   ReportStatusCodeLib
-- 
2.6.3.windows.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Patch 3/5] QuarkPlatformPkg/PlatformHelperLib: Remove PlatformDebugPortGetChar8()
  2016-10-06 19:12 [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE issues Michael Kinney
  2016-10-06 19:12 ` [Patch 1/5] QuarkPlatformPkg/ForceRecovery: Add UEFI application to force recovery Michael Kinney
  2016-10-06 19:12 ` [Patch 2/5] QuarkPlatformPkg/PlatformInit: Fix recovery detection issues Michael Kinney
@ 2016-10-06 19:12 ` Michael Kinney
  2016-10-06 19:12 ` [Patch 4/5] QuarkPlatformPkg: Add ForceRecovery UEFI application Michael Kinney
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Michael Kinney @ 2016-10-06 19:12 UTC (permalink / raw)
  To: edk2-devel

Remove the library function PlatformDebugPortGetChar8() from the
PlatformHelperLib that is no longer used by any modules.

Cc: Kelly Steele <kelly.steele@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
---
 .../Include/Library/PlatformHelperLib.h            | 16 +------------
 .../Library/PlatformHelperLib/PlatformHelperLib.c  | 27 ----------------------
 2 files changed, 1 insertion(+), 42 deletions(-)

diff --git a/QuarkPlatformPkg/Include/Library/PlatformHelperLib.h b/QuarkPlatformPkg/Include/Library/PlatformHelperLib.h
index 7b4119d..cf884e1 100644
--- a/QuarkPlatformPkg/Include/Library/PlatformHelperLib.h
+++ b/QuarkPlatformPkg/Include/Library/PlatformHelperLib.h
@@ -1,7 +1,7 @@
 /** @file
 PlatformHelperLib function prototype definitions.
 
-Copyright (c) 2013 - 2016 Intel Corporation.
+Copyright (c) 2013 - 2016 Intel Corporation.
 
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
@@ -46,20 +46,6 @@ PlatformFindFvFileRawDataSection (
   );
 
 /**
-  Read 8bit character from debug stream.
-
-  Block until character is read.
-
-  @return 8bit character read from debug stream.
-
-**/
-CHAR8
-EFIAPI
-PlatformDebugPortGetChar8 (
-  VOID
-  );
-
-/**
   Find free spi protect register and write to it to protect a flash region.
 
   @param   DirectValue      Value to directly write to register.
diff --git a/QuarkPlatformPkg/Library/PlatformHelperLib/PlatformHelperLib.c b/QuarkPlatformPkg/Library/PlatformHelperLib/PlatformHelperLib.c
index f9ceda4..768ea14 100644
--- a/QuarkPlatformPkg/Library/PlatformHelperLib/PlatformHelperLib.c
+++ b/QuarkPlatformPkg/Library/PlatformHelperLib/PlatformHelperLib.c
@@ -91,33 +91,6 @@ WriteFirstFreeSpiProtect (
 //
 
 /**
-  Read 8bit character from debug stream.
-
-  Block until character is read.
-
-  @return 8bit character read from debug stream.
-
-**/
-CHAR8
-EFIAPI
-PlatformDebugPortGetChar8 (
-  VOID
-  )
-{
-  CHAR8                             Got;
-
-  do {
-    if (SerialPortPoll ()) {
-      if (SerialPortRead ((UINT8 *) &Got, 1) == 1) {
-        break;
-      }
-    }
-  } while (TRUE);
-
-  return Got;
-}
-
-/**
   Clear SPI Protect registers.
 
   @retval EFI_SUCCESS        SPI protect registers cleared.
-- 
2.6.3.windows.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Patch 4/5] QuarkPlatformPkg: Add ForceRecovery UEFI application
  2016-10-06 19:12 [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE issues Michael Kinney
                   ` (2 preceding siblings ...)
  2016-10-06 19:12 ` [Patch 3/5] QuarkPlatformPkg/PlatformHelperLib: Remove PlatformDebugPortGetChar8() Michael Kinney
@ 2016-10-06 19:12 ` Michael Kinney
  2016-10-06 19:12 ` [Patch 5/5] QuarkPlatformPkg/RecoveryOemHookLib: Remove RecoveryOemHookLib Michael Kinney
  2016-10-07 19:26 ` [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE issues Steele, Kelly
  5 siblings, 0 replies; 8+ messages in thread
From: Michael Kinney @ 2016-10-06 19:12 UTC (permalink / raw)
  To: edk2-devel

https://bugzilla.tianocore.org/show_bug.cgi?id=138

Add the ForceRecovery UEFI application to the Quark.dsc file
so this application can be put onto an SD card or USB drive
to test the Galileo firmware recovery feature.

The library mappings to the RecoveryOemHookLib are also
removed becuse this library is not longer used by any modules.

Cc: Kelly Steele <kelly.steele@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
---
 QuarkPlatformPkg/Quark.dsc    | 6 +++++-
 QuarkPlatformPkg/QuarkMin.dsc | 1 -
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/QuarkPlatformPkg/Quark.dsc b/QuarkPlatformPkg/Quark.dsc
index 51a7b63..d5988da 100644
--- a/QuarkPlatformPkg/Quark.dsc
+++ b/QuarkPlatformPkg/Quark.dsc
@@ -221,7 +221,6 @@
   #
   # Quark Platform
   #
-  RecoveryOemHookLib|QuarkPlatformPkg/Library/RecoveryOemHookLib/RecoveryOemHookLib.inf
   PlatformSecLib|QuarkPlatformPkg/Library/PlatformSecLib/PlatformSecLib.inf
   PlatformPcieHelperLib|QuarkPlatformPkg/Library/PlatformPcieHelperLib/PlatformPcieHelperLib.inf
   PlatformHelperLib|QuarkPlatformPkg/Library/PlatformHelperLib/DxePlatformHelperLib.inf
@@ -863,6 +862,11 @@
   }
 !endif
 
+  #
+  # Force Recovery Application
+  #
+  QuarkPlatformPkg/Application/ForceRecovery/ForceRecovery.inf
+
   ShellPkg/Application/Shell/Shell.inf {
     <LibraryClasses>
       ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
diff --git a/QuarkPlatformPkg/QuarkMin.dsc b/QuarkPlatformPkg/QuarkMin.dsc
index 99ae067..1a4bd30 100644
--- a/QuarkPlatformPkg/QuarkMin.dsc
+++ b/QuarkPlatformPkg/QuarkMin.dsc
@@ -190,7 +190,6 @@
   #
   # Quark Platform
   #
-  RecoveryOemHookLib|QuarkPlatformPkg/Library/RecoveryOemHookLib/RecoveryOemHookLib.inf
   PlatformSecLib|QuarkPlatformPkg/Library/PlatformSecLib/PlatformSecLib.inf
   PlatformPcieHelperLib|QuarkPlatformPkg/Library/PlatformPcieHelperLib/PlatformPcieHelperLib.inf
   PlatformHelperLib|QuarkPlatformPkg/Library/PlatformHelperLib/DxePlatformHelperLib.inf
-- 
2.6.3.windows.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Patch 5/5] QuarkPlatformPkg/RecoveryOemHookLib: Remove RecoveryOemHookLib
  2016-10-06 19:12 [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE issues Michael Kinney
                   ` (3 preceding siblings ...)
  2016-10-06 19:12 ` [Patch 4/5] QuarkPlatformPkg: Add ForceRecovery UEFI application Michael Kinney
@ 2016-10-06 19:12 ` Michael Kinney
  2016-10-07 19:26 ` [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE issues Steele, Kelly
  5 siblings, 0 replies; 8+ messages in thread
From: Michael Kinney @ 2016-10-06 19:12 UTC (permalink / raw)
  To: edk2-devel

Remove the RecoveryOemHookLib class and instance that is no
longer used by any modules.

Cc: Kelly Steele <kelly.steele@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
---
 .../Include/Library/RecoveryOemHookLib.h           | 45 ----------------
 .../Library/RecoveryOemHookLib/CommonHeader.h      | 30 -----------
 .../RecoveryOemHookLib/RecoveryOemHookLib.c        | 61 ----------------------
 .../RecoveryOemHookLib/RecoveryOemHookLib.inf      | 49 -----------------
 4 files changed, 185 deletions(-)
 delete mode 100644 QuarkPlatformPkg/Include/Library/RecoveryOemHookLib.h
 delete mode 100644 QuarkPlatformPkg/Library/RecoveryOemHookLib/CommonHeader.h
 delete mode 100644 QuarkPlatformPkg/Library/RecoveryOemHookLib/RecoveryOemHookLib.c
 delete mode 100644 QuarkPlatformPkg/Library/RecoveryOemHookLib/RecoveryOemHookLib.inf

diff --git a/QuarkPlatformPkg/Include/Library/RecoveryOemHookLib.h b/QuarkPlatformPkg/Include/Library/RecoveryOemHookLib.h
deleted file mode 100644
index ea265ad..0000000
--- a/QuarkPlatformPkg/Include/Library/RecoveryOemHookLib.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/** @file
-This library includes the recovery function that can be customized by OEM,
-including how to select the recovery capsule if more than one capsule found,
-and security check.
-
-Copyright (c) 2013-2015 Intel Corporation.
-
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __RECOVERY_OEM_HOOK_LIB_H__
-#define __RECOVERY_OEM_HOOK_LIB_H__
-
-/**
-  This function allows the user to force a system recovery
-
-**/
-VOID
-EFIAPI
-OemInitiateRecovery (
-  VOID
-  );
-
-/**
-  This function allows the user to force a system recovery and deadloop.
-
-  Deadloop required since system should not execute beyond this point.
-  Deadloop should never happen since OemInitiateRecovery () called within
-  this routine should never return since it executes a Warm Reset.
-
-**/
-VOID
-EFIAPI
-OemInitiateRecoveryAndWait (
-  VOID
-  );
-
-#endif
diff --git a/QuarkPlatformPkg/Library/RecoveryOemHookLib/CommonHeader.h b/QuarkPlatformPkg/Library/RecoveryOemHookLib/CommonHeader.h
deleted file mode 100644
index 7902254..0000000
--- a/QuarkPlatformPkg/Library/RecoveryOemHookLib/CommonHeader.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/** @file
-Common header file shared by all source files.
-
-This file includes package header files, library classes and protocol, PPI & GUID definitions.
-
-Copyright (c) 2013-2015 Intel Corporation.
-
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-
-#ifndef __COMMON_HEADER_H_
-#define __COMMON_HEADER_H_
-
-
-
-#include <PiPei.h>
-
-#include <Ppi/DeviceRecoveryModule.h>
-
-#include <Library/RecoveryOemHookLib.h>
-#include <Library/QNCAccessLib.h>
-#include <Library/ResetSystemLib.h>
-
-#endif
diff --git a/QuarkPlatformPkg/Library/RecoveryOemHookLib/RecoveryOemHookLib.c b/QuarkPlatformPkg/Library/RecoveryOemHookLib/RecoveryOemHookLib.c
deleted file mode 100644
index 28e8b11..0000000
--- a/QuarkPlatformPkg/Library/RecoveryOemHookLib/RecoveryOemHookLib.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/** @file
-This file includes the function that can be customized by OEM.
-
-Copyright (c) 2013-2015 Intel Corporation.
-
-This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "CommonHeader.h"
-
-/**
-  This function allows the user to force a system recovery
-
-**/
-VOID
-EFIAPI
-OemInitiateRecovery (
-  VOID
-  )
-{
-  UINT32          Data32;
-
-  //
-  // Set 'B_CFG_STICKY_RW_FORCE_RECOVERY' sticky bit so we know we need to do a recovery following warm reset
-  //
-  Data32 = QNCAltPortRead (QUARK_SCSS_SOC_UNIT_SB_PORT_ID, QUARK_SCSS_SOC_UNIT_CFG_STICKY_RW);
-  Data32 |= B_CFG_STICKY_RW_FORCE_RECOVERY;
-  QNCAltPortWrite (QUARK_SCSS_SOC_UNIT_SB_PORT_ID, QUARK_SCSS_SOC_UNIT_CFG_STICKY_RW, Data32);
-
-  //
-  // Initialte the warm reset
-  //
-  ResetWarm ();
-}
-
-/**
-  This function allows the user to force a system recovery and deadloop.
-
-  Deadloop required since system should not execute beyond this point.
-  Deadloop should never happen since OemInitiateRecovery () called within
-  this routine should never return since it executes a Warm Reset.
-
-**/
-VOID
-EFIAPI
-OemInitiateRecoveryAndWait (
-  VOID
-  )
-{
-  volatile UINTN  Index;
-
-  OemInitiateRecovery ();
-  for (Index = 0; Index == 0;);
-}
diff --git a/QuarkPlatformPkg/Library/RecoveryOemHookLib/RecoveryOemHookLib.inf b/QuarkPlatformPkg/Library/RecoveryOemHookLib/RecoveryOemHookLib.inf
deleted file mode 100644
index b8ec7c3..0000000
--- a/QuarkPlatformPkg/Library/RecoveryOemHookLib/RecoveryOemHookLib.inf
+++ /dev/null
@@ -1,49 +0,0 @@
-## @file
-# Library Hook Point functions for Intel QNC.
-#
-# This library provides hook points for OEM w.r.t recovery
-#
-# Copyright (c) 2013-2015 Intel Corporation.
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution.  The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-##
-
-[Defines]
-  INF_VERSION                    = 0x00010005
-  BASE_NAME                      = RecoveryOemHookLib
-  FILE_GUID                      = DE6D4FB9-12DB-4dbb-ACF1-92514388355F
-  MODULE_TYPE                    = BASE
-  VERSION_STRING                 = 1.0
-  LIBRARY_CLASS                  = RecoveryOemHookLib
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-#  VALID_ARCHITECTURES           = IA32
-#
-
-[Sources]
-  RecoveryOemHookLib.c
-  CommonHeader.h
-
-
-[Packages]
-  MdePkg/MdePkg.dec
-  MdeModulePkg/MdeModulePkg.dec
-  QuarkPlatformPkg/QuarkPlatformPkg.dec
-  QuarkSocPkg/QuarkSocPkg.dec
-
-[LibraryClasses]
-  QNCAccessLib
-  ResetSystemLib
-
-[Ppis]
-  gEfiPeiDeviceRecoveryModulePpiGuid            # PPI SOMETIMES_CONSUMED
-
-- 
2.6.3.windows.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE issues
  2016-10-06 19:12 [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE issues Michael Kinney
                   ` (4 preceding siblings ...)
  2016-10-06 19:12 ` [Patch 5/5] QuarkPlatformPkg/RecoveryOemHookLib: Remove RecoveryOemHookLib Michael Kinney
@ 2016-10-07 19:26 ` Steele, Kelly
  2016-10-07 21:02   ` Steele, Kelly
  5 siblings, 1 reply; 8+ messages in thread
From: Steele, Kelly @ 2016-10-07 19:26 UTC (permalink / raw)
  To: Kinney, Michael D, edk2-devel@lists.01.org



Reviewed-by: Kelly Steele <kelly.steele@intel.com>




> -----Original Message-----
> From: Kinney, Michael D
> Sent: October 06, 2016 12:12
> To: edk2-devel@lists.01.org
> Cc: Steele, Kelly <kelly.steele@intel.com>
> Subject: [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE issues
> 
> This patch series addresses the following 3 issues in Bugzilla:
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=137
> https://bugzilla.tianocore.org/show_bug.cgi?id=138
> https://bugzilla.tianocore.org/show_bug.cgi?id=139
> 
> It also removes a function and library that are no longer used.
> 
> Cc: Kelly Steele <kelly.steele@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
> 
> Michael Kinney (5):
>   QuarkPlatformPkg/ForceRecovery: Add UEFI application to force recovery
>   QuarkPlatformPkg/PlatformInit: Fix recovery detection issues
>   QuarkPlatformPkg/PlatformHelperLib: Remove PlatformDebugPortGetChar8()
>   QuarkPlatformPkg: Add ForceRecovery UEFI application
>   QuarkPlatformPkg/RecoveryOemHookLib: Remove RecoveryOemHookLib
> 
>  .../Application/ForceRecovery/ForceRecovery.c      |  53 ++++++++++
>  .../Application/ForceRecovery/ForceRecovery.inf    |  39 +++++++
>  .../Include/Library/PlatformHelperLib.h            |  16 +--
>  .../Include/Library/RecoveryOemHookLib.h           |  45 ---------
>  .../Library/PlatformHelperLib/PlatformHelperLib.c  |  27 -----
>  .../Library/RecoveryOemHookLib/CommonHeader.h      |  30 ------
>  .../RecoveryOemHookLib/RecoveryOemHookLib.c        |  61 -----------
>  .../RecoveryOemHookLib/RecoveryOemHookLib.inf      |  49 ---------
>  .../Platform/Pei/PlatformInit/BootMode.c           |  89 ++++++----------
>  .../Platform/Pei/PlatformInit/CommonHeader.h       |   4 +-
>  .../Platform/Pei/PlatformInit/MrcWrapper.c         | 112 +--------------------
>  .../Platform/Pei/PlatformInit/MrcWrapper.h         |  11 +-
>  .../Platform/Pei/PlatformInit/PlatformEarlyInit.c  |  67 +++++++++++-
>  .../Pei/PlatformInit/PlatformEarlyInit.inf         |   1 -
>  QuarkPlatformPkg/Quark.dsc                         |   6 +-
>  QuarkPlatformPkg/QuarkMin.dsc                      |   1 -
>  16 files changed, 196 insertions(+), 415 deletions(-)
>  create mode 100644
> QuarkPlatformPkg/Application/ForceRecovery/ForceRecovery.c
>  create mode 100644
> QuarkPlatformPkg/Application/ForceRecovery/ForceRecovery.inf
>  delete mode 100644
> QuarkPlatformPkg/Include/Library/RecoveryOemHookLib.h
>  delete mode 100644
> QuarkPlatformPkg/Library/RecoveryOemHookLib/CommonHeader.h
>  delete mode 100644
> QuarkPlatformPkg/Library/RecoveryOemHookLib/RecoveryOemHookLib.c
>  delete mode 100644
> QuarkPlatformPkg/Library/RecoveryOemHookLib/RecoveryOemHookLib.inf
> 
> --
> 2.6.3.windows.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE issues
  2016-10-07 19:26 ` [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE issues Steele, Kelly
@ 2016-10-07 21:02   ` Steele, Kelly
  0 siblings, 0 replies; 8+ messages in thread
From: Steele, Kelly @ 2016-10-07 21:02 UTC (permalink / raw)
  To: Kinney, Michael D, 'edk2-devel@lists.01.org'

Entire patch reviewed. Looks good to me.

Reviewed-by: Kelly Steele <kelly.steele@intel.com>

> -----Original Message-----
> From: Steele, Kelly
> Sent: October 07, 2016 12:27
> To: Kinney, Michael D <michael.d.kinney@intel.com>; edk2-devel@lists.01.org
> Subject: RE: [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE
> issues
> 
> 
> 
> Reviewed-by: Kelly Steele <kelly.steele@intel.com>
> 
> 
> 
> 
> > -----Original Message-----
> > From: Kinney, Michael D
> > Sent: October 06, 2016 12:12
> > To: edk2-devel@lists.01.org
> > Cc: Steele, Kelly <kelly.steele@intel.com>
> > Subject: [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE issues
> >
> > This patch series addresses the following 3 issues in Bugzilla:
> >
> > https://bugzilla.tianocore.org/show_bug.cgi?id=137
> > https://bugzilla.tianocore.org/show_bug.cgi?id=138
> > https://bugzilla.tianocore.org/show_bug.cgi?id=139
> >
> > It also removes a function and library that are no longer used.
> >
> > Cc: Kelly Steele <kelly.steele@intel.com>
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
> >
> > Michael Kinney (5):
> >   QuarkPlatformPkg/ForceRecovery: Add UEFI application to force recovery
> >   QuarkPlatformPkg/PlatformInit: Fix recovery detection issues
> >   QuarkPlatformPkg/PlatformHelperLib: Remove
> PlatformDebugPortGetChar8()
> >   QuarkPlatformPkg: Add ForceRecovery UEFI application
> >   QuarkPlatformPkg/RecoveryOemHookLib: Remove RecoveryOemHookLib
> >
> >  .../Application/ForceRecovery/ForceRecovery.c      |  53 ++++++++++
> >  .../Application/ForceRecovery/ForceRecovery.inf    |  39 +++++++
> >  .../Include/Library/PlatformHelperLib.h            |  16 +--
> >  .../Include/Library/RecoveryOemHookLib.h           |  45 ---------
> >  .../Library/PlatformHelperLib/PlatformHelperLib.c  |  27 -----
> >  .../Library/RecoveryOemHookLib/CommonHeader.h      |  30 ------
> >  .../RecoveryOemHookLib/RecoveryOemHookLib.c        |  61 -----------
> >  .../RecoveryOemHookLib/RecoveryOemHookLib.inf      |  49 ---------
> >  .../Platform/Pei/PlatformInit/BootMode.c           |  89 ++++++----------
> >  .../Platform/Pei/PlatformInit/CommonHeader.h       |   4 +-
> >  .../Platform/Pei/PlatformInit/MrcWrapper.c         | 112 +--------------------
> >  .../Platform/Pei/PlatformInit/MrcWrapper.h         |  11 +-
> >  .../Platform/Pei/PlatformInit/PlatformEarlyInit.c  |  67 +++++++++++-
> >  .../Pei/PlatformInit/PlatformEarlyInit.inf         |   1 -
> >  QuarkPlatformPkg/Quark.dsc                         |   6 +-
> >  QuarkPlatformPkg/QuarkMin.dsc                      |   1 -
> >  16 files changed, 196 insertions(+), 415 deletions(-)
> >  create mode 100644
> > QuarkPlatformPkg/Application/ForceRecovery/ForceRecovery.c
> >  create mode 100644
> > QuarkPlatformPkg/Application/ForceRecovery/ForceRecovery.inf
> >  delete mode 100644
> > QuarkPlatformPkg/Include/Library/RecoveryOemHookLib.h
> >  delete mode 100644
> > QuarkPlatformPkg/Library/RecoveryOemHookLib/CommonHeader.h
> >  delete mode 100644
> > QuarkPlatformPkg/Library/RecoveryOemHookLib/RecoveryOemHookLib.c
> >  delete mode 100644
> > QuarkPlatformPkg/Library/RecoveryOemHookLib/RecoveryOemHookLib.inf
> >
> > --
> > 2.6.3.windows.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-10-07 21:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-06 19:12 [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE issues Michael Kinney
2016-10-06 19:12 ` [Patch 1/5] QuarkPlatformPkg/ForceRecovery: Add UEFI application to force recovery Michael Kinney
2016-10-06 19:12 ` [Patch 2/5] QuarkPlatformPkg/PlatformInit: Fix recovery detection issues Michael Kinney
2016-10-06 19:12 ` [Patch 3/5] QuarkPlatformPkg/PlatformHelperLib: Remove PlatformDebugPortGetChar8() Michael Kinney
2016-10-06 19:12 ` [Patch 4/5] QuarkPlatformPkg: Add ForceRecovery UEFI application Michael Kinney
2016-10-06 19:12 ` [Patch 5/5] QuarkPlatformPkg/RecoveryOemHookLib: Remove RecoveryOemHookLib Michael Kinney
2016-10-07 19:26 ` [Patch 0/5] QuarkPlatformPkg: Fix BOOT_IN_RECOVERY_MODE issues Steele, Kelly
2016-10-07 21:02   ` Steele, Kelly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox