void cmd_vfl_erase(int argc, char** argv) { int count; if(argc < 2) { bufferPrintf("Usage: %s <block> [count]\r\n", argv[0]); return; } if(argc < 3) { count = 1; } else { count = parseNumber(argv[2]); } uint32_t block = parseNumber(argv[1]); uint32_t firstBlock = block; for(; block < (firstBlock + count); block++) { bufferPrintf("VFL_Erase(%d): %x\r\n", block, VFL_Erase(block)); } }
// Format FTL layer // You must close FTL layer FTL_Close() BOOL32 WMR_Format_FTL(void) { UINT32 nBlock; UINT32 pTotalScts; WMR_UTIL_LOG((TEXT("[WMR ] ++WMR_Format_FTL()\r\n"))); #if 0 if (FTL_Close() == FTL_SUCCESS) { WMR_UTIL_LOG((TEXT("[WMR ] WMR_Format_FTL() : FTL_Close() Success\r\n"))); } else { WMR_UTIL_ERR((TEXT("[WMR:ERR] WMR_Format_FTL() : FTL_Close() Failure\r\n"))); return FALSE32; } #endif for (nBlock=FTL_INFO_SECTION_START; nBlock<SUBLKS_TOTAL; nBlock++) { if (VFL_Erase(nBlock) != VFL_SUCCESS) { WMR_UTIL_ERR((TEXT("[WMR:ERR] WMR_Format_FTL() : VFL_Erase() Failure @ Virtual Block %d\r\n"), nBlock)); } } WMR_UTIL_INF((TEXT("[WMR:INF] WMR_Format_FTL() : All Virtual Block Erased (VFL) !!!\r\n"))); if (FTL_Init() == FTL_SUCCESS) { WMR_UTIL_INF((TEXT("[WMR:INF] WMR_Format_FTL() : FTL_Init() Success\r\n"))); } else { WMR_UTIL_ERR((TEXT("[WMR:ERR] WMR_Format_FTL() : FTL_Init() Failure\r\n"))); return FALSE32; } if (FTL_Format() == FTL_SUCCESS) { WMR_UTIL_INF((TEXT("[WMR:INF] WMR_Format_FTL() : FTL_Format() Success\r\n"))); } else { WMR_UTIL_ERR((TEXT("[WMR:ERR] WMR_Format_FTL() : FTL_Format() Failure\r\n"))); return FALSE32; } WMR_UTIL_LOG((TEXT("[WMR ] --WMR_Format_FTL()\r\n"))); if (FTL_Open(&pTotalScts) == FTL_SUCCESS) { WMR_UTIL_INF((TEXT("[WMR:INF] WMR_Format_FTL() : FTL_Open() Success\r\n"))); } else { WMR_UTIL_ERR((TEXT("[WMR:ERR] WMR_Format_FTL() : FTL_Open() Failure\r\n"))); return FALSE32; } WMR_UTIL_LOG((TEXT("[WMR ] --WMR_Format_FTL()\r\n"))); return TRUE32; }