]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
nand: Calculate SYS_NAND_BLOCK_PAGES (neeĢ SYS_NAND_PAGE_COUNT) automatically
authorSean Anderson <seanga2@gmail.com>
Sat, 4 Nov 2023 20:37:41 +0000 (16:37 -0400)
committerTom Rini <trini@konsulko.com>
Thu, 16 Nov 2023 17:43:48 +0000 (12:43 -0500)
Contrary to what the help message says, this is the number of pages per
block. Calculate it automatically based on SYS_NAND_BLOCK_SIZE and
SYS_NAND_PAGE_SIZE. To better reflect its semantics, rename it to
SYS_NAND_BLOCK_PAGES.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
49 files changed:
README
configs/am335x_baltos_defconfig
configs/am335x_evm_defconfig
configs/am335x_guardian_defconfig
configs/am335x_igep003x_defconfig
configs/am3517_evm_defconfig
configs/am43xx_evm_defconfig
configs/am43xx_evm_rtconly_defconfig
configs/am43xx_evm_usbhost_boot_defconfig
configs/am43xx_hs_evm_defconfig
configs/axm_defconfig
configs/chiliboard_defconfig
configs/corvus_defconfig
configs/da850evm_nand_defconfig
configs/devkit3250_defconfig
configs/devkit8000_defconfig
configs/dra7xx_evm_defconfig
configs/draco_defconfig
configs/etamin_defconfig
configs/gardena-smart-gateway-at91sam_defconfig
configs/igep00x0_defconfig
configs/m53menlo_defconfig
configs/omap35_logic_defconfig
configs/omap35_logic_somlv_defconfig
configs/omap3_beagle_defconfig
configs/omap3_evm_defconfig
configs/omap3_logic_defconfig
configs/omap3_logic_somlv_defconfig
configs/omapl138_lcdk_defconfig
configs/phycore-am335x-r2-regor_defconfig
configs/phycore-am335x-r2-wega_defconfig
configs/pxm2_defconfig
configs/rastaban_defconfig
configs/rut_defconfig
configs/sama5d3_xplained_nandflash_defconfig
configs/sama5d3xek_nandflash_defconfig
configs/sama5d4_xplained_nandflash_defconfig
configs/sama5d4ek_nandflash_defconfig
configs/smartweb_defconfig
configs/taurus_defconfig
configs/thuban_defconfig
drivers/mtd/nand/raw/Kconfig
drivers/mtd/nand/raw/am335x_spl_bch.c
drivers/mtd/nand/raw/atmel_nand.c
drivers/mtd/nand/raw/mxc_nand_spl.c
drivers/mtd/nand/raw/nand_spl_loaders.c
drivers/mtd/nand/raw/nand_spl_simple.c
drivers/mtd/nand/raw/omap_gpmc.c
include/system-constants.h

diff --git a/README b/README
index 60c6b8a19db1be743748e44ab1125bf0ae5f6da8..00d422737fbdaa2698957260e3a342810023a262 100644 (file)
--- a/README
+++ b/README
@@ -1191,11 +1191,10 @@ The following options need to be configured:
                Support for a lightweight UBI (fastmap) scanner and
                loader
 
-               CONFIG_SYS_NAND_5_ADDR_CYCLE, CONFIG_SYS_NAND_PAGE_COUNT,
-               CONFIG_SYS_NAND_PAGE_SIZE, CONFIG_SYS_NAND_OOBSIZE,
-               CONFIG_SYS_NAND_BLOCK_SIZE, CONFIG_SYS_NAND_BAD_BLOCK_POS,
-               CFG_SYS_NAND_ECCPOS, CFG_SYS_NAND_ECCSIZE,
-               CFG_SYS_NAND_ECCBYTES
+               CONFIG_SYS_NAND_5_ADDR_CYCLE, CONFIG_SYS_NAND_PAGE_SIZE,
+               CONFIG_SYS_NAND_OOBSIZE, CONFIG_SYS_NAND_BLOCK_SIZE,
+               CONFIG_SYS_NAND_BAD_BLOCK_POS, CFG_SYS_NAND_ECCPOS,
+               CFG_SYS_NAND_ECCSIZE, CFG_SYS_NAND_ECCBYTES
                Defines the size and behavior of the NAND that SPL uses
                to read U-Boot
 
