\r
#include "PL031RealTimeClock.h"\r
\r
-STATIC BOOLEAN mPL031Initialized = FALSE;\r
-STATIC EFI_EVENT mRtcVirtualAddrChangeEvent;\r
-STATIC UINTN mPL031RtcBase;\r
+STATIC BOOLEAN mPL031Initialized = FALSE;\r
+STATIC EFI_EVENT mRtcVirtualAddrChangeEvent;\r
+STATIC UINTN mPL031RtcBase;\r
\r
EFI_STATUS\r
IdentifyPL031 (\r
VOID\r
)\r
{\r
- EFI_STATUS Status;\r
+ EFI_STATUS Status;\r
\r
// Check if this is a PrimeCell Peripheral\r
if ( (MmioRead8 (mPL031RtcBase + PL031_RTC_PCELL_ID0) != 0x0D)\r
- || (MmioRead8 (mPL031RtcBase + PL031_RTC_PCELL_ID1) != 0xF0)\r
- || (MmioRead8 (mPL031RtcBase + PL031_RTC_PCELL_ID2) != 0x05)\r
- || (MmioRead8 (mPL031RtcBase + PL031_RTC_PCELL_ID3) != 0xB1)) {\r
+ || (MmioRead8 (mPL031RtcBase + PL031_RTC_PCELL_ID1) != 0xF0)\r
+ || (MmioRead8 (mPL031RtcBase + PL031_RTC_PCELL_ID2) != 0x05)\r
+ || (MmioRead8 (mPL031RtcBase + PL031_RTC_PCELL_ID3) != 0xB1))\r
+ {\r
Status = EFI_NOT_FOUND;\r
goto EXIT;\r
}\r
\r
// Check if this PrimeCell Peripheral is the PL031 Real Time Clock\r
if ( (MmioRead8 (mPL031RtcBase + PL031_RTC_PERIPH_ID0) != 0x31)\r
- || (MmioRead8 (mPL031RtcBase + PL031_RTC_PERIPH_ID1) != 0x10)\r
- || ((MmioRead8 (mPL031RtcBase + PL031_RTC_PERIPH_ID2) & 0xF) != 0x04)\r
- || (MmioRead8 (mPL031RtcBase + PL031_RTC_PERIPH_ID3) != 0x00)) {\r
+ || (MmioRead8 (mPL031RtcBase + PL031_RTC_PERIPH_ID1) != 0x10)\r
+ || ((MmioRead8 (mPL031RtcBase + PL031_RTC_PERIPH_ID2) & 0xF) != 0x04)\r
+ || (MmioRead8 (mPL031RtcBase + PL031_RTC_PERIPH_ID3) != 0x00))\r
+ {\r
Status = EFI_NOT_FOUND;\r
goto EXIT;\r
}\r
\r
Status = EFI_SUCCESS;\r
\r
- EXIT:\r
+EXIT:\r
return Status;\r
}\r
\r
VOID\r
)\r
{\r
- EFI_STATUS Status;\r
+ EFI_STATUS Status;\r
\r
// Prepare the hardware\r
- Status = IdentifyPL031();\r
+ Status = IdentifyPL031 ();\r
if (EFI_ERROR (Status)) {\r
goto EXIT;\r
}\r
\r
mPL031Initialized = TRUE;\r
\r
- EXIT:\r
+EXIT:\r
return Status;\r
}\r
\r
EFI_STATUS\r
EFIAPI\r
LibGetTime (\r
- OUT EFI_TIME *Time,\r
- OUT EFI_TIME_CAPABILITIES *Capabilities\r
+ OUT EFI_TIME *Time,\r
+ OUT EFI_TIME_CAPABILITIES *Capabilities\r
)\r
{\r
EFI_STATUS Status;\r
// Update the Capabilities info\r
if (Capabilities != NULL) {\r
// PL031 runs at frequency 1Hz\r
- Capabilities->Resolution = PL031_COUNTS_PER_SECOND;\r
+ Capabilities->Resolution = PL031_COUNTS_PER_SECOND;\r
// Accuracy in ppm multiplied by 1,000,000, e.g. for 50ppm set 50,000,000\r
- Capabilities->Accuracy = (UINT32)PcdGet32 (PcdPL031RtcPpmAccuracy);\r
+ Capabilities->Accuracy = (UINT32)PcdGet32 (PcdPL031RtcPpmAccuracy);\r
// FALSE: Setting the time does not clear the values below the resolution level\r
- Capabilities->SetsToZero = FALSE;\r
+ Capabilities->SetsToZero = FALSE;\r
}\r
\r
return EFI_SUCCESS;\r
}\r
\r
-\r
/**\r
Sets the current local time and date information.\r
\r
EFI_STATUS\r
EFIAPI\r
LibSetTime (\r
- IN EFI_TIME *Time\r
+ IN EFI_TIME *Time\r
)\r
{\r
EFI_STATUS Status;\r
return EFI_SUCCESS;\r
}\r
\r
-\r
/**\r
Returns the current wakeup alarm clock setting.\r
\r
EFI_STATUS\r
EFIAPI\r
LibGetWakeupTime (\r
- OUT BOOLEAN *Enabled,\r
- OUT BOOLEAN *Pending,\r
- OUT EFI_TIME *Time\r
+ OUT BOOLEAN *Enabled,\r
+ OUT BOOLEAN *Pending,\r
+ OUT EFI_TIME *Time\r
)\r
{\r
// Not a required feature\r
return EFI_UNSUPPORTED;\r
}\r
\r
-\r
/**\r
Sets the system wakeup alarm clock time.\r
\r
EFI_STATUS\r
EFIAPI\r
LibSetWakeupTime (\r
- IN BOOLEAN Enabled,\r
- OUT EFI_TIME *Time\r
+ IN BOOLEAN Enabled,\r
+ OUT EFI_TIME *Time\r
)\r
{\r
// Not a required feature\r
VOID\r
EFIAPI\r
LibRtcVirtualNotifyEvent (\r
- IN EFI_EVENT Event,\r
- IN VOID *Context\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
)\r
{\r
//\r
// to virtual address. After the OS transitions to calling in virtual mode, all future\r
// runtime calls will be made in virtual mode.\r
//\r
- EfiConvertPointer (0x0, (VOID**)&mPL031RtcBase);\r
+ EfiConvertPointer (0x0, (VOID **)&mPL031RtcBase);\r
return;\r
}\r
\r
EFI_STATUS\r
EFIAPI\r
LibRtcInitialize (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
{\r
- EFI_STATUS Status;\r
- EFI_HANDLE Handle;\r
+ EFI_STATUS Status;\r
+ EFI_HANDLE Handle;\r
\r
// Initialize RTC Base Address\r
mPL031RtcBase = PcdGet32 (PcdPL031RtcBase);\r
// Declare the controller as EFI_MEMORY_RUNTIME\r
Status = gDS->AddMemorySpace (\r
EfiGcdMemoryTypeMemoryMappedIo,\r
- mPL031RtcBase, SIZE_4KB,\r
+ mPL031RtcBase,\r
+ SIZE_4KB,\r
EFI_MEMORY_UC | EFI_MEMORY_RUNTIME\r
);\r
if (EFI_ERROR (Status)) {\r
Handle = NULL;\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
&Handle,\r
- &gEfiRealTimeClockArchProtocolGuid, NULL,\r
+ &gEfiRealTimeClockArchProtocolGuid,\r
+ NULL,\r
NULL\r
- );\r
+ );\r
ASSERT_EFI_ERROR (Status);\r
\r
//\r