public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] KB9202: Add NAND support
Date: Fri, 15 May 2009 17:30:48 -0500	[thread overview]
Message-ID: <4A0DED18.9000806@freescale.com> (raw)
In-Reply-To: <20090515221544.GF7923@traven>

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@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?

-Scott

  reply	other threads:[~2009-05-15 22:30 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 [this message]
2009-05-16 14:11   ` Matthias Kaehlcke
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=4A0DED18.9000806@freescale.com \
    --to=scottwood@freescale.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