mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
driver/cfi-flash: Add a config option for the page size of CFI flash.
We have added a defconfig configuration to set the page size of the flash. According to the CFI protocol, the flash supports a single write operation with a data volume ranging from byte size up to the maximum number of bytes. However, the MTD device structure requires defining a page size, which serves as the minimum write unit of the flash. Hence, this configuration is introduced. Any page size within the range of 1 to the maximum number of bytes is considered valid. Signed-off-by: jingfei <jingfei@xiaomi.com>
This commit is contained in:
+3
-2
@@ -969,8 +969,9 @@ int cfi_check(FAR struct cfi_dev_s *cfi)
|
||||
|
||||
cfi->cfi_offset = g_cfi_query_address[i];
|
||||
cfi->dev_num = cfi->bankwidth / cfi->dev_width;
|
||||
cfi->page_size = (1 << info->max_write_bytes_num) *
|
||||
cfi->dev_num;
|
||||
cfi->page_size = MIN(CONFIG_MTD_CFI_PAGE_SIZE,
|
||||
(1 << info->max_write_bytes_num) *
|
||||
cfi->dev_num);
|
||||
|
||||
/* fix amd feature */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user