public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Alessandro Rubini <rubini-list@gnudd.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] Nand driver for Nomadik SoC
Date: Mon, 9 Feb 2009 18:56:52 +0100	[thread overview]
Message-ID: <20090209175652.GA1206@mail.gnudd.com> (raw)
In-Reply-To: <20090209171641.GA27824@ld0162-tx32.am.freescale.net>

> From: Scott Wood <scottwood@freescale.com>

Unfortunately freescale.com i.e. mail.global.frontbridge.com i.e. microsoft
has blacklisted me. I'm trying to do what they say but I fear you won't
get direct email.

>> +static inline int parity(int b) /* b is really a byte; returns 0 or ~0 */
> 
> If it's really a byte, then why not tell the compiler this with uint8_t?

Because otherwise it will add instructions to mask the value.
 
>> +	__asm__ __volatile__(

> Why is this volatile?
> The underscores are unnecessary, BTW.

Both for my own pedantry.

> Have you verified that this is noticeably better than C code?

Well... it looked like I only checked without -O. I rechecked and the
result is the same. Ok, will switch to the C version.

>> +/*
>> + * This is the ECC routine used in hardware, according to the manual.
>> + * HW claims to make the calculation but not the correction; so we must
>> + * recalculate the bytes for a comparison.
>> + */
> 
> Why must you recalculate?  What does the hardware do with the ECC it
> calculates?

It only makes it available. You must recalculate and compare. However,
I haven't been able to make the hardware work (nor original vendor
code did actually use the hardware). I'm waiting for an errata sheet
or direct clarification. Meanwhile this code is working and it's the
best I can do (I can't use ECC_SOFT as the ECC layout would be
different from shipped devices).
 
>> +	.oobfree = { {0x08, 0x08}, {0x18, 0x08}, {0x28, 0x08}, {0x38, 0x08} },
>> +};
> 
> Any particular reason why bytes 0x05-0x07, 0x10-0x11, 0x15-0x17,
> etc. aren't marked free?

Since most other ECC routines use 2..7 I chose to leave open the
possibility to switch over from 2..4. Is that wrong?

>> +	len >>= 2;
>
> What if "len" isn't a multiple of 4?

I thought it never is. This always reads either 512 or 64
bytes. Aligned, too.

>> -#define CONFIG_SYS_NAND_BASE		0x40000000
>> +#define CONFIG_SYS_NAND_BASE		0x40000000 /* SMPS0n */
> 
> What is "SMPS0n"?

It's the chip select. Usually who would use this code will have the
manuals, so all the strange names can be looked up.  Specifically,
it's never spelled out. It's something like "Static Memory Pccard/nand
Select". Kind of black magic, like most vendor names (all vendors).

thanks
/alessandro

  reply	other threads:[~2009-02-09 17:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-07  4:43 [U-Boot] [PATCH] Nand driver for Nomadik SoC Alessandro Rubini
2009-02-07 15:04 ` [U-Boot] [PATCH v2] " Alessandro Rubini
2009-02-07 21:08   ` Jean-Christophe PLAGNIOL-VILLARD
2009-02-07 23:19   ` [U-Boot] [PATCH v3] " Alessandro Rubini
2009-02-09  7:34     ` Stefan Roese
2009-02-09  8:40       ` Alessandro Rubini
2009-02-09  8:48         ` Stefan Roese
2009-02-09 17:16     ` Scott Wood
2009-02-09 17:56       ` Alessandro Rubini [this message]
2009-02-09 18:10         ` Scott Wood
  -- strict thread matches above, loose matches on Subject: below --
2009-02-09 14:53 [U-Boot] [PATCH 0/3] Drivers for nomadik 8815 board Alessandro Rubini
2009-02-09 14:53 ` [U-Boot] [PATCH 1/3] Added nomadik.h header Alessandro Rubini
2009-02-09 14:53 ` [U-Boot] [PATCH 2/3] Nand driver for Nomadik SoC Alessandro Rubini
2009-02-09 21:48   ` Alessandro Rubini
2009-02-09 22:28     ` Scott Wood
2009-02-09 14:53 ` [U-Boot] [PATCH 3/3] Enable Ethernet for Nomadik 8815 Evaluation Kit Alessandro Rubini

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=20090209175652.GA1206@mail.gnudd.com \
    --to=rubini-list@gnudd.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