mirror of
https://github.com/eclipse-threadx/levelx.git
synced 2026-09-14 12:37:01 +08:00
Update on 18 Jan 2023. Expand to see details.
22299de Remove internal deprecated files. 2b9332f Fix ECC issues by new NAND logic 6a5eda1 Add a notice for not released file. b756fb0 Upgrade to the latest Container Images.
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _lx_nand_flash_driver_block_erase PORTABLE C */
|
||||
/* 6.1.7 */
|
||||
/* 6.x */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -76,58 +76,17 @@
|
||||
/* resulting in version 6.1 */
|
||||
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
|
||||
/* resulting in version 6.1.7 */
|
||||
/* xx-xx-xxxx Xiuwen Cai Modified comment(s), */
|
||||
/* removed cache support, */
|
||||
/* resulting in version 6.x */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _lx_nand_flash_driver_block_erase(LX_NAND_FLASH *nand_flash, ULONG block, ULONG erase_count)
|
||||
{
|
||||
|
||||
ULONG cache_index;
|
||||
ULONG i;
|
||||
UINT status;
|
||||
|
||||
|
||||
/* Determine if the block status cache is enabled. */
|
||||
if (nand_flash -> lx_nand_flash_block_status_cache != LX_NULL)
|
||||
{
|
||||
|
||||
/* Save the block status value in the cache. */
|
||||
nand_flash -> lx_nand_flash_block_status_cache[block] = 0xFF;
|
||||
}
|
||||
|
||||
/* Determine if the page extra byte cache is enabled. */
|
||||
if (nand_flash -> lx_nand_flash_page_extra_bytes_cache != LX_NULL)
|
||||
{
|
||||
|
||||
/* Calculate the cache index. */
|
||||
cache_index = (block * nand_flash -> lx_nand_flash_pages_per_block);
|
||||
|
||||
/* Loop to clear the entries in the page extra bytes cache. */
|
||||
for (i = 0; i < nand_flash -> lx_nand_flash_pages_per_block; i++)
|
||||
{
|
||||
|
||||
/* Clear each cache entry. */
|
||||
nand_flash -> lx_nand_flash_page_extra_bytes_cache[cache_index+i].lx_nand_page_extra_info_logical_sector = (ULONG) 0xFFFFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
/* Determine if the page 0 cache is enabled. */
|
||||
if (nand_flash -> lx_nand_flash_page_0_cache != LX_NULL)
|
||||
{
|
||||
|
||||
/* Yes, the page 0 cache is enabled. */
|
||||
|
||||
/* Build index to page 0 cache. */
|
||||
cache_index = block * (nand_flash -> lx_nand_flash_pages_per_block + 1);
|
||||
|
||||
/* Clear the associated page 0 cache. */
|
||||
for (i = 0; i < (nand_flash -> lx_nand_flash_pages_per_block + 1); i++)
|
||||
{
|
||||
|
||||
/* Clear each cache entry. */
|
||||
nand_flash -> lx_nand_flash_page_0_cache[cache_index+i] = (ULONG) 0xFFFFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
/* Increment the block erases count. */
|
||||
nand_flash -> lx_nand_flash_diagnostic_block_erases++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user