bdk: sdmmc: add defines for max block number
This commit is contained in:
@@ -327,7 +327,7 @@ static int _sdmmc_storage_readwrite(sdmmc_storage_t *storage, u32 sector, u32 nu
|
||||
do
|
||||
{
|
||||
reinit_try:
|
||||
if (_sdmmc_storage_readwrite_ex(storage, &blkcnt, sct_off, MIN(sct_total, 0xFFFF), bbuf, is_write))
|
||||
if (_sdmmc_storage_readwrite_ex(storage, &blkcnt, sct_off, MIN(sct_total, SDMMC_AMAX_BLOCKNUM), bbuf, is_write))
|
||||
goto out;
|
||||
else
|
||||
retries--;
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
#define SDMMC_CMD_BLOCKSIZE 64
|
||||
#define SDMMC_DAT_BLOCKSIZE 512
|
||||
#define SDMMC_HMAX_BLOCKNUM 0xFFFF // HW max.
|
||||
#define SDMMC_AMAX_BLOCKNUM 0xF000 // Aligned max.
|
||||
|
||||
extern u32 sd_power_cycle_time_start;
|
||||
|
||||
|
||||
@@ -1008,8 +1008,8 @@ static int _sdmmc_config_sdma(sdmmc_t *sdmmc, u32 *blkcnt_out, const sdmmc_req_t
|
||||
return 0;
|
||||
|
||||
u32 blkcnt = req->num_sectors;
|
||||
if (blkcnt >= 0xFFFF)
|
||||
blkcnt = 0xFFFF;
|
||||
if (blkcnt >= SDMMC_HMAX_BLOCKNUM)
|
||||
blkcnt = SDMMC_HMAX_BLOCKNUM;
|
||||
u32 admaaddr = (u32)req->buf;
|
||||
|
||||
// Check alignment.
|
||||
|
||||
Reference in New Issue
Block a user