Skip to content
Snippets Groups Projects
Commit 310995d9 authored by Wilson Lee's avatar Wilson Lee Committed by Michal Simek
Browse files

mtd: zynq: nand: Move board_nand_init() function to board.c


Putting board_nand_init() function inside NAND driver was not appropriate
due to it doesn't allow board vendor to customise their NAND
initialization code such as adding NAND lock/unlock code.

This commit was to move the board_nand_init() function from NAND driver
to board.c file. This allow customization of board_nand_init() function.

Signed-off-by: default avatarWilson Lee <wilson.lee@ni.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Cc: Scott Wood <oss@buserror.net>
Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
parent 40df7961
No related branches found
No related tags found
No related merge requests found
/*
* Copyright (C) 2017 National Instruments Corp.
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <nand.h>
void zynq_nand_init(void);
...@@ -994,7 +994,7 @@ static int zynq_nand_device_ready(struct mtd_info *mtd) ...@@ -994,7 +994,7 @@ static int zynq_nand_device_ready(struct mtd_info *mtd)
return 0; return 0;
} }
static int zynq_nand_init(struct nand_chip *nand_chip, int devnum) int zynq_nand_init(struct nand_chip *nand_chip, int devnum)
{ {
struct zynq_nand_info *xnand; struct zynq_nand_info *xnand;
struct mtd_info *mtd; struct mtd_info *mtd;
...@@ -1180,12 +1180,14 @@ fail: ...@@ -1180,12 +1180,14 @@ fail:
return err; return err;
} }
#ifdef CONFIG_SYS_NAND_SELF_INIT
static struct nand_chip nand_chip[CONFIG_SYS_MAX_NAND_DEVICE]; static struct nand_chip nand_chip[CONFIG_SYS_MAX_NAND_DEVICE];
void board_nand_init(void) void __weak board_nand_init(void)
{ {
struct nand_chip *nand = &nand_chip[0]; struct nand_chip *nand = &nand_chip[0];
if (zynq_nand_init(nand, 0)) if (zynq_nand_init(nand, 0))
puts("ZYNQ NAND init failed\n"); puts("ZYNQ NAND init failed\n");
} }
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment