From patchwork Sat Jan 16 21:53:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1427621 X-Patchwork-Delegate: bmeng.cn@gmail.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 (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ahEO9t0O; 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DJBj94M9Sz9s24 for ; Sun, 17 Jan 2021 08:57:01 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B5E3182A08; Sat, 16 Jan 2021 22:54:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ahEO9t0O"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4EAEC829DD; Sat, 16 Jan 2021 22:54:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 0B638829B9 for ; Sat, 16 Jan 2021 22:54:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd31.google.com with SMTP id p72so633266iod.12 for ; Sat, 16 Jan 2021 13:54:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HQrpfEsun5ot2F6AoNBiuuH6QCd71YsE0XSmjDEXy1w=; b=ahEO9t0OcZ8Hru2KkaAoNbZtoFHgR1HvKW0u+AisZjcjPTzJJq7ZB7mSK3gyJHI5h3 +zJc+MO/LH5XNfuZOkW2OItQRYVk3b9Uxa/YwJ7njmOmHSqtIkAdcOx7i+v+s0X2sMCo X+Ao1u6Grw2YjKd0a+X8P3xZ+rqpih0WnQnLg= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=HQrpfEsun5ot2F6AoNBiuuH6QCd71YsE0XSmjDEXy1w=; b=ph/uA7HY2jtpwOXV8JRkNRJkVW32VeMuVx3rtZCXGItdIrojPg82obEW7SSHmFoFSH 1BRJLBnMs81ZUKhD03F9PVbOVvsAtSwujNJFoxZx5mjZnq/zzZsrlAdJo+aKk9xlFs+r NbbzoK94uyYqGN0cUsFBb/lbS4XHhVkGB2hUiSZE1k1xU1xppWqtkcTynl6RmflVb9a+ VTGmA1euwQUqVHbCD//A+75QJkS1s7dqMY7uuAvIvLVZgpmmNuWLT6lf/BYkWzsqII11 aYW/JH9v+1lA8q5W493DC9KxhBP716YvGHSmqWYM5MZ5Pv3pkfRxIapU8Bkj6LqyV34l LuJA== X-Gm-Message-State: AOAM5309KUv4y7lloG8cwarOH1X3ERTr6Q2CqA2kgwur70e0NhLtgrxs ETGRadN8rstpFjlUbXKwhcZg3WVdGe7YHZHd X-Google-Smtp-Source: ABdhPJyr/gsXMkv8lma7rOhXPjlurBwcrw3LsjUQ8PqmqJ9qo96et2BdwUlMHGT7NiEOOIqA9h8xpQ== X-Received: by 2002:a6b:cc07:: with SMTP id c7mr486024iog.122.1610834046614; Sat, 16 Jan 2021 13:54:06 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id a17sm7428746ilc.77.2021.01.16.13.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jan 2021 13:54:06 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng Subject: [PATCH 04/12] x86: Make sure the SPL image ends on a suitable boundary Date: Sat, 16 Jan 2021 14:53:51 -0700 Message-Id: <20210116145343.4.I66e525bc185416fb67c5ff72d9fadde9d60f7ae4@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210116215359.1220766-1-sjg@chromium.org> References: <20210116215359.1220766-1-sjg@chromium.org> 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.102.3 at phobos.denx.de X-Virus-Status: Clean The part of U-Boot that actually ends up in u-boot-nodtb.bin is not built with any particular alignment. It ends at the start of the BSS section. The BSS section selects its own alignment, which may larger. This means that there can be a gap of a few bytes between the image ending and BSS starting. Since u-boot.bin is build by joining u-boot-nodtb.bin and u-boot.dtb (with perhaps some padding for BSS), the expected result is not obtained. U-Boot uses the end of BSS to find the devicetree, so this means that it cannot be found. Add 32-byte alignment of BSS so that the image size is correct and appending the devicetree will place it at the end of BSS. Signed-off-by: Simon Glass --- arch/x86/cpu/u-boot-spl.lds | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/cpu/u-boot-spl.lds b/arch/x86/cpu/u-boot-spl.lds index e6c22895b35..e0c70b076b8 100644 --- a/arch/x86/cpu/u-boot-spl.lds +++ b/arch/x86/cpu/u-boot-spl.lds @@ -43,6 +43,7 @@ SECTIONS __binman_sym_start = .; KEEP(*(SORT(.binman_sym*))); __binman_sym_end = .; + . = ALIGN(32); } _image_binary_end = .;