Revision: 14526
          http://sourceforge.net/p/edk2/code/14526
Author:   oliviermartin
Date:     2013-08-06 12:11:13 +0000 (Tue, 06 Aug 2013)
Log Message:
-----------
ArmPlatformPkg/PL180MciDxe: Increased the TPL at the highest priority to 
disable interrupts

This change prevent any interrupt to disturb the PL180 data transfer.
If the data transfer is not fast enough, we get UNDERRUN error.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c

Modified: trunk/edk2/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c
===================================================================
--- trunk/edk2/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c    2013-08-06 
12:10:25 UTC (rev 14525)
+++ trunk/edk2/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c    2013-08-06 
12:11:13 UTC (rev 14526)
@@ -217,12 +217,17 @@
   UINTN Status;
   EFI_STATUS RetVal;
   UINTN  DataCtrlReg;
+  EFI_TPL Tpl;
 
   RetVal = EFI_SUCCESS;
 
   // Read data from the RX FIFO
   Loop   = 0;
   Finish = MMCI0_BLOCKLEN / 4;
+  
+  // Raise the TPL at the highest level to disable Interrupts.
+  Tpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
+
   do {
     // Read the Status flags
     Status = MmioRead32 (MCI_STATUS_REG);
@@ -270,6 +275,9 @@
     }
   } while ((Loop < Finish));
 
+  // Restore Tpl
+  gBS->RestoreTPL (Tpl);
+
   // Clear Status flags
   MmioWrite32 (MCI_CLEAR_STATUS_REG, MCI_CLR_ALL_STATUS);
 
@@ -294,6 +302,7 @@
   UINTN Status;
   EFI_STATUS RetVal;
   UINTN  DataCtrlReg;
+  EFI_TPL Tpl;
 
   RetVal = EFI_SUCCESS;
 
@@ -301,6 +310,10 @@
   Loop   = 0;
   Finish = MMCI0_BLOCKLEN / 4;
   Timer  = MMCI0_TIMEOUT * 100;
+
+  // Raise the TPL at the highest level to disable Interrupts.
+  Tpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
+
   do {
     // Read the Status flags
     Status = MmioRead32 (MCI_STATUS_REG);
@@ -345,6 +358,9 @@
     }
   } while (Loop < Finish);
 
+  // Restore Tpl
+  gBS->RestoreTPL (Tpl);
+
   // Wait for FIFO to drain
   Timer  = MMCI0_TIMEOUT * 60;
   Status = MmioRead32 (MCI_STATUS_REG);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to