index 16993ef5386f57a47b7dbe7d83edb81badd10ecc..3891e48e9c7755427d5d160c831a7b232d486dcf 100644 (file)
@@ -67,7 +67,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index f048e60f7f389d67d7b72e99ba8de8bcfbaae289..73f221d55bce4020273d3642468a81474afc6bcc 100644 (file)
@@ -84,7 +84,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index 01d848ceede1e0a1545961f5331f0f532969572a..5369e46bc1bc0aad0ea2e4d414114fda1329f042 100644 (file)
@@ -99,7 +99,6 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_OMAP_ECCSCHEME_BCH16_CODE_HW=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x40000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x1000
 CONFIG_SYS_NAND_OOBSIZE=0x100
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index 4dd6366ef67a3cd952b77aba2de33eabd62f196f..4c5c82f9bdd74a5bf433fcd823c9251df8aca865 100644 (file)
@@ -85,7 +85,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_MTD_UBI_FASTMAP=y
index 0a83ac9378c0e31e5bd15f40f917a32f01caf3bd..111929fb9129556189e7a2a404355256f6778adf 100644 (file)
@@ -75,7 +75,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_OMAP_ECCSCHEME_BCH8_CODE_HW_DETECTION_SW=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
index 6571afd345e8506d2a8370d149ccc1ce6539a6ce..5f2356bcd320e2fc30ada065619d2481e72cfd77 100644 (file)
@@ -72,7 +72,6 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_OMAP_ECCSCHEME_BCH16_CODE_HW=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x40000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x1000
 CONFIG_SYS_NAND_OOBSIZE=0xe0
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index e84aed4d54da75aad1ae4d112f48af7e69844d0b..30681e7eeb6477f20f4660bec86a49207347d6c8 100644 (file)
@@ -62,7 +62,6 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_OMAP_ECCSCHEME_BCH16_CODE_HW=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x40000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x1000
 CONFIG_SYS_NAND_OOBSIZE=0xe0
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index 0cae3242b04543b912655e43247676589f997bf4..6c4cc99e5ffe29a08a39ac9cf3f76f55e616801f 100644 (file)
@@ -75,7 +75,6 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_OMAP_ECCSCHEME_BCH16_CODE_HW=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x40000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x1000
 CONFIG_SYS_NAND_OOBSIZE=0xe0
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index 370ee9672580165f52b7b4730210da4157693961..49ecb4c9e66a1775e67912f0b3b3c927431968c8 100644 (file)
@@ -68,7 +68,6 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_OMAP_ECCSCHEME_BCH16_CODE_HW=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x40000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x1000
 CONFIG_SYS_NAND_OOBSIZE=0xe0
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index f9c02144c4a3c636ecc4e6c9fd6713f46e8123c9..e1a01b24b88856977125103861addbb77122d3c6 100644 (file)
@@ -86,7 +86,6 @@ CONFIG_MTD=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index 06642d282d1f7187805dfbfeb1a15fece922bc76..0cd649d643a690f4251e8555bb30ef30b6711022 100644 (file)
@@ -63,7 +63,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index ecf61f0d1e6d0c104ffa3b5efb10e4e74062ed04..5eaa6dbb5fccb9c5fc849e499e80811c3e30c1f3 100644 (file)
@@ -81,7 +81,6 @@ CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index 5f6f5d788d0d02b6091e59cdae3ba09d98c92f85..62b8edde248e0ced70a1df229d36072c224dd189 100644 (file)
@@ -88,7 +88,6 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index ec4031da51df49ad3e02b62844edd1ffa8e0a700..569b156c9970b0548c3804fa0db9accdf078e34b 100644 (file)
@@ -73,7 +73,6 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_LPC32XX_SLC=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 # CONFIG_SYS_NAND_5_ADDR_CYCLE is not set
index ef16da176a919ce276029b2422de699635eadea6..a7f82442eb0550e2e6705243c1fd1b8121208627 100644 (file)
@@ -77,7 +77,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_OMAP_ECCSCHEME_HAM1_CODE_HW=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
index 19ca89fa86772e0a5c7bfcdc91b811191a5f8dbd..c3a3ec2cd42cba434556f780210c7cb5a66dabfc 100644 (file)
@@ -104,7 +104,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
index ee19920a703b587c71ce0a74ba16e8ee04dbce6f..2a82087ab315313dc430d32273783f71c39224ac 100644 (file)
@@ -100,7 +100,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index c0ce7a33569d08dff7f2b3a37c70636bbe9bb096..4ac0abc56b0c780ab8aa333d3980254c75c2f63d 100644 (file)
@@ -104,7 +104,6 @@ CONFIG_SYS_MAX_NAND_DEVICE=3
 CONFIG_NAND_OMAP_ECCSCHEME_BCH16_CODE_HW=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x80000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x80
 CONFIG_SYS_NAND_PAGE_SIZE=0x1000
 CONFIG_SYS_NAND_OOBSIZE=0xe0
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index 439fcc0575395dbd27a85a2f7a395907aa1e45c0..0fb92ff1638263f435b1ef0c893a9e4b800cc6f3 100644 (file)
@@ -99,7 +99,6 @@ CONFIG_MTD=y
 CONFIG_NAND_ATMEL=y
 CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index 993bbe29c6b8d8e04e83cfc375509344b8694f35..3b1af07f05713bbf62a42c24367326f03398f365 100644 (file)
