From: stefano babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] Correct corrupted NAND Flash access on KARO TX25 modules
Date: Mon, 02 Apr 2012 23:54:06 +0200 [thread overview]
Message-ID: <4F7A1FFE.4010905@denx.de> (raw)
In-Reply-To: <7605B15734F74B40A124AED46B25250A4F2888@HEFRMBX01.sofr.hefr.lan>
Am 02/04/2012 22:55, schrieb Gachet Daniel:
> This patch v2 correct corrupted data while reading NAND flash modules on the KARO TX25 module.
>
Hi Daniel,
> The current version of the mxc_nand driver uses the symmetric mode to access the NAND flash, but the devices populated on the KARO TX25 only support an asymmetric mode (i.MX25: bit 8 within NAND_FLASH_CONFIG1 register cleared).
>
> To solve the problem in a generic way, the proposition is to define a specific value for that bit, CONFIG_NAND_MXC_NFC_ONE_CYCLE. This value could be defined in the specific board configuration file (./include/configs/...). Short description:
>
> CONFIG_NAND_MXC_NFC_ONE_CYCLE enables to specify how to access NAND flash on the i.MX25 CPU.
> If CONFIG_NAND_MXC_NFC_ONE_CYCLE is defined, a one-clock cycle will be used to access the NAND flash (symmetric mode); otherwise a two-clock cycle will be used (asymmetric mode).
>
> Signed-off-by: Daniel Gachet <daniel.gachet@hefr.ch>
> Cc: stefano babic <sbabic@denx.de>
>
> diff -upr drivers/mtd/nand/mxc_nand.c drivers/mtd/nand/mxc_nand.c
> --- drivers/mtd/nand/mxc_nand.c 2011-12-23 20:25:35.000000000 +0100
> +++ drivers/mtd/nand/mxc_nand.c 2012-04-02 22:30:13.000000000 +0200
> @@ -1290,7 +1290,9 @@ static void mxc_setup_config1(void)
> uint16_t tmp;
>
> tmp = readw(&host->regs->nfc_config1);
> +#ifdef CONFIG_NAND_MXC_NFC_ONE_CYCLE
> tmp |= NFC_ONE_CYCLE;
> +#endif
This is not correct. You invert the logic, making as default your board.
But this breaks other boards because none of them set this switch.
To complete your patch you should:
- use an inverted logic, letting as default the current behavior and
modifying the behavior only for your board.
- add the config switch to your board configuration file, that is tx25.h
- add a description in the README file for your new configuration switch
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
next prev parent reply other threads:[~2012-04-02 21:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-02 20:55 [U-Boot] [PATCH v2] Correct corrupted NAND Flash access on KARO TX25 modules Gachet Daniel
2012-04-02 21:08 ` Marek Vasut
2012-04-02 21:56 ` stefano babic
2012-04-02 21:54 ` stefano babic [this message]
2012-04-03 5:26 ` Gachet Daniel
2012-04-03 12:28 ` Stefano Babic
2012-04-06 20:16 ` 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=4F7A1FFE.4010905@denx.de \
--to=sbabic@denx.de \
--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