rk3188 (radxa rock pro) boot failure w/ barebox 2018-04 and later

Панов Андрей rockford at yandex.ru
Fri Sep 14 11:20:04 PDT 2018


Attached patch fixed the problem.

in arch/arm/cpu/uncompress.c global_variable_offset() was called before relocation.

And we have TEXT_BASE = 0 (since CONFIG_*_RELOCATABLE is set and it is not configurable)

Arch memory starts at 0x60000000 and image linked at 0x0, so global_variable_offset() returns 0x60000000

We're running around 0x60000000 and at
       image_end = (void *)&image_end_marker + global_variable_offset();
&image_end_marker is 0x6000XXXXX
image_end goes at 0x60000000 more than it is actually

After relocation global_variable_offset() becomes zero.

So if we move 
       image_end = (void *)&image_end_marker + global_variable_offset();
after relocation it will point to right location.

I am not sure it is true for all architectures, but in current state it is wrong when memory is not starts at 0.

13.09.2018, 15:38, "Sam Ravnborg" <sam at ravnborg.org>:
> Hi S.
> On Thu, Sep 13, 2018 at 01:18:54PM +0200, perachet7 at gmail.com wrote:
>>  Hey list,
>>  Between 2018-04 and 2018-05 tar release, barebox stops booting on rk3188
>>  (radxa rock pro).
>>  A git bisect reveals (see end of mail for commit detail):
>>          first bad commit: [2a94e821ba2e64890ac47b9ba177c7b6585b23be] ARM: For
>>  relocatable image force TEXT_BASE 0x0.
>>  As was suggested on #barebox, I tried setting TEXT_BASE=0x10 at this commit
>>  but it's a no fix.
>>  It is however booting even later releases if the trailing "if !RELOCATABLE" is
>>  removed. I have yet to have a deeper look at the code modified by
>>  Furthermore, it seems the commit itself is only triggering a boot failure. The
>>  proper code causing it is probably hiding someplace else.
>>  Any direction, ideas or hints given is appreciated.
> I was hit by a do-not-boot issue as well after upgrading to 2018.05.
> In my case this was due to a fix to get_runtime_offset()
> It turned out that I had subtraced the value, not added.
> Looks like an artifict from some code I copied some time ago.
> Maybe this hint can help you, and maybe this is totally unrelated.
> Good luck chasing it down.
>         Sam
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-------------- next part --------------
A non-text attachment was scrubbed...
Name: variable_offset.diff
Type: text/x-diff
Size: 927 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/barebox/attachments/20180914/6a33ad36/attachment.bin>

More information about the barebox mailing list