From patchwork Tue Oct 8 18:14:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 833598 Delivered-To: patch@linaro.org Received: by 2002:adf:a1d9:0:b0:367:895a:4699 with SMTP id v25csp436364wrv; Tue, 8 Oct 2024 11:17:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVe6CLLkSTLGew+abzMC43fGv88j9WLXNYriH5XNY4evix2ZWZiMzQ3K+813AzjSyWZhkPO2g==@linaro.org X-Google-Smtp-Source: AGHT+IGKODkAeK7OngBZ9ITrPHLY4e1fFon9o7jomWvX+GXRuJqto6qzf+KCAYW5yRbYHv2Jt/Vv X-Received: by 2002:a05:6e02:1a69:b0:39f:507a:6170 with SMTP id e9e14a558f8ab-3a3946e8410mr10275795ab.8.1728411428494; Tue, 08 Oct 2024 11:17:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728411428; cv=none; d=google.com; s=arc-20240605; b=MNiCAVxjD9lYLoSHohsbwoSFARp9dmg3hyX+sNJZA4dxh7R4KrCXSGwkaWxSJS4ID8 5CJAWLOuFHLQeFB72hObtnZQ9evcY84x6q7A7vgbju/xatXuBTVrYXa+ipxe/q52xG4+ GVpX0G+4RpMQ9qx37Cg3olI82tBaFdURg5YugFIzRjt7jQaawcmcz58G6mYju6J/WIAE cdb5/IafY6nw0QhxdaphXp8lwzqGn/3XPnntl8Efx90L7hvrqBX+Li10/4GRFP5G8WFX gLtZbOkuNYzhQNlI0qKsHJcmpzN++tE3LQhIKc0SJ439ZHl6K72XDO/mCexfJ41GAjOp j11Q== 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=0Vfy9XaomPICkfQdjzcIlLsW32iaL4qmCrqGVXdL+QQ=; fh=EURqIhM9Cs9+QDCQ9Vm6IsJQ8gNya1VBDuunKFxPiA8=; b=VTQMp+icwlp0Xyp+GyRCqMy6IrENZHknim480tLc7VMS5wrbir5shxdxIvion8jXVh FA3lkL/6k6EOlvLxoIngSiZRm354SDvkoUpQ8IbN2S57Zx4VYqsUeggpyEMaevsNnW35 Vc1+m+nS0e/XB1te4rqU6dH10DSER9BXCUhdzfKkyseHWQhXyrGWi3sLC2BqZCjKYZrs a5qMRFS5vilG97r/xMs6OFKLa19u2yKT5FgZjPgUOsRNrR71NXFDbT+sQWxQnmsCFcwi 2UFjiHlqZhy5hsazODm3tzdrR7BArRL0/s+FsSdoEPB5+udKAei51jyYTSRBCDpJbK8V xqDg==; 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 e9e14a558f8ab-3a37a7f5654si38940745ab.48.2024.10.08.11.17.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 11:17:08 -0700 (PDT) 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 76A4A88F62; Tue, 8 Oct 2024 20:15:35 +0200 (CEST) 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 C065488E26; Tue, 8 Oct 2024 20:15:33 +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=-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 3AD4888F5B for ; Tue, 8 Oct 2024 20:15:31 +0200 (CEST) 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 466C4DA7; Tue, 8 Oct 2024 11:16:00 -0700 (PDT) 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 D18933F64C; Tue, 8 Oct 2024 11:15:27 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Tom Rini , Bin Meng , Caleb Connolly , Jonas Karlman , Sughosh Ganu Subject: [PATCH v2 13/14] lmb: remove call to efi_lmb_reserve() Date: Tue, 8 Oct 2024 23:44:34 +0530 Message-Id: <20241008181435.1753814-14-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241008181435.1753814-1-sughosh.ganu@linaro.org> References: <20241008181435.1753814-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 EFI memory allocations are now being done through the LMB module. With this change, there is no need to get the EFI memory map and set aside EFI allocated memory. Signed-off-by: Sughosh Ganu Reviewed-by: Ilias Apalodimas --- Changes since V1: * Do not remove the inclusion of efi_loader.h as it is now needed for the lmb_map_update_notify() lib/lmb.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/lib/lmb.c b/lib/lmb.c index 82dfd36364b..82fa9cd14b9 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -208,38 +208,6 @@ static void lmb_fix_over_lap_regions(struct alist *lmb_rgn_lst, lmb_remove_region(lmb_rgn_lst, r2); } -/** - * efi_lmb_reserve() - add reservations for EFI memory - * - * Add reservations for all EFI memory areas that are not - * EFI_CONVENTIONAL_MEMORY. - * - * Return: 0 on success, 1 on failure - */ -static __maybe_unused int efi_lmb_reserve(void) -{ - struct efi_mem_desc *memmap = NULL, *map; - efi_uintn_t i, map_size = 0; - efi_status_t ret; - - ret = efi_get_memory_map_alloc(&map_size, &memmap); - if (ret != EFI_SUCCESS) - return 1; - - for (i = 0, map = memmap; i < map_size / sizeof(*map); ++map, ++i) { - if (map->type != EFI_CONVENTIONAL_MEMORY) { - lmb_reserve_flags(map_to_sysmem((void *)(uintptr_t) - map->physical_start), - map->num_pages * EFI_PAGE_SIZE, - map->type == EFI_RESERVED_MEMORY_TYPE - ? LMB_NOMAP : LMB_NONE); - } - } - efi_free_pool(memmap); - - return 0; -} - static void lmb_reserve_uboot_region(void) { int bank; @@ -286,9 +254,6 @@ static void lmb_reserve_common(void *fdt_blob) if (CONFIG_IS_ENABLED(OF_LIBFDT) && fdt_blob) boot_fdt_add_mem_rsv_regions(fdt_blob); - - if (CONFIG_IS_ENABLED(EFI_LOADER)) - efi_lmb_reserve(); } static __maybe_unused void lmb_reserve_common_spl(void)