aboutsummaryrefslogtreecommitdiff
path: root/include/mtd
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@foss.st.com>2022-01-04 14:23:59 +0100
committerTom Rini <trini@konsulko.com>2022-01-21 14:01:35 -0500
commit144fef87df7cf29b1ce772a73009e7c16908812b (patch)
tree302ae270518ee8c9c987e654536420085737048a /include/mtd
parent98150e7e8c78b851a7710e18b156f279f8485cbe (diff)
downloadu-boot-144fef87df7cf29b1ce772a73009e7c16908812b.zip
u-boot-144fef87df7cf29b1ce772a73009e7c16908812b.tar.gz
u-boot-144fef87df7cf29b1ce772a73009e7c16908812b.tar.bz2
mtd: cfi: change CONFIG_SYS_MAX_FLASH_BANKS_DETECT as boolean
Prepare migration to Kconfig. CONFIG_SYS_MAX_FLASH_BANKS_DETECT becomes boolean and CONFIG_SYS_MAX_FLASH_BANKS define the MAX size, also used for detection when CONFIG_SYS_MAX_FLASH_BANKS_DETECT=y (CFI_MAX_FLASH_BANKS = CONFIG_SYS_MAX_FLASH_BANKS). CONFIG_SYS_MAX_FLASH_BANKS become mandatory when CONFIG_SYS_MAX_FLASH_BANKS_DETECT is activated. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'include/mtd')
-rw-r--r--include/mtd/cfi_flash.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/mtd/cfi_flash.h b/include/mtd/cfi_flash.h
index d62c8f1..d4aeea7 100644
--- a/include/mtd/cfi_flash.h
+++ b/include/mtd/cfi_flash.h
@@ -158,19 +158,19 @@ struct cfi_pri_hdr {
* cfi_flash_num_flash_banks when CONFIG_SYS_MAX_FLASH_BANKS_DETECT is defined
* or CONFIG_SYS_MAX_FLASH_BANKS
*/
+#define CFI_MAX_FLASH_BANKS 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 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 CFI_FLASH_BANKS CONFIG_SYS_MAX_FLASH_BANKS_DETECT
#endif
-#else
-#define CFI_MAX_FLASH_BANKS CONFIG_SYS_MAX_FLASH_BANKS
+#endif
+/* default when bank detection is not supported */
+#ifndef CFI_FLASH_BANKS
#define CFI_FLASH_BANKS CONFIG_SYS_MAX_FLASH_BANKS
#endif