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
UINTN Status;\r
EFI_STATUS RetVal;\r
UINTN DataCtrlReg;\r
UINTN Status;\r
EFI_STATUS RetVal;\r
UINTN DataCtrlReg;\r
\r
RetVal = EFI_SUCCESS;\r
\r
// Read data from the RX FIFO\r
Loop = 0;\r
Finish = MMCI0_BLOCKLEN / 4;\r
\r
RetVal = EFI_SUCCESS;\r
\r
// Read data from the RX FIFO\r
Loop = 0;\r
Finish = MMCI0_BLOCKLEN / 4;\r
+ \r
+ // Raise the TPL at the highest level to disable Interrupts.\r
+ Tpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
+\r
do {\r
// Read the Status flags\r
Status = MmioRead32 (MCI_STATUS_REG);\r
do {\r
// Read the Status flags\r
Status = MmioRead32 (MCI_STATUS_REG);\r
}\r
} while ((Loop < Finish));\r
\r
}\r
} while ((Loop < Finish));\r
\r
+ // Restore Tpl\r
+ gBS->RestoreTPL (Tpl);\r
+\r
// Clear Status flags\r
MmioWrite32 (MCI_CLEAR_STATUS_REG, MCI_CLR_ALL_STATUS);\r
\r
// Clear Status flags\r
MmioWrite32 (MCI_CLEAR_STATUS_REG, MCI_CLR_ALL_STATUS);\r
\r
UINTN Status;\r
EFI_STATUS RetVal;\r
UINTN DataCtrlReg;\r
UINTN Status;\r
EFI_STATUS RetVal;\r
UINTN DataCtrlReg;\r
\r
RetVal = EFI_SUCCESS;\r
\r
\r
RetVal = EFI_SUCCESS;\r
\r
Loop = 0;\r
Finish = MMCI0_BLOCKLEN / 4;\r
Timer = MMCI0_TIMEOUT * 100;\r
Loop = 0;\r
Finish = MMCI0_BLOCKLEN / 4;\r
Timer = MMCI0_TIMEOUT * 100;\r
+\r
+ // Raise the TPL at the highest level to disable Interrupts.\r
+ Tpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
+\r
do {\r
// Read the Status flags\r
Status = MmioRead32 (MCI_STATUS_REG);\r
do {\r
// Read the Status flags\r
Status = MmioRead32 (MCI_STATUS_REG);\r
}\r
} while (Loop < Finish);\r
\r
}\r
} while (Loop < Finish);\r
\r
+ // Restore Tpl\r
+ gBS->RestoreTPL (Tpl);\r
+\r
// Wait for FIFO to drain\r
Timer = MMCI0_TIMEOUT * 60;\r
Status = MmioRead32 (MCI_STATUS_REG);\r
// Wait for FIFO to drain\r
Timer = MMCI0_TIMEOUT * 60;\r
Status = MmioRead32 (MCI_STATUS_REG);\r