public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
	u-boot@lists.denx.de
Cc: Bin Meng <bmeng.cn@gmail.com>
Subject: [PATCH] spl: Align device tree blob address at 8-byte boundary
Date: Mon, 12 Jul 2021 11:52:31 +0800	[thread overview]
Message-ID: <20210712035231.26475-1-bmeng.cn@gmail.com> (raw)

Since libfdt v1.6.1, a new requirement on the device tree address via:

  commit 5e735860c478 ("libfdt: Check for 8-byte address alignment in fdt_ro_probe_()")

must be met that the device tree must be loaded in to memory at an
8-byte aligned address.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 common/spl/spl_fit.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index f41abca0cc..9baf6aca9f 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -374,6 +374,12 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image,
 	 */
 	image_info.load_addr = spl_image->load_addr + spl_image->size;
 
+	/*
+	 * Since libfdt v1.6.1, the device tree must be loaded in to memory
+	 * at an 8-byte aligned address.
+	 */
+	image_info.load_addr = roundup(image_info.load_addr, 8);
+
 	/* Figure out which device tree the board wants to use */
 	node = spl_fit_get_image_node(ctx, FIT_FDT_PROP, index++);
 	if (node < 0) {
-- 
2.25.1


             reply	other threads:[~2021-07-12  3:52 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-12  3:52 Bin Meng [this message]
2021-07-12  5:21 ` [PATCH] spl: Align device tree blob address at 8-byte boundary Reuben Dowle
2021-07-12  5:36   ` Bin Meng
2021-07-12 15:15     ` Tom Rini
2021-07-12 15:38       ` Marek Vasut
2021-07-12 15:43         ` Tom Rini
2021-07-12 15:51           ` Marek Vasut
2021-07-12 16:02             ` Tom Rini
2021-07-12 16:09               ` Marek Vasut
2021-07-12 16:01       ` Alex G.
2021-07-12 19:46         ` Simon Glass
2021-07-13  3:09         ` Bin Meng
2021-07-13 13:47         ` Tom Rini
2021-07-13 14:35           ` Marek Vasut
2021-07-13 14:41             ` Tom Rini
2021-07-13 14:53               ` Marek Vasut
2021-07-13 16:47                 ` Simon Glass
2021-07-13 17:50                   ` Marek Vasut
2021-07-13 18:11                     ` Tom Rini
2021-07-13 20:35                       ` Marek Vasut
2021-07-13 20:46                         ` Alex G
2021-07-13 21:11                         ` Tom Rini
2021-07-26 13:26                           ` Bin Meng
2021-07-26 13:38                             ` Tom Rini
2021-07-13 21:06                       ` Alex G
2021-07-13 17:20         ` Tom Rini
2021-07-13  3:00       ` Bin Meng

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=20210712035231.26475-1-bmeng.cn@gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.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