Home | History | Annotate | Download | only in ResetSystemLib
      1 /** @file
      2   Reset System Library functions for PCAT platforms
      3 
      4   Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
      5   This program and the accompanying materials
      6   are licensed and made available under the terms and conditions of the BSD License
      7   which accompanies this distribution.  The full text of the license may be found at
      8   http://opensource.org/licenses/bsd-license.php
      9 
     10   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     11   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     12 
     13 **/
     14 
     15 #include <Base.h>
     16 
     17 #include <Library/DebugLib.h>
     18 #include <Library/IoLib.h>
     19 
     20 /**
     21   Calling this function causes a system-wide reset. This sets
     22   all circuitry within the system to its initial state. This type of reset
     23   is asynchronous to system operation and operates without regard to
     24   cycle boundaries.
     25 
     26   System reset should not return, if it returns, it means the system does
     27   not support cold reset.
     28 **/
     29 VOID
     30 EFIAPI
     31 ResetCold (
     32   VOID
     33   )
     34 {
     35   IoWrite8 ((UINTN) PcdGet64 (PcdResetControlRegister), PcdGet8 (PcdResetControlValueColdReset));
     36 }
     37 
     38 /**
     39   Calling this function causes a system-wide initialization. The processors
     40   are set to their initial state, and pending cycles are not corrupted.
     41 
     42   System reset should not return, if it returns, it means the system does
     43   not support warm reset.
     44 **/
     45 VOID
     46 EFIAPI
     47 ResetWarm (
     48   VOID
     49   )
     50 {
     51   IoWrite8 ((UINTN) PcdGet64 (PcdResetControlRegister), PcdGet8 (PcdResetControlValueColdReset));
     52 }
     53 
     54 /**
     55   Calling this function causes the system to enter a power state equivalent
     56   to the ACPI G2/S5 or G3 states.
     57 
     58   System shutdown should not return, if it returns, it means the system does
     59   not support shut down reset.
     60 **/
     61 VOID
     62 EFIAPI
     63 ResetShutdown (
     64   VOID
     65   )
     66 {
     67   ASSERT (FALSE);
     68 }
     69 
     70 
     71 /**
     72   Calling this function causes the system to enter a power state for capsule
     73   update.
     74 
     75   Reset update should not return, if it returns, it means the system does
     76   not support capsule update.
     77 
     78 **/
     79 VOID
     80 EFIAPI
     81 EnterS3WithImmediateWake (
     82   VOID
     83   )
     84 {
     85   ASSERT (FALSE);
     86 }
     87 
     88 /**
     89   This function causes a systemwide reset. The exact type of the reset is
     90   defined by the EFI_GUID that follows the Null-terminated Unicode string passed
     91   into ResetData. If the platform does not recognize the EFI_GUID in ResetData
     92   the platform must pick a supported reset type to perform.The platform may
     93   optionally log the parameters from any non-normal reset that occurs.
     94 
     95   @param[in]  DataSize   The size, in bytes, of ResetData.
     96   @param[in]  ResetData  The data buffer starts with a Null-terminated string,
     97                          followed by the EFI_GUID.
     98 **/
     99 VOID
    100 EFIAPI
    101 ResetPlatformSpecific (
    102   IN UINTN   DataSize,
    103   IN VOID    *ResetData
    104   )
    105 {
    106   ResetCold ();
    107 }
    108