mirror of
https://github.com/eclipse-threadx/levelx.git
synced 2026-09-14 12:37:01 +08:00
Compare commits
1
Commits
v6.1.8_rel
...
v6.1.9_rel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdf7799991 |
+10
-2
@@ -26,7 +26,7 @@
|
|||||||
/* APPLICATION INTERFACE DEFINITION RELEASE */
|
/* APPLICATION INTERFACE DEFINITION RELEASE */
|
||||||
/* */
|
/* */
|
||||||
/* lx_api.h PORTABLE C */
|
/* lx_api.h PORTABLE C */
|
||||||
/* 6.1.8 */
|
/* 6.1.9 */
|
||||||
/* AUTHOR */
|
/* AUTHOR */
|
||||||
/* */
|
/* */
|
||||||
/* William E. Lamie, Microsoft Corporation */
|
/* William E. Lamie, Microsoft Corporation */
|
||||||
@@ -58,6 +58,10 @@
|
|||||||
/* 08-02-2021 William E. Lamie Modified comment(s), and */
|
/* 08-02-2021 William E. Lamie Modified comment(s), and */
|
||||||
/* updated product constants, */
|
/* updated product constants, */
|
||||||
/* resulting in version 6.1.8 */
|
/* resulting in version 6.1.8 */
|
||||||
|
/* 10-15-2021 Bhupendra Naphade Modified comment(s), */
|
||||||
|
/* updated configuration for */
|
||||||
|
/* nand flash */
|
||||||
|
/* resulting in version 6.1.9 */
|
||||||
/* */
|
/* */
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
|
||||||
@@ -162,7 +166,7 @@ typedef unsigned long long ULONG64;
|
|||||||
#define AZURE_RTOS_LEVELX
|
#define AZURE_RTOS_LEVELX
|
||||||
#define LEVELX_MAJOR_VERSION 6
|
#define LEVELX_MAJOR_VERSION 6
|
||||||
#define LEVELX_MINOR_VERSION 1
|
#define LEVELX_MINOR_VERSION 1
|
||||||
#define LEVELX_PATCH_VERSION 8
|
#define LEVELX_PATCH_VERSION 9
|
||||||
|
|
||||||
|
|
||||||
/* Define general LevelX Constants. */
|
/* Define general LevelX Constants. */
|
||||||
@@ -254,6 +258,10 @@ typedef unsigned long long ULONG64;
|
|||||||
#define LX_NAND_ERASE_COUNT_WRITE_SIZE (nand_flash -> lx_nand_flash_pages_per_block + 1)
|
#define LX_NAND_ERASE_COUNT_WRITE_SIZE (nand_flash -> lx_nand_flash_pages_per_block + 1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef LX_NAND_FLASH_MAPPING_LIST_UPDATE_DISABLE
|
||||||
|
#define LX_NAND_FLASH_MAPPING_LIST_UPDATE_DISABLE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Define the mask for the hash index into the NAND sector mapping cache table. The sector mapping cache is divided
|
/* Define the mask for the hash index into the NAND sector mapping cache table. The sector mapping cache is divided
|
||||||
into 4 entry pieces that are indexed by the formula:
|
into 4 entry pieces that are indexed by the formula:
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
/* FUNCTION RELEASE */
|
/* FUNCTION RELEASE */
|
||||||
/* */
|
/* */
|
||||||
/* _lx_nand_flash_block_obsoleted_check PORTABLE C */
|
/* _lx_nand_flash_block_obsoleted_check PORTABLE C */
|
||||||
/* 6.1.7 */
|
/* 6.1.9 */
|
||||||
/* AUTHOR */
|
/* AUTHOR */
|
||||||
/* */
|
/* */
|
||||||
/* William E. Lamie, Microsoft Corporation */
|
/* William E. Lamie, Microsoft Corporation */
|
||||||
@@ -86,6 +86,10 @@
|
|||||||
/* resulting in version 6.1 */
|
/* resulting in version 6.1 */
|
||||||
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
|
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
|
||||||
/* resulting in version 6.1.7 */
|
/* 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 */
|
||||||
/* */
|
/* */
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
VOID _lx_nand_flash_block_obsoleted_check(LX_NAND_FLASH *nand_flash, ULONG block)
|
VOID _lx_nand_flash_block_obsoleted_check(LX_NAND_FLASH *nand_flash, ULONG block)
|
||||||
@@ -316,22 +320,11 @@ UINT status;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Now store the erase count. */
|
/* Now store the erase count. */
|
||||||
page_word_ptr[0] = (erase_count | LX_BLOCK_ERASED);
|
page_word_ptr[0] = (erase_count);
|
||||||
|
|
||||||
/* Write the erase count for the block. */
|
/* Write the erase count for the block. */
|
||||||
status = _lx_nand_flash_driver_write(nand_flash, block, 0, page_word_ptr, LX_NAND_ERASE_COUNT_WRITE_SIZE);
|
status = _lx_nand_flash_driver_write(nand_flash, block, 0, page_word_ptr, LX_NAND_ERASE_COUNT_WRITE_SIZE);
|
||||||
|
|
||||||
/* Check to see if the write was successful. */
|
|
||||||
if (status == LX_SUCCESS)
|
|
||||||
{
|
|
||||||
|
|
||||||
/* Now store the erase count. */
|
|
||||||
page_word_ptr[0] = erase_count;
|
|
||||||
|
|
||||||
/* Write the 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. */
|
/* Check for an error from flash driver. */
|
||||||
if (status)
|
if (status)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
/* FUNCTION RELEASE */
|
/* FUNCTION RELEASE */
|
||||||
/* */
|
/* */
|
||||||
/* _lx_nand_flash_block_reclaim PORTABLE C */
|
/* _lx_nand_flash_block_reclaim PORTABLE C */
|
||||||
/* 6.1.8 */
|
/* 6.1.9 */
|
||||||
/* AUTHOR */
|
/* AUTHOR */
|
||||||
/* */
|
/* */
|
||||||
/* William E. Lamie, Microsoft Corporation */
|
/* William E. Lamie, Microsoft Corporation */
|
||||||
@@ -91,6 +91,10 @@
|
|||||||
/* 08-02-2021 Bhupendra Naphade Modified comment(s), updated */
|
/* 08-02-2021 Bhupendra Naphade Modified comment(s), updated */
|
||||||
/* obselete page count check, */
|
/* obselete page count check, */
|
||||||
/* resulting in version 6.1.8 */
|
/* resulting in version 6.1.8 */
|
||||||
|
/* 10-15-2021 Bhupendra Naphade Modified comment(s), */
|
||||||
|
/* removed multiple write */
|
||||||
|
/* to page 0, */
|
||||||
|
/* resulting in version 6.1.9 */
|
||||||
/* */
|
/* */
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
UINT _lx_nand_flash_block_reclaim(LX_NAND_FLASH *nand_flash)
|
UINT _lx_nand_flash_block_reclaim(LX_NAND_FLASH *nand_flash)
|
||||||
@@ -218,22 +222,11 @@ UINT status;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Now store the erase count. */
|
/* Now store the erase count. */
|
||||||
page_word_ptr[0] = (erase_count | LX_BLOCK_ERASED);
|
page_word_ptr[0] = (erase_count);
|
||||||
|
|
||||||
/* Write the erase count for the block. */
|
/* Write the erase count for the block. */
|
||||||
status = _lx_nand_flash_driver_write(nand_flash, erase_block, 0, page_word_ptr, LX_NAND_ERASE_COUNT_WRITE_SIZE);
|
status = _lx_nand_flash_driver_write(nand_flash, erase_block, 0, page_word_ptr, LX_NAND_ERASE_COUNT_WRITE_SIZE);
|
||||||
|
|
||||||
/* Check the status. */
|
|
||||||
if (status == LX_SUCCESS)
|
|
||||||
{
|
|
||||||
|
|
||||||
/* Now store the erase count. */
|
|
||||||
page_word_ptr[0] = erase_count;
|
|
||||||
|
|
||||||
/* Write the erase count for the block. */
|
|
||||||
status = _lx_nand_flash_driver_write(nand_flash, erase_block, 0, page_word_ptr, LX_NAND_ERASE_COUNT_WRITE_SIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check for an error from flash driver. */
|
/* Check for an error from flash driver. */
|
||||||
if (status)
|
if (status)
|
||||||
{
|
{
|
||||||
@@ -578,22 +571,11 @@ UINT status;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Now store the erase count. */
|
/* Now store the erase count. */
|
||||||
page_word_ptr[0] = (erase_count | LX_BLOCK_ERASED);
|
page_word_ptr[0] = (erase_count);
|
||||||
|
|
||||||
/* Write the erase count for the block. */
|
/* Write the erase count for the block. */
|
||||||
status = _lx_nand_flash_driver_write(nand_flash, erase_block, 0, page_word_ptr, LX_NAND_ERASE_COUNT_WRITE_SIZE);
|
status = _lx_nand_flash_driver_write(nand_flash, erase_block, 0, page_word_ptr, LX_NAND_ERASE_COUNT_WRITE_SIZE);
|
||||||
|
|
||||||
/* Determine if the write was successful. */
|
|
||||||
if (status == LX_SUCCESS)
|
|
||||||
{
|
|
||||||
|
|
||||||
/* Now store the erase count. */
|
|
||||||
page_word_ptr[0] = erase_count;
|
|
||||||
|
|
||||||
/* Write the erase count for the block. */
|
|
||||||
status = _lx_nand_flash_driver_write(nand_flash, erase_block, 0, page_word_ptr, LX_NAND_ERASE_COUNT_WRITE_SIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check for an error from flash driver. */
|
/* Check for an error from flash driver. */
|
||||||
if (status)
|
if (status)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
/* FUNCTION RELEASE */
|
/* FUNCTION RELEASE */
|
||||||
/* */
|
/* */
|
||||||
/* _lx_nand_flash_open PORTABLE C */
|
/* _lx_nand_flash_open PORTABLE C */
|
||||||
/* 6.1.7 */
|
/* 6.1.9 */
|
||||||
/* AUTHOR */
|
/* AUTHOR */
|
||||||
/* */
|
/* */
|
||||||
/* William E. Lamie, Microsoft Corporation */
|
/* William E. Lamie, Microsoft Corporation */
|
||||||
@@ -94,6 +94,10 @@
|
|||||||
/* resulting in version 6.1 */
|
/* resulting in version 6.1 */
|
||||||
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
|
/* 06-02-2021 Bhupendra Naphade Modified comment(s), */
|
||||||
/* resulting in version 6.1.7 */
|
/* 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 *))
|
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. */
|
/* 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. */
|
/* 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);
|
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. */
|
/* Check for an error from flash driver. */
|
||||||
if (status)
|
if (status)
|
||||||
{
|
{
|
||||||
@@ -498,18 +491,9 @@ LX_INTERRUPT_SAVE_AREA
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write the initial erase count for the block. */
|
/* Write the final erase count for the block. */
|
||||||
page_word_ptr[0] = (max_erased_count | LX_BLOCK_ERASED);
|
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);
|
status = _lx_nand_flash_driver_write(nand_flash, block, 0, page_word_ptr, 1);
|
||||||
|
|
||||||
/* 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. */
|
/* Check for an error from flash driver. */
|
||||||
if (status)
|
if (status)
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
#define EXTRA_BYTE_POSITION 2 /* 2 is the extra bytes starting byte postion */
|
#define EXTRA_BYTE_POSITION 2 /* 2 is the extra bytes starting byte postion */
|
||||||
#define ECC_BYTE_POSITION 40 /* 40 is the ECC starting byte position */
|
#define ECC_BYTE_POSITION 40 /* 40 is the ECC starting byte position */
|
||||||
|
|
||||||
|
|
||||||
/* Definition of the spare area is relative to the block size of the NAND part and perhaps manufactures of the NAND part.
|
/* Definition of the spare area is relative to the block size of the NAND part and perhaps manufactures of the NAND part.
|
||||||
Here are some common definitions:
|
Here are some common definitions:
|
||||||
|
|
||||||
@@ -169,7 +168,13 @@ UINT _lx_nand_flash_simulator_write(ULONG block, ULONG page, ULONG *source, ULO
|
|||||||
{
|
{
|
||||||
|
|
||||||
ULONG *flash_address;
|
ULONG *flash_address;
|
||||||
|
UCHAR *flash_spare_address;
|
||||||
|
UINT bytes_computed;
|
||||||
|
UINT ecc_bytes =0;
|
||||||
|
UCHAR new_ecc_buffer[24];
|
||||||
|
UCHAR *new_ecc_buffer_ptr = new_ecc_buffer;
|
||||||
|
UCHAR *ecc_buffer_ptr = new_ecc_buffer_ptr;
|
||||||
|
ULONG *page_ptr = &(nand_memory_area[block].physical_pages[page].memory[0]);
|
||||||
|
|
||||||
/* Increment the diag info. */
|
/* Increment the diag info. */
|
||||||
nand_block_diag[block].page_writes[page]++;
|
nand_block_diag[block].page_writes[page]++;
|
||||||
@@ -192,6 +197,41 @@ ULONG *flash_address;
|
|||||||
*flash_address++ = *source++;
|
*flash_address++ = *source++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Loop to compute the ECC over the entire NAND flash page. */
|
||||||
|
bytes_computed = 0;
|
||||||
|
|
||||||
|
while (bytes_computed < BYTES_PER_PHYSICAL_PAGE)
|
||||||
|
{
|
||||||
|
|
||||||
|
/* Compute the ECC for this 256 byte piece of the page. */
|
||||||
|
_lx_nand_flash_256byte_ecc_compute((UCHAR *)page_ptr, (UCHAR *)new_ecc_buffer_ptr);
|
||||||
|
|
||||||
|
/* Move to the next 256 byte portion of the page. */
|
||||||
|
bytes_computed = bytes_computed + 256;
|
||||||
|
|
||||||
|
/* Move the page buffer forward. */
|
||||||
|
page_ptr = page_ptr + 256;
|
||||||
|
|
||||||
|
ecc_bytes = ecc_bytes + 3;
|
||||||
|
|
||||||
|
/* Move the ECC buffer forward, note there are 3 bytes of ECC per page. */
|
||||||
|
new_ecc_buffer_ptr = new_ecc_buffer_ptr + 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Setup destination pointer in the spare area. */
|
||||||
|
flash_spare_address = (UCHAR *) &(nand_memory_area[block].physical_pages[page].spare[ECC_BYTE_POSITION]);
|
||||||
|
while(ecc_bytes--)
|
||||||
|
{
|
||||||
|
|
||||||
|
/* Can the word be written? We can clear new bits, but just can't unclear
|
||||||
|
in a NAND device. */
|
||||||
|
if ((*ecc_buffer_ptr & *flash_spare_address) != *ecc_buffer_ptr)
|
||||||
|
return(LX_INVALID_WRITE);
|
||||||
|
|
||||||
|
/* Set an ecc byte in the spare area. */
|
||||||
|
*flash_spare_address++ = *ecc_buffer_ptr++;
|
||||||
|
|
||||||
|
}
|
||||||
return(LX_SUCCESS);
|
return(LX_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
/* FUNCTION RELEASE */
|
/* FUNCTION RELEASE */
|
||||||
/* */
|
/* */
|
||||||
/* _lx_nor_flash_extended_cache_enable PORTABLE C */
|
/* _lx_nor_flash_extended_cache_enable PORTABLE C */
|
||||||
/* 6.1.7 */
|
/* 6.1.9 */
|
||||||
/* AUTHOR */
|
/* AUTHOR */
|
||||||
/* */
|
/* */
|
||||||
/* William E. Lamie, Microsoft Corporation */
|
/* William E. Lamie, Microsoft Corporation */
|
||||||
@@ -80,6 +80,10 @@
|
|||||||
/* 06-02-2021 Bhupendra Naphade Modified comment(s), and */
|
/* 06-02-2021 Bhupendra Naphade Modified comment(s), and */
|
||||||
/* updated product constants */
|
/* updated product constants */
|
||||||
/* resulting in version 6.1.7 */
|
/* resulting in version 6.1.7 */
|
||||||
|
/* 10-15-2021 Bhupendra Naphade Modified comment(s), and */
|
||||||
|
/* added check for out of */
|
||||||
|
/* bound memory access, */
|
||||||
|
/* resulting in version 6.1.9 */
|
||||||
/* */
|
/* */
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
UINT _lx_nor_flash_extended_cache_enable(LX_NOR_FLASH *nor_flash, VOID *memory, ULONG size)
|
UINT _lx_nor_flash_extended_cache_enable(LX_NOR_FLASH *nor_flash, VOID *memory, ULONG size)
|
||||||
@@ -135,7 +139,16 @@ ULONG *cache_memory;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Save the number of cache entries. */
|
/* Save the number of cache entries. */
|
||||||
nor_flash -> lx_nor_flash_extended_cache_entries = i;
|
if(i > LX_NOR_EXTENDED_CACHE_SIZE)
|
||||||
|
{
|
||||||
|
|
||||||
|
nor_flash -> lx_nor_flash_extended_cache_entries = LX_NOR_EXTENDED_CACHE_SIZE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
nor_flash -> lx_nor_flash_extended_cache_entries = i;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef LX_THREAD_SAFE_ENABLE
|
#ifdef LX_THREAD_SAFE_ENABLE
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user