From mboxrd@z Thu Jan 1 00:00:00 1970 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 95D50EB64DC for ; Sat, 1 Jul 2023 02:31:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7CCD486662; Sat, 1 Jul 2023 04:31:16 +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="CoF82WZn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D37BA865F9; Sat, 1 Jul 2023 04:31:10 +0200 (CEST) Received: from mail-oa1-x36.google.com (mail-oa1-x36.google.com [IPv6:2001:4860:4864:20::36]) (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 8288F865F9 for ; Sat, 1 Jul 2023 04:31:06 +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=festevam@gmail.com Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-1b07c02599cso552830fac.1 for ; Fri, 30 Jun 2023 19:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688178665; x=1690770665; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DdsrcWuXAaDHF9LvY/wI9RtpDu5d/JXA5aylQ1VYjP0=; b=CoF82WZn9urNDOPnvCTtucQ7AV0jZnbV/75WUKfpHEZnEuJNuOlXpuQjTvjahtcdnM qS2q5417RwaXMXUIWG9XYJrrnLEsYfC0jzWuIDmmEkPVt/0uaBXYLFbX8uLF8EQsjNk3 JD1qBMvRA0qsrJuzN+Ny3GIB9DUSdQQyEV896ifUOpj5CRnfizvaGTcxz6CQIJ7pgWS4 0sRElN8OUFCPhUWVXHqZ6TU/uF88s+pT6FaSPtiam2RxJU6yKMIAHcLsusvcew2cX90Q M+EY9FGsmUiagGfy6dAj2Sa3yKGUZRmvOxD/vnayJ59/keSg+7X8GqpB68kkAIX7XCwE GxRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688178665; x=1690770665; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DdsrcWuXAaDHF9LvY/wI9RtpDu5d/JXA5aylQ1VYjP0=; b=RqrH4KVTFQLbLuhoMNre6HPVoChuYepyGwl0PMJInWACXSR2h6P0iK/29hPshdHT9E 5rFu9N2HfFJhW+mFRiWNDERUZY+D1umauBUVcph1u1i6nzYn/4gUvR2CCkbmz5vivnLv zZrheUKhtwJYFpGPYe4dHgFKhC+UbnnmLWfVK0ivPcrY7XELvlIkC2w6CdOTjETazESJ DgoztEcIjJh8RdVupVA98Ea3SMB7vkY5HWvt0VXnpEYb7V7jKbA9ovsfy6hncNWSGVM1 2ae/onGoDMqEPXKC4BbYCfpumDdTjPN6e0/yXkSA3TYvDO1GkmxdZV9GTtsKCbtBEoNx oqFw== X-Gm-Message-State: ABy/qLaJVsJdFaECTQWFAoCxn5/Rskf7f0fv3W9g5jqVHaTgSn+aYKYP Sow3t1D5bn8Q3+pN9zTzBdixJ0PdrNsBIQ== X-Google-Smtp-Source: APBJJlEZYcTWTQuiND9kFNtKKbrNOGe9eTO4OXUqNk0STYtGbEmu7BAOkEffQLpDUAu3zI/SKiSjvQ== X-Received: by 2002:a05:6870:414f:b0:1b0:738f:712d with SMTP id r15-20020a056870414f00b001b0738f712dmr4469370oad.5.1688178665062; Fri, 30 Jun 2023 19:31:05 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:7f0:b380:973d:d9ad:37d9:2f8f:1d81]) by smtp.gmail.com with ESMTPSA id w18-20020a056870a2d200b001aa1779d0besm9725933oak.7.2023.06.30.19.31.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 19:31:04 -0700 (PDT) From: Fabio Estevam To: trini@konsulko.com Cc: marex@denx.de, u-boot@lists.denx.de, francesco.dolcini@toradex.com, Fabio Estevam Subject: [PATCH v2 3/3] spl: spl_legacy: Fix spl_end address Date: Fri, 30 Jun 2023 23:30:53 -0300 Message-Id: <20230701023053.747972-3-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230701023053.747972-1-festevam@gmail.com> References: <20230701023053.747972-1-festevam@gmail.com> 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.8 at phobos.denx.de X-Virus-Status: Clean From: Fabio Estevam Currently, spl_end points to the __bss_end address, which is an external RAM address instead of the end of the SPL text section in the internal RAM. This causes boot failures on imx6-colibri, for example: ``` Trying to boot from MMC1 SPL: Image overlaps SPL resetting ... ``` Fix this problem by assigning spl_end to _image_binary_end, as this symbol properly represents the end of the SPL text section. >From u-boot-spl.map: .end *(.__end) 0x00000000009121a4 _image_binary_end = . Fixes: 77aed22b48ab ("spl: spl_legacy: Add extra address checks") Reported-by: Francesco Dolcini Signed-off-by: Fabio Estevam Tested-by: Tom Rini --- Changes since v1: - None. common/spl/spl_legacy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/spl/spl_legacy.c b/common/spl/spl_legacy.c index d34bc5492e8d..095443c63d8d 100644 --- a/common/spl/spl_legacy.c +++ b/common/spl/spl_legacy.c @@ -19,7 +19,7 @@ static void spl_parse_legacy_validate(uintptr_t start, uintptr_t size) { uintptr_t spl_start = (uintptr_t)_start; - uintptr_t spl_end = (uintptr_t)__bss_end; + uintptr_t spl_end = (uintptr_t)_image_binary_end; uintptr_t end = start + size; if ((start >= spl_start && start < spl_end) || -- 2.34.1