]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BeagleBoardPkg: Ensure there is no pending IRQ and disable timer
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 20 Jul 2011 15:13:06 +0000 (15:13 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 20 Jul 2011 15:13:06 +0000 (15:13 +0000)
When the BeagleBoard UEFI is started from a 1st (or 2nd stage) boot loader
it is possible there are still some pending IRQ.
Clean the interrupts before starting the BeagleBoard UEFI.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12034 6f19259b-4bc3-4df7-8a09-765794883524

BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoard.c
BeagleBoardPkg/Library/BeagleBoardLib/Clock.c
Omap35xxPkg/TimerDxe/Timer.c

index a74b60d91ae2ccbe834256d1fbefe302d1ed67f3..5a40ccea91c45e3f98753c5f13fbb80116ed53c7 100755 (executable)
@@ -17,6 +17,8 @@
 #include <Library/DebugLib.h>
 #include <Library/PcdLib.h>
 
+#include <Omap3530/Omap3530.h>
+
 VOID
 PadConfiguration (
   VOID
@@ -101,12 +103,21 @@ ArmPlatformGetBootMode (
 VOID
 ArmPlatformNormalInitialize (
   VOID
-  ) {
+  )
+{
   //Set up Pin muxing.
   PadConfiguration ();
 
   // Set up system clocking
   ClockInit ();
+
+  // Turn off the functional clock for Timer 3
+  MmioAnd32 (CM_FCLKEN_PER, 0xFFFFFFFF ^ CM_ICLKEN_PER_EN_GPT3_ENABLE );
+  ArmDataSyncronizationBarrier ();
+
+  // Clear IRQs
+  MmioWrite32 (INTCPS_CONTROL, INTCPS_CONTROL_NEWIRQAGR);
+  ArmDataSyncronizationBarrier ();
 }
 
 /**
index 8de24f851c98ce634ac5699c8af22b8b185b1a56..1985a6bfb4c02d8d0c60d48021bc862154b3bc11 100755 (executable)
@@ -46,7 +46,6 @@ ClockInit (
 \r
   // Turn on functional & interface clocks to various Peripherals.\r
   MmioOr32(CM_FCLKEN_PER, CM_FCLKEN_PER_EN_UART3_ENABLE\r
-                          | CM_FCLKEN_PER_EN_GPT3_ENABLE\r
                           | CM_FCLKEN_PER_EN_GPT4_ENABLE\r
                           | CM_FCLKEN_PER_EN_GPIO2_ENABLE\r
                           | CM_FCLKEN_PER_EN_GPIO3_ENABLE\r
index 1919618ef266431c8db9f125929d59044a9aad64..d0ea973509eded94baa5e3b4cc6b0a0115b11269 100644 (file)
@@ -356,6 +356,9 @@ TimerInitialize (
   Status = gInterrupt->RegisterInterruptSource (gInterrupt, gVector, TimerInterruptHandler);
   ASSERT_EFI_ERROR (Status);
 
+  // Turn on the functional clock for Timer
+  MmioOr32 (CM_FCLKEN_PER, CM_FCLKEN_PER_EN_GPT3_ENABLE);
+
   // Set up default timer
   Status = TimerDriverSetTimerPeriod (&gTimer, FixedPcdGet32(PcdTimerPeriod));
   ASSERT_EFI_ERROR (Status);