Re: [PATCH v1 3/5] mtd: cfi: change CONFIG_SYS_MAX_FLASH_BANKS_DETECT as boolean

2022-01-21 Thread Tom Rini
On Tue, Jan 04, 2022 at 02:23:59PM +0100, Patrick Delaunay wrote:

> 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 
> Reviewed-by: Stefan Roese 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v1 3/5] mtd: cfi: change CONFIG_SYS_MAX_FLASH_BANKS_DETECT as boolean

2022-01-05 Thread Stefan Roese

On 1/4/22 14:23, Patrick Delaunay wrote:

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 


Reviewed-by: Stefan Roese 

Thanks,
Stefan


---

Changes in v1:
- solve issue in cfi_flash.h, with
   CFI_FLASH_BANKS=CONFIG_SYS_MAX_FLASH_BANKS_DETECT

  drivers/mtd/cfi_flash.c  |  2 +-
  include/configs/3c120_devboard.h |  3 ++-
  include/configs/adp-ae3xx.h  |  4 +---
  include/configs/adp-ag101p.h |  2 --
  include/configs/ax25-ae350.h |  4 +---
  include/configs/bmips_bcm6338.h  |  3 ++-
  include/configs/bmips_bcm6348.h  |  3 ++-
  include/configs/bmips_bcm6358.h  |  3 ++-
  include/configs/bmips_bcm6368.h  |  3 ++-
  include/configs/boston.h |  4 +++-
  include/configs/draak.h  |  3 ++-
  include/configs/ebisu.h  |  3 ++-
  include/configs/j721e_evm.h  |  3 ++-
  include/configs/mccmon6.h|  3 ++-
  include/configs/qemu-arm.h   |  3 ++-
  include/configs/salvator-x.h |  3 ++-
  include/configs/ulcb.h   |  3 ++-
  include/mtd/cfi_flash.h  | 10 +-
  18 files changed, 35 insertions(+), 27 deletions(-)

diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 71cefc125f..aae3ea0d1b 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -96,7 +96,7 @@ static u16 cfi_flash_config_reg(int i)
  }
  
  #if defined(CONFIG_SYS_MAX_FLASH_BANKS_DETECT)

-int cfi_flash_num_flash_banks = CONFIG_SYS_MAX_FLASH_BANKS_DETECT;
+int cfi_flash_num_flash_banks = CFI_MAX_FLASH_BANKS;
  #else
  int cfi_flash_num_flash_banks;
  #endif
diff --git a/include/configs/3c120_devboard.h b/include/configs/3c120_devboard.h
index f7ad7efb0d..e52fedcf39 100644
--- a/include/configs/3c120_devboard.h
+++ b/include/configs/3c120_devboard.h
@@ -20,7 +20,8 @@
   * CFI Flash
   */
  #define CONFIG_SYS_CFI_FLASH_STATUS_POLL /* fix amd flash issue */
-#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT  1
+#define CONFIG_SYS_MAX_FLASH_BANKS 1
+#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT
  #define CONFIG_SYS_MAX_FLASH_SECT 512
  
  /*

diff --git a/include/configs/adp-ae3xx.h b/include/configs/adp-ae3xx.h
index 58e8526048..11eff3852d 100644
--- a/include/configs/adp-ae3xx.h
+++ b/include/configs/adp-ae3xx.h
@@ -156,7 +156,7 @@
  
  /* support JEDEC */

  #ifdef CONFIG_CFI_FLASH
-#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT  1
+#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT
  #endif
  
  /* Do not use CONFIG_FLASH_CFI_LEGACY to detect on board flash */

@@ -173,9 +173,7 @@
   * There are 4 banks supported for this Controller,
   * but we have only 1 bank connected to flash on board
   */
-#ifndef CONFIG_SYS_MAX_FLASH_BANKS_DETECT
  #define CONFIG_SYS_MAX_FLASH_BANKS1
-#endif
  #define CONFIG_SYS_FLASH_BANKS_SIZES {0x400}
  
  /* max number of sectors on one chip */

diff --git a/include/configs/adp-ag101p.h b/include/configs/adp-ag101p.h
index 1022764985..31ef30adc6 100644
--- a/include/configs/adp-ag101p.h
+++ b/include/configs/adp-ag101p.h
@@ -286,9 +286,7 @@
   * There are 4 banks supported for this Controller,
   * but we have only 1 bank connected to flash on board
   */