@@ -78,7 +78,6 @@ CONFIG_SYS_MTDPARTS_RUNTIME=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_OMAP_ECCSCHEME_BCH8_CODE_HW_DETECTION_SW=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
index ef9e15d15200aa9b657875caee0af35f7c2e5108..e1ddc0af5db4976da55f72f7946d92497969069e 100644 (file)
@@ -90,7 +90,6 @@ CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_MXC=y
 CONFIG_MXC_NAND_HWECC=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index 539b0cfa4f78e90ac5377e143f7c706acac2a87a..3a65607253479379736edfebf8d7b764e02b5d3f 100644 (file)
@@ -74,7 +74,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_OMAP_ECCSCHEME_BCH8_CODE_HW_DETECTION_SW=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
index f14ce3d23dbaf0813d8ee1a1720d2cc113ecddf6..868e89114b787c072373fcedd13e0f4484a8db49 100644 (file)
@@ -83,7 +83,6 @@ CONFIG_SYS_MAX_FLASH_SECT=256
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_OMAP_ECCSCHEME_BCH8_CODE_HW_DETECTION_SW=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
index cabd365938584fb8cac50a65e9b2d41cc2de5c1a..7f0b927528def37d018e213adeb5854aace53d11 100644 (file)
@@ -83,7 +83,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_OMAP_ECCSCHEME_HAM1_CODE_HW=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
index 33ff39ff548721d1058b9e65c2c421382aa26a29..3434783d45be8bd4107eeb31a6b689b5189f38be 100644 (file)
@@ -74,7 +74,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_OMAP_ECCSCHEME_BCH8_CODE_HW_DETECTION_SW=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
index 7d3d602c9d984d4066590fac4379aa8816264a25..78bfbbd1a228025629e61d159d98a9af8658f219 100644 (file)
@@ -73,7 +73,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_OMAP_ECCSCHEME_BCH8_CODE_HW_DETECTION_SW=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
index 0141a425e07d411e20d9af16b7c4a24e9bba72a2..aefd8861db3272fe1db06a28762e66114d9e2c64 100644 (file)
@@ -84,7 +84,6 @@ CONFIG_SYS_MAX_FLASH_SECT=256
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_OMAP_ECCSCHEME_BCH8_CODE_HW_DETECTION_SW=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
index 47feff21bd406f84fdce8793d670643aa56d5a15..63554d56016e330a18cb01fcfe56e1f4849c3060 100644 (file)
@@ -84,7 +84,6 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
index 4bdf8822181cf6f8b3b28fa7acde442eaca93a95..85d53d0635742a4ae65a8a314f39def601bf4843 100644 (file)
@@ -76,7 +76,6 @@ CONFIG_DM_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index 7644fbec273f5b34c57262f1644ae60800a5bd26..60607548a25065f786207f31df1bbe58e36fd9c7 100644 (file)
@@ -76,7 +76,6 @@ CONFIG_DM_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index 2ea007d0de5e18626669eb367b486368348222d1..e1d1066815b5ab56ef03ce726284a8e2c9a8d176 100644 (file)
@@ -99,7 +99,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index 9f538a2f83d7b53cbcb764bb556ab914cda9c5d5..21495341e266ece061888595b90f9d654e64104e 100644 (file)
@@ -100,7 +100,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index ccf25667b5076b8242d3cc347b6968cadfc0b731..248073be1f28f9e1966bacf6fd2c868ee7ccd39f 100644 (file)
@@ -99,7 +99,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index a1b6122f8eb42b4cfde1466e010a2432f858113b..a0802f9c5febbf331d0990b0fe06286778538924 100644 (file)
@@ -86,7 +86,6 @@ CONFIG_PMECC_CAP=4
 CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index 6278a6c68a7ecc7c70b8fc354abc11f862234e1d..d96bb91e65dc85611b2155877a3efa11986d7ce1 100644 (file)
@@ -90,7 +90,6 @@ CONFIG_PMECC_CAP=4
 CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index d12f749d7f49c942f07cfaedce404e0c4f2cae22..68101a12fc28a95c298fcd1373ecbbb7e741af1d 100644 (file)
