For AST2600 SPL with CONFIG_SPL_SEPARATE_BSS=y and
CONFIG_OF_SEPARATE=y, fdt_find_separate() expects the appended control
DTB at _image_binary_end.

The AST2600 SPL linker script aligned _image_binary_end via the
.binman_sym_table section. In builds where that section has no emitted
contents, objcopy -O binary does not include the alignment bytes in
spl/u-boot-spl-nodtb.bin. This causes the nodtb binary to end before
_image_binary_end, so the appended DTB is placed too early.

On evb-ast2600 this produced:

  sizeof(spl/u-boot-spl-nodtb.bin) = 0xc92c
  _image_binary_end                = 0xc930

SPL then looked four bytes past the FDT header and failed with:

  Missing DTB
  No serial driver found

Move the 8-byte alignment into the preceding emitted __u_boot_list
section so the objcopy output and _image_binary_end agree.

Signed-off-by: Quentin Strydom <[email protected]>
---


Changes in v2:
- Replace the Makefile padding change with an AST2600 SPL linker script
  fix.
- Move the 8-byte alignment into the emitted __u_boot_list section so
  spl/u-boot-spl-nodtb.bin and _image_binary_end agree.
- This was reproduced and tested with QEMU ast2600-evb, not physical
  hardware.


 arch/arm/mach-aspeed/ast2600/u-boot-spl.lds | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds 
b/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds
index 303ace2f61c..894eda1db77 100644
--- a/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds
+++ b/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds
@@ -42,6 +42,7 @@ SECTIONS
        . = ALIGN(4);
        __u_boot_list : {
                KEEP(*(SORT(__u_boot_list*)));
+               . = ALIGN(8);
        } > .nor
 
        . = ALIGN(4);
@@ -49,7 +50,6 @@ SECTIONS
                __binman_sym_start = .;
                KEEP(*(SORT(.binman_sym*)));
                __binman_sym_end = .;
-               . = ALIGN(8);
        } > .nor
 
        /*
-- 
2.43.0

Reply via email to