]> git.proxmox.com Git - mirror_edk2.git/blame - BeagleBoardPkg/Library/ResetSystemLib/ResetSystemLib.c
edk2: Reformat TianoCore Contribution Agreement 1.1
[mirror_edk2.git] / BeagleBoardPkg / Library / ResetSystemLib / ResetSystemLib.c
CommitLineData
f8a61fe7 1/** @file\r
2 Do a generic Cold Reset for OMAP3550 and BeagleBoard specific Warm reset\r
3402aac7 3\r
1ebd6c11 4 Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
fb5a64de 5 Copyright (c) 2017, Linaro Ltd. All rights reserved.<BR>\r
3402aac7 6\r
1ebd6c11 7 This program and the accompanying materials\r
f8a61fe7 8 are licensed and made available under the terms and conditions of the BSD License\r
9 which accompanies this distribution. The full text of the license may be found at\r
10 http://opensource.org/licenses/bsd-license.php\r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14\r
15**/\r
16\r
17\r
18#include <Uefi.h>\r
19\r
f8a61fe7 20#include <Library/IoLib.h>\r
fb5a64de 21#include <Library/ResetSystemLib.h>\r
f8a61fe7 22\r
23#include <Omap3530/Omap3530.h>\r
24\r
fb5a64de
LL
25/**\r
26 This function causes a system-wide reset (cold reset), in which\r
27 all circuitry within the system returns to its initial state. This type of\r
28 reset is asynchronous to system operation and operates without regard to\r
29 cycle boundaries.\r
f8a61fe7 30\r
fb5a64de
LL
31 If this function returns, it means that the system does not support cold\r
32 reset.\r
33**/\r
f8a61fe7 34VOID\r
fb5a64de
LL
35EFIAPI\r
36ResetCold (\r
f8a61fe7 37 VOID\r
38 )\r
39{\r
fb5a64de
LL
40 //Perform cold reset of the system.\r
41 MmioOr32 (PRM_RSTCTRL, RST_DPLL3);\r
42 while ((MmioRead32(PRM_RSTST) & GLOBAL_COLD_RST) != 0x1);\r
f8a61fe7 43}\r
44\r
fb5a64de
LL
45/**\r
46 This function causes a system-wide initialization (warm reset), in which all\r
47 processors are set to their initial state. Pending cycles are not corrupted.\r
48\r
49 If this function returns, it means that the system does not support warm\r
50 reset.\r
51**/\r
f8a61fe7 52VOID\r
fb5a64de
LL
53EFIAPI\r
54ResetWarm (\r
f8a61fe7 55 VOID\r
fb5a64de
LL
56 )\r
57{\r
58 ResetCold ();\r
59}\r
f8a61fe7 60\r
61/**\r
fb5a64de
LL
62 This function causes the system to enter a power state equivalent\r
63 to the ACPI G2/S5 or G3 states.\r
f8a61fe7 64\r
fb5a64de
LL
65 If this function returns, it means that the system does not support shut down\r
66 reset.\r
f8a61fe7 67**/\r
fb5a64de 68VOID\r
f8a61fe7 69EFIAPI\r
fb5a64de
LL
70ResetShutdown (\r
71 VOID\r
f8a61fe7 72 )\r
73{\r
fb5a64de 74 // not implemented\r
f8a61fe7 75}\r
3402aac7 76\r
f8a61fe7 77/**\r
fb5a64de 78 This function causes the system to enter S3 and then wake up immediately.\r
f8a61fe7 79\r
fb5a64de
LL
80 If this function returns, it means that the system does not support S3\r
81 feature.\r
f8a61fe7 82**/\r
fb5a64de 83VOID\r
f8a61fe7 84EFIAPI\r
fb5a64de
LL
85EnterS3WithImmediateWake (\r
86 VOID\r
f8a61fe7 87 )\r
88{\r
fb5a64de 89 // not implemented\r
f8a61fe7 90}\r
91\r
fb5a64de
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
102**/\r
103VOID\r
104EFIAPI\r
105ResetPlatformSpecific (\r
106 IN UINTN DataSize,\r
107 IN VOID *ResetData\r
108 )\r
109{\r
110 ResetCold ();\r
111}\r