-#ifndef CONFIG_SYS_MAX_FLASH_BANKS_DETECT
  #define CONFIG_SYS_MAX_FLASH_BANKS1
-#endif
  #define CONFIG_SYS_FLASH_BANKS_SIZES {0x400}
  
  /* max number of sectors on one chip */

diff --git a/include/configs/ax25-ae350.h b/include/configs/ax25-ae350.h
index 1c3f957d32..2ad0d1589c 100644
--- a/include/configs/ax25-ae350.h
+++ b/include/configs/ax25-ae350.h
@@ -80,7 +80,7 @@
  
  /* support JEDEC */

  #ifdef CONFIG_CFI_FLASH
-#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT  1
+#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT
  #endif/* Do not use CONFIG_FLASH_CFI_LEGACY to detect on board flash */
  #define PHYS_FLASH_1  0x8800  /* BANK 0 */
  #define CONFIG_SYS_FLASH_BASE PHYS_FLASH_1
@@ -95,9 +95,7 @@
   * There are 4 banks supported for this Controller,
   * but we have only 1 bank connected to flash on board
  */
-#ifndef CONFIG_SYS_MAX_FLASH_BANKS_DETECT
  #define CONFIG_SYS_MAX_FLASH_BANKS1
-#endif
  #define CONFIG_SYS_FLASH_BANKS_SIZES {0x400}
  
  /* max number of sectors on one chip */

diff --git a/include/configs/bmips_bcm6338.h b/include/configs/bmips_bcm6338.h
index 6eaca1c31b..b7de3f4058 100644
--- a/include/configs/bmips_bcm6338.h
+++ b/include/configs/bmips_bcm6338.h
@@ -22,6 +22,7 @@
  
  #define CONFIG_SYS_FLASH_BASE			0xbfc0

  #define CONFIG_SYS_FLASH_EMPTY_INFO
-#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT  1
+#define CONFIG_SYS_MAX_FLASH_BANKS 1
+#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT
  
  #endif /* __CONFIG_BMIPS_BCM6338_H */

diff --git 

[PATCH v1 3/5] mtd: cfi: change CONFIG_SYS_MAX_FLASH_BANKS_DETECT as boolean

2022-01-04 Thread Patrick Delaunay
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 
---

Changes in v1:
- solve issue in cfi_flash.h, with
  CFI_FLASH_BANKS=CONFIG_SYS_MAX_FLASH_BANKS_DETECT

 drivers/mtd/cfi_flash.c  |  2 +-
 include/configs/3c120_devboard.h |  3 ++-
 include/configs/adp-ae3xx.h  |  4 +---
 include/configs/adp-ag101p.h |  2 --
 include/configs/ax25-ae350.h |  4 +---
 include/configs/bmips_bcm6338.h  |  3 ++-
 include/configs/bmips_bcm6348.h  |  3 ++-
 include/configs/bmips_bcm6358.h  |  3 ++-
 include/configs/bmips_bcm6368.h  |  3 ++-
 include/configs/boston.h |  4 +++-
 include/configs/draak.h  |  3 ++-
 include/configs/ebisu.h  |  3 ++-
 include/configs/j721e_evm.h  |  3 ++-
 include/configs/mccmon6.h|  3 ++-
 include/configs/qemu-arm.h   |  3 ++-
 include/configs/salvator-x.h |  3 ++-
 include/configs/ulcb.h   |  3 ++-
 include/mtd/cfi_flash.h  | 10 +-
 18 files changed, 35 insertions(+), 27 deletions(-)

diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 71cefc125f..aae3ea0d1b 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -96,7 +96,7 @@ static u16 cfi_flash_config_reg(int i)
 }
 
 #if defined(CONFIG_SYS_MAX_FLASH_BANKS_DETECT)
-int cfi_flash_num_flash_banks = CONFIG_SYS_MAX_FLASH_BANKS_DETECT;
+int cfi_flash_num_flash_banks = CFI_MAX_FLASH_BANKS;
 #else
 int cfi_flash_num_flash_banks;
 #endif
