From patchwork Sun Jul 26 20:17:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Moyer X-Patchwork-Id: 1336551 X-Patchwork-Delegate: trini@ti.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=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=RZIIHp3g; dkim-atps=neutral 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 (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BFDnZ2nY9z9sPf for ; Mon, 27 Jul 2020 06:20:02 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2A93F822B5; Sun, 26 Jul 2020 22:19:52 +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="RZIIHp3g"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8763D8229D; Sun, 26 Jul 2020 22:19:45 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) (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 D1BAD822A8 for ; Sun, 26 Jul 2020 22:19:41 +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=bdm310@gmail.com Received: by mail-pf1-x443.google.com with SMTP id 1so7934074pfn.9 for ; Sun, 26 Jul 2020 13:19:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=29qwxPPp3gs3ZUOIuu0zR0JqAJnGoGoECFTSlUMdVTQ=; b=RZIIHp3geonTbDCau2zU6Xqg0iGowTuMvEHaWVG9flfQ6ZJFnibqJladGJi82sKpME SbCFvWG2U0gGr6NsNdefwh1WoAWdsh53muFyld1pAmP7FeKI/ijSyEtgRwDiZbpGhtKj 8za2b/mWdAHAWCGosh8U20nIz6jdQbhk/yanK0cXEMuFlOoOb1+NZWH0PNeRP7CHl04H Zv+fJe+2BPfL8knBM3YplGSkuLeBZT0GTZFf758XAYbaX+O+6d2MtNvMLOJuxFV8MBpQ Q4NrJbJHwWqEZJfwImmDwz/U9cgEE9JyS/69W9vuJfTX3bo8pRRSde5I9alQEzIfSeBh A2dw== 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; bh=29qwxPPp3gs3ZUOIuu0zR0JqAJnGoGoECFTSlUMdVTQ=; b=TddutOeKcjCJyzu1ACPsXgCI9bcdZFZfuOTquBGGn21b7yLh0JWw32gVV1ZJMfnHnA f3oP9BWPrPCBnhNRHZuoH0KoYb4Zf/TI9jIL+GmdbCZ/T8pLh/U53KVyLV52bPkhWdEb LOygvjNdm0CS+LuxmLCupZUCti4y4bNHOh7titgdGEJ90EAYSPE5sCeJK5GENK9YrNXT Zh3qd4S6jzDJezM078nhmQo2k0PYMu03zcYhYEtLxyDH4ZeG10ypUDqMecJPEdLO+TLX +f6WKj0ubHK60XlGFgTuvvFTfA/2EggL+uyp9JOTSJUfLjq79Q3A8WIaPQOFw/sX+5pQ EZmg== X-Gm-Message-State: AOAM532fzvWT3frp8tkFr0SQVx9+fKkJTWerJocvaBRaTcoVsmd05Gw9 zVlyLprQWgue/ogROtind1N4BbeAqtQ= X-Google-Smtp-Source: ABdhPJz1ppDigBG4D+B5jTLv/vy5P6H7chW9MXfKPCYO8QC65kOHjY3jdbbvjE+4YiJwGU5+E+Z3Mg== X-Received: by 2002:aa7:8514:: with SMTP id v20mr2933395pfn.18.1595794780100; Sun, 26 Jul 2020 13:19:40 -0700 (PDT) Received: from kindleland.serenity.projectmoyer.com (c-24-23-252-37.hsd1.ca.comcast.net. [24.23.252.37]) by smtp.gmail.com with ESMTPSA id q24sm11735855pgg.3.2020.07.26.13.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jul 2020 13:19:39 -0700 (PDT) From: Brian Moyer To: u-boot@lists.denx.de Cc: Brian Moyer , Heiko Stuebner , Kever Yang , Patrick Delaunay , Tom Rini Subject: [PATCH v2 1/1] arm: Add SPL build check to SPL early bss clear Date: Sun, 26 Jul 2020 13:17:53 -0700 Message-Id: <20200726201753.28004-2-bdm310@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200726201753.28004-1-bdm310@gmail.com> References: <20200726201753.28004-1-bdm310@gmail.com> 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 SPL_CLEAR_BSS is called regardless of build type if CONFIG_SPL_EARLY_BSS is defined. Add a guard for CONFIG_SPL_BUILD to fix. Signed-off-by: Brian Moyer --- Changes in v2: - Adding a check to the first SPL_CLEAR_BSS resulted in BSS never getting cleared for u-boot proper. Added an or condition to the second call. - SPL_CLEAR_BSS is the only bss clearing operation. Renamed to just CLEAR_BSS for clarity. arch/arm/lib/crt0.S | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S index df9dd83e40..46b6be21a8 100644 --- a/arch/arm/lib/crt0.S +++ b/arch/arm/lib/crt0.S @@ -64,7 +64,7 @@ * can afford it due to sufficient memory being available early. */ -.macro SPL_CLEAR_BSS +.macro CLEAR_BSS ldr r0, =__bss_start /* this is auto-relocated! */ #ifdef CONFIG_USE_ARCH_MEMSET @@ -109,8 +109,8 @@ ENTRY(_main) mov r9, r0 bl board_init_f_init_reserve -#if defined(CONFIG_SPL_EARLY_BSS) - SPL_CLEAR_BSS +#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_EARLY_BSS) + CLEAR_BSS #endif mov r0, #0 @@ -150,8 +150,8 @@ here: #endif #if !defined(CONFIG_SPL_BUILD) || CONFIG_IS_ENABLED(FRAMEWORK) -#if !defined(CONFIG_SPL_EARLY_BSS) - SPL_CLEAR_BSS +#if !defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL_EARLY_BSS) + CLEAR_BSS #endif # ifdef CONFIG_SPL_BUILD