/** @file\r
Timer Architecture Protocol driver of the ARM flavor\r
\r
- Copyright (c) 2011 ARM Ltd. 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
- http://opensource.org/licenses/bsd-license.php \r
+ Copyright (c) 2011-2013 ARM Ltd. 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
+ http://opensource.org/licenses/bsd-license.php\r
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
ASSERT_EFI_ERROR (Status);\r
\r
// Disable the timer\r
+ TimerCtrlReg = ArmArchTimerGetTimerCtrlReg ();\r
+ TimerCtrlReg |= ARM_ARCH_TIMER_IMASK;\r
+ TimerCtrlReg &= ~ARM_ARCH_TIMER_ENABLE;\r
+ ArmArchTimerSetTimerCtrlReg (TimerCtrlReg);\r
Status = TimerDriverSetTimerPeriod (&gTimer, 0);\r
ASSERT_EFI_ERROR (Status);\r
\r
Status = gInterrupt->RegisterInterruptSource (gInterrupt, PcdGet32 (PcdArmArchTimerIntrNum), TimerInterruptHandler);\r
ASSERT_EFI_ERROR (Status);\r
\r
- // Unmask timer interrupts\r
- TimerCtrlReg = ArmArchTimerGetTimerCtrlReg ();\r
- TimerCtrlReg &= ~ARM_ARCH_TIMER_IMASK;\r
- ArmArchTimerSetTimerCtrlReg (TimerCtrlReg);\r
-\r
// Set up default timer\r
Status = TimerDriverSetTimerPeriod (&gTimer, FixedPcdGet32(PcdTimerPeriod)); // TIMER_DEFAULT_PERIOD\r
ASSERT_EFI_ERROR (Status);\r
);\r
ASSERT_EFI_ERROR(Status);\r
\r
- // enable Secure timer interrupts\r
- Status = gInterrupt->EnableInterruptSource (gInterrupt, PcdGet32 (PcdArmArchTimerSecIntrNum));\r
-\r
- // enable NonSecure timer interrupts\r
- Status = gInterrupt->EnableInterruptSource (gInterrupt, PcdGet32 (PcdArmArchTimerIntrNum));\r
+ // Everything is ready, unmask and enable timer interrupts\r
+ TimerCtrlReg = ARM_ARCH_TIMER_ENABLE;\r
+ ArmArchTimerSetTimerCtrlReg (TimerCtrlReg);\r
\r
// Register for an ExitBootServicesEvent\r
Status = gBS->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_NOTIFY, ExitBootServicesEvent, NULL, &EfiExitBootServicesEvent);\r