@@ -84,7 +84,6 @@ CONFIG_PMECC_CAP=8
 CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x40000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x1000
 CONFIG_SYS_NAND_OOBSIZE=0xe0
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index 27bfcdf00848f7235f06158dd5a686b83ffab886..b8062db775d0098f6edc0448c8e4da9771695e36 100644 (file)
@@ -81,7 +81,6 @@ CONFIG_PMECC_CAP=8
 CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x40000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x1000
 CONFIG_SYS_NAND_OOBSIZE=0xe0
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index 10cbccb69b00c6a04909b2c40103687459a316fa..80d2c0f1cc12e50cf22d28b88930402edae98989 100644 (file)
@@ -84,7 +84,6 @@ CONFIG_MTD=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index cc5755178b7f3dc2648cdcafe1b8abf71201c71e..9be30c8d8a410a0e53610dbf1067e7b519b147c7 100644 (file)
@@ -94,7 +94,6 @@ CONFIG_MTD=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index 116700e0df02765cad249f8eed6ff1d6742a0ea2..1134624f9d2d11ec3c7f0f2358e5c4cf54dc8a5a 100644 (file)
@@ -100,7 +100,6 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x20000
 CONFIG_SYS_NAND_ONFI_DETECTION=y
-CONFIG_SYS_NAND_PAGE_COUNT=0x40
 CONFIG_SYS_NAND_PAGE_SIZE=0x800
 CONFIG_SYS_NAND_OOBSIZE=0x40
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index a13e6f59cbd2e96dcd646ee65f42ba28f1b47523..6e9351f83804abf6d83c8c80e1be85c19040c711 100644 (file)
@@ -659,14 +659,6 @@ config SYS_NAND_ONFI_DETECTION
          And fetching device parameters flashed on device, by parsing
          ONFI parameter page.
 
-config SYS_NAND_PAGE_COUNT
-       hex "NAND chip page count"
-       depends on SPL_NAND_SUPPORT && (NAND_ATMEL || NAND_MXC || \
-               SPL_NAND_AM33XX_BCH || SPL_NAND_LOAD || SPL_NAND_SIMPLE || \
-               NAND_OMAP_GPMC)
-       help
-         Number of pages in the NAND chip.
-
 config SYS_NAND_PAGE_SIZE
        hex "NAND chip page size"
        depends on ARCH_SUNXI || NAND_OMAP_GPMC || NAND_LPC32XX_SLC || \
index 6ab3f1f42c54e24993b5d16e37612a0b5bee8e76..fb9c623f5615a42c91a97aa3c4e89e5292004ce1 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <system-constants.h>
 #include <asm/io.h>
 #include <linux/delay.h>
 #include <linux/mtd/nand_ecc.h>
