From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Fwd: [PATCH v4] arm: omap3: Add SPL support to cm_t35
Date: Wed, 04 Dec 2013 13:38:52 +0100 [thread overview]
Message-ID: <529F225C.5090408@denx.de> (raw)
In-Reply-To: <20980858CB6D3A4BAE95CA194937D5E73EA51A1E@DBDE04.ent.ti.com>
Pekon!
On 04.12.2013 13:15, Gupta, Pekon wrote:
>> Very strangely, the Technexion TAO3530 board works fine with SPL. Even
>> with current mainline. The only difference I can see right now is, that
>> TAO3530 has an 16bit NAND chip and the CM_T35 has an 8bit NAND chip.
>>
> For HAM1_HW this selects ecc-scheme as below..
> @@omap_select_ecc_scheme()
> case OMAP_ECC_HAM1_CODE_HW:
> + /* define ecc-layout */
> + ecclayout->eccbytes = nand->ecc.bytes * eccsteps;
> + for (i = 0; i < ecclayout->eccbytes; i++)
> + ecclayout->eccpos[i] = i + BADBLOCK_MARKER_LENGTH;
> + ecclayout->oobfree[0].offset = i + BADBLOCK_MARKER_LENGTH;
> + ecclayout->oobfree[0].length = oobsize - ecclayout->eccbytes -
> + BADBLOCK_MARKER_LENGTH;
>
> Aah!!... May be I understand the issue..
> Reference: As per OMAP3530 TRM given below
> http://www.ti.com/product/omap3530
> http://www.ti.com/litv/pdf/spruf98x
> Chapter-25: Initialization
> Sub-topic: Memory Booting
> Section: 25.4.7.4 NAND
> Figure 25-19. ECC Locations in NAND Spare Areas
> For large-page NAND
> (a) x8 Device: ECC signature starts from byte[1] in OOB (offset of 1 *byte*)
> (b) x16 Device: ECC signature starts from byte[2] in OOB (offset of 1 *word*)
>
> And in omap_gpmc.c .. BADBLOCK_MARKER_LENGTH = 2.
> So ECC signature starts from offset
> ecclayout->eccpos[0] = 0 + BADBLOCK_MARKER_LENGTH = 0x2;
> which is actually for (b) that is x16 device.
>
> Thus, Technexion TAO3530 board with x16 NAND device is booting correctly,
> Whereas CM_T35 with x8 NAND device fails..
Sounds like a very good explanation. Thanks!
>> Unfortunately I have to stop debugging this issue now. Perhaps Pekon has
>> an idea on whats going on here. Pekon, do you have an OMAP3530 board
>> with an 8bit NAND chip? Or do you have any other idea, what might cause
>> this problem?
>>
> It's a bug in driver. I should have taken care of device-width while defining
> the layout. I think this is the issue with HAM1 scheme only, because ROM
> code has same ecc-layout for other schemes (like BCH8) whether it's a
> x8 or x16 devices.
> Please patch following to see if CM_T35 boots fine, with latest u-boot.
>
> diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
> index bf43520..99dfcc6 100644
> --- a/drivers/mtd/nand/omap_gpmc.c
> +++ b/drivers/mtd/nand/omap_gpmc.c
> @@ -626,7 +626,10 @@ static int omap_select_ecc_scheme(struct nand_chip *nand,
> /* define ecc-layout */
> ecclayout->eccbytes = nand->ecc.bytes * eccsteps;
> for (i = 0; i < ecclayout->eccbytes; i++)
> - ecclayout->eccpos[i] = i + BADBLOCK_MARKER_LENGTH;
> + if (nand->options & NAND_BUSWIDTH_16)
> + ecclayout->eccpos[i] = i + 2;
> + else
> + ecclayout->eccpos[i] = i + 1;
> ecclayout->oobfree[0].offset = i + BADBLOCK_MARKER_LENGTH;
> ecclayout->oobfree[0].length = oobsize - ecclayout->eccbytes -
> BADBLOCK_MARKER_LENGTH;
>
> Thanks for pointing out this..
> Sorry I don't have many OMAP3 boards to boot-test HAM1, so this error crept in.
> Once you confirm its working, I'll submit a formal patch.
Yes. This fixes this issue on the cm-t35 board. So please submit a
proper patch. :)
Thanks again for this quick fix!
Stefan
next prev parent reply other threads:[~2013-12-04 12:38 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-14 8:54 [U-Boot] [PATCH 1/3] arm: spl: Fix SPL booting for OMAP3 Stefan Roese
2013-06-14 8:55 ` [U-Boot] [PATCH 2/3] arm: omap3: spl: Fix problem with 8bit NAND devices Stefan Roese
2013-07-30 13:25 ` [U-Boot] [U-Boot, " Tom Rini
2013-06-14 8:55 ` [U-Boot] [PATCH 3/3] arm: omap3: Add SPL support to cm_t35 Stefan Roese
2013-06-17 11:53 ` Igor Grinberg
2013-06-17 12:38 ` Tom Rini
2013-06-17 13:38 ` Igor Grinberg
2013-06-17 13:52 ` Stefan Roese
2013-06-17 14:03 ` [U-Boot] [PATCH v2 " Stefan Roese
2013-06-18 6:14 ` Nikita Kiryanov
2013-07-30 10:52 ` [U-Boot] [PATCH v3 " Stefan Roese
2013-07-30 12:10 ` Albert ARIBAUD
2013-07-30 12:14 ` Stefan Roese
2013-11-15 7:51 ` [U-Boot] [PATCH v4] " Stefan Roese
[not found] ` <5288BBAC.2020307@compulab.co.il>
[not found] ` <5295BF6C.20902@compulab.co.il>
[not found] ` <5295C3F8.50101@denx.de>
[not found] ` <529E01B7.4070402@compulab.co.il>
2013-12-04 11:38 ` [U-Boot] Fwd: " Stefan Roese
2013-12-04 11:57 ` Tom Rini
2013-12-04 12:02 ` Stefan Roese
2013-12-04 12:15 ` Gupta, Pekon
2013-12-04 12:38 ` Stefan Roese [this message]
2013-06-20 16:42 ` [U-Boot] [PATCH 1/3] arm: spl: Fix SPL booting for OMAP3 Albert ARIBAUD
2013-06-20 17:01 ` Stefan Roese
2013-06-20 17:51 ` Albert ARIBAUD
2013-06-20 18:28 ` Stefan Roese
2013-06-20 19:18 ` Albert ARIBAUD
2013-06-21 2:13 ` [U-Boot] [PATCH v2 " Stefan Roese
2013-06-21 8:57 ` Albert ARIBAUD
2013-06-21 9:10 ` [U-Boot] [PATCH v3 " Stefan Roese
2013-06-21 10:30 ` Albert ARIBAUD
2013-06-21 10:39 ` Stefan Roese
2013-06-21 10:42 ` [U-Boot] [PATCH v4 " Stefan Roese
2013-06-21 11:02 ` Albert ARIBAUD
2013-06-25 7:14 ` [U-Boot] [PATCH v5 " Stefan Roese
2013-06-27 8:27 ` Albert ARIBAUD
2013-07-03 19:47 ` Tom Rini
2013-07-04 11:58 ` Albert ARIBAUD
2013-07-15 14:33 ` [U-Boot] [PATCH " Tom Rini
2013-07-16 6:24 ` Stefan Roese
2013-07-16 14:36 ` Tom Rini
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=529F225C.5090408@denx.de \
--to=sr@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 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.