public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Priyanka Jain <priyanka.jain@nxp.com>,
	Qiang Zhao <qiang.zhao@nxp.com>,
	Shengzhou Liu <Shengzhou.Liu@nxp.com>,
	Alexander Graf <agraf@csgraf.de>, Bin Meng <bmeng.cn@gmail.com>,
	Wolfgang Denk <wd@denx.de>, Sinan Akman <sinan@writeme.com>
Cc: u-boot@lists.denx.de
Subject: [PATCH 1/8] powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support
Date: Tue,  5 Apr 2022 15:12:30 +0200	[thread overview]
Message-ID: <20220405131237.405-2-pali@kernel.org> (raw)
In-Reply-To: <20220405131237.405-1-pali@kernel.org>

Currently CONFIG_OF_SEPARATE is completely broken and U-Boot for some
mpc85xx board (e.g. P2020) has to be compiled with CONFIG_OF_EMBED.
Otherwise it crashes during early init.

When debug console is enabled and all debug logging options are turned on
then U-Boot on P2020 with CONFIG_OF_SEPARATE prints following error:

  No valid device tree binary found at 110dc300
  initcall sequence 110d3560 failed at call 1109535c (err=-1)
  ### ERROR ### Please RESET the board ###

Problem is with appended DTB. When CONFIG_SYS_MPC85XX_NO_RESETVEC is set
U-Boot binary image without DTB ends immediately after the .u_boot_list
section. At this position is defined _end symbol at which U-Boot expects
start of the appended DTB.

Problem is that after .u_boot_list section are in linker script defined
another sections with 256 byte long padding which are completely empty.
During conversion of U-Boot ELF binary to RAW binary u-boot-nodtb.bin,
objcopy removes trailing zero padding and therefore DTB is appended at
wrong position.

Changing alignment from 256 bytes to 4 bytes fixes this issue. And appended
DTB is finally at he correct position. With this fix U-Boot on P2020 with
CONFIG_OF_SEPARATE option starts working again.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 arch/powerpc/cpu/mpc85xx/u-boot.lds | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/u-boot.lds b/arch/powerpc/cpu/mpc85xx/u-boot.lds
index 17a0e631ca3e..48509dbdae01 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot.lds
@@ -75,11 +75,11 @@ SECTIONS
   __ex_table : { *(__ex_table) }
   __stop___ex_table = .;
 
-  . = ALIGN(256);
+  . = ALIGN(4);
   __init_begin = .;
   .text.init : { *(.text.init) }
   .data.init : { *(.data.init) }
-  . = ALIGN(256);
+  . = ALIGN(4);
   __init_end = .;
   _end = .;
 
-- 
2.20.1


  reply	other threads:[~2022-04-05 13:16 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-05 13:12 [PATCH 0/8] powerpc: mpc85xx: Fix and cleanup mpc85xx code Pali Rohár
2022-04-05 13:12 ` Pali Rohár [this message]
2022-04-08 11:04   ` [PATCH 1/8] powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support Pali Rohár
2022-04-05 13:12 ` [PATCH 2/8] powerpc: mpc85xx: Remove duplicate u-boot-nand.lds Pali Rohár
2022-04-05 13:12 ` [PATCH 3/8] powerpc: mpc85xx: Remove u-boot-nand_spl.lds Pali Rohár
2022-04-05 13:12 ` [PATCH 4/8] powerpc: mpc85xx: Remove useless SIZEOF_HEADERS and .interp from ld script Pali Rohár
2022-04-05 13:12 ` [PATCH 5/8] powerpc: mpc85xx: Put bss after image when not including reset vector Pali Rohár
2022-04-05 13:12 ` [PATCH 6/8] powerpc: mpc85xx: Define linker sections in ascending order Pali Rohár
2022-04-05 13:12 ` [PATCH 7/8] powerpc: mpc85xx: Set TEXT_BASE addresses to real base values Pali Rohár
2022-04-25  4:27   ` Priyanka Jain (OSS)
2022-04-25 12:31     ` Pali Rohár
2022-05-11 18:59       ` Pali Rohár
2022-05-18 10:51         ` Pali Rohár
2022-06-04 13:01           ` Pali Rohár
2022-04-25 12:29   ` [PATCH v2] " Pali Rohár
2022-06-16  8:57     ` Peng Fan (OSS)
2022-06-16  9:30       ` Pali Rohár
2022-06-16 12:19       ` [PATCH v3] " Pali Rohár
2022-06-23 11:29         ` Pali Rohár
2022-06-23 12:34           ` Tom Rini
2022-06-28  9:18             ` Pali Rohár
2022-06-28 13:42               ` Tom Rini
2022-06-28 14:52         ` Tom Rini
2022-06-28 17:43           ` Pali Rohár
2022-04-05 13:12 ` [PATCH 8/8] board: freescale: p1_p2_rdb_pc: Simplify SPL offset macros Pali Rohár
2022-06-28 17:53   ` [PATCH v2] " Pali Rohár
2022-06-28 18:17     ` Tom Rini
2022-06-28 18:22       ` Pali Rohár
2022-06-28 18:28         ` Tom Rini
2022-06-28 18:34           ` Pali Rohár
2022-06-28 18:39             ` Tom Rini
2022-06-28 18:41               ` Pali Rohár
2022-06-28 18:53                 ` Tom Rini
2022-06-28 18:58                   ` Pali Rohár
2022-06-28 19:08                     ` Tom Rini
2022-06-28 19:13                       ` Pali Rohár
2022-04-05 17:03 ` [PATCH 0/8] powerpc: mpc85xx: Fix and cleanup mpc85xx code Sinan Akman
2022-04-05 17:17   ` Pali Rohár
2022-04-05 18:10     ` Sinan Akman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220405131237.405-2-pali@kernel.org \
    --to=pali@kernel.org \
    --cc=Shengzhou.Liu@nxp.com \
    --cc=agraf@csgraf.de \
    --cc=bmeng.cn@gmail.com \
    --cc=priyanka.jain@nxp.com \
    --cc=qiang.zhao@nxp.com \
    --cc=sinan@writeme.com \
    --cc=u-boot@lists.denx.de \
    --cc=wd@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox