[U-Boot] mips-relocs tool conflicts with CONFIG_OF_SEPRATE

Daniel Schwierzeck daniel.schwierzeck at gmail.com
Sat Nov 17 15:39:55 UTC 2018


Am Sa., 17. Nov. 2018, 15:43 hat 袁建鹏 <yuanjp at hust.edu.cn> geschrieben:

> Hi
>
>
>
>
> I'm adding a new board support to u-boot-2018.09. When I boot the device,I
> got an error msg:
>
>     No valid device tree binary found - please append one to U-Boot
> binary, use u-boot-dtb.bin or define CONFIG_OF_EMBED. For sandbox, use -d
> <file.dtb>
>

This is fixed in v2018.11, please rebase.


>
>
>
> After some debugging, I found the reason:
>
> the device tree blob is cat to u-boot-nodtb.bin. the dtb is referenced by
> `_end` symbol which is defined at arch/mips/cpu/u-boot.lds
>
>     /*
>      * .rel must come last so that the mips-relocs tool can shrink
>      * the section size & the PT_LOAD program header filesz.
>      */
>     .rel : {
>         __rel_start = .;
>         BYTE(0x0)
>         . += (32 * 1024) - 1;
>
>
>     }
>
>     _end = .;
>
>
>
>
> But mips-relocs tool shrink the .rel section, that make filesz smaller
> than memsz:
>
>
>
>
>
>
>
> Program Headers:
>   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
>   ABIFLAGS       0x02c2a8 0x8102c228 0x8102c228 0x00018 0x00018 R   0x8
>   LOAD           0x000080 0x81000000 0x81000000 0x30906 0x3638c RWE 0x10
>
>
>
>
> the _end is 0x3638c, but the actual offset of dtb is changed to 0x30906.
> so we can't read the dtb correctly.
>
> I disable shrink then works fine. but a better solution is to change the
> _end symbol in u-boot elf accordingly.
>
>
>
>
>
>
>
> Best Regards.
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
>


More information about the U-Boot mailing list