aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@foss.st.com>2022-01-04 14:23:58 +0100
committerTom Rini <trini@konsulko.com>2022-01-21 14:01:35 -0500
commit98150e7e8c78b851a7710e18b156f279f8485cbe (patch)
tree82c493969d61e48171c439e866148e96e7d8eb71 /include
parentc8363b12b26d7ef990fe00ca92071c3a26f70396 (diff)
downloadu-boot-98150e7e8c78b851a7710e18b156f279f8485cbe.zip
u-boot-98150e7e8c78b851a7710e18b156f279f8485cbe.tar.gz
u-boot-98150e7e8c78b851a7710e18b156f279f8485cbe.tar.bz2
mtd: cfi: introduce CFI_FLASH_BANKS
Replace CONFIG_SYS_MAX_FLASH_BANKS by CFI_FLASH_BANKS to prepare Kconfig migration and avoid to redefine CONFIG_SYS_MAX_FLASH_BANKS in cfi_flash.h. After this patch CONFIG_SYS_MAX_FLASH_BANKS should be never used in the cfi code: use CFI_MAX_FLASH_BANKS for struct size or CFI_FLASH_BANKS for number of CFI banks which can be dynamic. This patch modify all the files which include mtd/cfi_flash.h. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'include')
-rw-r--r--include/mtd/cfi_flash.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/mtd/cfi_flash.h b/include/mtd/cfi_flash.h
index a1af6fc..d62c8f1 100644
--- a/include/mtd/cfi_flash.h
+++ b/include/mtd/cfi_flash.h
@@ -154,21 +154,24 @@ struct cfi_pri_hdr {
/*
* CFI_MAX_FLASH_BANKS only used for flash_info struct declaration.
*
- * Use CONFIG_SYS_MAX_FLASH_BANKS_DETECT if defined
+ * CFI_FLASH_BANKS selects the correct number of available banks =
+ * cfi_flash_num_flash_banks when CONFIG_SYS_MAX_FLASH_BANKS_DETECT is defined
+ * or CONFIG_SYS_MAX_FLASH_BANKS
*/
#if defined(CONFIG_SYS_MAX_FLASH_BANKS_DETECT)
#define CFI_MAX_FLASH_BANKS CONFIG_SYS_MAX_FLASH_BANKS_DETECT
/* map to cfi_flash_num_flash_banks only when supported */
#if IS_ENABLED(CONFIG_FLASH_CFI_DRIVER) && \
(!IS_ENABLED(CONFIG_SPL_BUILD) || IS_ENABLED(CONFIG_SPL_MTD_SUPPORT))
-#define CONFIG_SYS_MAX_FLASH_BANKS (cfi_flash_num_flash_banks)
+#define CFI_FLASH_BANKS (cfi_flash_num_flash_banks)
/* board code can update this variable before CFI detection */
extern int cfi_flash_num_flash_banks;
#else
-#define CONFIG_SYS_MAX_FLASH_BANKS CONFIG_SYS_MAX_FLASH_BANKS_DETECT
+#define CFI_FLASH_BANKS CONFIG_SYS_MAX_FLASH_BANKS_DETECT
#endif
#else
#define CFI_MAX_FLASH_BANKS CONFIG_SYS_MAX_FLASH_BANKS
+#define CFI_FLASH_BANKS CONFIG_SYS_MAX_FLASH_BANKS
#endif
phys_addr_t cfi_flash_bank_addr(int i);