mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-25 01:37:22 +00:00
sdmmc: Add erase command-38. Support erase/trim/discard/sanitize
options. Erase command (38) for SD cards allows option for erase/dicard/fule operation at block level and for MMC cards supports option for discard/trim at block level. When Sanitize is executed only the portion of data that was unmapped by a Discard command shall be removed by the Sanitize command. Unit test cases added to verify ERASE feature in SD/SDSPI mode. TRIM/DISCARD/SANITIZE tests for eMMC devices. Closes https://github.com/espressif/esp-idf/pull/7635 Closes https://github.com/espressif/esp-idf/issues/7623
This commit is contained in:
@@ -268,6 +268,7 @@ void sdmmc_card_print_info(FILE* stream, const sdmmc_card_t* card)
|
||||
print_csd = true;
|
||||
} else {
|
||||
type = (card->ocr & SD_OCR_SDHC_CAP) ? "SDHC/SDXC" : "SDSC";
|
||||
print_csd = true;
|
||||
}
|
||||
fprintf(stream, "Type: %s\n", type);
|
||||
if (card->max_freq_khz < 1000) {
|
||||
@@ -280,8 +281,13 @@ void sdmmc_card_print_info(FILE* stream, const sdmmc_card_t* card)
|
||||
|
||||
if (print_csd) {
|
||||
fprintf(stream, "CSD: ver=%d, sector_size=%d, capacity=%d read_bl_len=%d\n",
|
||||
card->csd.csd_ver,
|
||||
(card->is_mmc ? card->csd.csd_ver : card->csd.csd_ver + 1),
|
||||
card->csd.sector_size, card->csd.capacity, card->csd.read_block_len);
|
||||
if (card->is_mmc) {
|
||||
fprintf(stream, "EXT CSD: bus_width=%d\n", (1 << card->log_bus_width));
|
||||
} else if (!card->is_sdio){ // make sure card is SD
|
||||
fprintf(stream, "SSR: bus_width=%d\n", (card->ssr.cur_bus_width ? 4 : 1));
|
||||
}
|
||||
}
|
||||
if (print_scr) {
|
||||
fprintf(stream, "SCR: sd_spec=%d, bus_width=%d\n", card->scr.sd_spec, card->scr.bus_width);
|
||||
|
Reference in New Issue
Block a user