From patchwork Thu Sep 5 08:28:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 825628 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp187299wrb; Thu, 5 Sep 2024 01:31:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVX8ZkBRjkx4B/q2WCcFUymqp5+jSE0l9iBfwSyij10iJYradcO6vKZW7JfikvH8BOn/1IjsQ==@linaro.org X-Google-Smtp-Source: AGHT+IEV4HU+3RNwqDAdu65LqHq94wwJY4WX4xWVylDT5Np/bYDARgtdW6b/ofb2JdUeHOaqWC+h X-Received: by 2002:a2e:b8d6:0:b0:2f1:750d:53a7 with SMTP id 38308e7fff4ca-2f6105c4993mr230151951fa.8.1725525068171; Thu, 05 Sep 2024 01:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725525068; cv=none; d=google.com; s=arc-20240605; b=ABaGABrRMVIVsK75RF0ZYKRf7z+hq55T7hSaFOg5tgqmHdH4Mv9cJPJ/Zz/lePG5bw xwIXB7nzs7WQ1SeEkTJrkT2x8thGVO9Qm+oiDziF28glvSB9nVWL05Ya3BC91YhUXuWn fcuHxZkkJGPQ7RNxkRUqwTngGAigZGvA9D6Z4H5QSQsIZF/tDvK1XLvVOLIJl5G2Re9Z Z2DQNdGyJpW9sAoLFwjBLDBpZ7y1qs4L3WRRc4UQXueB5b1OYl366MVoC02a2oDsD5PS zhGZ62LC4nc83RTdq/TYAOEHM05NTgEOO6qX9EpF4bZoy4f/4jeqqtpn0aIvBxQTX+Yg kWzA== 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=X/emLcIUDrY41XKW9AZ70Id/UkcE2c92PgJ7AH5uz1o=; fh=xhhG27Jur2HVmyj6xWbgrQg2vRawqr6LmtjP4yz05ls=; b=Xe+ff+6VHOw/kG9xgh/OyUqEANv7znKTflXp7fSISxbQ7Ws4oCygw4RbVH1x5oUXgU MG4Ws9N2/+pixE3+ii88P2eGJ2ioolvR1z2yR9oxBuYj26X6xqFAVhcAC7MQ6B8supMc acgm7QRh8CQP9uAMANvikmyrrFn6CMdxZ0eSpxHyzs3mMiMs9/MQocwRTDylTUQ0eCHY cM82qu52WgyGX64dTfvONKhXWN2phhnWU6GjDxs2d5/zn2tq6jGLnoxY0oQ0ioKQMERM 2gupGE1XgMEZv3fBzyy20II3nquN2/RxMK6brzFZog4pdkIsocwE6heX+/osOzDCqwT4 x8ZA==; 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 a640c23a62f3a-a8a74db09c3si47773966b.1006.2024.09.05.01.31.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 01:31: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 6CA4D88C87; Thu, 5 Sep 2024 10:29:21 +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 5FD4088C6D; Thu, 5 Sep 2024 10:29:20 +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_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE 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 69E0B88C6D for ; Thu, 5 Sep 2024 10:29:18 +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 77D85FEC; Thu, 5 Sep 2024 01:29:44 -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 84DA93F66E; Thu, 5 Sep 2024 01:29:15 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Tom Rini , Bin Meng , Sughosh Ganu Subject: [PATCH 15/16] lmb: remove call to efi_lmb_reserve() Date: Thu, 5 Sep 2024 13:58:10 +0530 Message-Id: <20240905082811.1585467-16-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240905082811.1585467-1-sughosh.ganu@linaro.org> References: <20240905082811.1585467-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 --- lib/lmb.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/lib/lmb.c b/lib/lmb.c index ec5078527e..7074217417 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -7,7 +7,6 @@ */ #include -#include #include #include #include @@ -186,38 +185,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; @@ -264,9 +231,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)