public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/5] mtd/nand: Add function board_nand_init_tail() for some special NAND controllers
Date: Thu, 8 Dec 2011 17:35:17 +0100	[thread overview]
Message-ID: <201112081735.17594.marek.vasut@gmail.com> (raw)
In-Reply-To: <1323341352-14996-1-git-send-email-Shengzhou.Liu@freescale.com>

> 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 |   19 ++++++++++++++++++-
>  1 files changed, 18 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand.c b/drivers/mtd/nand/nand.c
> index d987f4c..800541e 100644
> --- a/drivers/mtd/nand/nand.c
> +++ b/drivers/mtd/nand/nand.c
> @@ -39,6 +39,14 @@ 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)
> +{

Isn't struct nand_chip * already passed in mtd->priv ?

M

> +	/* Allow for init at tail in controller-specific file for some reason */
> +	return 0;
> +}
> +int 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 +59,16 @@ 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)) {
> +			if (board_nand_init_tail(mtd, nand)) {
> +				mtd->name = NULL;
> +				return;
> +			}
> +
> +			if (nand_scan_tail(mtd)) {
> +				mtd->name = NULL;
> +				return;
> +			}
>  			if (!mtd->name)
>  				mtd->name = (char *)default_nand_name;
>  #ifdef CONFIG_NEEDS_MANUAL_RELOC

      parent reply	other threads:[~2011-12-08 16:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-08 10:49 [U-Boot] [PATCH 1/5] mtd/nand: Add function board_nand_init_tail() for some special NAND controllers Shengzhou Liu
2011-12-08 10:49 ` [U-Boot] [PATCH 2/5] mtd/nand: Fixup for support ONFI detect Shengzhou Liu
2011-12-08 10:49   ` [U-Boot] [PATCH 3/5] mtd/nand: remove CONFIG_SYS_NAND_ONFI_DETECTION to enable ONFI detection Shengzhou Liu
2011-12-08 10:49     ` [U-Boot] [PATCH 4/5] mtd/nand: Add ONFI support for FSL NAND controller Shengzhou Liu
2011-12-08 10:49       ` [U-Boot] [PATCH 5/5] mtd/nand: workaround for Freescale FCM to support 4k pagesize Nand chip Shengzhou Liu
2011-12-08 16:37         ` Marek Vasut
2011-12-09  2:33           ` LiuShuo
2011-12-09  8:27             ` Marek Vasut
2011-12-09  8:58               ` LiuShuo
2011-12-09  9:11                 ` Marek Vasut
2011-12-09  9:32                   ` LiuShuo
2011-12-09  9:46                     ` Marek Vasut
2011-12-08 18:09       ` [U-Boot] [PATCH 4/5] mtd/nand: Add ONFI support for FSL NAND controller Scott Wood
2011-12-08 16:35 ` Marek Vasut [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201112081735.17594.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox