From: David Brownell <david-b@pacbell.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ARM DaVinci: Adding CONFIG options for NAND ALE and CLE
Date: Tue, 28 Apr 2009 19:03:31 -0700 [thread overview]
Message-ID: <200904281903.31732.david-b@pacbell.net> (raw)
In-Reply-To: <C9D59C82B94F474B872F2092A87F26147DF6C75C@dlee07.ent.ti.com>
Hi Sandeep,
On Tuesday 28 April 2009, Paulraj, Sandeep wrote:
> >
> > I had been thinking that the davinci_nand driver should
> > probably change to let board_nand_init() really become a
> > board-specific function...
> >
> > It would call a driver routine to init the callback functions
> > and set up private data so that for example the 2GByte NAND
> > could be properly treated as a single device with two chips,
> > instead of two separate devices. (As Linux does; I'm just
> > assuming that mechanism works right in U-Boot.)
>
> [Sandeep] At the U-Boot level do we really need this mechanism?
I think it will improve Linux interop.
For example, the MTDPART support in U-Boot provides a string
that can be passed on the kernel command line to ensure that
U-Boot and Linux use the same partitioning.
But ... that won't work very well if Linux sees one big device,
while U-Boot sees two smaller ones. That "mtdpart=..." command
line string won't work for Linux.
> > Other private data could include CLE/ALE masks, if needed.
>
> [Sandeep] This is the way we do it in the kernel. Again does
> U-boot really need this much sophistication.
Erm, the 2.6.30 code (and davinci-git) passes the masks in
through platform_data; they're not fixed at compile time.
> > That is, the u-boot davinci_nand.c code could
> >
> > #ifndef CONFIG_SYS_DAVINCI_NAND_CLE
> > ... #define it to the default 0x10 ...
> > #endif
>
> [Sandeep] It is my personal opinion that we should try to
> avoid such #ifdefs in the driver. I would just define all
> these in the config.h file. Let me know your opinion.
The place to *really* avoid #ifdefs is inside C functions.
I could agree that putting such defaults into the DaVinci
"nand.h" header might be prettier.
But I'd like to keep the config.h files free of such stuff.
Especially, free of stuff that doesn't change from board
to board (except in unusual cases).
> We will need such a #ifndef for the CLE as well so I would
> just put both the values in the config.h rather than have
> 2 #ifndefs in the NAND driver
Well, "nand.h" would be better. Especially considering
that board using a non-default values are uncommon.
> > Related: MASK_ALE should not be 0x0a by default, but 0x08;
> > right?
>
> [Sandeep] That is what I use in the internal LSP releases
>
> > That's what newer docs say; I think the old stuff
> > was just a bug. In Linux, 0x08 works just fine.
>
> [Sandeep] Yes that is correct. I was going to send an e-mail
> tomorrow to see if anyone had any objections to me changing this value
Nah ... just fixit. ;)
- Dave
prev parent reply other threads:[~2009-04-29 2:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-28 20:33 [U-Boot] [PATCH] ARM DaVinci: Adding CONFIG options for NAND ALE and CLE s-paulraj at ti.com
2009-04-28 20:54 ` Steve Chen
2009-04-28 20:57 ` Paulraj, Sandeep
2009-04-28 21:22 ` Scott Wood
2009-04-29 0:02 ` Paulraj, Sandeep
2009-04-28 21:51 ` David Brownell
2009-04-29 0:32 ` Paulraj, Sandeep
2009-04-29 2:03 ` David Brownell [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=200904281903.31732.david-b@pacbell.net \
--to=david-b@pacbell.net \
--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