diff options
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c | 45 | ||||
-rw-r--r-- | MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.h | 10 |
2 files changed, 3 insertions, 52 deletions
diff --git a/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c b/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c index e9367fb..c6b58b3 100644 --- a/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c +++ b/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.c @@ -158,11 +158,7 @@ PcRtcInit ( Time.Month = RtcRead (RTC_ADDRESS_MONTH);
Time.Year = RtcRead (RTC_ADDRESS_YEAR);
- if (RtcTestCenturyRegister () == EFI_SUCCESS) {
- Century = (UINT8) (RtcRead (RTC_ADDRESS_CENTURY) & 0x7f);
- } else {
- Century = RtcRead (RTC_ADDRESS_CENTURY);
- }
+ Century = BcdToDecimal8 (RtcRead (RTC_ADDRESS_CENTURY));
//
// Set RTC configuration after get original time
@@ -285,11 +281,7 @@ PcRtcGetTime ( Time->Month = RtcRead (RTC_ADDRESS_MONTH);
Time->Year = RtcRead (RTC_ADDRESS_YEAR);
- if (RtcTestCenturyRegister () == EFI_SUCCESS) {
- Century = (UINT8) (RtcRead (RTC_ADDRESS_CENTURY) & 0x7f);
- } else {
- Century = RtcRead (RTC_ADDRESS_CENTURY);
- }
+ Century = BcdToDecimal8 (RtcRead (RTC_ADDRESS_CENTURY));
//
// Release RTC Lock.
@@ -401,10 +393,6 @@ PcRtcSetTime ( RtcWrite (RTC_ADDRESS_DAY_OF_THE_MONTH, RtcTime.Day);
RtcWrite (RTC_ADDRESS_MONTH, RtcTime.Month);
RtcWrite (RTC_ADDRESS_YEAR, (UINT8) RtcTime.Year);
- if (RtcTestCenturyRegister () == EFI_SUCCESS) {
- Century = (UINT8) ((Century & 0x7f) | (RtcRead (RTC_ADDRESS_CENTURY) & 0x80));
- }
-
RtcWrite (RTC_ADDRESS_CENTURY, Century);
//
@@ -520,11 +508,7 @@ PcRtcGetWakeupTime ( Time->Year = RtcRead (RTC_ADDRESS_YEAR);
}
- if (RtcTestCenturyRegister () == EFI_SUCCESS) {
- Century = (UINT8) (RtcRead (RTC_ADDRESS_CENTURY) & 0x7f);
- } else {
- Century = RtcRead (RTC_ADDRESS_CENTURY);
- }
+ Century = BcdToDecimal8 (RtcRead (RTC_ADDRESS_CENTURY));
//
// Release RTC Lock.
@@ -663,29 +647,6 @@ PcRtcSetWakeupTime ( return EFI_SUCCESS;
}
-/**
- See if century register of RTC is valid.
-
- @retval EFI_SUCCESS Century register is valid.
- @retval EFI_DEVICE_ERROR Century register is NOT valid.
-**/
-EFI_STATUS
-RtcTestCenturyRegister (
- VOID
- )
-{
- UINT8 Century;
- UINT8 Temp;
-
- Century = RtcRead (RTC_ADDRESS_CENTURY);
- Temp = (UINT8) (RtcRead (RTC_ADDRESS_CENTURY) & 0x7f);
- RtcWrite (RTC_ADDRESS_CENTURY, Century);
- if (Temp == 0x19 || Temp == 0x20) {
- return EFI_SUCCESS;
- }
-
- return EFI_DEVICE_ERROR;
-}
/**
Checks an 8-bit BCD value, and converts to an 8-bit value if valid.
diff --git a/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.h b/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.h index 5beb075..90cfa39 100644 --- a/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.h +++ b/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/PcRtc.h @@ -296,16 +296,6 @@ ConvertEfiTimeToRtcTime ( OUT UINT8 *Century
);
-/**
- See if centry register of RTC is valid.
-
- @retval EFI_SUCCESS Century register is valid.
- @retval EFI_DEVICE_ERROR Century register is NOT valid.
-**/
-EFI_STATUS
-RtcTestCenturyRegister (
- VOID
- );
/**
Converts time read from RTC to EFI_TIME format defined by UEFI spec.
|