Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D13F1C433F5 for ; Tue, 8 Feb 2022 18:51:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4D2F283DB5; Tue, 8 Feb 2022 19:50:44 +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="CbUbNyiq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5F86683D88; Tue, 8 Feb 2022 19:50:36 +0100 (CET) Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (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 7B3AB83D99 for ; Tue, 8 Feb 2022 19:50:30 +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-il1-x136.google.com with SMTP id h11so6634920ilq.9 for ; Tue, 08 Feb 2022 10:50:30 -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=kyS3dCj+tRwP4ONXbS7+SOTGjjKCGvYEzmqa3YXBU7I=; b=CbUbNyiquDsD9z147JadUiAdC1G0htrgZjNOCY6fIHuD1xlh4WtVlZK+LCaSh+zo4b pI7j20T7cyqHIzP+6kFwzRaTXAUI4/N2e3uo8kdYITYfc7o59/vK0+GG8UmP6Zx6oKtO YX2pCJN/2nHvdiPExpLlqdvCj2SgeUxQdkCho= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kyS3dCj+tRwP4ONXbS7+SOTGjjKCGvYEzmqa3YXBU7I=; b=1MMoXyqtir9oH9QOkRNZLVeskOFfzybTHS9UuWqETlYv/JKP0nXbZK7aWX1TLBIpI5 Tx+mrmb+GDDH19CyYNVQjhuDcqDBoeQpxjajM7ArsS44FvUHN9fyiI9sfXt3vEvgDw4T vBimoWDZsr9o+NaBQLQc67imW+seeegQomFl4MnSwj3srJDZhbpaU6ldgnJJ2HUMLP9H PBuynvM9iSjlawhy4mnMz9JgxC39TdrTQ2nALPolp6dMwWMlLy60SVKs5BvZW6yHlw6M 4swVUgjUT9L7q11OrwNjvuCkFA99mG2ePp0gXXR1EReubEX6mSMIRcMyjWucHvUw4Idt VMSg== X-Gm-Message-State: AOAM533I6CwSueVD/wNDP+MY9sVncXUX/FwQtzpQHFPoI/7qdG3ikpEU gk9SGjl2GlPgqR9Iuq8QvOpWT2W3Zt2V7Q== X-Google-Smtp-Source: ABdhPJwJ79nm+/gpK3cM+12koIYo+3uMQmP0iqnyla0OgP70vZMQXoVf82HebCNrgnLMDuAt0W5uQQ== X-Received: by 2002:a05:6e02:1c2c:: with SMTP id m12mr2975111ilh.113.1644346228973; Tue, 08 Feb 2022 10:50:28 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id q2sm2911844ilt.33.2022.02.08.10.50.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 10:50:28 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: huang lin , Jeffy Chen , Simon Glass , Kever Yang , Philipp Tomsich , Alper Nebi Yasak , Tom Rini , Roger Quadros , Philippe Reynes , Ivan Mikhaylov , Alexandru Gagniuc , Bin Meng , Jaehoon Chung , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Michal Simek , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Ricardo Salveti , Stefan Roese Subject: [PATCH 04/24] spl: Allow disabling binman symbols in SPL Date: Tue, 8 Feb 2022 11:49:48 -0700 Message-Id: <20220208185008.35843-3-sjg@chromium.org> X-Mailer: git-send-email 2.35.0.263.gb82422642f-goog In-Reply-To: <20220208185008.35843-1-sjg@chromium.org> References: <20220208185008.35843-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean When CONFIG_SPL_FIT is enabled we do not access U-Boot directly in the image, since it is embedded in a FIT which is parsed at runtime. Provide a CONFIG option to drop the symbols in this case. Signed-off-by: Simon Glass --- common/spl/Kconfig | 24 ++++++++++++++++++++++++ common/spl/spl.c | 4 ++++ 2 files changed, 28 insertions(+) diff --git a/common/spl/Kconfig b/common/spl/Kconfig index e0d0a6f77b..9418d37b2e 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -101,6 +101,18 @@ config SPL_SHOW_ERRORS This adds a small amount to SPL code size, perhaps 100 bytes. +config SPL_BINMAN_SYMBOLS + bool "Declare binman symbols in SPL" + depends on SPL_FRAMEWORK && BINMAN + default y + help + This enables use of symbols in SPL which refer to U-Boot, enabling SPL + to obtain the location of U-Boot simply by calling spl_get_image_pos() + and spl_get_image_size(). + + For this to work, you must have a U-Boot image in the binman image, so + binman can update SPL with the location of it. + menu "PowerPC and LayerScape SPL Boot options" config SPL_NAND_BOOT @@ -1321,6 +1333,18 @@ config TPL_SIZE_LIMIT Specifies the maximum length of the U-Boot TPL image. If this value is zero, it is ignored. +config TPL_BINMAN_SYMBOLS + bool "Declare binman symbols in SPL" + depends on SPL_FRAMEWORK && BINMAN + default y + help + This enables use of symbols in TPL which refer to U-Boot, enabling SPL + to obtain the location of U-Boot simply by calling spl_get_image_pos() + and spl_get_image_size(). + + For this to work, you must have a U-Boot image in the binman image, so + binman can update SPL with the location of it. + config TPL_FRAMEWORK bool "Support TPL based upon the common SPL framework" default y if SPL_FRAMEWORK diff --git a/common/spl/spl.c b/common/spl/spl.c index 444907432c..b452d4feeb 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -49,9 +49,11 @@ DECLARE_GLOBAL_DATA_PTR; u32 *boot_params_ptr = NULL; +#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS) /* See spl.h for information about this */ binman_sym_declare(ulong, u_boot_any, image_pos); binman_sym_declare(ulong, u_boot_any, size); +#endif #ifdef CONFIG_TPL binman_sym_declare(ulong, u_boot_spl, image_pos); @@ -140,6 +142,7 @@ void spl_fixup_fdt(void *fdt_blob) #endif } +#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS) ulong spl_get_image_pos(void) { return spl_phase() == PHASE_TPL ? @@ -153,6 +156,7 @@ ulong spl_get_image_size(void) binman_sym(ulong, u_boot_spl, size) : binman_sym(ulong, u_boot_any, size); } +#endif /* BINMAN_SYMBOLS */ ulong spl_get_image_text_base(void) { -- 2.35.0.263.gb82422642f-goog