@@ -32,7 +33,7 @@ static int nand_command(int block, int page, uint32_t offs,
        u8 cmd)
 {
        struct nand_chip *this = mtd_to_nand(mtd);
-       int page_addr = page + block * CONFIG_SYS_NAND_PAGE_COUNT;
+       int page_addr = page + block * SYS_NAND_BLOCK_PAGES;
        void (*hwctrl)(struct mtd_info *mtd, int cmd,
                        unsigned int ctrl) = this->cmd_ctrl;
 
index 6b17e744a6926547e189c3d5065347f5a939b3d1..83320112952ce8024986a2cf96f7611ba4838b5b 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <log.h>
+#include <system-constants.h>
 #include <asm/gpio.h>
 #include <asm/arch/gpio.h>
 #include <dm/device_compat.h>
@@ -1258,7 +1259,7 @@ static struct nand_chip nand_chip;
 static int nand_command(int block, int page, uint32_t offs, u8 cmd)
 {
        struct nand_chip *this = mtd_to_nand(mtd);
-       int page_addr = page + block * CONFIG_SYS_NAND_PAGE_COUNT;
+       int page_addr = page + block * SYS_NAND_BLOCK_PAGES;
        void (*hwctrl)(struct mtd_info *mtd, int cmd,
                        unsigned int ctrl) = this->cmd_ctrl;
 
@@ -1359,7 +1360,7 @@ int spl_nand_erase_one(int block, int page)
        if (nand_chip.select_chip)
                nand_chip.select_chip(mtd, 0);
 
-       page_addr = page + block * CONFIG_SYS_NAND_PAGE_COUNT;
+       page_addr = page + block * SYS_NAND_BLOCK_PAGES;
        hwctrl(mtd, NAND_CMD_ERASE1, NAND_CTRL_CLE | NAND_CTRL_CHANGE);
        /* Row address */
        hwctrl(mtd, (page_addr & 0xff), NAND_CTRL_ALE | NAND_CTRL_CHANGE);
index 309e75d01e5af7105acdb96ceac742da0d8f1a83..81ceb12103bd8af345d99199e7983131a4476ed5 100644 (file)
@@ -13,6 +13,7 @@
 #include <common.h>
 #include <hang.h>
 #include <nand.h>
+#include <system-constants.h>
 #include <linux/mtd/rawnand.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/io.h>
@@ -304,13 +305,13 @@ int nand_spl_load_image(uint32_t from, unsigned int size, void *buf)
                 * Check if we have crossed a block boundary, and if so
                 * check for bad block.
                 */
-               if (!(page % CONFIG_SYS_NAND_PAGE_COUNT)) {
+               if (!(page % SYS_NAND_BLOCK_PAGES)) {
                        /*
                         * Yes, new block. See if this block is good. If not,
                         * loop until we find a good block.
                         */
                        while (is_badblock(page)) {
-                               page = page + CONFIG_SYS_NAND_PAGE_COUNT;
+                               page = page + SYS_NAND_BLOCK_PAGES;
                                /* Check i we've reached the end of flash. */
                                if (page >= maxpages)
                                        return -1;
index 156b44d83581e6b4393dabf8ba7b6d7a4f0b3298..35d6b1d6c0c90afbef2f0db3d24a39d27645717f 100644 (file)
@@ -12,7 +12,7 @@ int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst)
        while (block <= lastblock) {
                if (!nand_is_bad_block(block)) {
                        /* Skip bad blocks */
-                       while (page < CONFIG_SYS_NAND_PAGE_COUNT) {
+                       while (page < SYS_NAND_BLOCK_PAGES) {
                                nand_read_page(block, page, dst);
                                /*
                                 * When offs is not aligned to page address the
index 2f3af9edd4c2eeea2c4b3bdb82380c27048a5dcc..bbdb76d6b75ba6c29c201d9707efb47a50bbb02c 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <nand.h>
+#include <system-constants.h>
 #include <asm/io.h>
 #include <linux/mtd/nand_ecc.h>
 #include <linux/mtd/rawnand.h>
@@ -27,7 +28,7 @@ static int nand_command(int block, int page, uint32_t offs,
        u8 cmd)
 {
        struct nand_chip *this = mtd_to_nand(mtd);
-       int page_addr = page + block * CONFIG_SYS_NAND_PAGE_COUNT;
+       int page_addr = page + block * SYS_NAND_BLOCK_PAGES;
 
        while (!this->dev_ready(mtd))
                ;
@@ -59,7 +60,7 @@ static int nand_command(int block, int page, uint32_t offs,
        u8 cmd)
 {
        struct nand_chip *this = mtd_to_nand(mtd);
-       int page_addr = page + block * CONFIG_SYS_NAND_PAGE_COUNT;
+       int page_addr = page + block * SYS_NAND_BLOCK_PAGES;
        void (*hwctrl)(struct mtd_info *mtd, int cmd,
                        unsigned int ctrl) = this->cmd_ctrl;
 
index 1a5ed0de31a9c1866943f89553fd00a5128149f4..0e25bd5dc28f71b93398a05d440c31d7e1af4eaf 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <log.h>
+#include <system-constants.h>
 #include <asm/io.h>
 #include <dm/uclass.h>
 #include <linux/errno.h>
@@ -1298,7 +1299,7 @@ static int nand_is_bad_block(int block)
 
 static int nand_read_page(int block, int page, uchar *dst)
 {
-       int page_addr = block * CONFIG_SYS_NAND_PAGE_COUNT + page;
+       int page_addr = block * SYS_NAND_BLOCK_PAGES + page;
        loff_t ofs = page_addr * CONFIG_SYS_NAND_PAGE_SIZE;
        int ret;
        size_t len = CONFIG_SYS_NAND_PAGE_SIZE;
index 59371568d1e7399da08f30f59d9b4d6b1eac8096..d688629f119b095166a28f93363f28878a765a38 100644 (file)
@@ -41,4 +41,8 @@
 #define SPL_PAYLOAD_ARGS_ADDR  0
 #endif
 
+/* Number of pages per block */
+#define SYS_NAND_BLOCK_PAGES \
+       (CONFIG_SYS_NAND_BLOCK_SIZE / CONFIG_SYS_NAND_PAGE_SIZE)
+
 #endif