From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 2/4] sunxi: nand: Add basic sunxi NAND driver for SPL with DMA support
Date: Fri, 31 Jul 2015 16:27:44 +0200 [thread overview]
Message-ID: <55BB85E0.90701@redhat.com> (raw)
In-Reply-To: <CAOMqctRV5cKdWVQVApv1J0NMTyO1V3npLRRKbK-CVUR8TzYipw@mail.gmail.com>
Hi,
On 31-07-15 16:25, Michal Suchanek wrote:
> On 31 July 2015 at 11:24, Boris Brezillon
> <boris.brezillon@free-electrons.com> wrote:
>> Hi Hans,
>>
>> On Fri, 31 Jul 2015 10:36:43 +0200
>> Hans de Goede <hdegoede@redhat.com> wrote:
>>
>>> Hi,
>>>
>>> On 31-07-15 02:47, Scott Wood wrote:
>>>> On Thu, 2015-07-23 at 14:33 +0200, Piotr Zierhoffer wrote:
>>>>> +int nand_spl_load_image(uint32_t offs, unsigned int size, void *dest)
>>>>> +{
>>>>> + void *current_dest;
>>>>> + uint32_t count;
>>>>> + uint32_t current_count;
>>>>> + uint32_t ecc_errors = 0;
>>>>> +
>>>>> + memset(dest, 0x0, size); /* clean destination memory */
>>>>> + for (current_dest = dest;
>>>>> + current_dest < (dest + size);
>>>>> + current_dest += CONFIG_NAND_SUNXI_SPL_ECC_PAGE_SIZE) {
>>>>> + nand_read_page(offs, offs
>>>>> + < CONFIG_NAND_SUNXI_SPL_SYNDROME_PARTITIONS_END,
>>>>> + &ecc_errors);
>>>>> + count = current_dest - dest;
>>>>> +
>>>>> + if (size - count > CONFIG_NAND_SUNXI_SPL_ECC_PAGE_SIZE)
>>>>> + current_count = CONFIG_NAND_SUNXI_SPL_ECC_PAGE_SIZE;
>>>>> + else
>>>>> + current_count = size - count;
>>>>> +
>>>>> + memcpy(current_dest,
>>>>> + temp_buf,
>>>>> + current_count);
>>>>> + offs += CONFIG_NAND_SUNXI_SPL_ECC_PAGE_SIZE;
>>>>> + }
>>>>> + return ecc_errors ? -1 : 0;
>>>>> +}
>>>>
>>>> No bad block marker handling?
>>>
>>> The bootrom does not use bad block marker handling (and allwinner's
>>> own FTL does neither for the non boot area, the actually mess up
>>> things by writing metadata which looks like classic bad block
>>> markers).
>>
>> Hm, checking for bad block markers (and skipping bad blocks) is always a
>> good thing, even if it does not by itself guarantee that the data
>> stored in there are not corrupted.
>
> Not on Allwinner hardware. Allwinner tools write data to the nand
> which looks like bad block markers so skipping blocks which appear
> marked as bad will inevitably skip valid blocks on many (most ?)
> Allwinner devices.
Right this has been my observation as well.
> Only in the case you soldered a new nand chip yourself and never used
> Allwinner tools with it will the bad block markers remain valid. This
> is overall very unlikely so it should not be something SPL handles.
Or if you've some device where the nand was not initialized from
the factory, I think some Olinuxino devices with nand fall into this
category.
I agree that is best to simply ignore bad block markers on sunxi
though, as they tend to lead to many false positives (think 60% of
the entire nand consisting of bad blocks in my experience)
Regards,
Hans
next prev parent reply other threads:[~2015-07-31 14:27 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-23 12:33 [U-Boot] [PATCH v3 0/4] sunxi: nand: Basic NAND driver for SPL Piotr Zierhoffer
2015-07-23 12:33 ` [U-Boot] [PATCH v3 1/4] sunxi: nand: Add pinmux and clock settings for NAND support Piotr Zierhoffer
2015-07-23 12:33 ` [U-Boot] [PATCH v3 2/4] sunxi: nand: Add basic sunxi NAND driver for SPL with DMA support Piotr Zierhoffer
2015-07-31 0:47 ` Scott Wood
2015-07-31 8:36 ` Hans de Goede
2015-07-31 9:24 ` Boris Brezillon
2015-07-31 14:25 ` Michal Suchanek
2015-07-31 14:27 ` Hans de Goede [this message]
2015-07-31 14:41 ` Boris Brezillon
2015-07-31 15:27 ` Michal Suchanek
2015-07-31 16:57 ` Scott Wood
2015-07-23 12:33 ` [U-Boot] [PATCH v3 3/4] sunxi: nand: Add board configuration options Piotr Zierhoffer
2015-07-23 12:33 ` [U-Boot] [PATCH v3 4/4] sunxi: nand: Add information to sunxi that it was run from NAND in SPL Piotr Zierhoffer
2015-07-23 14:04 ` [U-Boot] [PATCH v3 0/4] sunxi: nand: Basic NAND driver for SPL Marek Vasut
2015-07-23 14:59 ` Piotr Zierhoffer
2015-07-23 15:57 ` Marek Vasut
2015-08-01 12:15 ` Hans de Goede
2015-08-01 12:30 ` Boris Brezillon
2015-08-01 19:22 ` Scott Wood
2015-08-02 12:56 ` Hans de Goede
2015-08-06 7:55 ` Piotr Zierhoffer
2015-08-20 12:37 ` Stefan Roese
2015-08-20 13:42 ` Hans de Goede
2015-08-20 14:49 ` Stefan Roese
2015-08-27 10:06 ` Stefan Roese
2015-08-27 10:10 ` 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=55BB85E0.90701@redhat.com \
--to=hdegoede@redhat.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