M module-bsp/board/rt1051/bsp/eMMC/fsl_mmc.c => module-bsp/board/rt1051/bsp/eMMC/fsl_mmc.c +2 -25
@@ 1865,11 1865,7 @@ static status_t MMC_Write(
}
/* Wait for the card's buffer to be not full to write to improve the write performance. */
- error = MMC_PollingCardStatusBusy(card);
- if(kStatus_Success != error)
- {
- return error;
- }
+ while ((GET_SDMMCHOST_STATUS(card->host.base) & CARD_DATA0_STATUS_MASK) != CARD_DATA0_NOT_BUSY) {}
/* Wait for the card write process complete */
if (kStatus_Success != MMC_WaitWriteComplete(card)) {
@@ 2268,11 2264,7 @@ status_t MMC_EraseGroups(mmc_card_t *card, uint32_t startGroup, uint32_t endGrou
}
/* Wait for the card's buffer to be not full to write to improve the write performance. */
- status_t error = MMC_PollingCardStatusBusy(card);
- if(kStatus_Success != error)
- {
- return error;
- }
+ while ((GET_SDMMCHOST_STATUS(card->host.base) & CARD_DATA0_STATUS_MASK) != CARD_DATA0_NOT_BUSY) {}
if (kStatus_Success != MMC_WaitWriteComplete(card)) {
return kStatus_SDMMC_WaitWriteCompleteFailed;
@@ 2639,18 2631,3 @@ status_t MMC_StopBoot(mmc_card_t *card, uint32_t bootMode)
return kStatus_Success;
}
-
-status_t MMC_PollingCardStatusBusy(mmc_card_t *card)
-{
- int retries = 0;
- const int maxRetries = 10000;
- do {
- if ((GET_SDMMCHOST_STATUS(card->host.base) & CARD_DATA0_STATUS_MASK) == CARD_DATA0_NOT_BUSY) {
- return kStatus_Success;
- }
- // yeld
- SDMMCHOST_Delay(0);
- } while (retries++ < maxRetries);
-
- return kStatus_SDMMC_PollingCardIdleFailed;
-}
M module-bsp/board/rt1051/bsp/eMMC/fsl_mmc.h => module-bsp/board/rt1051/bsp/eMMC/fsl_mmc.h +0 -12
@@ 356,18 356,6 @@ extern "C"
*/
status_t MMC_SetMaxEraseUnitSize(mmc_card_t *card);
- /*!
- * @brief Polling card idle status.
- *
- * This function can be used to poll the status from busy to idle.
- *
- * @param card Card descriptor.
- *
- * @retval kStatus_SDMMC_TransferFailed Command tranfer failed.
- * @retval kStatus_Success Operate successfully.
- */
- status_t MMC_PollingCardStatusBusy(mmc_card_t *card);
-
/* @} */
#if defined(__cplusplus)
}
M module-bsp/board/rt1051/bsp/eMMC/fsl_sdmmc_common.h => module-bsp/board/rt1051/bsp/eMMC/fsl_sdmmc_common.h +0 -1
@@ 124,7 124,6 @@ enum _sdmmc_status
kStatus_SDMMC_CardDetectFailed = MAKE_STATUS(kStatusGroup_SDMMC, 39U), /*!< card detect failed */
kStatus_SDMMC_PartitioningFailed = MAKE_STATUS(kStatusGroup_SDMMC, 40U), /*!< Partitioning failed */
kStatus_SDMMC_PartitioningNotSupported = MAKE_STATUS(kStatusGroup_SDMMC, 41U), /*!< Partitioning not supported */
- kStatus_SDMMC_PollingCardIdleFailed = MAKE_STATUS(kStatusGroup_SDMMC, 42U), /*!< polling card idle status failed */
};
/*! @brief card operation voltage */
M module-platform/rt1051/src/disk_emmc.cpp => module-platform/rt1051/src/disk_emmc.cpp +2 -3
@@ 105,9 105,8 @@ namespace purefs::blkdev
return statusBlkDevFail;
}
// Wait for the card's buffer to become empty
- auto error = MMC_PollingCardStatusBusy(mmcCard.get());
- if (kStatus_Success != error) {
- return error;
+ while ((GET_SDMMCHOST_STATUS(mmcCard->host.base) & CARD_DATA0_STATUS_MASK) != CARD_DATA0_NOT_BUSY) {
+ taskYIELD();
}
if (pmState == pm_state::suspend) {
driverUSDHC->Enable();