From patchwork Mon Oct 21 03:31:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1180213 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=none (no SPF record) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Z0YhTogg"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46xN2Q5xRBz9sCJ for ; Mon, 21 Oct 2019 14:50:21 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 6F963C21BE5; Mon, 21 Oct 2019 03:36:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 39649C21DE8; Mon, 21 Oct 2019 03:35:26 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1D15CC21DFD; Mon, 21 Oct 2019 03:33:51 +0000 (UTC) Received: from mail-il1-f196.google.com (mail-il1-f196.google.com [209.85.166.196]) by lists.denx.de (Postfix) with ESMTPS id 1C96AC21DCA for ; Mon, 21 Oct 2019 03:33:48 +0000 (UTC) Received: by mail-il1-f196.google.com with SMTP id c12so10710579ilm.1 for ; Sun, 20 Oct 2019 20:33:48 -0700 (PDT) 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=q67J93lw0Jam+TYGtC9oJH8lJZ+uuYANccIzVoiESDw=; b=Z0YhToggy8j/lwi7j1pd8841I3t7kNMxHsTILVnIvfDk5DAZ1t0ftJaPgQiCCZtKZU 9KMo7XYcfa4KuSnx7O5XHgiO0ADNH+XqjRG+zz6qXjSKxpzJXIhlDj8/39zOc1oWwjmd Zi9Ws/i/UZ4tx0Pj9G2FAOHWhLBhgX1Sln+1o= 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=q67J93lw0Jam+TYGtC9oJH8lJZ+uuYANccIzVoiESDw=; b=rbryOYxsnONIxLm8aPXj00nn4HE+/QGmCe332BvLG29pGEA8weKerG+mKDq2iyJxx8 UqVnud64FR522oTe8+/Y3g+KUXOqik8QFd9EZCrAet+d20aj0p6rZfLiNB5Np+eMoMow iu0aPB1a1aDVYLLboXKZR+95H81fAHNcc1M7vsAGrpREOqjtvWLGuguRll1QPD5HSdzZ K/J08co7hGmyBKv96zi5BgZE3RpKz3ifwFgLghRmdR6N/CBQVZfUAu9jV178nD+tpzYG 6uO0WRX8XZROrqZ1b4HP4hvjVLScGuaukfGykM66Ufqk9J/xJByzDI7qXfCd53iY0HgV RXQA== X-Gm-Message-State: APjAAAV51sMswMmgcRoi6brULQZXBcAXifaoAKnQTE3YEgCHelrF5D3A NeLH5zfvMtMyVP+sHFI6FvsHBMy4h3WsRw== X-Google-Smtp-Source: APXvYqytJUSgfQ1YJiTs0vkn6pdR1vNqjPp1XmhhaqvdIJGJXy/QzAtuD5/LWuOhGpyYmA6r8lh1Kw== X-Received: by 2002:a92:188:: with SMTP id 130mr2539813ilb.177.1571628826870; Sun, 20 Oct 2019 20:33:46 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id q11sm5293182ilm.28.2019.10.20.20.33.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Oct 2019 20:33:46 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sun, 20 Oct 2019 21:31:52 -0600 Message-Id: <20191021033322.217715-19-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.866.gb869b98d4c-goog In-Reply-To: <20191021033322.217715-2-sjg@chromium.org> References: <20191021033322.217715-2-sjg@chromium.org> MIME-Version: 1.0 Cc: Tien Fong Chee , Heinrich Schuchardt , Stefan Roese , Chris Packham , Marek Vasut Subject: [U-Boot] [PATCH v3 019/108] spl: Add a size check for TPL X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" We have the ability to enforce a maximum size for SPL but not yet for TPL. Add a new option for this. Document the size check macro while we are here. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- Changes in v3: None Changes in v2: None Makefile | 7 +++++++ common/spl/Kconfig | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/Makefile b/Makefile index cbacf1cfe2c..3a29b5a90f9 100644 --- a/Makefile +++ b/Makefile @@ -806,6 +806,12 @@ else SPL_SIZE_CHECK = endif +ifneq ($(CONFIG_TPL_SIZE_LIMIT),0) +TPL_SIZE_CHECK = @$(call size_check,$@,$(CONFIG_TPL_SIZE_LIMIT)) +else +TPL_SIZE_CHECK = +endif + # Statically apply RELA-style relocations (currently arm64 only) # This is useful for arm64 where static relocation needs to be performed on # the raw binary, but certain simulators only accept an ELF file (but don't @@ -1795,6 +1801,7 @@ spl/boot.bin: spl/u-boot-spl tpl/u-boot-tpl.bin: tools prepare \ $(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SPL_OF_PLATDATA),dts/dt.dtb) $(Q)$(MAKE) obj=tpl -f $(srctree)/scripts/Makefile.spl all + $(TPL_SIZE_CHECK) TAG_SUBDIRS := $(patsubst %,$(srctree)/%,$(u-boot-dirs) include) diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 86d7edfee1b..c661809923a 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -1232,6 +1232,14 @@ config TPL if TPL +config TPL_SIZE_LIMIT + hex "Maximum size of TPL image" + depends on TPL + default 0 + help + Specifies the maximum length of the U-Boot TPL image. + If this value is zero, it is ignored. + config TPL_HANDOFF bool "Pass hand-off information from TPL to SPL and U-Boot proper" depends on HANDOFF && TPL_BLOBLIST