All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/4] mtd/nand : Add function board_nand_init_tail() for some special NAND controllers
@ 2011-12-02  9:17 Shengzhou Liu
  2011-12-02  9:17 ` [U-Boot] [PATCH 2/4] mtd/nand: Fixup for support ONFI detect Shengzhou Liu
  2011-12-04  9:04 ` [U-Boot] [PATCH 1/4] mtd/nand : Add function board_nand_init_tail() for some special NAND controllers Igor Grinberg
  0 siblings, 2 replies; 9+ messages in thread
From: Shengzhou Liu @ 2011-12-02  9:17 UTC (permalink / raw)
  To: u-boot

In some NAND controllers there is a size limitation of RAM buffer(2K bytes).
To support large-page NAND chips with greater than 2K pagesize, we need a large
buffer, but we don't know pagesize before calling nand_scan_ident(), for more
flexible and to identify different cases of large-page greater than 2K bytes,
we have a board_nand_init_tail() between nand_scan_ident() and nand_scan_tail().

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
---
 drivers/mtd/nand/nand.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/nand.c b/drivers/mtd/nand/nand.c
index d987f4c..2bafe47 100644
--- a/drivers/mtd/nand/nand.c
+++ b/drivers/mtd/nand/nand.c
@@ -39,6 +39,13 @@ static ulong base_address[CONFIG_SYS_MAX_NAND_DEVICE] = CONFIG_SYS_NAND_BASE_LIS
 static const char default_nand_name[] = "nand";
 static __attribute__((unused)) char dev_name[CONFIG_SYS_MAX_NAND_DEVICE][8];
 
+int __board_nand_init_tail(struct mtd_info *mtd, struct nand_chip *nand)
+{
+	/* Allow for init at tail in controller-specific file for some reason */
+}
+void board_nand_init_tail(struct mtd_info *mtd, struct nand_chip *nand)
+__attribute__((weak, alias("__board_nand_init_tail")));
+
 static void nand_init_chip(struct mtd_info *mtd, struct nand_chip *nand,
 			   ulong base_addr)
 {
@@ -51,7 +58,12 @@ static void nand_init_chip(struct mtd_info *mtd, struct nand_chip *nand,
 
 	nand->IO_ADDR_R = nand->IO_ADDR_W = (void  __iomem *)base_addr;
 	if (board_nand_init(nand) == 0) {
-		if (nand_scan(mtd, maxchips) == 0) {
+		if (!nand_scan_ident(mtd, maxchips, NULL)) {
+			board_nand_init_tail(mtd, nand);
+			if (nand_scan_tail(mtd)) {
+				mtd->name = NULL;
+				return;
+			}
 			if (!mtd->name)
 				mtd->name = (char *)default_nand_name;
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
-- 
1.6.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-12-05 19:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-02  9:17 [U-Boot] [PATCH 1/4] mtd/nand : Add function board_nand_init_tail() for some special NAND controllers Shengzhou Liu
2011-12-02  9:17 ` [U-Boot] [PATCH 2/4] mtd/nand: Fixup for support ONFI detect Shengzhou Liu
2011-12-02  9:17   ` [U-Boot] [PATCH 3/4] mtd/nand: remove CONFIG_SYS_NAND_ONFI_DETECTION to enable ONFI detection Shengzhou Liu
2011-12-02  9:17     ` [U-Boot] [PATCH 4/4] mtd/nand: Add ONFI support for FSL NAND controller Shengzhou Liu
2011-12-02 18:45       ` Scott Wood
     [not found]         ` <3F453DDFF675A64A89321A1F352810216B03B9@039-SN1MPN1-005.039d.mgd.msft.net>
2011-12-05 19:17           ` Scott Wood
2011-12-02 18:32   ` [U-Boot] [PATCH 2/4] mtd/nand: Fixup for support ONFI detect Scott Wood
     [not found]     ` <3F453DDFF675A64A89321A1F352810216B0393@039-SN1MPN1-005.039d.mgd.msft.net>
2011-12-05 19:20       ` Scott Wood
2011-12-04  9:04 ` [U-Boot] [PATCH 1/4] mtd/nand : Add function board_nand_init_tail() for some special NAND controllers Igor Grinberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.