summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
Commit message (Collapse)AuthorAgeFilesLines
* EmbeddedPkg: Fix build error for MmcDxePierre Gondois2020-07-231-3/+3
| | | | | | | | | | | | | | | | | | | The following command line: build -b NOOPT -a IA32 -t VS2017 -p edk2\EmbeddedPkg\EmbeddedPkg.dsc Generates the following error: MmcDxe.lib(Diagnostics.obj) : error LNK2001: unresolved external symbol __allshl MmcDxe.lib(Diagnostics.obj) : error LNK2001: unresolved external symbol __aullshr MmcDxe.lib(MmcBlockIo.obj) : error LNK2001: unresolved external symbol __allmul These erros are due to the use of shift/multiply operations on UINT64 variable on a IA32 architecture. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* EmbeddedPkg/MmcDxe: Added MaxBlock Transfer Limit 65535 in R/W.Gaurav Jain2020-06-121-11/+23
| | | | | | | | | | | | | | | | | | | | Moved BlockCount calculation below BufferSize Validation checks. First Ensure Buffersize is Not Zero and multiple of Media BlockSize. then calculate BlockCount and perform Block checks. Corrected BlockCount calculation, as BufferSize is multiple of BlockSize, So adding (BlockSize-1) bytes to BufferSize and then divide by BlockSize will have no impact on BlockCount. Reading Large Images from MMC causes errors. As per SD Host Controller Spec version 4.20, Restriction of 16-bit Block Count transfer is 65535. Max block transfer limit in single cmd is 65535 blocks. Added Max Block check that can be processed is 0xFFFF. then Update BlockCount on the basis of MaxBlock. Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com> Reviewed-by: "Loh, Tien Hock" <tien.hock.loh@intel.com>
* EmbeddedPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-091-7/+1
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: Fix Command Argument for SD/eMMC R/W operation.Meenakshi Aggarwal2019-01-301-5/+16
| | | | | | | | | | | | | | | | | | Issue : SD read failure for high capacity cards e.g. 64 GB Reason : Command argument value exceeds 32 bit for block number 0x3787FFF and cant be fit into 32 bit wide SD host controller register. Fix : AccessMode bits [29:30] of OCR is a valid definition to calculate data address for eMMC cards. For SD cards, data address is calculated on the basis of card capacity status bit[30] of OCR. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg: MmcDxe - Recieve response was missing after CMD12Meenakshi Aggarwal2017-09-011-0/+1
| | | | | | | | | | We are not recieving the response from memory card after sending CMD 12. It was not resulting in any failure but we should recieve response after sending a command. Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Reviewed-by: Jun Nie <jun.nie@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* EmbeddedPkg/MmcDxe: expand to support multiple blocksHaojian Zhuang2016-11-241-59/+117
| | | | | | | | | | Make use of DMA to transfer multiple blocks at one time. It could improve the performance on MMC/SD driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* EmbeddedPkg: Remove dependency on TimerLibOlivier Martin2015-05-061-3/+2
| | | | | | | | | | | | | UEFI drivers should not depend on TimerLib. They should use BS.Stall() instead. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Ronald Cron <Ronald.Cron@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17343 6f19259b-4bc3-4df7-8a09-765794883524
* MmcDxe: Adding eMMC supportOlivier Martin2014-01-091-257/+1
| | | | | | | | | 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@15074 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Moved all the 'Print*()' functions to MmcDebug.cOlivier Martin2013-08-301-123/+1
| | | | | | | | | 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@14612 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Removed redundant CMD12 calls from MMCOlivier Martin2013-08-061-6/+18
| | | | | | | | | | | | Command 12 - Stop transmission (ends read or write). Normally only needed for streaming transfers or after 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@14525 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Update Mmc code to conform to coding standardOlivier Martin2013-08-061-77/+59
| | | | | | | | | 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@14524 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Make the driver more compliant with the UEFI specificationoliviermartin2013-04-141-7/+17
| | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14264 6f19259b-4bc3-4df7-8a09-765794883524
* ARM Packages: Fixed coding style and typosoliviermartin2013-03-121-132/+135
| | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14179 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Ensure MMC is in Identification Modeoliviermartin2012-10-191-7/+6
| | | | | | | | | | | | | | This change ensure the MMC card is in Identification Mode. The card might be in Data Transfer Mode if a pre UEFI Boot Loader had initialized the card. A potential optimization would be to skip the Identification Mode in this case. Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13872 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: The timeout while waiting for the programming to be ↵oliviermartin2012-08-311-1/+0
| | | | | | | | | | complete was decreased twice. Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13694 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Fixed typooliviermartin2012-08-021-11/+17
| | | | | | | | Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13585 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Avoid nanosecond delay when command succeedsoliviermartin2012-08-021-1/+4
| | | | | | | | | | Check response just after receiving it to avoid the delay. Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13584 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Fixed MmcIdentificationMode()oliviermartin2012-08-021-3/+3
| | | | | | | | | | The condition to check if the card is ready was not correct. Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13583 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Fixed XCLANG buildoliviermartin2012-03-261-5/+6
| | | | | | | | | | | | Move the constant array from its declaration inside the function to a global declaration. Signed-off-by: Andrew Fish <afish@apple.com> Reviewed-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13140 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Add 'This' pointer attribute to protocol functionoliviermartin2011-09-011-34/+34
| | | | | | | | | | | | | | | | This attribute allows the EFI_MMC_HOST_PROTOCOL interface to manage multiple instances in one driver. EmbeddedPkg/MmcDxe: Add Revision attribute to the EFI_MMC_HOST_PROTOCOL Note: The ARM PL180 and Omap35xx MMC host drivers has been updated. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12255 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Card Presence Detect Race Conditionoliviermartin2011-08-301-80/+76
| | | | | | | | | | | | | | | | | | | | | | The MMC driver defaults to assume a card is not present. It then starts a timer in MmcDxeInitialize to check for card presence every 200ms. However it does not immediately check to see if a card is present so if the EFI driver connection process occurs less than 200ms after the driver load, the connection process for partition or filesystem drivers will fail because MediaPresent still is FALSE. To resolve this race condition, we need to immediately perform the presence check in the Start routine. EmbeddedPkg/MmcDxe: Media ID Handling Initialize the MMC device on Start or when presence changes instead of doing it on the Block IO calls. This way the layered drivers can be stopped and rebuilt with new Media IDs instead of experiencing errors on calls to Block IO. Proposed-by: Eugene Cohen (HP) Reviewed-by: oliviermartin git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12237 6f19259b-4bc3-4df7-8a09-765794883524
* ArmPkg: Fix ARMGCC buildoliviermartin2011-08-181-1/+0
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12165 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Set the BlockLength at the beginning of the BlockIo transferoliviermartin2011-08-151-10/+12
| | | | | | | | Before the SetBlockLength command was called prior to a Read or Write command. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12133 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Implement the correct macro to get the device size of SD ↵oliviermartin2011-08-151-3/+2
| | | | | | 2 High Density cards git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12131 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Fix the CMD3 sequenceoliviermartin2011-08-151-11/+13
| | | | | | | | | | In the former version, we were checking the card was in the new state (Standby state). But the transition to the nez state is only visible in the response of the next command. This commit removes the check on the MMC state. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12130 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Improved parameters checkingoliviermartin2011-08-151-9/+19
| | | | | | | | Ensure the passed parameters are correct. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12129 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Create a periodic function to check if a card is presentoliviermartin2011-08-151-5/+23
| | | | | | | | | | In the former version, the check was done for every BlockIo operation. By using a periodical function, we check less time in consequence performance are better. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12128 6f19259b-4bc3-4df7-8a09-765794883524
* ArmPkg: Fix warnings raised by ARMGCColiviermartin2011-06-151-0/+2
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11829 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Fix coding styleoliviermartin2011-06-031-466/+498
| | | | | | | | Make the coding style more compliant with the EDK2 coding convention. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11727 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg/MmcDxe: Wait for the MMC controller to be in Transfer Modeoliviermartin2011-06-031-5/+15
| | | | | | | | | | The MMC controller might be ready for data but not be in a 'ready' state to send or receive commands. This fix waits for the MMC controller to be in the correct state. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11726 6f19259b-4bc3-4df7-8a09-765794883524
* EmbeddedPkg: Move Universal/MmcDxe from ArmPkg to EmbeddedPkgoliviermartin2011-06-031-0/+614
The MmcDxe is not ARM architecture specific. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11725 6f19259b-4bc3-4df7-8a09-765794883524