diff --git a/include/configs/3c120_devboard.h b/include/configs/3c120_devboard.h
index f7ad7efb0d..e52fedcf39 100644
--- a/include/configs/3c120_devboard.h
+++ b/include/configs/3c120_devboard.h
@@ -20,7 +20,8 @@
  * CFI Flash
  */
 #define CONFIG_SYS_CFI_FLASH_STATUS_POLL /* fix amd flash issue */
-#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT  1
+#define CONFIG_SYS_MAX_FLASH_BANKS 1
+#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT
 #define CONFIG_SYS_MAX_FLASH_SECT  512
 
 /*
diff --git a/include/configs/adp-ae3xx.h b/include/configs/adp-ae3xx.h
index 58e8526048..11eff3852d 100644
--- a/include/configs/adp-ae3xx.h
+++ b/include/configs/adp-ae3xx.h
@@ -156,7 +156,7 @@
 
 /* support JEDEC */
 #ifdef CONFIG_CFI_FLASH
-#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT  1
+#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT
 #endif
 
 /* Do not use CONFIG_FLASH_CFI_LEGACY to detect on board flash */
@@ -173,9 +173,7 @@
  * There are 4 banks supported for this Controller,
  * but we have only 1 bank connected to flash on board
  */
-#ifndef CONFIG_SYS_MAX_FLASH_BANKS_DETECT
 #define CONFIG_SYS_MAX_FLASH_BANKS 1
-#endif
 #define CONFIG_SYS_FLASH_BANKS_SIZES {0x400}
 
 /* max number of sectors on one chip */
diff --git a/include/configs/adp-ag101p.h b/include/configs/adp-ag101p.h
index 1022764985..31ef30adc6 100644
--- a/include/configs/adp-ag101p.h
+++ b/include/configs/adp-ag101p.h
@@ -286,9 +286,7 @@
  * There are 4 banks supported for this Controller,
  * but we have only 1 bank connected to flash on board
  */
-#ifndef CONFIG_SYS_MAX_FLASH_BANKS_DETECT
 #define CONFIG_SYS_MAX_FLASH_BANKS 1
-#endif
 #define CONFIG_SYS_FLASH_BANKS_SIZES {0x400}
 
 /* max number of sectors on one chip */
diff --git a/include/configs/ax25-ae350.h b/include/configs/ax25-ae350.h
index 1c3f957d32..2ad0d1589c 100644
--- a/include/configs/ax25-ae350.h
+++ b/include/configs/ax25-ae350.h
@@ -80,7 +80,7 @@
 
 /* support JEDEC */
 #ifdef CONFIG_CFI_FLASH
-#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT  1
+#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT
 #endif/* Do not use CONFIG_FLASH_CFI_LEGACY to detect on board flash */
 #define PHYS_FLASH_1   0x8800  /* BANK 0 */
 #define CONFIG_SYS_FLASH_BASE  PHYS_FLASH_1
@@ -95,9 +95,7 @@
  * There are 4 banks supported for this Controller,
  * but we have only 1 bank connected to flash on board
 */
-#ifndef CONFIG_SYS_MAX_FLASH_BANKS_DETECT
 #define CONFIG_SYS_MAX_FLASH_BANKS 1
-#endif
 #define CONFIG_SYS_FLASH_BANKS_SIZES {0x400}
 
 /* max number of sectors on one chip */
diff --git a/include/configs/bmips_bcm6338.h b/include/configs/bmips_bcm6338.h
index 6eaca1c31b..b7de3f4058 100644
--- a/include/configs/bmips_bcm6338.h
+++ b/include/configs/bmips_bcm6338.h
@@ -22,6 +22,7 @@
 
 #define CONFIG_SYS_FLASH_BASE  0xbfc0
 #define CONFIG_SYS_FLASH_EMPTY_INFO
-#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT  1
+#define CONFIG_SYS_MAX_FLASH_BANKS 1
+#define CONFIG_SYS_MAX_FLASH_BANKS_DETECT
 
 #endif /* __CONFIG_BMIPS_BCM6338_H */
diff --git a/include/configs/bmips_bcm6348.h b/include/configs/bmips_bcm6348.h
index 5bfbcb779b..5ed0eebce4 100644
--- a/include/configs/bmips_bcm6348.h
+++