public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Amit Virdi <amit.virdi@st.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 2/4] mtd/NAND: Add FSMC driver support
Date: Wed, 16 May 2012 16:11:24 +0530	[thread overview]
Message-ID: <4FB38454.3080803@st.com> (raw)
In-Reply-To: <4FB2C71A.3000208@freescale.com>

Hi Scott,

On 5/16/2012 2:44 AM, Scott Wood wrote:
> On 05/07/2012 02:26 AM, Amit Virdi wrote:
>> +	while (num_err--) {
>> +		change_bit(0,&err_idx[i]);
>> +		change_bit(1,&err_idx[i]);
>> +
>> +		if (err_idx[i]<  512 * 8) {
>> +			change_bit(err_idx[i], dat);
>> +			i++;
>> +		}
>> +	}
>
> Is it normal to not count bit flips in the ECC itself?
>

Correcting bit flip in ECC isn't of any use, so we skipped it.

Otherwise also, the ECC and the data area are not contiguous here as 
they are at different parts of RAM so we couldn't have done
	if (err_idx[i]<  (512+13) * 8) {
here.

>> +{
>> +	u_int ecc_tmp;
>> +
>> +	switch (fsmc_version) {
>> +	case FSMC_VER8:
>> +		/* Busy waiting for ecc computation to finish for 512 bytes */
>> +		while (!(readl(&fsmc_regs_p->sts)&  FSMC_CODE_RDY))
>> +			;
>
> Timeout?
>

Ok, I'll implement 1 sec timeout.

>> +	/*
>> +	 * ecc_oob is intentionally taken as u16. In 16bit devices, we end up
>> +	 * reading 14 bytes (7 words) from oob. The local array is to maintain
>> +	 * word alignment
>> +	 */
>> +	uint16_t ecc_oob[7];
>> +	uint8_t *oob = (uint8_t *)&ecc_oob[0];
>
> Please use a union, or better an explicit alignment attribute.
>

Ok.

>> +enum {
>> +	FSMC_VER1 = 1,
>> +	FSMC_VER2,
>> +	FSMC_VER3,
>> +	FSMC_VER4,
>> +	FSMC_VER5,
>> +	FSMC_VER6,
>> +	FSMC_VER7,
>> +	FSMC_VER8,
>> +};
>
> Is this really necessary?
>

No. I'll remove it.

Thanks
Amit Virdi

  reply	other threads:[~2012-05-16 10:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-07  7:26 [U-Boot] [PATCH V2 0/4] mtd/NAND: Support for FSMC controller Amit Virdi
2012-05-07  7:26 ` [U-Boot] [PATCH V2 1/4] ARM: Define change_bit routine Amit Virdi
2012-05-07  7:26 ` [U-Boot] [PATCH V2 2/4] mtd/NAND: Add FSMC driver support Amit Virdi
2012-05-15 21:14   ` Scott Wood
2012-05-16 10:41     ` Amit Virdi [this message]
2012-05-16 11:05       ` Amit Virdi
2012-05-16 11:31         ` Amit Virdi
2012-05-16 16:02       ` Scott Wood
2012-05-17 11:21         ` Amit Virdi
2012-05-07  7:26 ` [U-Boot] [PATCH V2 3/4] SPEAr: Configure FSMC driver for NAND interface Amit Virdi
2012-05-07  7:26 ` [U-Boot] [PATCH V2 4/4] mtd/NAND: Remove obsolete SPEAr specific NAND drivers Amit Virdi
2012-05-07  8:19 ` [U-Boot] [PATCH V2 0/4] mtd/NAND: Support for FSMC controller Stefan Roese
2012-05-14 13:49   ` Stefan Roese

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=4FB38454.3080803@st.com \
    --to=amit.virdi@st.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