mtd: nand: add initialization flag
Add initialization flag to avoid initializing NAND Flash multiple times, otherwise it will calculate a wrong total size. Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
This commit is contained in:
parent
132a1468dc
commit
d72158c045
|
|
@ -133,6 +133,16 @@ static void create_mtd_concat(void)
|
||||||
|
|
||||||
void nand_init(void)
|
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
|
#ifdef CONFIG_SYS_NAND_SELF_INIT
|
||||||
board_nand_init();
|
board_nand_init();
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue