diff options
author | Olivier Martin <olivier.martin@arm.com> | 2013-08-06 12:11:13 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-08-06 12:11:13 +0000 |
commit | bb058bcdfbfeb91e3c6c3f61559ca3d7239062f9 (patch) | |
tree | a6e2a903798e0614e8098762b584e78a1698f4ba /ArmPlatformPkg/Drivers/PL180MciDxe | |
parent | 9532373b1dd5b9f4ba0c2c69fd287d436013ad0c (diff) | |
download | edk2-platforms-bb058bcdfbfeb91e3c6c3f61559ca3d7239062f9.tar.xz |
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 <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14526 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/Drivers/PL180MciDxe')
-rw-r--r-- | ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c index d9de4a8fdf..db8b29fac3 100644 --- a/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c +++ b/ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c @@ -217,12 +217,17 @@ MciReadBlockData ( 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 @@ MciReadBlockData ( }
} while ((Loop < Finish));
+ // Restore Tpl
+ gBS->RestoreTPL (Tpl);
+
// Clear Status flags
MmioWrite32 (MCI_CLEAR_STATUS_REG, MCI_CLR_ALL_STATUS);
@@ -294,6 +302,7 @@ MciWriteBlockData ( UINTN Status;
EFI_STATUS RetVal;
UINTN DataCtrlReg;
+ EFI_TPL Tpl;
RetVal = EFI_SUCCESS;
@@ -301,6 +310,10 @@ MciWriteBlockData ( 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 @@ MciWriteBlockData ( }
} while (Loop < Finish);
+ // Restore Tpl
+ gBS->RestoreTPL (Tpl);
+
// Wait for FIFO to drain
Timer = MMCI0_TIMEOUT * 60;
Status = MmioRead32 (MCI_STATUS_REG);
|