]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.c
ArmPlatformPkg: remove NorFlashArmVExpressLib
[mirror_edk2.git] / ArmPlatformPkg / ArmVExpressPkg / Library / ResetSystemLib / ResetSystemLib.c
CommitLineData
1e57a462 1/** @file\r
2 Template library implementation to support ResetSystem Runtime call.\r
1e57a462 3\r
18e44b07 4 Fill in the templates with what ever makes you system reset.\r
1e57a462 5\r
6 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
18e44b07 7 Copyright (c) 2013, ARM Ltd. All rights reserved.<BR>\r
729ddffd 8 Copyright (c) 2017, Linaro Ltd. All rights reserved.<BR>\r
18e44b07 9\r
1e57a462 10 This program and the accompanying materials\r
11 are licensed and made available under the terms and conditions of the BSD License\r
12 which accompanies this distribution. The full text of the license may be found at\r
13 http://opensource.org/licenses/bsd-license.php\r
14\r
15 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
16 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
17\r
18**/\r
19\r
729ddffd 20#include <Base.h>\r
1e57a462 21\r
1e57a462 22#include <Library/ArmPlatformSysConfigLib.h>\r
729ddffd
LL
23#include <Library/DebugLib.h>\r
24#include <Library/ResetSystemLib.h>\r
1e57a462 25\r
26#include <ArmPlatform.h>\r
27\r
28/**\r
729ddffd
LL
29 This function causes a system-wide reset (cold reset), in which\r
30 all circuitry within the system returns to its initial state. This type of\r
31 reset is asynchronous to system operation and operates without regard to\r
32 cycle boundaries.\r
1e57a462 33\r
729ddffd
LL
34 If this function returns, it means that the system does not support cold\r
35 reset.\r
36**/\r
37VOID\r
38EFIAPI\r
39ResetCold (\r
40 VOID\r
41 )\r
42{\r
43 ArmPlatformSysConfigSet (SYS_CFG_REBOOT, 0);\r
44}\r
45\r
46/**\r
47 This function causes a system-wide initialization (warm reset), in which all\r
48 processors are set to their initial state. Pending cycles are not corrupted.\r
1e57a462 49\r
729ddffd
LL
50 If this function returns, it means that the system does not support warm\r
51 reset.\r
1e57a462 52**/\r
729ddffd 53VOID\r
1e57a462 54EFIAPI\r
729ddffd
LL
55ResetWarm (\r
56 VOID\r
1e57a462 57 )\r
58{\r
729ddffd 59 ResetCold ();\r
1e57a462 60}\r
61\r
62/**\r
729ddffd
LL
63 This function causes the system to enter a power state equivalent\r
64 to the ACPI G2/S5 or G3 states.\r
65\r
66 If this function returns, it means that the system does not support shut down reset.\r
67**/\r
68VOID\r
69EFIAPI\r
70ResetShutdown (\r
71 VOID\r
72 )\r
73{\r
74 ArmPlatformSysConfigSet (SYS_CFG_SHUTDOWN, 0);\r
75}\r
1e57a462 76\r
729ddffd
LL
77/**\r
78 This function causes the system to enter S3 and then wake up immediately.\r
3402aac7 79\r
729ddffd
LL
80 If this function returns, it means that the system does not support S3\r
81 feature.\r
82**/\r
83VOID\r
84EFIAPI\r
85EnterS3WithImmediateWake (\r
86 VOID\r
87 )\r
88{\r
89 // not implemented\r
90}\r
1e57a462 91\r
729ddffd
LL
92/**\r
93 This function causes a systemwide reset. The exact type of the reset is\r
94 defined by the EFI_GUID that follows the Null-terminated Unicode string passed\r
95 into ResetData. If the platform does not recognize the EFI_GUID in ResetData\r
96 the platform must pick a supported reset type to perform.The platform may\r
97 optionally log the parameters from any non-normal reset that occurs.\r
98\r
99 @param[in] DataSize The size, in bytes, of ResetData.\r
100 @param[in] ResetData The data buffer starts with a Null-terminated string,\r
101 followed by the EFI_GUID.\r
1e57a462 102**/\r
729ddffd 103VOID\r
1e57a462 104EFIAPI\r
729ddffd
LL
105ResetPlatformSpecific (\r
106 IN UINTN DataSize,\r
107 IN VOID *ResetData\r
1e57a462 108 )\r
109{\r
729ddffd 110 ResetCold ();\r
1e57a462 111}\r