|
|
@@ -40,7 +40,7 @@
|
|
|
/* FUNCTION RELEASE */
|
|
|
/* */
|
|
|
/* _lx_nand_flash_open PORTABLE C */
|
|
|
-/* 6.1.7 */
|
|
|
+/* 6.1.9 */
|
|
|
/* AUTHOR */
|
|
|
/* */
|
|
|
/* William E. Lamie, Microsoft Corporation */
|
|
|
@@ -94,6 +94,10 @@
|
|
|
/* resulting in version 6.1 */
|
|
|
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
|
|
|
/* resulting in version 6.1.7 */
|
|
|
+/* 10-15-2021 Bhupendra Naphade Modified comment(s), */
|
|
|
+/* removed multiple write */
|
|
|
+/* to page 0, */
|
|
|
+/* resulting in version 6.1.9 */
|
|
|
/* */
|
|
|
/**************************************************************************/
|
|
|
UINT _lx_nand_flash_open(LX_NAND_FLASH *nand_flash, CHAR *name, UINT (*nand_driver_initialize)(LX_NAND_FLASH *))
|
|
|
@@ -282,22 +286,11 @@ LX_INTERRUPT_SAVE_AREA
|
|
|
}
|
|
|
|
|
|
/* Setup the initial erase count to 1. */
|
|
|
- page_word_ptr[0] = (((ULONG) 1) | LX_BLOCK_ERASED);
|
|
|
+ page_word_ptr[0] = (((ULONG) 1));
|
|
|
|
|
|
/* Write the initial erase count for the block. */
|
|
|
status = _lx_nand_flash_driver_write(nand_flash, block, 0, page_word_ptr, LX_NAND_ERASE_COUNT_WRITE_SIZE);
|
|
|
|
|
|
- /* Check for status after the block erase. */
|
|
|
- if (status == LX_SUCCESS)
|
|
|
- {
|
|
|
-
|
|
|
- /* Setup the initial erase count to 1. */
|
|
|
- page_word_ptr[0] = ((ULONG) 1);
|
|
|
-
|
|
|
- /* Write the initial erase count for the block. */
|
|
|
- status = _lx_nand_flash_driver_write(nand_flash, block, 0, page_word_ptr, LX_NAND_ERASE_COUNT_WRITE_SIZE);
|
|
|
- }
|
|
|
-
|
|
|
/* Check for an error from flash driver. */
|
|
|
if (status)
|
|
|
{
|
|
|
@@ -497,20 +490,11 @@ LX_INTERRUPT_SAVE_AREA
|
|
|
/* Continue with next block. */
|
|
|
continue;
|
|
|
}
|
|
|
+
|
|
|
+ /* Write the final erase count for the block. */
|
|
|
+ page_word_ptr[0] = max_erased_count;
|
|
|
+ status = _lx_nand_flash_driver_write(nand_flash, block, 0, page_word_ptr, 1);
|
|
|
|
|
|
- /* Write the initial erase count for the block. */
|
|
|
- page_word_ptr[0] = (max_erased_count | LX_BLOCK_ERASED);
|
|
|
- status = _lx_nand_flash_driver_write(nand_flash, block, 0, page_word_ptr, LX_NAND_ERASE_COUNT_WRITE_SIZE);
|
|
|
-
|
|
|
- /* Determine if the write was successful. */
|
|
|
- if (status == LX_SUCCESS)
|
|
|
- {
|
|
|
-
|
|
|
- /* Write the initial erase count for the block. */
|
|
|
- page_word_ptr[0] = max_erased_count;
|
|
|
- status = _lx_nand_flash_driver_write(nand_flash, block, 0, page_word_ptr, LX_NAND_ERASE_COUNT_WRITE_SIZE);
|
|
|
- }
|
|
|
-
|
|
|
/* Check for an error from flash driver. */
|
|
|
if (status)
|
|
|
{
|