public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <matthias@kaehlcke.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] KB9202: Add NAND support
Date: Sat, 16 May 2009 16:11:32 +0200	[thread overview]
Message-ID: <20090516141132.GG7923@traven> (raw)
In-Reply-To: <4A0DED18.9000806@freescale.com>

Hi Scott

El Fri, May 15, 2009 at 05:30:48PM -0500 Scott Wood ha dit:

> Matthias Kaehlcke wrote:
>> +/*
>> + * Board-specific function to access the device ready signal.
>> + */
>> +static int kb9202_nand_ready(struct mtd_info *mtd)
>> +{
>> +	return (((AT91C_BASE_PIOC->PIO_PDSR) & KB9202_NAND_BUSY) != 0);
>> +}
>
> Use I/O accessors.
>
>> +int board_nand_init(struct nand_chip *nand)
>> +{
>> +	unsigned	value;
> [snip]
>>> +	/* enable internal NAND controller */
>>> +	value = *(AT91C_EBI_CSA);
>>> +	value |= AT91C_EBI_CS3A_SMC_SmartMedia;
>>> +	*(AT91C_EBI_CSA) = value;
>
> This is a hardware register.  Surely it has a defined width?
>
>> +	/* setup nand flash access (allow ample margin) */
>> +	/* 4 wait states, 1 setup, 1 hold, 1 float for 8-bit device */
>> +	((AT91PS_SMC2)AT91C_BASE_SMC2)->SMC2_CSR[3] =
>> +		AT91C_SMC2_WSEN |
>> +		(4 & AT91C_SMC2_NWS) |
>> +		((1 << 8) & AT91C_SMC2_TDF) |
>> +		AT91C_SMC2_DBW_8 |
>> +		((1 << 24) & AT91C_SMC2_RWSETUP) |
>> +		((1 << 29) & AT91C_SMC2_RWHOLD);
>
> What is AT91PS_SMC2?  Please don't hide pointers inside typedefs. Please 
> define symbols to have the proper type in the first place, rather than 
> casting at the point of use.
>
>> +#ifdef CONFIG_KB9202B_ATL
>> +#define CFG_MAX_FLASH_BANKS    0
>> +#else
>
> Is this really the recommended way of turning off flash support?

thanks for your review and your comments.

i'm new to u-boot development, could you point me to the correct way
of turning of flash support? i found this in the original patch
provided by kwikbyte and just ported it to the current u-boot version.

-- 
Matthias Kaehlcke
Embedded Linux Engineer
Barcelona

              You can't separate peace from freedom because no
               one can be at peace unless he has his freedom
                              (Malcolm X)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

  reply	other threads:[~2009-05-16 14:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-15 22:15 [U-Boot] [PATCH 2/2] KB9202: Add NAND support Matthias Kaehlcke
2009-05-15 22:30 ` Scott Wood
2009-05-16 14:11   ` Matthias Kaehlcke [this message]
2009-05-18 17:38     ` Scott Wood
2009-05-19  7:25       ` Matthias Kaehlcke
2009-06-03 17:42   ` Matthias Kaehlcke
2009-06-03 19:50     ` Scott Wood
2009-06-04 17:45       ` Matthias Kaehlcke
2009-06-04  6:53     ` Stefan Roese
2009-06-04 17:49       ` Matthias Kaehlcke
2009-06-04 18:08         ` Stefan Roese
2009-06-04 18:50           ` Matthias Kaehlcke
2009-06-04 19:08             ` Wolfgang Denk
2009-06-11 18:46               ` [U-Boot] [PATCH 2/2 v4] " Matthias Kaehlcke
2009-06-23 21:19                 ` Scott Wood
2009-06-24 15:23                   ` [U-Boot] [PATCH 2/2 v5] " Matthias Kaehlcke
2009-06-24 20:51                     ` Scott Wood
2009-07-12 19:57                       ` Jean-Christophe PLAGNIOL-VILLARD
2009-07-16 18:45                         ` Scott Wood
2009-07-16 19:19                           ` [U-Boot] [PATCH 2/2 v6] " Matthias Kaehlcke
2009-08-06 21:47                             ` Scott Wood

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=20090516141132.GG7923@traven \
    --to=matthias@kaehlcke.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