From acad5569abbc01e012e3ddf20918b10a80c74433 Mon Sep 17 00:00:00 2001 From: Guo Mang Date: Fri, 23 Dec 2016 11:01:56 +0800 Subject: BroxtonSiPkg: Add Reset Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Mang --- .../SouthCluster/Reset/RuntimeDxe/ScReset.h | 142 +++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/Reset/RuntimeDxe/ScReset.h (limited to 'Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/Reset/RuntimeDxe/ScReset.h') diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/Reset/RuntimeDxe/ScReset.h b/Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/Reset/RuntimeDxe/ScReset.h new file mode 100644 index 0000000000..0c90d11727 --- /dev/null +++ b/Silicon/BroxtonSoC/BroxtonSiPkg/SouthCluster/Reset/RuntimeDxe/ScReset.h @@ -0,0 +1,142 @@ +/** @file + Header file definitions for SC reset. + + Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef _SC_RESET_RT_H_ +#define _SC_RESET_RT_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ScAccess.h" +#include + +// +// Driver private data +// +#define RESET_SIGNATURE SIGNATURE_32 ('I', 'E', 'R', 'S') + +typedef struct { + UINT32 Signature; + EFI_HANDLE Handle; + EFI_SC_EXTENDED_RESET_PROTOCOL ScExtendedResetProtocol; +#if ((TIANO_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000)) + CHAR16 *CapsuleVariableName; +#endif + UINTN PmcBase; + UINTN AcpiBar; + UINT8 ResetSelect; +} SC_RESET_INSTANCE; + +#define RESET_INSTANCE_FROM_THIS(a) \ + CR ( \ + a, \ + SC_RESET_INSTANCE, \ + ScExtendedResetProtocol, \ + RESET_SIGNATURE \ + ) + +/** + Install and initialize reset protocols. + + @param[in] ImageHandle Image handle of the loaded driver + @param[in] SystemTable Pointer to the System Table + + @retval EFI_SUCCESS Thread can be successfully created + @retval EFI_OUT_OF_RESOURCES Cannot allocate protocol data structure + @retval EFI_DEVICE_ERROR Cannot create the timer service + +**/ +EFI_STATUS +EFIAPI +InitializeScReset ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ); + +/** + Generate system reset by Reset Control Register (IO Cf9h) + + @param[in] ResetType Warm or cold + @param[in] ResetStatus Possible cause of reset + @param[in] DataSize Size of ResetData in bytes + @param[in] ResetData Optional Unicode string + +**/ +VOID +EFIAPI +IntelScResetSystem ( + IN EFI_RESET_TYPE ResetType, + IN EFI_STATUS ResetStatus, + IN UINTN DataSize, + IN VOID *ResetData OPTIONAL + ); + +#if ((TIANO_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000)) +/** + If need be, do any special reset required for capsules. For this + implementation where we're called from the ResetSystem() api, + just set our capsule variable and return to let the caller + do a soft reset. + + @param[in] CapsuleDataPtr Pointer to the capsule block descriptors + +**/ +VOID +CapsuleReset ( + IN UINTN CapsuleDataPtr + ); +#endif + +/** + Execute SC Extended Reset from the host controller. + + @param[in] This Pointer to the EFI_SC_EXTENDED_RESET_PROTOCOL instance. + @param[in] ScExtendedResetTypes SC Extended Reset Types which includes PowerCycle, Globalreset. + + @retval EFI_SUCCESS Successfully completed. + @retval EFI_INVALID_PARAMETER If ResetType is invalid. + +**/ +EFI_STATUS +EFIAPI +ScExtendedReset ( + IN EFI_SC_EXTENDED_RESET_PROTOCOL *This, + IN SC_EXTENDED_RESET_TYPES ScExtendedResetTypes + ); + +/** + Fixup internal data pointers so that the services can be called in virtual mode. + + @param[in] Event The event registered. + @param[in] Context Event context. Not used in this event handler. + +**/ +VOID +EFIAPI +ScResetVirtualddressChangeEvent ( + IN EFI_EVENT Event, + IN VOID *Context + ); +#endif + -- cgit v1.2.3