All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/9] Add v1.1 support to nand_spl fsl nfc	driver
Date: Fri, 15 Jan 2010 17:13:28 -0600	[thread overview]
Message-ID: <20100115231328.GA2956@loki.buserror.net> (raw)
In-Reply-To: <1263357841-5100-4-git-send-email-jcrigby@gmail.com>

On Tue, Jan 12, 2010 at 09:43:55PM -0700, John Rigby wrote:
>  struct fsl_nfc_regs {
> -	u32 main_area0[128]; /* @0x000 */
> -	u32 main_area1[128];
> -	u32 main_area2[128];
> -	u32 main_area3[128];
> -	u32 spare_area0[4];
> -	u32 spare_area1[4];
> -	u32 spare_area2[4];
> -	u32 spare_area3[4];
> -	u32 reserved1[64 - 16 + 64 * 5];
> -	u16 bufsiz; /* @ 0xe00 */
> +	u8 main_area[NAND_MXC_NR_BUFS][512];
> +	u8 spare_area[NAND_MXC_NR_BUFS][NAND_MXC_SPARE_BUF_SIZE];

You could do u32 ...[NAND_MXC_SPARE_BUF_SIZE / 4] to avoid the casts later
on...

> diff --git a/nand_spl/nand_boot_fsl_nfc.c b/nand_spl/nand_boot_fsl_nfc.c
> index a9df2a8..02d8330 100644
> --- a/nand_spl/nand_boot_fsl_nfc.c
> +++ b/nand_spl/nand_boot_fsl_nfc.c
> @@ -26,13 +26,17 @@
>  
>  #include <common.h>
>  #include <nand.h>
> +#ifdef CONFIG_MX31
>  #include <asm-arm/arch/mx31-regs.h>
> +#else
> +#include <asm-arm/arch/imx-regs.h>
> +#endif

Hmm, can't this be pushed into an arch header?

>  #include <asm/io.h>
>  #include <fsl_nfc.h>
>  
> -static struct fsl_nfc_regs *nfc;
> +struct fsl_nfc_regs *nfc;
>  
> -static void nfc_wait_ready(void)
> +void nfc_wait_ready(void)

Why non-static?

> @@ -65,12 +91,12 @@ static void nfc_nand_page_address(unsigned int page_address)
>  {
>  	unsigned int page_count;
>  
> -	writew(0x00, &nfc->flash_cmd);
> +	writew(0x00, &nfc->flash_add);
>  	writew(NFC_ADDR, &nfc->nand_flash_config2);
>  	nfc_wait_ready();
>  
> -	/* code only for 2kb flash */
> -	if (CONFIG_SYS_NAND_PAGE_SIZE == 0x800) {
> +	/* code only for large page flash */
> +	if (CONFIG_SYS_NAND_PAGE_SIZE > 512) {
>  		writew(0x00, &nfc->flash_add);
>  		writew(NFC_ADDR, &nfc->nand_flash_config2);
>  		nfc_wait_ready();
> @@ -88,22 +114,38 @@ static void nfc_nand_page_address(unsigned int page_address)
>  			page_count = page_count >> 8;
>  		} while (page_count);
>  	}
> +
> +	writew(0x00, &nfc->flash_add);
> +	writew(NFC_ADDR, &nfc->nand_flash_config2);
> +	nfc_wait_ready();

This (along with later bits) looks like it changes the behavior for existing
chips.  Have you tested it on a previously-supported chip?  Maybe elaborate
on the changes in the commit message.

-Scott

  parent reply	other threads:[~2010-01-15 23:13 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-13  4:43 [U-Boot] [PATCH 0/9] Add support for i.MX25 SOC and TX25 board John Rigby
2010-01-13  4:43 ` [U-Boot] [PATCH 1/9] mxc_serial replace platform specific clock John Rigby
2010-01-13  4:43   ` [U-Boot] [PATCH 2/9] arm926ejs: add nand_spl boot support John Rigby
2010-01-13  4:43     ` [U-Boot] [PATCH 3/9] Add v1.1 support to nand_spl fsl nfc driver John Rigby
2010-01-13  4:43       ` [U-Boot] [PATCH 4/9] Nand mxc_nand add v1.1 controller support John Rigby
2010-01-13  4:43         ` [U-Boot] [PATCH 5/9] fec_mxc: cleanup and factor out imx27 dependencies John Rigby
2010-01-13  4:43           ` [U-Boot] [PATCH 6/9] Add support for Freescale MX25 SOC John Rigby
2010-01-13  4:43             ` [U-Boot] [PATCH 7/9] fec_mxc: add imx25 support John Rigby
2010-01-13  4:44               ` [U-Boot] [PATCH 8/9] env_nand.c: print error message and fail gracefully John Rigby
2010-01-13  4:44                 ` [U-Boot] [PATCH 9/9] Add support for KARO TX25 board John Rigby
2010-01-13 15:26                   ` Fabio Estevam
2010-01-15 15:20                   ` Wolfgang Denk
2010-01-15 22:28                 ` [U-Boot] [PATCH 8/9] env_nand.c: print error message and fail gracefully Scott Wood
2010-01-13 15:10         ` [U-Boot] [PATCH 4/9] Nand mxc_nand add v1.1 controller support Fabio Estevam
2010-01-13 16:50           ` John Rigby
2010-01-15  0:48             ` Fabio Estevam
2010-01-15 16:49               ` John Rigby
2010-01-15 22:36                 ` Scott Wood
2010-01-15 23:32                   ` John Rigby
2010-01-13 15:15       ` [U-Boot] [PATCH 3/9] Add v1.1 support to nand_spl fsl nfc driver Fabio Estevam
2010-01-15 23:13       ` Scott Wood [this message]
2010-01-15 23:30         ` John Rigby
2010-01-15 23:48           ` Scott Wood
2010-01-15 15:09 ` [U-Boot] [PATCH 0/9] Add support for i.MX25 SOC and TX25 board Wolfgang Denk
2010-01-15 15:14 ` Wolfgang Denk

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=20100115231328.GA2956@loki.buserror.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.