summaryrefslogtreecommitdiff
path: root/components/fal/src
diff options
context:
space:
mode:
authorguo <[email protected]>2023-11-13 22:49:16 +0800
committerGitHub <[email protected]>2023-11-13 22:49:16 +0800
commit6d7e393ce9d30388c4edba2fa0306b9ac1cf230a (patch)
tree53b1219d9a15976d627e9d613d1420ce8cb6e003 /components/fal/src
parent3aa19af30120341a4344d69f8bd500682db2b8c5 (diff)
[fal] Add blocks mechanism to fal. (#8252)
Diffstat (limited to 'components/fal/src')
-rw-r--r--components/fal/src/fal_flash.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/components/fal/src/fal_flash.c b/components/fal/src/fal_flash.c
index 8cef82c2bb..b0ca60f0c9 100644
--- a/components/fal/src/fal_flash.c
+++ b/components/fal/src/fal_flash.c
@@ -27,7 +27,7 @@ static uint8_t init_ok = 0;
*/
int fal_flash_init(void)
{
- size_t i;
+ size_t i, j, offset;
if (init_ok)
{
@@ -47,6 +47,17 @@ int fal_flash_init(void)
log_d("Flash device | %*.*s | addr: 0x%08lx | len: 0x%08x | blk_size: 0x%08x |initialized finish.",
FAL_DEV_NAME_MAX, FAL_DEV_NAME_MAX, device_table[i]->name, device_table[i]->addr, device_table[i]->len,
device_table[i]->blk_size);
+ offset = 0;
+ for (j = 0; j < FAL_DEV_BLK_MAX; j ++)
+ {
+ const struct flash_blk *blk = &device_table[i]->blocks[j];
+ size_t blk_len = blk->count * blk->size;
+ if (blk->count == 0 || blk->size == 0)
+ break;
+ log_d(" blk%2d | addr: 0x%08lx | len: 0x%08x | blk_size: 0x%08x |initialized finish.",
+ j, device_table[i]->addr + offset, blk_len, blk->size);
+ offset += blk_len;
+ }
}
init_ok = 1;