]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h
PcAtChipsetPkg: Clean up source files
[mirror_edk2.git] / PcAtChipsetPkg / PcatRealTimeClockRuntimeDxe / PcRtc.h
index 026c1086b2fe826522c7017a0973e0c180d3d373..25f4d09af8086525c2df17a3a9a4d84f8f00f0e5 100644 (file)
@@ -1,7 +1,9 @@
 /** @file\r
   Header file for real time clock driver.\r
 \r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2017, AMD Inc. All rights reserved.<BR>\r
+\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -19,6 +21,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <Uefi.h>\r
 \r
+#include <Guid/Acpi.h>\r
+\r
 #include <Protocol/RealTimeClock.h>\r
 \r
 #include <Library/BaseLib.h>\r
@@ -34,15 +38,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/PcdLib.h>\r
 #include <Library/ReportStatusCodeLib.h>\r
 \r
-\r
 typedef struct {\r
   EFI_LOCK  RtcLock;\r
   INT16     SavedTimeZone;\r
   UINT8     Daylight;\r
+  UINT8     CenturyRtcAddress;\r
 } PC_RTC_MODULE_GLOBALS;\r
 \r
-#define PCAT_RTC_ADDRESS_REGISTER 0x70\r
-#define PCAT_RTC_DATA_REGISTER    0x71\r
+extern PC_RTC_MODULE_GLOBALS  mModuleGlobal;\r
 \r
 //\r
 // Dallas DS12C887 Real Time Clock\r
@@ -71,13 +74,6 @@ typedef struct {
 #define RTC_INIT_DAY    1\r
 #define RTC_INIT_MONTH  1\r
 \r
-//\r
-// Register initial values\r
-//\r
-#define RTC_INIT_REGISTER_A 0x26\r
-#define RTC_INIT_REGISTER_B 0x02\r
-#define RTC_INIT_REGISTER_D 0x0\r
-\r
 #pragma pack(1)\r
 //\r
 // Register A\r
@@ -322,7 +318,7 @@ ConvertRtcTimeToEfiTime (
   @param    Timeout  Tell how long it should take to wait.\r
 \r
   @retval   EFI_DEVICE_ERROR   RTC device error.\r
-  @retval   EFI_SUCCESS        RTC is updated and ready.  \r
+  @retval   EFI_SUCCESS        RTC is updated and ready.\r
 **/\r
 EFI_STATUS\r
 RtcWaitToUpdate (\r
@@ -355,4 +351,30 @@ IsLeapYear (
   IN EFI_TIME   *Time\r
   );\r
 \r
+/**\r
+  Get the century RTC address from the ACPI FADT table.\r
+\r
+  @return  The century RTC address or 0 if not found.\r
+**/\r
+UINT8\r
+GetCenturyRtcAddress (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Notification function of ACPI Table change.\r
+\r
+  This is a notification function registered on ACPI Table change event.\r
+  It saves the Century address stored in ACPI FADT table.\r
+\r
+  @param  Event        Event whose notification function is being invoked.\r
+  @param  Context      Pointer to the notification function's context.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+PcRtcAcpiTableChangeCallback (\r
+  IN EFI_EVENT        Event,\r
+  IN VOID             *Context\r
+  );\r
 #endif\r