]> git.proxmox.com Git - mirror_edk2.git/commit - EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
EmbeddedPkg/MmcDxe: Added MaxBlock Transfer Limit 65535 in R/W.
authorGaurav Jain <gaurav.jain@nxp.com>
Fri, 3 Apr 2020 09:24:07 +0000 (14:54 +0530)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 12 Jun 2020 08:12:27 +0000 (08:12 +0000)
commit567bc4b4ae8a975791382dd30ac413bc0d3ce88c
treeead589dace430a276de2c067e710d663286db18c
parenta4cfb842fca9693a330cb5435284c1ee8bfbbace
EmbeddedPkg/MmcDxe: Added MaxBlock Transfer Limit 65535 in R/W.

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/Universal/MmcDxe/MmcBlockIo.c