diff options
| author | Wilson Lee <[email protected]> | 2017-11-15 01:14:35 -0800 |
|---|---|---|
| committer | Michal Simek <[email protected]> | 2017-11-29 08:02:40 +0100 |
| commit | 310995d9f91ae56082b49be06fe8c3d01424f8f6 (patch) | |
| tree | 10ef5f422c0690e1b95697013aebe28f5e38f48c | |
| parent | 40df796133399d463b8a736deb5227a05c81caea (diff) | |
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: Wilson Lee <[email protected]>
Cc: Joe Hershberger <[email protected]>
Cc: Keng Soon Cheah <[email protected]>
Cc: Chen Yee Chew <[email protected]>
Cc: Albert Aribaud <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Siva Durga Prasad Paladugu <[email protected]>
Cc: Scott Wood <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
| -rw-r--r-- | arch/arm/mach-zynq/include/mach/nand.h | 9 | ||||
| -rw-r--r-- | drivers/mtd/nand/zynq_nand.c | 6 |
2 files changed, 13 insertions, 2 deletions
diff --git a/arch/arm/mach-zynq/include/mach/nand.h b/arch/arm/mach-zynq/include/mach/nand.h new file mode 100644 index 00000000000..61ef45f5828 --- /dev/null +++ b/arch/arm/mach-zynq/include/mach/nand.h @@ -0,0 +1,9 @@ +/* + * Copyright (C) 2017 National Instruments Corp. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <nand.h> + +void zynq_nand_init(void); diff --git a/drivers/mtd/nand/zynq_nand.c b/drivers/mtd/nand/zynq_nand.c index 8d6a663d72b..e6c80b5b5c1 100644 --- a/drivers/mtd/nand/zynq_nand.c +++ b/drivers/mtd/nand/zynq_nand.c @@ -994,7 +994,7 @@ static int zynq_nand_device_ready(struct mtd_info *mtd) 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 mtd_info *mtd; @@ -1180,12 +1180,14 @@ fail: return err; } +#ifdef CONFIG_SYS_NAND_SELF_INIT 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]; if (zynq_nand_init(nand, 0)) puts("ZYNQ NAND init failed\n"); } +#endif |
