From patchwork Sat Jun 18 12:13:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alper Nebi Yasak X-Patchwork-Id: 1645041 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=axDC4hqH; dkim-atps=neutral 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=) 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 (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LQFFg74Yjz9s2R for ; Sat, 18 Jun 2022 22:14:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2893F8443B; Sat, 18 Jun 2022 14:14:00 +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="axDC4hqH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 715ED84429; Sat, 18 Jun 2022 14:13:58 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (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 09DB28443B for ; Sat, 18 Jun 2022 14:13:56 +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=alpernebiyasak@gmail.com Received: by mail-wr1-x42a.google.com with SMTP id o16so8768826wra.4 for ; Sat, 18 Jun 2022 05:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t4L0L3jOwq/Zo72Q+lvugfYXq8476OKBX0dy7hBdmg4=; b=axDC4hqHQpSbWDuvQvL01gypxu+Bqy7yoQosK5IS0EoykZKHSsmi5GjjLQQcoZUabe oTQIPdnJ7MTirKMgKg6/CKKY/sAXB5Tyn8+jQphwA57ETvla08+1wjqdAI17959PmczO nlNle/jkap7RXO1871hzs6xtxOovA6TcorLgTtZ1peS+JTVlyO8YXsdDGvQQ7ebjsEnS doY4WsDpV7ziuWTlYxzmqmcCU/WYfyvfNeoQCBvOMfGuu6HXObxGPUnEs3WaTdM+FDfm PAvfImYBzq/owpMyLBfCAq77/Qd0sLHB08vVvznkYoP5PgvzTpdn/vqPejPpJiZd+0uv kQow== 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=t4L0L3jOwq/Zo72Q+lvugfYXq8476OKBX0dy7hBdmg4=; b=m49J4CLFEjgDEFqgiWRMvmmeu6YJTEQhNCMQvS0nMFHVdvz+8DKEa94NJhNfKmqrPm udA9Z8xgV455fIfdxCPeJ/QH7I7FH/2MQKBhel6X4Fq09seyj7M71DXSDmk5DH0LIchJ mpHKdUbcVP5Jgc+Sy3SjGGFl2eu6rNZFNBvh8j+VO30B4h8J0bgi5p+cKdPJ4y4PvCct sWkFHyw+RBTMGrth4FGkfUAxNmL/s4tWBB/9oUkq1rn6nHeF5ZmCS6s0kMPEXSJOk7mC Q/H++jheh6kpvfXLLm7YiY/Je+zxKAJ8AIhXcgtr3Iuv93k4HBrt71EdPZDW0WGd3UbK es6Q== X-Gm-Message-State: AJIora/87JO7YeM2tR1HIpVXfVSvj6dwNTEq7+yMD2yWldXSO/78nfRn y5WZ/Mo7ZmEm/VthFs1HtOg+Nxl8Q/g= X-Google-Smtp-Source: AGRyM1u0ye7OY0/yMZrgZQHO/bIfwzXCEJN0dCQpTPvaQqZoEK+ld1FqJUxYKCcR7XXkQ7J06dPL3g== X-Received: by 2002:a5d:62ce:0:b0:21a:33d9:70eb with SMTP id o14-20020a5d62ce000000b0021a33d970ebmr12177226wrv.86.1655554435395; Sat, 18 Jun 2022 05:13:55 -0700 (PDT) Received: from localhost.localdomain ([178.233.178.185]) by smtp.gmail.com with ESMTPSA id h28-20020adfa4dc000000b0020fff0ea0a3sm7532394wrb.116.2022.06.18.05.13.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jun 2022 05:13:54 -0700 (PDT) From: Alper Nebi Yasak To: u-boot@lists.denx.de Cc: Michael Walle , Wolfgang Denk , Marek Vasut , Ricardo Salveti , Patrick Delaunay , Heiko Thiery , Stefan Roese , Peng Fan , Philippe Reynes , =?utf-8?q?Marek_Beh=C3=BA?= =?utf-8?q?n?= , Tom Rini , Simon Glass , Oleksandr Suvorov , Ovidiu Panait , Heiko Schocher , Alexandru Gagniuc , Andre Przywara , =?utf-8?q?Pali_Roh=C3=A1r?= , Heinrich Schuchardt , Alper Nebi Yasak Subject: [PATCH v2 1/8] spl: binman: Fix use of undeclared u_boot_any symbols Date: Sat, 18 Jun 2022 15:13:06 +0300 Message-Id: <20220618121316.12061-2-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220618121316.12061-1-alpernebiyasak@gmail.com> References: <20220618121316.12061-1-alpernebiyasak@gmail.com> MIME-Version: 1.0 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 Some SPL functions directly use the binman 'u_boot_any' symbols to get U-Boot's binman image position. These symbols are declared by the SPL/TPL_BINMAN_SYMBOLS configs, but they are accessed by macros defined by just CONFIG_BINMAN. So when BINMAN is enabled and BINMAN_SYMBOLS is disabled, the code tries to use undeclared symbols and we get an error. Therefore, any use of 'u_boot_any' symbols in the code is an implicit dependency on SPL/TPL_BINMAN_SYMBOLS. However, in the current uses they are meant to be the next phase's values, where that happens to be U-Boot. In the meantime, helper funcions spl_get_image_pos/size() were introduced to get these values. Convert all uses of u_boot_any symbols to these functions, so we only access these symbols at one place. Make sure they will not use these symbols when the BINMAN_SYMBOLS configs are disabled, by returning early in those cases. Signed-off-by: Alper Nebi Yasak Signed-off-by: Alper Nebi Yasak --- (no changes since v1) common/spl/spl.c | 10 +++++++--- common/spl/spl_ram.c | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index 2a69a7c9324d..5630dcdb5c1e 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -149,9 +149,11 @@ void spl_fixup_fdt(void *fdt_blob) #endif } -#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS) ulong spl_get_image_pos(void) { + if (!CONFIG_IS_ENABLED(BINMAN_SYMBOLS)) + return BINMAN_SYM_MISSING; + #ifdef CONFIG_VPL if (spl_next_phase() == PHASE_VPL) return binman_sym(ulong, u_boot_vpl, image_pos); @@ -163,6 +165,9 @@ ulong spl_get_image_pos(void) ulong spl_get_image_size(void) { + if (!CONFIG_IS_ENABLED(BINMAN_SYMBOLS)) + return BINMAN_SYM_MISSING; + #ifdef CONFIG_VPL if (spl_next_phase() == PHASE_VPL) return binman_sym(ulong, u_boot_vpl, size); @@ -171,7 +176,6 @@ 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) { @@ -222,7 +226,7 @@ __weak struct image_header *spl_get_load_buffer(ssize_t offset, size_t size) void spl_set_header_raw_uboot(struct spl_image_info *spl_image) { - ulong u_boot_pos = binman_sym(ulong, u_boot_any, image_pos); + ulong u_boot_pos = spl_get_image_pos(); spl_image->size = CONFIG_SYS_MONITOR_LEN; diff --git a/common/spl/spl_ram.c b/common/spl/spl_ram.c index 829645925718..d64710878cf2 100644 --- a/common/spl/spl_ram.c +++ b/common/spl/spl_ram.c @@ -70,7 +70,7 @@ static int spl_ram_load_image(struct spl_image_info *spl_image, load.read = spl_ram_load_read; spl_load_simple_fit(spl_image, &load, 0, header); } else { - ulong u_boot_pos = binman_sym(ulong, u_boot_any, image_pos); + ulong u_boot_pos = spl_get_image_pos(); debug("Legacy image\n"); /* From patchwork Sat Jun 18 12:13:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alper Nebi Yasak X-Patchwork-Id: 1645042 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=keRTBOx9; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LQFFm0sHCz9s2R for ; Sat, 18 Jun 2022 22:14:20 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9008484453; Sat, 18 Jun 2022 14:14:07 +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="keRTBOx9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A649384434; Sat, 18 Jun 2022 14:14:06 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) (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 839B784463 for ; Sat, 18 Jun 2022 14:14:02 +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=alpernebiyasak@gmail.com Received: by mail-wr1-x430.google.com with SMTP id v14so8767732wra.5 for ; Sat, 18 Jun 2022 05:14:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NuIJn7H/Mj6GMBWbMOuoWIg8V/KPXJpxMh/UEJFtr+E=; b=keRTBOx9ZwcoU4Q6CB1RLpF6jGDjAo8Wnq7XZfpBdHDbHJ48WKbxhhhtW2+giHlx6B F3iPx+z6NTVjNi3Rr1UZeS93ky9WwnGMpwPqdkXDmdBcRAGrwDLGpdKhzDLsPmhaF3AQ UrDVx6R1rFB3cOCprycibZmG6GKcpjncrT8ifTNUOICmJSnIw84zExmiwqF+FazaTM2w dKEya6hi/Zz8B5dbyB3o4Hbr9iMnbtUVKAlyxdl5yUI0tziRMedRilsC4/NvsFpiysxk R3C5QuLPsKkDXnNg7g7oCPFRFpIU7qDEw1rYXNhlhamYsJAu8XVKOip6/7D3DIaB+M5M /Slg== 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=NuIJn7H/Mj6GMBWbMOuoWIg8V/KPXJpxMh/UEJFtr+E=; b=Kcqkyka3NwGaFGZHx9uf8rjNSV4WniUZfsTNC2y/n58FsYAI2kq+uK2YkAGQBziGg5 EQDmhJaK00+nnnHlAPr5P167jgQEy22KE8TR2E50pzZQX3FrJbWyfrIWoS9K6TI7Hg4y OGWxVh5Ppjl8N2mmt5ToyuOPmSGGpLwl6KOTtGq9ZnZZEuYlEf9B5SS0X8En86TgGrQS grREEnm4u0Uq7gcYcRPt7mXEWL71NPTgf8D6ZFkPkKePO8cT9KmCslT2vXuhztF/MqOv oU89whyvrmWkUKs5SGtPqwgVlyVQb3+tan9UJcAFn0OzN345tJfd5vp9Dht7oOQ0Imss V1MQ== X-Gm-Message-State: AJIora+sQVj4Rbo+YD4jw125iJ3ASVRzWeMxu0RcodJtq+/PnR+pThNh s22koGPnuFNklX8rXSlfKu/HXYvh+94= X-Google-Smtp-Source: AGRyM1sCHTnHOsZ7692FC8fallkO8k44AwILri9u5YLYr5S2Ub+MuyLltpRMQypV9OdvzxpTNxUWIg== X-Received: by 2002:a05:6000:178d:b0:20f:e960:2f2 with SMTP id e13-20020a056000178d00b0020fe96002f2mr14255141wrg.569.1655554442142; Sat, 18 Jun 2022 05:14:02 -0700 (PDT) Received: from localhost.localdomain ([178.233.178.185]) by smtp.gmail.com with ESMTPSA id h28-20020adfa4dc000000b0020fff0ea0a3sm7532394wrb.116.2022.06.18.05.13.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jun 2022 05:14:01 -0700 (PDT) From: Alper Nebi Yasak To: u-boot@lists.denx.de Cc: Michael Walle , Wolfgang Denk , Marek Vasut , Ricardo Salveti , Patrick Delaunay , Heiko Thiery , Stefan Roese , Peng Fan , Philippe Reynes , =?utf-8?q?Marek_Beh=C3=BA?= =?utf-8?q?n?= , Tom Rini , Simon Glass , Oleksandr Suvorov , Ovidiu Panait , Heiko Schocher , Alexandru Gagniuc , Andre Przywara , =?utf-8?q?Pali_Roh=C3=A1r?= , Heinrich Schuchardt , Alper Nebi Yasak Subject: [PATCH v2 2/8] spl: binman: Make TPL_BINMAN_SYMBOLS depend on TPL_FRAMEWORK Date: Sat, 18 Jun 2022 15:13:07 +0300 Message-Id: <20220618121316.12061-3-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220618121316.12061-1-alpernebiyasak@gmail.com> References: <20220618121316.12061-1-alpernebiyasak@gmail.com> MIME-Version: 1.0 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 TPL_BINMAN_SYMBOLS depends on SPL_FRAMEWORK. The code this enables is compiled by checking CONFIG_$(SPL_TPL_)FRAMEWORK, so it should depend on TPL_FRAMEWORK instead (which in turn depends on SPL_FRAMEWORK). This was most likely a typo due to copy-pasting the config's SPL version, fix it. Signed-off-by: Alper Nebi Yasak Signed-off-by: Alper Nebi Yasak --- (no changes since v1) common/spl/Kconfig.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/spl/Kconfig.tpl b/common/spl/Kconfig.tpl index 9a0e719cf949..834cb6b6dd82 100644 --- a/common/spl/Kconfig.tpl +++ b/common/spl/Kconfig.tpl @@ -10,7 +10,7 @@ config TPL_SIZE_LIMIT config TPL_BINMAN_SYMBOLS bool "Declare binman symbols in TPL" - depends on SPL_FRAMEWORK && BINMAN + depends on TPL_FRAMEWORK && BINMAN default y help This enables use of symbols in TPL which refer to U-Boot, enabling TPL From patchwork Sat Jun 18 12:13:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alper Nebi Yasak X-Patchwork-Id: 1645043 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=m040F/V4; dkim-atps=neutral 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=) 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 (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LQFFy5G8bz9s2R for ; Sat, 18 Jun 2022 22:14:30 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5F7B884480; Sat, 18 Jun 2022 14:14:17 +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="m040F/V4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 895AA8447A; Sat, 18 Jun 2022 14:14:15 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 811C984450 for ; Sat, 18 Jun 2022 14:14:08 +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=alpernebiyasak@gmail.com Received: by mail-wr1-x429.google.com with SMTP id e25so4905023wrc.13 for ; Sat, 18 Jun 2022 05:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RBHhdhXqvlyDezMuOm7o8c/URDfnU9lQ3AAwhz1lSPA=; b=m040F/V4+UFTQYPIPYr3Laoe6kf6+755q32+TflAf88W+aPbCqTuWxdLi7sbfpXr3I DdF81/7GyhNF1xCkc5hGZZUHMYYIl41I09cg2j+9mjaU1P5Si2r9Vny8e8hW02AZEF4L 1tzyDVIcuXS9Zokf29eptSxj1s8t/o6hDpGNwEayd4WngctfN6lkrRtNHk8rXwxdCnki h64RiEHq9LcQBi3uboGoMVqmFMLm1IPjp6sC/RV/36iCVJFkHBv4QkKQ3ATxgYfK4hoZ EAmod8GQ480IxxFVmYlf7dm8LRlnTtU7l1q9YiTTATmPX6lec5jnQtVMAjc4nXLwGuqr W8FA== 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=RBHhdhXqvlyDezMuOm7o8c/URDfnU9lQ3AAwhz1lSPA=; b=gcdZvQZ7zL86rssUUYGEbXom+hxbXXgliz7yeycQKcBrGYO2AbD83tMhIHqyOTwehW LAOmLfbgGeODsXUzZCPSfK6i+fNArHgPPMOIeorCxpjEyjeho8/oDBJr1m+GG1VPskoh EKatt/MxlcWRWQrzDT+J1Yz5QKO01EHz+Rwkp4beeY6KcQJCDTqfEEnSvL7zEmdcCQZH kdv/bkLO9IWoM5995UHs027Bk5mTgJvoL3/RcBKHGAiw7T85zXhnFGFjFu2OWZOfbsCX Z871un+pwdYGksRFCzyKPsPWBa/19LNUWcVfXpoThZW0zQdgSGrCFoUpGxb/nUxMdA/V f3TQ== X-Gm-Message-State: AJIora8yA5khNQhyoPzHjmL4rhDOBxf4GNslBOK4WYTB+rU6WFlhLVC7 jcaBUbh6adWyXy/CbeJhs+9Pud19mjM= X-Google-Smtp-Source: AGRyM1tu8tP/mMENr6WAqlAOUv3uOhVmJhMxBhXKVxfQLoxqotiTQLhXkYmrBDAZIFHg16HgFTTo+w== X-Received: by 2002:adf:fbc3:0:b0:21a:3a80:fa09 with SMTP id d3-20020adffbc3000000b0021a3a80fa09mr9663608wrs.212.1655554448156; Sat, 18 Jun 2022 05:14:08 -0700 (PDT) Received: from localhost.localdomain ([178.233.178.185]) by smtp.gmail.com with ESMTPSA id h28-20020adfa4dc000000b0020fff0ea0a3sm7532394wrb.116.2022.06.18.05.14.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jun 2022 05:14:07 -0700 (PDT) From: Alper Nebi Yasak To: u-boot@lists.denx.de Cc: Michael Walle , Wolfgang Denk , Marek Vasut , Ricardo Salveti , Patrick Delaunay , Heiko Thiery , Stefan Roese , Peng Fan , Philippe Reynes , =?utf-8?q?Marek_Beh=C3=BA?= =?utf-8?q?n?= , Tom Rini , Simon Glass , Oleksandr Suvorov , Ovidiu Panait , Heiko Schocher , Alexandru Gagniuc , Andre Przywara , =?utf-8?q?Pali_Roh=C3=A1r?= , Heinrich Schuchardt , Alper Nebi Yasak Subject: [PATCH v2 3/8] spl: binman: Declare extern symbols for VPL as well Date: Sat, 18 Jun 2022 15:13:08 +0300 Message-Id: <20220618121316.12061-4-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220618121316.12061-1-alpernebiyasak@gmail.com> References: <20220618121316.12061-1-alpernebiyasak@gmail.com> MIME-Version: 1.0 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 The binman extern symbol declarations in spl.h are missing the VPL symbols recently added to spl.c, add them like the others. Signed-off-by: Alper Nebi Yasak Signed-off-by: Alper Nebi Yasak --- (no changes since v1) include/spl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/spl.h b/include/spl.h index 83ac583e0b49..1778e0f53686 100644 --- a/include/spl.h +++ b/include/spl.h @@ -288,6 +288,8 @@ binman_sym_extern(ulong, u_boot_any, image_pos); binman_sym_extern(ulong, u_boot_any, size); binman_sym_extern(ulong, u_boot_spl, image_pos); binman_sym_extern(ulong, u_boot_spl, size); +binman_sym_extern(ulong, u_boot_vpl, image_pos); +binman_sym_extern(ulong, u_boot_vpl, size); /** * spl_get_image_pos() - get the image position of the next phase From patchwork Sat Jun 18 12:13:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alper Nebi Yasak X-Patchwork-Id: 1645044 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=KzbYOhnB; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LQFG85bqrz9s2R for ; Sat, 18 Jun 2022 22:14:40 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0CC7284484; Sat, 18 Jun 2022 14:14:23 +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="KzbYOhnB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 37D0584477; Sat, 18 Jun 2022 14:14:21 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 B8C4A8447E for ; Sat, 18 Jun 2022 14:14:14 +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=alpernebiyasak@gmail.com Received: by mail-wr1-x429.google.com with SMTP id s1so8759515wra.9 for ; Sat, 18 Jun 2022 05:14:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KsWEeECcctYELlSmtYyaciZEVB45stjp4ef80GHA52A=; b=KzbYOhnBrbqrpl73mrlM1je7AhCU5vtpry78zPBEp/42cBqcpx6XJhEpsY0OAAdMIt IZ1S2I3svWeoH+7luWwPJ8uOa6n9seWII+cZmuXFGJU5nayOOxq4AhLQkImvTVpTZmsF tiX5L6BEOQhplyV/WD9zWQLsWNGNGHoAc2ZEc3cCMzTibfOKMqc3y4qld47U6VLavRRI XZ0epBh/G4KsBVSNnQyhop8dWrTt55hagb55MIrtufA4mmO7gxjbpgyHnoXYIiOI8jDU XIyQL3IArWtLQ0STHlqxYVzkITd9fpe8qPm31qr6i/UE7TcYERjvebV/W5Q57XPHMlf5 oiYA== 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=KsWEeECcctYELlSmtYyaciZEVB45stjp4ef80GHA52A=; b=x/LMcPaBmKCcTj4IZQJJ//3xwqtt3QndwMX690RM/YqwYjzuZ/pkJqQBP5yMliIiaI WAFKIHMpRruuo9AGsHULXasrW0/XLKVkddDvXon6VW74lMS00yodulGBsy2vPb822oSd cP2tDYz1elCEO98D9LA376C2j17odNzRbQHcRRRH75u0bQ8o+cR1v6vy2OORGuz8IUu9 vGZFwx99SmoZLXHIQGXhAA+M8Hg6oDO+o0xB1OjZBy9WTpavK/uz9euCll7c7Am4wa+w fvH/iVma8WsQ3FqwqwrMW/OPdDqJkHchvo+4ZE51zhHK9Lj2+AVglZrsGD95FfbHr7no vLsg== X-Gm-Message-State: AJIora+guLQF0Oe40xYkD+mhoXyMn7CwIPC47yjJoPVM7Qj0Bi2bV62A CUruQHVoklsMGxwMRWD8pgfcSv0xBUI= X-Google-Smtp-Source: AGRyM1vEEDiihTqga9IRv21FYNc/+ku0nYQKEfsxsVVip4SF3fv4YXPtL1/8ly23ypBQUIj67mMygg== X-Received: by 2002:a05:6000:1547:b0:218:568a:bd2e with SMTP id 7-20020a056000154700b00218568abd2emr14050545wry.716.1655554454108; Sat, 18 Jun 2022 05:14:14 -0700 (PDT) Received: from localhost.localdomain ([178.233.178.185]) by smtp.gmail.com with ESMTPSA id h28-20020adfa4dc000000b0020fff0ea0a3sm7532394wrb.116.2022.06.18.05.14.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jun 2022 05:14:13 -0700 (PDT) From: Alper Nebi Yasak To: u-boot@lists.denx.de Cc: Michael Walle , Wolfgang Denk , Marek Vasut , Ricardo Salveti , Patrick Delaunay , Heiko Thiery , Stefan Roese , Peng Fan , Philippe Reynes , =?utf-8?q?Marek_Beh=C3=BA?= =?utf-8?q?n?= , Tom Rini , Simon Glass , Oleksandr Suvorov , Ovidiu Panait , Heiko Schocher , Alexandru Gagniuc , Andre Przywara , =?utf-8?q?Pali_Roh=C3=A1r?= , Heinrich Schuchardt , Alper Nebi Yasak Subject: [PATCH v2 4/8] spl: binman: Split binman symbols support from enabling binman Date: Sat, 18 Jun 2022 15:13:09 +0300 Message-Id: <20220618121316.12061-5-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220618121316.12061-1-alpernebiyasak@gmail.com> References: <20220618121316.12061-1-alpernebiyasak@gmail.com> MIME-Version: 1.0 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 Enabling CONFIG_BINMAN makes binman run after a build to package any images specified in the device-tree. It also enables a mechanism for SPL/TPL to declare and use special linker symbols that refer to other entries in the same binman image. A similar feature that gets this info from the device-tree exists for U-Boot proper, but it is gated behind a CONFIG_BINMAN_FDT unlike the symbols. Confusingly, CONFIG_SPL/TPL_BINMAN_SYMBOLS also exist. These configs don't actually enable/disable the symbols mechanism as one would expect, but declare some symbols for U-Boot using this mechanism. Reuse the BINMAN_SYMBOLS configs to make them toggle the symbols mechanism, and declare symbols for the U-Boot phases in a dependent BINMAN_UBOOT_SYMBOLS config. Extend it to cover symbols of all phases. Update the config prompt and help message to make it clearer about this. Fix binman test binaries to work with CONFIG_IS_ENABLED(BINMAN_SYMBOLS). Co-developed-by: Peng Fan [Alper: New config for phase symbols, update Kconfigs, commit message] Signed-off-by: Alper Nebi Yasak Signed-off-by: Alper Nebi Yasak --- See Peng's patch [1] included in these changes. [1] binman_sym: guard with CONFIG_IS_ENABLED(BINMAN_SYMBOLS) https://lore.kernel.org/u-boot/20220603071715.15212-8-peng.fan@oss.nxp.com/ Changes in v2: - Split binman symbols support from enabling binman - Move U-Boot phase symbol declarations to BINMAN_UBOOT_SYMBOLS configs - Merge in Peng's patch for binman_sym.h changes common/spl/Kconfig | 22 ++++++++++++++----- common/spl/Kconfig.tpl | 24 +++++++++++++++------ common/spl/spl.c | 9 ++++---- include/binman_sym.h | 6 +++--- tools/binman/test/Makefile | 2 +- tools/binman/test/generated/autoconf.h | 3 +++ tools/binman/test/u_boot_binman_syms.c | 2 +- tools/binman/test/u_boot_binman_syms_size.c | 2 +- 8 files changed, 49 insertions(+), 21 deletions(-) create mode 100644 tools/binman/test/generated/autoconf.h diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 2ad2351c6eb3..46d9be73bb1f 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -190,12 +190,24 @@ config SPL_BINMAN_SYMBOLS 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(). + This enables use of symbols in SPL which refer to other entries in + the same binman image as the SPL. These can be declared with the + binman_sym_declare(type, entry, prop) macro and accessed by the + binman_sym(type, entry, prop) macro defined in binman_sym.h. - 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. + See tools/binman/binman.rst for a detailed explanation. + +config SPL_BINMAN_UBOOT_SYMBOLS + bool "Declare binman symbols for U-Boot phases in SPL" + depends on SPL_BINMAN_SYMBOLS + default y + help + This enables use of symbols in SPL which refer to U-Boot phases, + enabling SPL to obtain the location and size of its next phase simply + by calling spl_get_image_pos() and spl_get_image_size(). + + For this to work, you must have all U-Boot phases in the same binman + image, so binman can update SPL with the locations of everything. source "common/spl/Kconfig.nxp" diff --git a/common/spl/Kconfig.tpl b/common/spl/Kconfig.tpl index 834cb6b6dd82..8c59c767302f 100644 --- a/common/spl/Kconfig.tpl +++ b/common/spl/Kconfig.tpl @@ -9,16 +9,28 @@ config TPL_SIZE_LIMIT If this value is zero, it is ignored. config TPL_BINMAN_SYMBOLS - bool "Declare binman symbols in TPL" + bool "Support binman symbols in TPL" depends on TPL_FRAMEWORK && BINMAN default y help - This enables use of symbols in TPL which refer to U-Boot, enabling TPL - to obtain the location of U-Boot simply by calling spl_get_image_pos() - and spl_get_image_size(). + This enables use of symbols in TPL which refer to other entries in + the same binman image as the TPL. These can be declared with the + binman_sym_declare(type, entry, prop) macro and accessed by the + binman_sym(type, entry, prop) macro defined in binman_sym.h. - For this to work, you must have a U-Boot image in the binman image, so - binman can update TPL with the location of it. + See tools/binman/binman.rst for a detailed explanation. + +config TPL_BINMAN_UBOOT_SYMBOLS + bool "Declare binman symbols for U-Boot phases in TPL" + depends on TPL_BINMAN_SYMBOLS + default y + help + This enables use of symbols in TPL which refer to U-Boot phases, + enabling TPL to obtain the location and size of its next phase simply + by calling spl_get_image_pos() and spl_get_image_size(). + + For this to work, you must have all U-Boot phases in the same binman + image, so binman can update TPL with the locations of everything. config TPL_FRAMEWORK bool "Support TPL based upon the common SPL framework" diff --git a/common/spl/spl.c b/common/spl/spl.c index 5630dcdb5c1e..89b875d0e017 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -51,11 +51,10 @@ DECLARE_GLOBAL_DATA_PTR; u32 *boot_params_ptr = NULL; -#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS) +#if CONFIG_IS_ENABLED(BINMAN_UBOOT_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); @@ -67,6 +66,8 @@ binman_sym_declare(ulong, u_boot_vpl, image_pos); binman_sym_declare(ulong, u_boot_vpl, size); #endif +#endif /* BINMAN_UBOOT_SYMBOLS */ + /* Define board data structure */ static struct bd_info bdata __attribute__ ((section(".data"))); @@ -151,7 +152,7 @@ void spl_fixup_fdt(void *fdt_blob) ulong spl_get_image_pos(void) { - if (!CONFIG_IS_ENABLED(BINMAN_SYMBOLS)) + if (!CONFIG_IS_ENABLED(BINMAN_UBOOT_SYMBOLS)) return BINMAN_SYM_MISSING; #ifdef CONFIG_VPL @@ -165,7 +166,7 @@ ulong spl_get_image_pos(void) ulong spl_get_image_size(void) { - if (!CONFIG_IS_ENABLED(BINMAN_SYMBOLS)) + if (!CONFIG_IS_ENABLED(BINMAN_UBOOT_SYMBOLS)) return BINMAN_SYM_MISSING; #ifdef CONFIG_VPL diff --git a/include/binman_sym.h b/include/binman_sym.h index 72e6765fe520..8586ef8731b6 100644 --- a/include/binman_sym.h +++ b/include/binman_sym.h @@ -13,7 +13,7 @@ #define BINMAN_SYM_MISSING (-1UL) -#ifdef CONFIG_BINMAN +#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS) /** * binman_symname() - Internal function to get a binman symbol name @@ -77,7 +77,7 @@ #define binman_sym(_type, _entry_name, _prop_name) \ (*(_type *)&binman_symname(_entry_name, _prop_name)) -#else /* !BINMAN */ +#else /* !CONFIG_IS_ENABLED(BINMAN_SYMBOLS) */ #define binman_sym_declare(_type, _entry_name, _prop_name) @@ -87,6 +87,6 @@ #define binman_sym(_type, _entry_name, _prop_name) BINMAN_SYM_MISSING -#endif /* BINMAN */ +#endif /* CONFIG_IS_ENABLED(BINMAN_SYMBOLS) */ #endif diff --git a/tools/binman/test/Makefile b/tools/binman/test/Makefile index 57057e2d588f..bea8567c9b45 100644 --- a/tools/binman/test/Makefile +++ b/tools/binman/test/Makefile @@ -21,7 +21,7 @@ CC = $(CROSS_COMPILE)gcc OBJCOPY = $(CROSS_COMPILE)objcopy VPATH := $(SRC) -CFLAGS := -march=i386 -m32 -nostdlib -I $(SRC)../../../include \ +CFLAGS := -march=i386 -m32 -nostdlib -I $(SRC)../../../include -I $(SRC) \ -Wl,--no-dynamic-linker LDS_UCODE := -T $(SRC)u_boot_ucode_ptr.lds diff --git a/tools/binman/test/generated/autoconf.h b/tools/binman/test/generated/autoconf.h new file mode 100644 index 000000000000..6a23039f4699 --- /dev/null +++ b/tools/binman/test/generated/autoconf.h @@ -0,0 +1,3 @@ +#define CONFIG_BINMAN 1 +#define CONFIG_SPL_BUILD 1 +#define CONFIG_SPL_BINMAN_SYMBOLS 1 diff --git a/tools/binman/test/u_boot_binman_syms.c b/tools/binman/test/u_boot_binman_syms.c index 37fc339ce84b..89fee5567e1d 100644 --- a/tools/binman/test/u_boot_binman_syms.c +++ b/tools/binman/test/u_boot_binman_syms.c @@ -5,7 +5,7 @@ * Simple program to create some binman symbols. This is used by binman tests. */ -#define CONFIG_BINMAN +#include #include binman_sym_declare(unsigned long, u_boot_spl_any, offset); diff --git a/tools/binman/test/u_boot_binman_syms_size.c b/tools/binman/test/u_boot_binman_syms_size.c index 7224bc1863c7..c4a053f96f1a 100644 --- a/tools/binman/test/u_boot_binman_syms_size.c +++ b/tools/binman/test/u_boot_binman_syms_size.c @@ -5,7 +5,7 @@ * Simple program to create some binman symbols. This is used by binman tests. */ -#define CONFIG_BINMAN +#include #include binman_sym_declare(char, u_boot_spl, pos); From patchwork Sat Jun 18 12:13:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alper Nebi Yasak X-Patchwork-Id: 1645045 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=pIj5Ctsq; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LQFGM2Dyzz9s2R for ; Sat, 18 Jun 2022 22:14:51 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E94928447A; Sat, 18 Jun 2022 14:14:25 +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="pIj5Ctsq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B6A0984477; Sat, 18 Jun 2022 14:14:24 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) (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 14E038446D for ; Sat, 18 Jun 2022 14:14:21 +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=alpernebiyasak@gmail.com Received: by mail-wm1-x335.google.com with SMTP id j5-20020a05600c1c0500b0039c5dbbfa48so5541681wms.5 for ; Sat, 18 Jun 2022 05:14:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rgKPrPdgCWvgu5fF+3G3uybpPnXGJ4zgqXmFeluB7Yk=; b=pIj5Ctsq0Vv/Xr4tJ4Ybl0nn+p9PTh3EPa0H63SzWsGqFMit8/VTz99wjXmRxaLOrJ NnTwEy2c7YUzrArdWYLu+UH8yOLu6rdP6Qxg38r418TDdlqqzw66CTAgXZfNR/OwF5Cg vQZEu/OJt0FOido7el2zPkMB3GLOfLXAWsWgWblECkc4H40i3ib40r74hcN4Tn5NGm/5 yiuUHxUFmYjWZgyhWDPhAqmpelScXGPQKcnChKhJXZCm10ptD2aZELalmT2sJuQkeXRV xliKuqxcw8IpbN2h94KEhq4f5Y+QZId+HXv8lPhRNYmeIWQvX3z7O48HzoRIB29oviMO inUw== 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=rgKPrPdgCWvgu5fF+3G3uybpPnXGJ4zgqXmFeluB7Yk=; b=SomJp9KrJXa7PnCbW8zPg2Ql7MBTX/B0uy6Msbc+AdnemRFM8odZQSZrwHEctWNCdt Dvd1w8CcRKHW5KspREJxKro272MxgIQJIK2+Xqrgf7kkQZ8TMZC5LYfVIiuTOm29sYEb dIf4ZIxKUEFqMPTkEDoYhNb66s+w2u44U2Lw/fhX3Jorrm3JDMiQM8jE1KVmhro1SJZw xcBnSJDly9ljhhZhoTyGUNRJrC/VCp1e3vlZ+Wbl/fNg42u8cgmkoOQoO8Hw3Nwun7NM yRpchtoQpZRINKnzbWhtV4m87hA0Ah9l3tRu2FEYoc8miqQ+hO3mjaj6iI/Ed73s4UVw mEJw== X-Gm-Message-State: AOAM531pXGh+uVuPmVP4yJA4SQlwBHn48lW/oYBAjH8C6yxpmMACd6rE mISYfee/DxhQGboyuIRB0Z89u5V7Brc= X-Google-Smtp-Source: ABdhPJzf8I9XEnlRQNe0jFGb6NDRVcBVTcRrDhZ9yidJ/XTwGnXyVSkN5eu/p1sKAFj7nO4dz8VCsg== X-Received: by 2002:a05:600c:3508:b0:39c:8240:5538 with SMTP id h8-20020a05600c350800b0039c82405538mr25158462wmq.165.1655554460624; Sat, 18 Jun 2022 05:14:20 -0700 (PDT) Received: from localhost.localdomain ([178.233.178.185]) by smtp.gmail.com with ESMTPSA id h28-20020adfa4dc000000b0020fff0ea0a3sm7532394wrb.116.2022.06.18.05.14.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jun 2022 05:14:20 -0700 (PDT) From: Alper Nebi Yasak To: u-boot@lists.denx.de Cc: Michael Walle , Wolfgang Denk , Marek Vasut , Ricardo Salveti , Patrick Delaunay , Heiko Thiery , Stefan Roese , Peng Fan , Philippe Reynes , =?utf-8?q?Marek_Beh=C3=BA?= =?utf-8?q?n?= , Tom Rini , Simon Glass , Oleksandr Suvorov , Ovidiu Panait , Heiko Schocher , Alexandru Gagniuc , Andre Przywara , =?utf-8?q?Pali_Roh=C3=A1r?= , Heinrich Schuchardt , Alper Nebi Yasak Subject: [PATCH v2 5/8] spl: binman: Add config options for binman symbols in VPL Date: Sat, 18 Jun 2022 15:13:10 +0300 Message-Id: <20220618121316.12061-6-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220618121316.12061-1-alpernebiyasak@gmail.com> References: <20220618121316.12061-1-alpernebiyasak@gmail.com> MIME-Version: 1.0 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 The SPL code declares binman symbols for U-Boot phases depending on CONFIG_IS_ENABLED(BINMAN_UBOOT_SYMBOLS). This config exists for SPL and TPL, also add a version for VPL. Signed-off-by: Alper Nebi Yasak Signed-off-by: Alper Nebi Yasak --- Changes in v2: - Update VPL configs for the new BINMAN_UBOOT_SYMBOLS common/spl/Kconfig.vpl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/common/spl/Kconfig.vpl b/common/spl/Kconfig.vpl index ba1ea6075b94..daec0bb7bfff 100644 --- a/common/spl/Kconfig.vpl +++ b/common/spl/Kconfig.vpl @@ -198,4 +198,28 @@ config VPL_TEXT_BASE help The address in memory that VPL will be running from. +config VPL_BINMAN_SYMBOLS + bool "Declare binman symbols in VPL" + depends on VPL_FRAMEWORK && BINMAN + default y + help + This enables use of symbols in VPL which refer to other entries in + the same binman image as the VPL. These can be declared with the + binman_sym_declare(type, entry, prop) macro and accessed by the + binman_sym(type, entry, prop) macro defined in binman_sym.h. + + See tools/binman/binman.rst for a detailed explanation. + +config VPL_BINMAN_UBOOT_SYMBOLS + bool "Declare binman symbols for U-Boot phases in VPL" + depends on VPL_BINMAN_SYMBOLS + default y + help + This enables use of symbols in VPL which refer to U-Boot phases, + enabling VPL to obtain the location and size of its next phase simply + by calling spl_get_image_pos() and spl_get_image_size(). + + For this to work, you must have all U-Boot phases in the same binman + image, so binman can update VPL with the locations of everything. + endmenu From patchwork Sat Jun 18 12:13:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alper Nebi Yasak X-Patchwork-Id: 1645046 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=X5gfXAsU; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LQFGY3gj5z9s2R for ; Sat, 18 Jun 2022 22:15:01 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B38EF8448C; Sat, 18 Jun 2022 14:14:34 +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="X5gfXAsU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8490584459; Sat, 18 Jun 2022 14:14:32 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (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 366FA84485 for ; Sat, 18 Jun 2022 14:14:27 +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=alpernebiyasak@gmail.com Received: by mail-wm1-x329.google.com with SMTP id x6-20020a1c7c06000000b003972dfca96cso3535886wmc.4 for ; Sat, 18 Jun 2022 05:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+fgjKVBQgZDYlNiKJDWdwFMJgjrUSswEW8aPtIqn7us=; b=X5gfXAsU6PqUfckdRjeSwMIK4Vp/xlj6c/khzkePHwksWla6kXJ4yF/Xx9f+adpRZm rPcYJur3nMfE3/foA63mPWtmfR1zIUUN2nduZpj5Hg/cMdhg4nN6w7hCOfKdZy5OMfHP ItlMN416kLnLcwPAZB98vzcZu77dwv2VY0v93VJWZ+e7vdkzyRoqiPBuZirzkDNLvpz/ Uzxc/ve2Q+cWthD3oUUkM6vqSvkRkTJAeIGkjMcZrhQVYWrpe9d7WTcc4lEUbW//jTuA nQRHujk/DEcd3uY4gJlET76nUUYSi25hCLV9y1SOCgaiDJYfrNltcD4JDVqvaP91Q74x Im3A== 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=+fgjKVBQgZDYlNiKJDWdwFMJgjrUSswEW8aPtIqn7us=; b=hPZcIL6fdokKaov51mRQ7oSjgoOsEz2uhoaSNdxXrDoruB4PuSis3/ujcNeKHnsqNP iC4fQMQnM7AP78AfnjauzuuRPcrNn5d9p1YJ+VFD9lafs6MGt2FkukMZ0OI4l2Sr6QZA agMsxXibaWNZ+6C6gXPsraCr/9JAf+9t5CAqKo99eJU5gZqs/tKdvrAWlmtu8hMRlqiY 5IegpJLwpnOi7V7fT8+Rv5LLBEhN/A4eOMnEngVnj2zOpy20J75AX5RKy7n1K/6utsve fsq0qfRxj1sHjMV+2sb+izhi5UxvuueNuva2Xxslvxg/yXagPHX2O3/C6xT7OpgIDx2/ 7lJA== X-Gm-Message-State: AOAM5312yuzNxuGiwLXUlqoARonHMXM2kA+wm68zAH2r/8IvM7ig7mCn sx5MP9C9y6d8o5gET1IeARmX2d8NVD4= X-Google-Smtp-Source: ABdhPJzwCwMQMpgazixZ4NwSK1M9VsS3nAUjwKmy7iTH/jzWCjpDz/A5BTTuUV/CDeo9HIhQ6vEVmw== X-Received: by 2002:a05:600c:3acc:b0:39c:7427:d379 with SMTP id d12-20020a05600c3acc00b0039c7427d379mr25707094wms.32.1655554466686; Sat, 18 Jun 2022 05:14:26 -0700 (PDT) Received: from localhost.localdomain ([178.233.178.185]) by smtp.gmail.com with ESMTPSA id h28-20020adfa4dc000000b0020fff0ea0a3sm7532394wrb.116.2022.06.18.05.14.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jun 2022 05:14:26 -0700 (PDT) From: Alper Nebi Yasak To: u-boot@lists.denx.de Cc: Michael Walle , Wolfgang Denk , Marek Vasut , Ricardo Salveti , Patrick Delaunay , Heiko Thiery , Stefan Roese , Peng Fan , Philippe Reynes , =?utf-8?q?Marek_Beh=C3=BA?= =?utf-8?q?n?= , Tom Rini , Simon Glass , Oleksandr Suvorov , Ovidiu Panait , Heiko Schocher , Alexandru Gagniuc , Andre Przywara , =?utf-8?q?Pali_Roh=C3=A1r?= , Heinrich Schuchardt , Alper Nebi Yasak Subject: [PATCH v2 6/8] spl: binman: Check at runtime if binman symbols were filled in Date: Sat, 18 Jun 2022 15:13:11 +0300 Message-Id: <20220618121316.12061-7-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220618121316.12061-1-alpernebiyasak@gmail.com> References: <20220618121316.12061-1-alpernebiyasak@gmail.com> MIME-Version: 1.0 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 Binman lets us declare symbols in SPL/TPL that refer to other entries in the same binman image as them. These symbols are filled in with the correct values while binman assembles the images, but this is done in-memory only. Symbols marked as optional can be filled with BINMAN_SYM_MISSING as an error value if their referred entry is missing. However, the unmodified SPL/TPL binaries are still available on disk, and can be used by people. For these files, nothing ensures that the symbols are set to this error value, and they will be considered valid when they are not. Empirically, all symbols show up as zero in a sandbox_vpl build when we run e.g. tpl/u-boot-tpl directly. On the other hand, zero is a perfectly fine value for a binman-written symbol, so we cannot say the symbols have wrong values based on that. Declare a magic symbol that binman always fills in with a fixed value. Check this value as an indicator that symbols were filled in correctly. Return the error value for all symbols when this magic symbol has the wrong value. For binman tests, we need to make room for the new symbol in the mocked SPL/TPL data by extending them by four bytes. This messes up some test image layouts. Fix the affected values, and check the magic symbol wherever it makes sense. Signed-off-by: Alper Nebi Yasak Signed-off-by: Alper Nebi Yasak --- (no changes since v1) common/spl/spl.c | 1 + include/binman_sym.h | 45 ++++++++++++++++++++- tools/binman/elf.py | 12 ++++-- tools/binman/elf_test.py | 12 +++--- tools/binman/ftest.py | 33 +++++++-------- tools/binman/test/021_image_pad.dts | 2 +- tools/binman/test/024_sorted.dts | 2 +- tools/binman/test/028_pack_4gb_outside.dts | 2 +- tools/binman/test/029_x86_rom.dts | 6 +-- tools/binman/test/053_symbols.dts | 2 +- tools/binman/test/149_symbols_tpl.dts | 4 +- tools/binman/test/155_symbols_tpl_x86.dts | 4 +- tools/binman/test/187_symbols_sub.dts | 2 +- tools/binman/test/u_boot_binman_syms.c | 4 ++ tools/binman/test/u_boot_binman_syms_size.c | 4 ++ 15 files changed, 97 insertions(+), 38 deletions(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index 89b875d0e017..6f76205f8d7a 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -40,6 +40,7 @@ #include DECLARE_GLOBAL_DATA_PTR; +DECLARE_BINMAN_MAGIC_SYM; #ifndef CONFIG_SYS_UBOOT_START #define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE diff --git a/include/binman_sym.h b/include/binman_sym.h index 8586ef8731b6..528d7e4e90ed 100644 --- a/include/binman_sym.h +++ b/include/binman_sym.h @@ -11,6 +11,8 @@ #ifndef __BINMAN_SYM_H #define __BINMAN_SYM_H +/* BSYM in little endian, keep in sync with tools/binman/elf.py */ +#define BINMAN_SYM_MAGIC_VALUE (0x4d595342UL) #define BINMAN_SYM_MISSING (-1UL) #if CONFIG_IS_ENABLED(BINMAN_SYMBOLS) @@ -62,6 +64,37 @@ __attribute__((aligned(4), weak, unused, \ section(".binman_sym"))) +/** + * _binman_sym_magic - Internal magic symbol for validity checks + * + * When building images, binman fills in this symbol with the magic + * value #defined above. This is used to check at runtime if the + * symbol values were filled in and are OK to use. + */ +extern ulong _binman_sym_magic; + +/** + * DECLARE_BINMAN_MAGIC_SYM - Declare the internal magic symbol + * + * This macro declares the _binman_sym_magic symbol so that it exists. + * Declaring it here would cause errors during linking due to multiple + * definitions of the symbol. + */ +#define DECLARE_BINMAN_MAGIC_SYM \ + ulong _binman_sym_magic \ + __attribute__((aligned(4), section(".binman_sym"))) + +/** + * BINMAN_SYMS_OK - Check if the symbol values are valid + * + * This macro checks if the magic symbol's value is filled properly, + * which indicates that other symbols are OK to use as well. + * + * Return: 1 if binman symbol values are usable, 0 if not + */ +#define BINMAN_SYMS_OK \ + (*(ulong *)&_binman_sym_magic == BINMAN_SYM_MAGIC_VALUE) + /** * binman_sym() - Access a previously declared symbol * @@ -72,10 +105,14 @@ * @_type: Type f the symbol (e.g. unsigned long) * @entry_name: Name of the entry to look for (e.g. 'u_boot_spl') * @_prop_name: Property value to get from that entry (e.g. 'pos') - * @returns value of that property (filled in by binman) + * + * Return: value of that property (filled in by binman), or + * BINMAN_SYM_MISSING if the value is unavailable */ #define binman_sym(_type, _entry_name, _prop_name) \ - (*(_type *)&binman_symname(_entry_name, _prop_name)) + (BINMAN_SYMS_OK ? \ + (*(_type *)&binman_symname(_entry_name, _prop_name)) : \ + BINMAN_SYM_MISSING) #else /* !CONFIG_IS_ENABLED(BINMAN_SYMBOLS) */ @@ -85,6 +122,10 @@ #define binman_sym_extern(_type, _entry_name, _prop_name) +#define DECLARE_BINMAN_MAGIC_SYM + +#define BINMAN_SYMS_OK (0) + #define binman_sym(_type, _entry_name, _prop_name) BINMAN_SYM_MISSING #endif /* CONFIG_IS_ENABLED(BINMAN_SYMBOLS) */ diff --git a/tools/binman/elf.py b/tools/binman/elf.py index afa05e58fdd8..6d440ddf21df 100644 --- a/tools/binman/elf.py +++ b/tools/binman/elf.py @@ -25,6 +25,9 @@ except: # pragma: no cover ELF_TOOLS = False +# BSYM in little endian, keep in sync with include/binman_sym.h +BINMAN_SYM_MAGIC_VALUE = 0x4d595342 + # Information about an EFL symbol: # section (str): Name of the section containing this symbol # address (int): Address of the symbol (its value) @@ -223,9 +226,12 @@ def LookupAndWriteSymbols(elf_fname, entry, section): raise ValueError('%s has size %d: only 4 and 8 are supported' % (msg, sym.size)) - # Look up the symbol in our entry tables. - value = section.GetImage().LookupImageSymbol(name, sym.weak, msg, - base.address) + if name == '_binman_sym_magic': + value = BINMAN_SYM_MAGIC_VALUE + else: + # Look up the symbol in our entry tables. + value = section.GetImage().LookupImageSymbol(name, sym.weak, + msg, base.address) if value is None: value = -1 pack_string = pack_string.lower() diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py index 02bc10837492..5a51c64cfee3 100644 --- a/tools/binman/elf_test.py +++ b/tools/binman/elf_test.py @@ -127,7 +127,7 @@ def testOutsideFile(self): elf_fname = self.ElfTestFile('u_boot_binman_syms') with self.assertRaises(ValueError) as e: elf.LookupAndWriteSymbols(elf_fname, entry, section) - self.assertIn('entry_path has offset 4 (size 8) but the contents size ' + self.assertIn('entry_path has offset 8 (size 8) but the contents size ' 'is a', str(e.exception)) def testMissingImageStart(self): @@ -161,18 +161,20 @@ def testNoValue(self): This should produce -1 values for all thress symbols, taking up the first 16 bytes of the image. """ - entry = FakeEntry(24) + entry = FakeEntry(28) section = FakeSection(sym_value=None) elf_fname = self.ElfTestFile('u_boot_binman_syms') elf.LookupAndWriteSymbols(elf_fname, entry, section) - self.assertEqual(tools.get_bytes(255, 20) + tools.get_bytes(ord('a'), 4), - entry.data) + expected = (struct.pack('; + offset = <28>; }; }; }; diff --git a/tools/binman/test/024_sorted.dts b/tools/binman/test/024_sorted.dts index b79d9adf6827..b54f9b14191d 100644 --- a/tools/binman/test/024_sorted.dts +++ b/tools/binman/test/024_sorted.dts @@ -7,7 +7,7 @@ / { binman { sort-by-offset; u-boot { - offset = <26>; + offset = <30>; }; u-boot-spl { diff --git a/tools/binman/test/028_pack_4gb_outside.dts b/tools/binman/test/028_pack_4gb_outside.dts index 11a1f6059e26..b6ad7fb56a53 100644 --- a/tools/binman/test/028_pack_4gb_outside.dts +++ b/tools/binman/test/028_pack_4gb_outside.dts @@ -13,7 +13,7 @@ u-boot { }; u-boot-spl { - offset = <0xffffffe7>; + offset = <0xffffffe3>; }; }; }; diff --git a/tools/binman/test/029_x86_rom.dts b/tools/binman/test/029_x86_rom.dts index 88aa007bbae1..ad8f9d6e1bdd 100644 --- a/tools/binman/test/029_x86_rom.dts +++ b/tools/binman/test/029_x86_rom.dts @@ -7,13 +7,13 @@ / { binman { sort-by-offset; end-at-4gb; - size = <32>; + size = <36>; u-boot { - offset = <0xffffffe0>; + offset = <0xffffffdc>; }; u-boot-spl { - offset = <0xffffffe7>; + offset = <0xffffffe3>; }; }; }; diff --git a/tools/binman/test/053_symbols.dts b/tools/binman/test/053_symbols.dts index 296580927648..b28f34a72faa 100644 --- a/tools/binman/test/053_symbols.dts +++ b/tools/binman/test/053_symbols.dts @@ -10,7 +10,7 @@ u-boot-spl { }; u-boot { - offset = <0x18>; + offset = <0x1c>; }; u-boot-spl2 { diff --git a/tools/binman/test/149_symbols_tpl.dts b/tools/binman/test/149_symbols_tpl.dts index 0a4ab3f1fabd..4e649c45978d 100644 --- a/tools/binman/test/149_symbols_tpl.dts +++ b/tools/binman/test/149_symbols_tpl.dts @@ -11,12 +11,12 @@ u-boot-spl { }; u-boot-spl2 { - offset = <0x1c>; + offset = <0x20>; type = "u-boot-spl"; }; u-boot { - offset = <0x34>; + offset = <0x3c>; }; section { diff --git a/tools/binman/test/155_symbols_tpl_x86.dts b/tools/binman/test/155_symbols_tpl_x86.dts index 9d7dc51b3d9b..e1ce33e67fbc 100644 --- a/tools/binman/test/155_symbols_tpl_x86.dts +++ b/tools/binman/test/155_symbols_tpl_x86.dts @@ -14,12 +14,12 @@ u-boot-spl { }; u-boot-spl2 { - offset = <0xffffff1c>; + offset = <0xffffff20>; type = "u-boot-spl"; }; u-boot { - offset = <0xffffff34>; + offset = <0xffffff3c>; }; section { diff --git a/tools/binman/test/187_symbols_sub.dts b/tools/binman/test/187_symbols_sub.dts index 54511a737112..3ab62d372152 100644 --- a/tools/binman/test/187_symbols_sub.dts +++ b/tools/binman/test/187_symbols_sub.dts @@ -11,7 +11,7 @@ u-boot-spl { }; u-boot { - offset = <24>; + offset = <28>; }; }; diff --git a/tools/binman/test/u_boot_binman_syms.c b/tools/binman/test/u_boot_binman_syms.c index 89fee5567e1d..ed761246aec7 100644 --- a/tools/binman/test/u_boot_binman_syms.c +++ b/tools/binman/test/u_boot_binman_syms.c @@ -5,9 +5,13 @@ * Simple program to create some binman symbols. This is used by binman tests. */ +typedef unsigned long ulong; + #include #include +DECLARE_BINMAN_MAGIC_SYM; + binman_sym_declare(unsigned long, u_boot_spl_any, offset); binman_sym_declare(unsigned long long, u_boot_spl2, offset); binman_sym_declare(unsigned long, u_boot_any, image_pos); diff --git a/tools/binman/test/u_boot_binman_syms_size.c b/tools/binman/test/u_boot_binman_syms_size.c index c4a053f96f1a..fa41b3d9a332 100644 --- a/tools/binman/test/u_boot_binman_syms_size.c +++ b/tools/binman/test/u_boot_binman_syms_size.c @@ -5,7 +5,11 @@ * Simple program to create some binman symbols. This is used by binman tests. */ +typedef unsigned long ulong; + #include #include +DECLARE_BINMAN_MAGIC_SYM; + binman_sym_declare(char, u_boot_spl, pos); From patchwork Sat Jun 18 12:13:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alper Nebi Yasak X-Patchwork-Id: 1645047 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=UHigq9Vn; dkim-atps=neutral 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=) 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 (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LQFGm2Nkfz9s2R for ; Sat, 18 Jun 2022 22:15:11 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7165D84470; Sat, 18 Jun 2022 14:14:39 +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="UHigq9Vn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2C78584470; Sat, 18 Jun 2022 14:14:36 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (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 6FCDE84485 for ; Sat, 18 Jun 2022 14:14:33 +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=alpernebiyasak@gmail.com Received: by mail-wm1-x334.google.com with SMTP id l2-20020a05600c4f0200b0039c55c50482so5567206wmq.0 for ; Sat, 18 Jun 2022 05:14:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gEuAd48umlfcQYdAZ7R8s5D9iwGHlpU4cvdRXyswxYs=; b=UHigq9VnZ4cWSXe0QCZRveeJOgFjpjPIxPvrFVcsSvDkz6MI49/1z9N0VWh92MMwG4 HGyXL9tLiLI1J0DK92GRTiy3LNSIMMtYBuJqLgOBiL3+HP2wKCyaLz0HbJsirJ767Fg2 /Dmk0YjnhmmiHrGRJ9y426uW+RLUAQeXRC7kjJ1SGZ1iPAXPtRnY/NsgIv9N6KZks//e SFo1r2e8NgJjjqtbiKom72DJgYRtnI7AMiMpE9BYUyGMaYZ1QUvEUw2kPfyAjwKsvI8C WPZJUGD5qJiQyfokzUQ166cMX7EyGTw1DwNGZVf4bvnNCmh4cBTatP5PlRi5yaRl7jJr dLNg== 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=gEuAd48umlfcQYdAZ7R8s5D9iwGHlpU4cvdRXyswxYs=; b=PUML4L3N+xEIcdt13qXphFsQ4SuYZynpSIN1sO+d6yUb5Dzy7dBxc6U05lIrIotWBL 6+x+OvdZ44+zwnZ4WjvrJ8uFB5DYkoP2M3xB08Y+0em+1IZ63mU4gguzVNCPYoJ+Yoqa vRK76cX0Qv/E8nsWaFolAKAxIwFgUaDXKuN3LamgPzGtei50E0BjFyT8K+Ewhl5K3lvt DVvIFXd5h4SV/IpHvUxrIGxEsuHqDsjVD3553f+Vup3fHzBiglLREScpq5/YYMj5DnrG d9/crbr2mPIW9CsuhaqcYdMGbLhnCouzzOkbQAI/2I8vAI0xkkcj9lWSVU3XPXsglVxa eh+w== X-Gm-Message-State: AJIora8yhqAOuJVhkMk+6O+Uze9sl66e228Uq1yZ0n5CR/MxrZaSrt+d +GVhrmGH+OeV9v2eNotXQJDiZJOnek0= X-Google-Smtp-Source: AGRyM1u3WMImTXO55v8hmP7HgXjfEWk5jsmZXO4/MXFGQfm2OvPZbNDfY10LQlAD8wBsNZcQ7rb3Cw== X-Received: by 2002:a05:600c:1d06:b0:39d:b642:ec8d with SMTP id l6-20020a05600c1d0600b0039db642ec8dmr14829457wms.137.1655554472837; Sat, 18 Jun 2022 05:14:32 -0700 (PDT) Received: from localhost.localdomain ([178.233.178.185]) by smtp.gmail.com with ESMTPSA id h28-20020adfa4dc000000b0020fff0ea0a3sm7532394wrb.116.2022.06.18.05.14.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jun 2022 05:14:32 -0700 (PDT) From: Alper Nebi Yasak To: u-boot@lists.denx.de Cc: Michael Walle , Wolfgang Denk , Marek Vasut , Ricardo Salveti , Patrick Delaunay , Heiko Thiery , Stefan Roese , Peng Fan , Philippe Reynes , =?utf-8?q?Marek_Beh=C3=BA?= =?utf-8?q?n?= , Tom Rini , Simon Glass , Oleksandr Suvorov , Ovidiu Panait , Heiko Schocher , Alexandru Gagniuc , Andre Przywara , =?utf-8?q?Pali_Roh=C3=A1r?= , Heinrich Schuchardt , Alper Nebi Yasak Subject: [PATCH v2 7/8] spl: binman: Disable u_boot_any symbols for i.MX8M boards Date: Sat, 18 Jun 2022 15:13:12 +0300 Message-Id: <20220618121316.12061-8-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220618121316.12061-1-alpernebiyasak@gmail.com> References: <20220618121316.12061-1-alpernebiyasak@gmail.com> MIME-Version: 1.0 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 The i.MX8M boards use partially specified binman images which have an SPL entry without a U-Boot entry. This would normally cause an error due to the 'u_boot_any' binman symbols declared by BINMAN_UBOOT_SYMBOLS requiring a U-Boot-like entry in the same image as the SPL. However, a problem in the ARMv8 __image_copy_start symbol definition effectively disables binman from attempting to write any symbols at all, so everything appears to work fine until runtime. A future patch fixes the issue in the linker scripts, which lets binman fill in the symbols, which would result in the build error described above. Explicitly disable the 'u_boot_any' symbols for i.MX8M boards. They are already effectively unusable, and they are incompatible with the boards' current binman image descriptions. Signed-off-by: Alper Nebi Yasak Signed-off-by: Alper Nebi Yasak --- Changes in v2: - Add new patch to disable u_boot_any symbols for i.MX8M boards common/spl/Kconfig | 1 + common/spl/Kconfig.tpl | 1 + common/spl/Kconfig.vpl | 1 + 3 files changed, 3 insertions(+) diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 46d9be73bb1f..152569ee4350 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -200,6 +200,7 @@ config SPL_BINMAN_SYMBOLS config SPL_BINMAN_UBOOT_SYMBOLS bool "Declare binman symbols for U-Boot phases in SPL" depends on SPL_BINMAN_SYMBOLS + default n if ARCH_IMX8M default y help This enables use of symbols in SPL which refer to U-Boot phases, diff --git a/common/spl/Kconfig.tpl b/common/spl/Kconfig.tpl index 8c59c767302f..e314b793a2e9 100644 --- a/common/spl/Kconfig.tpl +++ b/common/spl/Kconfig.tpl @@ -23,6 +23,7 @@ config TPL_BINMAN_SYMBOLS config TPL_BINMAN_UBOOT_SYMBOLS bool "Declare binman symbols for U-Boot phases in TPL" depends on TPL_BINMAN_SYMBOLS + default n if ARCH_IMX8M default y help This enables use of symbols in TPL which refer to U-Boot phases, diff --git a/common/spl/Kconfig.vpl b/common/spl/Kconfig.vpl index daec0bb7bfff..ba4b2e4f99e9 100644 --- a/common/spl/Kconfig.vpl +++ b/common/spl/Kconfig.vpl @@ -213,6 +213,7 @@ config VPL_BINMAN_SYMBOLS config VPL_BINMAN_UBOOT_SYMBOLS bool "Declare binman symbols for U-Boot phases in VPL" depends on VPL_BINMAN_SYMBOLS + default n if ARCH_IMX8M default y help This enables use of symbols in VPL which refer to U-Boot phases, From patchwork Sat Jun 18 12:13:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alper Nebi Yasak X-Patchwork-Id: 1645048 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Y22zzA4Z; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LQFGy03lRz9s2R for ; Sat, 18 Jun 2022 22:15:21 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 77B57844A1; Sat, 18 Jun 2022 14:14: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="Y22zzA4Z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 40FB184287; Sat, 18 Jun 2022 14:14:42 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 8924884487 for ; Sat, 18 Jun 2022 14:14:39 +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=alpernebiyasak@gmail.com Received: by mail-wr1-x429.google.com with SMTP id s1so8759515wra.9 for ; Sat, 18 Jun 2022 05:14:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5QsnDpZxOpWdUoXB0jF8w+8+0R2ZAxojooFOYuhmmzQ=; b=Y22zzA4Zae0DuKd8pixkkB+h7eAvBcdOboc0vx8QkfqPo8GONxyNot4pK23xI92DKH 3SZLrYjjiSoJEiW6TAO0rgvsss5yo0ECon/Vm1LtLe9Wlu+QkFk3kaConAWVFl3c4PQE 6L0tVncbyI4OpeUfVvwIws1tjcsGiLoFSBU4K/5qgBv7+HTcUzvqxa1rASMbur6n2lKt IXwnJGy26htJH/WTQrNtMoipsnbfABsl1BMcrWZj+Zdm14SUElGepxNGT89sbWzvJJst iiahBQaO7kSLgkVe+dGrLjbz76qtDNOp4H0MGFcyrdtFr0y+XYl/joNpuf0RWy4tc9Og E8gw== 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=5QsnDpZxOpWdUoXB0jF8w+8+0R2ZAxojooFOYuhmmzQ=; b=hs5ORAUCMvPiHFbpXpkhg7XI9SId7CB1k1H40Mb8+GxPxZtK6/j38Dw5/d2AntFsi7 1RUG6xYwF3MqdsgQDeyN9VWyJqdhTd13h7xwjhNjTulOToVeX2cKcVZY9Wv5Fq+ey7O8 mP3lc/PQi8FVSFZ6gc171zUEC+2UDEPRTCpMCc75xTby0QOi3Lxd3iAMvwn5dQKc2lxS qbcYsiRbOKqjQSIvbJ/PHLbUJA8s5IKJ3zMr5c3QYAzECSiXCpDpSbf0rdwFDA1QVL4n ZwJaTZX3PLsyouscIOmLwSV1LjASGs2Mexb1idmrnJZDMqQANye9rylTHql6Q3T9C7nu iI7A== X-Gm-Message-State: AJIora+RjjbVBuUa2fHl75F9sGDIpCj3J8IOAZWiGQBVGy8dOZdFqt2n +AA8sZjR+NhKWTGfdqBhhyceLbAM+Xk= X-Google-Smtp-Source: AGRyM1vkQ2q+usDGNlFp+22YtBRbw+VagsBTzB6xuTU3Bfb/qId0d7vUt99NORrl68Eo8uzDx1gV6w== X-Received: by 2002:a05:6000:698:b0:21b:8977:6dda with SMTP id bo24-20020a056000069800b0021b89776ddamr5862wrb.211.1655554479294; Sat, 18 Jun 2022 05:14:39 -0700 (PDT) Received: from localhost.localdomain ([178.233.178.185]) by smtp.gmail.com with ESMTPSA id h28-20020adfa4dc000000b0020fff0ea0a3sm7532394wrb.116.2022.06.18.05.14.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jun 2022 05:14:38 -0700 (PDT) From: Alper Nebi Yasak To: u-boot@lists.denx.de Cc: Michael Walle , Wolfgang Denk , Marek Vasut , Ricardo Salveti , Patrick Delaunay , Heiko Thiery , Stefan Roese , Peng Fan , Philippe Reynes , =?utf-8?q?Marek_Beh=C3=BA?= =?utf-8?q?n?= , Tom Rini , Simon Glass , Oleksandr Suvorov , Ovidiu Panait , Heiko Schocher , Alexandru Gagniuc , Andre Przywara , =?utf-8?q?Pali_Roh=C3=A1r?= , Heinrich Schuchardt , Alper Nebi Yasak Subject: [PATCH v2 8/8] armv8: u-boot-spl.lds: mark __image_copy_start as symbol Date: Sat, 18 Jun 2022 15:13:13 +0300 Message-Id: <20220618121316.12061-9-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220618121316.12061-1-alpernebiyasak@gmail.com> References: <20220618121316.12061-1-alpernebiyasak@gmail.com> MIME-Version: 1.0 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 From: Peng Fan In arch/arm/lib/sections.c there is below code: char __image_copy_start[0] __section(".__image_copy_start"); But actually 'objdump -t spl/u-boot-spl' not able to find out symbol '__image_copy_start' for binman update image-pos/size. So update link file Signed-off-by: Peng Fan Reviewed-by: Tom Rini Reviewed-by: Alper Nebi Yasak Signed-off-by: Peng Fan Reviewed-by: Tom Rini Reviewed-by: Alper Nebi Yasak --- This is from Peng's i.MX8M binman symbols series [1], picked it onto this series because it made more sense as a binman symbols fix. [1] armv8: u-boot-spl.lds: mark __image_copy_start as symbol https://lore.kernel.org/u-boot/20220603071715.15212-5-peng.fan@oss.nxp.com/ Changes in v2: - Pick Peng's __image_copy_start fix arch/arm/cpu/armv8/u-boot-spl.lds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/cpu/armv8/u-boot-spl.lds b/arch/arm/cpu/armv8/u-boot-spl.lds index 730eb93dbc3b..9b1e7d462870 100644 --- a/arch/arm/cpu/armv8/u-boot-spl.lds +++ b/arch/arm/cpu/armv8/u-boot-spl.lds @@ -23,7 +23,7 @@ SECTIONS { .text : { . = ALIGN(8); - *(.__image_copy_start) + __image_copy_start = .; CPUDIR/start.o (.text*) *(.text*) } >.sram