From: Stefan Agner <stefan@agner.ch>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 8/8] mtd: vf610_nfc: enable ONFI detection
Date: Fri, 08 May 2015 17:49:08 +0200 [thread overview]
Message-ID: <ac2ec3f1b5ed8d0a4f4c75d5dedee02e@agner.ch> (raw)
In-Reply-To: <1429571851.4352.45.camel@freescale.com>
On 2015-04-21 01:17, Scott Wood wrote:
> On Wed, 2015-04-08 at 16:44 +0200, Stefan Agner wrote:
>> + case ALT_BUF_ONFI:
>> + /* Reverse byte since the controller uses big endianness */
>> + c = nfc->column % 4;
>> + c = nfc->column - c + (3 - c);
>
> These two lines can be simplified to "c = nfc->column ^ 3;"
>
> Doesn't this driver run on some big-endian targets, in which case you
> wouldn't want to reverse? I think you should instead be using in_be32()
> and then extracting the byte within the word after it's been put into
> cpu byte order.
Yes agreed, big endian platforms shouldn't be left out here, will fix
that.
>> + tmp = *((u8 *)(nfc->regs + NFC_MAIN_AREA(0) + c));
>> + break;
>> + default:
>> + tmp = *((u8 *)(nfc->regs + NFC_MAIN_AREA(0) + c));
>> + break;
>
> Why is the byte order different here? I guess you've been writing data
> backwards onto the NAND chip? Won't that mess up factory bad block
> markers?
Yes, the data end up backward in the NAND chip. I asked that myself to,
however, I have devices which definitely come with "naturally" looking
bad blocks. It seems that the whole pages are actually set to 0x00 on
those chips, although this is not specified in the data sheet. I will
try to figure out more...
--
Stefan
prev parent reply other threads:[~2015-05-08 15:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-08 14:44 [U-Boot] [PATCH v2 0/8] mtd: vf610_nfc: various fixes and improvements Stefan Agner
2015-04-08 14:44 ` [U-Boot] [PATCH v2 1/8] mtd: vf610_nfc: remove caching of page in buffer Stefan Agner
2015-04-08 14:44 ` [U-Boot] [PATCH v2 2/8] mtd: vf610_nfc: remove read on SEQIN Stefan Agner
2015-04-08 14:44 ` [U-Boot] [PATCH v2 3/8] mtd: vf610_nfc: allow bitflips in an empty page Stefan Agner
2015-04-08 14:44 ` [U-Boot] [PATCH v2 4/8] mtd: vf610_nfc: implement OOB only read Stefan Agner
2015-04-08 14:44 ` [U-Boot] [PATCH v2 5/8] mtd: vf610_nfc: use in-band bad block table Stefan Agner
2015-04-08 14:44 ` [U-Boot] [PATCH v2 6/8] mtd: vf610_nfc: add Freescale NFC controller configs to Kconfig Stefan Agner
2015-04-08 14:44 ` [U-Boot] [PATCH v2 7/8] mtd: vf610_nfc: add 32-error correction option for HW ECC Stefan Agner
2015-04-08 14:44 ` [U-Boot] [PATCH v2 8/8] mtd: vf610_nfc: enable ONFI detection Stefan Agner
2015-04-20 23:17 ` Scott Wood
2015-05-08 15:49 ` Stefan Agner [this message]
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=ac2ec3f1b5ed8d0a4f4c75d5dedee02e@agner.ch \
--to=stefan@agner.ch \
--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