public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC/PATCH 1/4] Enable multi chip support in the NAND layer
Date: Fri, 16 Jan 2009 08:59:23 +0100	[thread overview]
Message-ID: <49703E5B.1080604@grandegger.com> (raw)
In-Reply-To: <20090115221719.GB23385@ld0162-tx32.am.freescale.net>

Scott Wood wrote:
> On Wed, Jan 07, 2009 at 07:53:45PM +0100, Wolfgang Grandegger wrote:
>>  		for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++) {
>> -			if (nand_info[i].name)
>> +			if (nand_info[i].name) {
>> +#if NAND_MAX_CHIPS > 1
>> +				struct nand_chip *chip = nand_info[i].priv;
>> +				printf("Device %d: %dx %s, sector size %u KiB\n",
>> +				       i, chip->numchips, nand_info[i].name,
>> +				       nand_info[i].erasesize >> 10);
>> +#else
>>  				printf("Device %d: %s, sector size %u KiB\n",
>>  				       i, nand_info[i].name,
>>  				       nand_info[i].erasesize >> 10);
>> +#endif
> 
> Do we really need the ifdef?

Not really, "1x" (one time) would make clear that it's a single-chip device.

>> Index: u-boot/drivers/mtd/nand/nand.c
>> ===================================================================
>> --- u-boot.orig/drivers/mtd/nand/nand.c
>> +++ u-boot/drivers/mtd/nand/nand.c
>> @@ -28,6 +28,10 @@
>>  #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
>>  #endif
>>  
>> +#ifndef NAND_MAX_CHIPS
>> +#define NAND_MAX_CHIPS 1
>> +#endif
> 
> This needs to be seen from cmd_nand.c as well.

Yep, in the meantime I realized that it's already pre-set in
include/linux/mtd/nand.h:

  /* The maximum number of NAND chips in an array */
  #ifndef NAND_MAX_CHIPS
  #define NAND_MAX_CHIPS          8
  #endif

but most (if not all) boards set it to 1.

But at that occasion, I think the name should be changed to
CONFIG_SYS_NAND_MAX_CHIPS, right?

Wolfgang.

  reply	other threads:[~2009-01-16  7:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-07 18:53 [U-Boot] [RFC/PATCH 1/4] Enable multi chip support in the NAND layer Wolfgang Grandegger
2009-01-15 22:17 ` Scott Wood
2009-01-16  7:59   ` Wolfgang Grandegger [this message]
2009-01-16  8:22     ` Wolfgang Denk
2009-01-16 17:15       ` Wolfgang Grandegger
2009-01-19 16:12         ` Stefan Roese
2009-01-19 17:08           ` Scott Wood
2009-01-19 17:21             ` Stefan Roese
2009-01-19 19:50               ` Wolfgang Grandegger
2009-01-20  7:40                 ` Stefan Roese
2009-01-20  8:36                   ` Wolfgang Grandegger

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=49703E5B.1080604@grandegger.com \
    --to=wg@grandegger.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