From patchwork Mon Jul 12 03:52:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1503763 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=uBBMrVTp; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GNVGf2tVHz9sRN for ; Mon, 12 Jul 2021 13:52:56 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A1C6282C0B; Mon, 12 Jul 2021 05:52:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uBBMrVTp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C700B82C10; Mon, 12 Jul 2021 05:52:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A9DFC82C08 for ; Mon, 12 Jul 2021 05:52:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-pf1-x42b.google.com with SMTP id a127so15126966pfa.10 for ; Sun, 11 Jul 2021 20:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5yW3zJeEXjeJxfwQsgDu6wpa1sPhZ1nXiUTxBBIMCdg=; b=uBBMrVTpQaGCtIhqOxkEkwBSjv269UsbT1LlvaF8sGzRSH4WWrDlYJpWcHscxImUH4 NxQKxrIMUm+5QutpwOrx5bg4dE8xPZ4HXg5ByyM3NJxBElk4SLuxcZCCElNsTa7HNu3R F6mJNqWTU99VAPzbURAbybWpK3Pkll0nB1GI6ENWPD3H2m8JbXrOAYn/gk/ryj6MsGNs HLxf0Nw6+q0hxDld2lEh+4HdM/NtOB8nPewgbcEn/+d5AQDBMEkgctTAt+5MEnIaBFva urGNMPTP/MorwUQZcYaSqIV6tXt3EIlN7AKd2XqzjDriI5ya5gsdt1J+P2LBRBnFuHXo EZ8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5yW3zJeEXjeJxfwQsgDu6wpa1sPhZ1nXiUTxBBIMCdg=; b=a+ZTJq5nkb08ltvlOe2tYemIWzvOeesePIPhxIgZAQIYplLqkZ1lWteLdCKeRrFLyJ Rw9dFNEqduESALHiIEd/LjuQwTJPnoVFtnRKFYsG3ciu6hMM3FuIv1/FNBP1M942GQ8E yiPy6zc6b1NyKJkGB33oBK+bg2ZCsd0j7xtfJ31B/ZcspDevvqzYOwaBEZTij5F2ZH2u PVXQLWthQijugrbbCH5JWmfLc9avql4viy1GvOnOxGbH/LMIqzdY4LDWGTNs6FhSyik+ tCJNuQ8JT1vz799Tzkmb2VH2vrVSNMp+sl4A4pNfytslHAfysDTj8pYxHMLDtj40AbLN TYOw== X-Gm-Message-State: AOAM532HM5C0uZDDBm3l1MxX6TvdWJuuKodaO+ZExLTeSnsK0wFy+cje NNYL+Awa8NyU1HbxbNP/pDI= X-Google-Smtp-Source: ABdhPJwDEYk72bNcPQi4rrAxa3yondTRmbnkOh4OgVTz8QCVPI8+6ZIuIT2dxODzrBRxQJFWkkEmfw== X-Received: by 2002:a63:b48:: with SMTP id a8mr40283925pgl.169.1626061958833; Sun, 11 Jul 2021 20:52:38 -0700 (PDT) Received: from i9-aorus-gtx1080.localdomain (144.168.56.201.16clouds.com. [144.168.56.201]) by smtp.gmail.com with ESMTPSA id c136sm13927608pfc.201.2021.07.11.20.52.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Jul 2021 20:52:38 -0700 (PDT) From: Bin Meng To: Tom Rini , Simon Glass , u-boot@lists.denx.de Cc: Bin Meng Subject: [PATCH] spl: Align device tree blob address at 8-byte boundary Date: Mon, 12 Jul 2021 11:52:31 +0800 Message-Id: <20210712035231.26475-1-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean 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 --- 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) {