]> git.proxmox.com Git - mirror_edk2.git/blob - BeagleBoardPkg/Library/ResetSystemLib/ResetSystemLib.c
BeagleBoardPkg: drop unused PcdCacheEnabled dependency
[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 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16
17
18 #include <Uefi.h>
19
20 #include <Library/IoLib.h>
21 #include <Library/ResetSystemLib.h>
22
23 #include <Omap3530/Omap3530.h>
24
25 /**
26 This function causes a system-wide reset (cold reset), in which
27 all circuitry within the system returns to its initial state. This type of
28 reset is asynchronous to system operation and operates without regard to
29 cycle boundaries.
30
31 If this function returns, it means that the system does not support cold
32 reset.
33 **/
34 VOID
35 EFIAPI
36 ResetCold (
37 VOID
38 )
39 {
40 //Perform cold reset of the system.
41 MmioOr32 (PRM_RSTCTRL, RST_DPLL3);
42 while ((MmioRead32(PRM_RSTST) & GLOBAL_COLD_RST) != 0x1);
43 }
44
45 /**
46 This function causes a system-wide initialization (warm reset), in which all
47 processors are set to their initial state. Pending cycles are not corrupted.
48
49 If this function returns, it means that the system does not support warm
50 reset.
51 **/
52 VOID
53 EFIAPI
54 ResetWarm (
55 VOID
56 )
57 {
58 ResetCold ();
59 }
60
61 /**
62 This function causes the system to enter a power state equivalent
63 to the ACPI G2/S5 or G3 states.
64
65 If this function returns, it means that the system does not support shut down
66 reset.
67 **/
68 VOID
69 EFIAPI
70 ResetShutdown (
71 VOID
72 )
73 {
74 // not implemented
75 }
76
77 /**
78 This function causes the system to enter S3 and then wake up immediately.
79
80 If this function returns, it means that the system does not support S3
81 feature.
82 **/
83 VOID
84 EFIAPI
85 EnterS3WithImmediateWake (
86 VOID
87 )
88 {
89 // not implemented
90 }
91
92 /**
93 This function causes a systemwide reset. The exact type of the reset is
94 defined by the EFI_GUID that follows the Null-terminated Unicode string passed
95 into ResetData. If the platform does not recognize the EFI_GUID in ResetData
96 the platform must pick a supported reset type to perform.The platform may
97 optionally log the parameters from any non-normal reset that occurs.
98
99 @param[in] DataSize The size, in bytes, of ResetData.
100 @param[in] ResetData The data buffer starts with a Null-terminated string,
101 followed by the EFI_GUID.
102 **/
103 VOID
104 EFIAPI
105 ResetPlatformSpecific (
106 IN UINTN DataSize,
107 IN VOID *ResetData
108 )
109 {
110 ResetCold ();
111 }