[U-Boot] [PATCH 11/14] sunxi: Fill memory before comparing it when doing dram init on sun6i

Hans de Goede hdegoede at redhat.com
Fri Dec 19 17:56:40 CET 2014


Hi,

On 19-12-14 11:08, Siarhei Siamashka wrote:
> On Thu, 18 Dec 2014 19:12:13 +0000
> Ian Campbell <ijc at hellion.org.uk> wrote:
>
>> On Tue, 2014-12-16 at 21:31 +0100, Hans de Goede wrote:
>>> The sun8i boot0 code fills the DRAM with a "random" pattern before comparing
>>> it at different offsets to do columns, etc. detection. The sun6i boot0 code
>>> does not do it, but it seems like a good idea to do this regardless.
>>
>> Is this the right way round? The existing sun6i code (which you are
>> moving here) seems to _rely_ on something having written a useful
>> pattern, which I would have assumed to have been boot0. Or else how does
>> it work now? Chance?
>
> It appears that this code is just trying to find the first address line,
> which is not connected anywhere. If the address line is not connected,
> then having the corresponding bit set or clear in the memory address
> does not matter and we are effectively accessing the same location.

Correct.

> Both sun6i and sun8i code is incorrect and only works because of relying
> on luck.
>
> The sun6i code is incorrect because it is just reading memory without
> initializing it at all. Probably relying on having some unique garbage
> there in a natural way.
>
> The newer sun8i code is still incorrect because it is not safeguarding
> against accidentally encountering the same test pattern at an unrelated
> memory location. Yes, the probability is extremely low, but still not
> zero.

The probability is so low that it really does not matter, so I've no intention
to fix this.

Regards,

Hans


More information about the U-Boot mailing list