]> git.proxmox.com Git - mirror_edk2.git/blob - BeagleBoardPkg/Library/ResetSystemLib/ResetSystemLib.c
9fc572957f5f5f8f532f536338ff71d13378c097
[mirror_edk2.git] / BeagleBoardPkg / Library / ResetSystemLib / ResetSystemLib.c
1 /** @file
2 Do a generic Cold Reset for OMAP3550 and BeagleBoard specific Warm reset
3
4 Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
5 Copyright (c) 2017, Linaro Ltd. All rights reserved.<BR>
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11
12 #include <Uefi.h>
13
14 #include <Library/IoLib.h>
15 #include <Library/ResetSystemLib.h>
16
17 #include <Omap3530/Omap3530.h>
18
19 /**
20 This function causes a system-wide reset (cold reset), in which
21 all circuitry within the system returns to its initial state. This type of
22 reset is asynchronous to system operation and operates without regard to
23 cycle boundaries.
24
25 If this function returns, it means that the system does not support cold
26 reset.
27 **/
28 VOID
29 EFIAPI
30 ResetCold (
31 VOID
32 )
33 {
34 //Perform cold reset of the system.
35 MmioOr32 (PRM_RSTCTRL, RST_DPLL3);
36 while ((MmioRead32(PRM_RSTST) & GLOBAL_COLD_RST) != 0x1);
37 }
38
39 /**
40 This function causes a system-wide initialization (warm reset), in which all
41 processors are set to their initial state. Pending cycles are not corrupted.
42
43 If this function returns, it means that the system does not support warm
44 reset.
45 **/
46 VOID
47 EFIAPI
48 ResetWarm (
49 VOID
50 )
51 {
52 ResetCold ();
53 }
54
55 /**
56 This function causes the system to enter a power state equivalent
57 to the ACPI G2/S5 or G3 states.
58
59 If this function returns, it means that the system does not support shut down
60 reset.
61 **/
62 VOID
63 EFIAPI
64 ResetShutdown (
65 VOID
66 )
67 {
68 // not implemented
69 }
70
71 /**
72 This function causes the system to enter S3 and then wake up immediately.
73
74 If this function returns, it means that the system does not support S3
75 feature.
76 **/
77 VOID
78 EFIAPI
79 EnterS3WithImmediateWake (
80 VOID
81 )
82 {
83 // not implemented
84 }
85
86 /**
87 This function causes a systemwide reset. The exact type of the reset is
88 defined by the EFI_GUID that follows the Null-terminated Unicode string passed
89 into ResetData. If the platform does not recognize the EFI_GUID in ResetData
90 the platform must pick a supported reset type to perform.The platform may
91 optionally log the parameters from any non-normal reset that occurs.
92
93 @param[in] DataSize The size, in bytes, of ResetData.
94 @param[in] ResetData The data buffer starts with a Null-terminated string,
95 followed by the EFI_GUID.
96 **/
97 VOID
98 EFIAPI
99 ResetPlatformSpecific (
100 IN UINTN DataSize,
101 IN VOID *ResetData
102 )
103 {
104 ResetCold ();
105 }