]> git.proxmox.com Git - mirror_edk2.git/blob - PcAtChipsetPkg/Library/ResetSystemLib/ResetSystemLib.c
eccef89ebef9a60a7f522c2c599ce9fac6b1869c
[mirror_edk2.git] / PcAtChipsetPkg / Library / ResetSystemLib / ResetSystemLib.c
1 /** @file
2 Reset System Library functions for PCAT platforms
3
4 Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include <Base.h>
10
11 #include <Library/DebugLib.h>
12 #include <Library/IoLib.h>
13
14 /**
15 Calling this function causes a system-wide reset. This sets
16 all circuitry within the system to its initial state. This type of reset
17 is asynchronous to system operation and operates without regard to
18 cycle boundaries.
19
20 System reset should not return, if it returns, it means the system does
21 not support cold reset.
22 **/
23 VOID
24 EFIAPI
25 ResetCold (
26 VOID
27 )
28 {
29 IoWrite8 ((UINTN) PcdGet64 (PcdResetControlRegister), PcdGet8 (PcdResetControlValueColdReset));
30 }
31
32 /**
33 Calling this function causes a system-wide initialization. The processors
34 are set to their initial state, and pending cycles are not corrupted.
35
36 System reset should not return, if it returns, it means the system does
37 not support warm reset.
38 **/
39 VOID
40 EFIAPI
41 ResetWarm (
42 VOID
43 )
44 {
45 IoWrite8 ((UINTN) PcdGet64 (PcdResetControlRegister), PcdGet8 (PcdResetControlValueColdReset));
46 }
47
48 /**
49 Calling this function causes the system to enter a power state equivalent
50 to the ACPI G2/S5 or G3 states.
51
52 System shutdown should not return, if it returns, it means the system does
53 not support shut down reset.
54 **/
55 VOID
56 EFIAPI
57 ResetShutdown (
58 VOID
59 )
60 {
61 ASSERT (FALSE);
62 }
63
64
65 /**
66 Calling this function causes the system to enter a power state for capsule
67 update.
68
69 Reset update should not return, if it returns, it means the system does
70 not support capsule update.
71
72 **/
73 VOID
74 EFIAPI
75 EnterS3WithImmediateWake (
76 VOID
77 )
78 {
79 ASSERT (FALSE);
80 }
81
82 /**
83 This function causes a systemwide reset. The exact type of the reset is
84 defined by the EFI_GUID that follows the Null-terminated Unicode string passed
85 into ResetData. If the platform does not recognize the EFI_GUID in ResetData
86 the platform must pick a supported reset type to perform.The platform may
87 optionally log the parameters from any non-normal reset that occurs.
88
89 @param[in] DataSize The size, in bytes, of ResetData.
90 @param[in] ResetData The data buffer starts with a Null-terminated string,
91 followed by the EFI_GUID.
92 **/
93 VOID
94 EFIAPI
95 ResetPlatformSpecific (
96 IN UINTN DataSize,
97 IN VOID *ResetData
98 )
99 {
100 ResetCold ();
101 }