]> git.proxmox.com Git - mirror_edk2.git/blob - QuarkPlatformPkg/Application/ForceRecovery/ForceRecovery.c
ArmPkg/CompilerIntrinsicsLib: Add uread, uwrite GCC assembly sources
[mirror_edk2.git] / QuarkPlatformPkg / Application / ForceRecovery / ForceRecovery.c
1 /** @file
2 Application that sets a sticky bit to force recovery on next reset.
3
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include <Uefi.h>
10
11 #include <Library/UefiRuntimeServicesTableLib.h>
12 #include <Library/QNCAccessLib.h>
13
14 /**
15 The user Entry Point for Application. The user code starts with this function
16 as the real entry point for the application.
17
18 @param[in] ImageHandle The firmware allocated handle for the EFI image.
19 @param[in] SystemTable A pointer to the EFI System Table.
20
21 @retval EFI_SUCCESS The entry point is executed successfully.
22 @retval other Some error occurs when executing this entry point.
23
24 **/
25 EFI_STATUS
26 EFIAPI
27 UefiMain (
28 IN EFI_HANDLE ImageHandle,
29 IN EFI_SYSTEM_TABLE *SystemTable
30 )
31 {
32 //
33 // Set 'B_CFG_STICKY_RW_FORCE_RECOVERY' sticky bit so we know we need to do a recovery following warm reset
34 //
35 QNCAltPortWrite (
36 QUARK_SCSS_SOC_UNIT_SB_PORT_ID,
37 QUARK_SCSS_SOC_UNIT_CFG_STICKY_RW,
38 QNCAltPortRead (QUARK_SCSS_SOC_UNIT_SB_PORT_ID, QUARK_SCSS_SOC_UNIT_CFG_STICKY_RW) | B_CFG_STICKY_RW_FORCE_RECOVERY
39 );
40
41 //
42 // Do a warm reset
43 //
44 gRT->ResetSystem (EfiResetWarm, EFI_SUCCESS, 0, NULL);
45
46 return EFI_SUCCESS;
47 }