mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexey Galakhov <agalakhov@gmail.com>
To: Juergen Beisert <jbe@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/4] Fine split S3C arch dependencies from generic code
Date: Fri, 04 May 2012 18:34:43 +0600	[thread overview]
Message-ID: <4FA3CCE3.6030606@gmail.com> (raw)
In-Reply-To: <201205041400.18168.jbe@pengutronix.de>

On 04.05.2012 18:00, Juergen Beisert wrote:
> Alexey Galakhov wrote:
>> On 04.05.2012 17:13, Juergen Beisert wrote:
>>> AFAIR the MLC ECC generator is different in its handling. At least it is
>>> much slower than the 1 bit ECC generator and so the routines must wait
>>> the result to continue on the block data.
>>
>> Correct.
>>
>> This is achieved by adding register polling loop at the beginning of
>> corresponding calculate() function. The rest of function is almost the
>> same, just the number of ECC bytes is larger.
>>
>> The S3C2440 has a hardware ECC corrector which we do not use yet.
> 
> AFAIK only a hardware ECC _calculator_, but no correction unit. It must be 
> done in software.

At least S5PV210 has a correction unit. If you provide correct ECC to
the unit (write into NFxECCDx), you may then read back the exact byte
and bit position of the error from NFESTAT.

S3C2440 seems to have something very similar. At least it has bits with
same names in NFESTAT. Its usage is not documented in my copy of
datasheet, perhaps in some appnote?

The "s3c_nand.c" driver does like that, even for 2440:
    nfmeccdata0 = (read_ecc[1] << 16) | read_ecc[0];
    nfmeccdata1 = (read_ecc[3] << 16) | read_ecc[2];
    writel(nfmeccdata0, regs + S3C_NFMECCDATA0);
    writel(nfmeccdata1, regs + S3C_NFMECCDATA1);
    nfestat0 = readl(regs + S3C_NFMECCERR0);
    err_type = nfestat0 & 0x3;
and then (if err_type == 1):
    dat[(nfestat0 >> 7) & 0x7ff] ^= (1 << ((nfestat0 >> 4) & 0x7));

The MLC case is very similar. The only exception is that there is no
write-back of ECC values, instead one should READ the corresponding part
of OOB immediately after reading the data.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-05-04 12:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-03 13:14 [PATCH 0/4] Support Samsung S5PV210 CPU Alexey Galakhov
2012-05-03 13:14 ` [PATCH 1/4] Support most Samsung SoCs in S3C serial driver Alexey Galakhov
2012-05-03 13:14 ` [PATCH 2/4] Fine split S3C arch dependencies from generic code Alexey Galakhov
2012-05-03 17:41   ` Juergen Beisert
2012-05-04  9:39     ` Alexey Galakhov
2012-05-04  9:58       ` Juergen Beisert
2012-05-04 10:50         ` Alexey Galakhov
2012-05-04 11:13           ` Juergen Beisert
2012-05-04 11:26             ` missing sscanf christian.buettner
2012-05-04 11:40             ` [PATCH 2/4] Fine split S3C arch dependencies from generic code Alexey Galakhov
2012-05-04 12:00               ` Juergen Beisert
2012-05-04 12:34                 ` Alexey Galakhov [this message]
2012-05-04 10:52         ` Alexey Galakhov
2012-05-03 13:14 ` [PATCH 3/4] Minimal S5PV210 + Tiny210 support (2nd stage only) Alexey Galakhov
2012-05-03 17:49   ` Juergen Beisert
2012-05-04  9:41     ` Alexey Galakhov
2012-05-03 13:14 ` [PATCH 4/4] S5PV210 iROM magic boot code Alexey Galakhov
2012-05-03 17:59   ` Juergen Beisert
2012-05-04  9:47     ` Alexey Galakhov

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=4FA3CCE3.6030606@gmail.com \
    --to=agalakhov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=jbe@pengutronix.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