[U-Boot] [PATCH] POST: Added ECC memory test for mpc83xx.

Timur Tabi timur.tabi at gmail.com
Tue Apr 6 16:40:48 CEST 2010


On Tue, Apr 6, 2010 at 4:28 AM, Michael Zaidman
<michael.zaidman at gmail.com> wrote:

> I do not question the rationale behind the requirement to use the I/O
> accessors. My question is - if there are any exceptions to the rule?

Not really.  The problem is that volatile does not take the PowerPC
execution ordering into account.  So even if you use volatile, the
read write might not actually be performed when you think it should be
performed.

> Just for curiosity I compared the assembly code generated by both
> versions of ecc_clear routine  - original and using I/O accessors. The
> original is of 0x3C size while "accessors" version has 0x74 size.

That's not surprising.  The I/O accessors are not very efficient,
since they sync after ever write.

> Rewriting code to use accessors API added 56 bytes or 14 opcodes. It
> doubled the routine's execution time. The routine is called in the
> loop per each ecc word, that significantly increased execution time of
> the ECC POST test and consequently board startup time.

If this is really a problem, you can modify the code to perform the
writes without the I/O accessors, and then terminate the block with a
sync.  You should add a comment explaining why you're not using I/O
accessors.  At this point, I'm not 100% clear whether the use of
volatile is okay.

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the U-Boot mailing list