diff options
author | Tom Rini <trini@konsulko.com> | 2017-04-04 09:17:08 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-04-04 09:17:08 -0400 |
commit | 797f165f7ae90a75579ae3df7932d8d1518e8544 (patch) | |
tree | 620b82acccf043481b25e5fca589aefcea0109c1 /drivers/mtd/nand/nand.c | |
parent | 234d12985ae1a5d878de6445187ec0b888772511 (diff) | |
parent | 78be6222b01efa12d9267876ad1d1d0daf38dfa0 (diff) |
Merge git://git.denx.de/u-boot-fsl-qoriq
Diffstat (limited to 'drivers/mtd/nand/nand.c')
-rw-r--r-- | drivers/mtd/nand/nand.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nand.c b/drivers/mtd/nand/nand.c index 05512412b94..168bac6055d 100644 --- a/drivers/mtd/nand/nand.c +++ b/drivers/mtd/nand/nand.c @@ -131,8 +131,23 @@ static void create_mtd_concat(void) } #endif +unsigned long nand_size(void) +{ + return total_nand_size; +} + void nand_init(void) { + static int initialized; + + /* + * Avoid initializing NAND Flash multiple times, + * otherwise it will calculate a wrong total size. + */ + if (initialized) + return; + initialized = 1; + #ifdef CONFIG_SYS_NAND_SELF_INIT board_nand_init(); #else @@ -142,8 +157,6 @@ void nand_init(void) nand_init_chip(i); #endif - printf("%lu MiB\n", total_nand_size / 1024); - #ifdef CONFIG_SYS_NAND_SELECT_DEVICE /* * Select the chip in the board/cpu specific driver |