From 2f57139c211d193debddd25f45c02b738cefd871 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Fri, 13 May 2022 09:18:27 -0400 Subject: Convert CONFIG_SYS_FLASH_CFI_WIDTH to Kconfig This converts the following to Kconfig: CONFIG_SYS_FLASH_CFI_WIDTH Signed-off-by: Tom Rini --- drivers/mtd/Kconfig | 29 +++++++++++++++++++++++++++++ drivers/mtd/cfi_flash.c | 7 ------- 2 files changed, 29 insertions(+), 7 deletions(-) (limited to 'drivers') diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig index 4088267dd11..c3f5455347e 100644 --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig @@ -48,6 +48,35 @@ config FLASH_CFI_DRIVER option. Visit for more information on CFI. +choice + prompt "Data-width of the flash device" + depends on FLASH_CFI_DRIVER + default SYS_FLASH_CFI_WIDTH_8BIT + +config SYS_FLASH_CFI_WIDTH_8BIT + bool "Data-width of the device is 8-bit" + +config SYS_FLASH_CFI_WIDTH_16BIT + bool "Data-width of the device is 16-bit" + +config SYS_FLASH_CFI_WIDTH_32BIT + bool "Data-width of the device is 32-bit" + +config SYS_FLASH_CFI_WIDTH_64BIT + bool "Data-width of the device is 64-bit" + +endchoice + +config SYS_FLASH_CFI_WIDTH + hex + depends on FLASH_CFI_DRIVER + default 0x1 if SYS_FLASH_CFI_WIDTH_8BIT + default 0x2 if SYS_FLASH_CFI_WIDTH_16BIT + default 0x4 if SYS_FLASH_CFI_WIDTH_32BIT + default 0x8 if SYS_FLASH_CFI_WIDTH_64BIT + help + This must be kept in sync with the table in include/flash.h + config CFI_FLASH bool "Enable Driver Model for CFI Flash driver" depends on DM_MTD diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index aae3ea0d1b4..49504107065 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -68,13 +68,6 @@ static uint flash_verbose = 1; flash_info_t flash_info[CFI_MAX_FLASH_BANKS]; /* FLASH chips info */ -/* - * Check if chip width is defined. If not, start detecting with 8bit. - */ -#ifndef CONFIG_SYS_FLASH_CFI_WIDTH -#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_8BIT -#endif - #ifdef CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS #define __maybe_weak __weak #else -- cgit v1.2.3