From patchwork Thu Feb 13 13:11:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 864827 Delivered-To: patch@linaro.org Received: by 2002:a5d:47a6:0:b0:38f:210b:807b with SMTP id 6csp416169wrb; Thu, 13 Feb 2025 05:12:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU3C01kCN6wo51KpLj1H+pquiNGT/a63fi7SbVkrYAgI7LwO9Q8gQ3nGsW36hf8DEDmk26XEA==@linaro.org X-Google-Smtp-Source: AGHT+IGZRww4zvQ1B1eTgm3Mf9G7LDIwP5bwTAiu7kCbpCJfS9wTaoKx6VA7SVBdmdWfJKlz7UkF X-Received: by 2002:a05:600c:4f42:b0:439:64d6:e4ee with SMTP id 5b1f17b1804b1-43964d6e748mr14471535e9.30.1739452328093; Thu, 13 Feb 2025 05:12:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739452328; cv=none; d=google.com; s=arc-20240605; b=So2kZssK+9dPFJfQ9ezFknNQmiZ70gWSnoE6/lfuZqHoniuc55H1/9pOBBP2mgCQ0I 2eilpOcxZv5/BYvVxSxigS3uimhykagLLwJvcbvEXxwZUlhPhiKw8qMBBv+qd8y0NWgF hQVWMiWwUkmtrUO+PkVcrXRcr/WxZk1hBxY+Owxz4pIkRX6NSbSTXPoYTkjN5bFctSWO POmSeJ6iS8fkJrZGxOYx2zjRSFcXdYibNBbKlQ4mEUjzb1ghuqC925Qsgoeg9A8pUHRY nHEfEBCplox/8BZ0t3H+ElV433c4aLom9hXdBTzcF+moaGobSoVbN9eFQV+6YGllc7yi w5CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=A6EedcqGd3DC4aLuhjEdo9zaAcMDSXgsHePH9KwF3rM=; fh=2HGKihHUAicyV3F+aHiaoPpwvqWA0zlC04Ew6QaQoEg=; b=HmJiLLcnvDh3fy52LRcrdpF7dXCqR4vh38kS/3YYlO1h88lUK9jlIZrosc75pHYya1 fuuiMnIDguI7GoZrUGc+OS7rYBCYHYCrb4Pws7fk2pTyT8ciaFI/Jo6/WYctaaingnzZ +qqWdGF4lhFywLkNNQ0xClwCt3WenycIWf1W60UswagIOtELaKYuxNwKeB3Q369wlNzI 4hGecjfaLYp2PMoUsQ65caTRSfV9jqa6dMm2wKqT0P97AhkYWLD82uyODpN9g/K2xwQf OPfUNZJnGlK3WhaEA+y4bmoVhXip/9N07vSHHINFkpWTb2woRfx2L/ITwupRbZkBbCEP +MCQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id ffacd0b85a97d-38f259d5d23si1423811f8f.344.2025.02.13.05.12.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2025 05:12:08 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9086180F3F; Thu, 13 Feb 2025 14:11:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 955B9806FE; Thu, 13 Feb 2025 14:11:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 7C7FE806FE for ; Thu, 13 Feb 2025 14:11:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A11DD16F3; Thu, 13 Feb 2025 05:12:05 -0800 (PST) Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4FF9A3F58B; Thu, 13 Feb 2025 05:11:42 -0800 (PST) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Simon Glass , Tom Rini , Quentin Schulz , Udit Kumar , Heinrich Schuchardt , Sughosh Ganu Subject: [PATCH 4/4] lmb: build lmb_map_update_notify() only with EFI_LOADER Date: Thu, 13 Feb 2025 18:41:04 +0530 Message-Id: <20250213131104.186663-5-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250213131104.186663-1-sughosh.ganu@linaro.org> References: <20250213131104.186663-1-sughosh.ganu@linaro.org> 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.8 at phobos.denx.de X-Virus-Status: Clean The lmb_map_update_notify() function is used to update the EFI memory map based on corresponding changes in the LMB map. This is causing build failure with a certain old architecture(armv5) toolchain, when building with CONFIG_CC_OPTIMIZE_FOR_DEBUG symbol on platforms which do not enable the EFI_LOADER code. Build the code in lmb_map_update_notify() only when the EFI_LOADER config is enabled to get around this issue. Signed-off-by: Sughosh Ganu Suggested-by: Tom Rini Reviewed-by: Tom Rini --- lib/lmb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/lmb.c b/lib/lmb.c index a55bfe289db..7f4b2315b15 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -428,7 +428,7 @@ long io_lmb_free(struct lmb *io_lmb, phys_addr_t base, phys_size_t size) static struct lmb lmb; -static bool lmb_should_notify(u32 flags) +static bool __maybe_unused lmb_should_notify(u32 flags) { return !lmb.test && !(flags & LMB_NONOTIFY) && CONFIG_IS_ENABLED(EFI_LOADER); @@ -437,6 +437,7 @@ static bool lmb_should_notify(u32 flags) static int lmb_map_update_notify(phys_addr_t addr, phys_size_t size, u8 op, u32 flags) { +#if CONFIG_IS_ENABLED(EFI_LOADER) u64 efi_addr; u64 pages; efi_status_t status; @@ -464,7 +465,7 @@ static int lmb_map_update_notify(phys_addr_t addr, phys_size_t size, u8 op, return -1; } unmap_sysmem((void *)(uintptr_t)efi_addr); - +#endif return 0; }