[U-Boot] rk3288: broken boot

Dr. Philipp Tomsich philipp.tomsich at theobroma-systems.com
Wed Feb 14 11:02:29 UTC 2018


> On 14 Feb 2018, at 11:47, Jagan Teki <jagannadh.teki at gmail.com> wrote:
> 
> On Wed, Feb 14, 2018 at 5:38 AM, Dr. Philipp Tomsich
> <philipp.tomsich at theobroma-systems.com <mailto:philipp.tomsich at theobroma-systems.com>> wrote:
>> Jagan,
>> 
>>> On 13 Feb 2018, at 13:20, Jagan Teki <jagannadh.teki at gmail.com> wrote:
>>> 
>>> On Tue, Feb 13, 2018 at 5:29 PM, Dr. Philipp Tomsich
>>> <philipp.tomsich at theobroma-systems.com> wrote:
>>>> I verified the build for evb-rk3288_defconfig and everything looks fine:
>>>> 
>>>> spl/u-boot-spl.bin:     file format binary
>>>> 
>>>> 
>>>> Disassembly of section .data:
>>>> 
>>>> 00000000 <.data>:
>>>>      0:       eaffffff        b       0x4     <— this is the extra branch inserted (to be overwritten by mkimage)
>>>>      4:       ea000016        b       0x64
>>> 
>>> I saw this on SPL, but I'm using TPL where I'm using mkimage to tp binary
>>> 
>>>>       ...
>>>>     20:       ea00000f        b       0x64
>>>>     24:       e59ff014        ldr     pc, [pc, #20]   ; 0x40
>>>>     28:       e59ff014        ldr     pc, [pc, #20]   ; 0x44
>>>>     2c:       e59ff014        ldr     pc, [pc, #20]   ; 0x48
>>>>     30:       e59ff014        ldr     pc, [pc, #20]   ; 0x4c
>>>>     34:       e59ff014        ldr     pc, [pc, #20]   ; 0x50
>>>>     38:       e59ff014        ldr     pc, [pc, #20]   ; 0x54
>>>>     3c:       e59ff014        ldr     pc, [pc, #20]   ; 0x58
>>> 
>>> I can see the difference of size by 8 bytes with spl/u-boot-spl-dtb.bin
>>> 
>>> with tparams->header_size = RK_SPL_HDR_START + 4; (working scenario)
>>> $ ls -l spl/u-boot-spl-dtb.bin
>>> -rw-r--r-- 1 root root 37571
>>> 
>>> normal build have
>>> $ ls -l spl/u-boot-spl-dtb.bin
>>> -rw-r--r-- 1 root root 37563
>> 
>> In order to find the issue, I’d recommend to look at both the ELF file
>> and the binary for your TPL stage. Disassembling the binary will show
>> whether the extra branch is indeed added as the first instruction and
>> if the second instruction is a branch to the reset entry-point.
> 
> This is what I found with mkimage tpl, the extra 0xeaffffff branch
> inserted start with 0x820 in case of working, but branch insertion did
> 4 bytes prior to 0x820 [1]
> 
> https://paste.ubuntu.com/p/BbZrvJhqJD/ <https://paste.ubuntu.com/p/BbZrvJhqJD/>
This output looks very wrong (even the one that works for you).

There shouldn’t be all the 0-bytes at the beginning and the ea000016 (‘b 0x64’)
should be at offset 4 (i.e. 0x804); the 0xeaffffff should have been at offset 0 (and
been overwritten with the ‘RK32’ at 0x800).

Apparently the tpl/u-boot-tpl.bin you feed into mkimage is already wrong: you
should check your ld-script, the ELF-file and the objcopy.  This looks as if some
part of the process is adding 7 words of padding.  The assembly injected from
the boot0 header needs to be at the start of the binary… if it is not, then something
has gone wrong before.

Thanks,
Philipp.



More information about the U-Boot mailing list