From patchwork Fri Jun 7 18:52:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 802328 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp949437wro; Fri, 7 Jun 2024 11:56:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWRQsHo4wB7sftPNbT5/7lN5P6DloPbPFsp/nARr3HQnUaDpoZb5yqZntQmgW3gERr8DRpeYceDqgIdYbeivEKb X-Google-Smtp-Source: AGHT+IEVtCJgzpnFbP2g9QXyxIi7gV9FxqzH6vg7Rzpo/rniaGJm3BBnVksHhM1iefMqc8A1piWG X-Received: by 2002:a17:906:1818:b0:a6e:e4dd:d8af with SMTP id a640c23a62f3a-a6ee4ed1b29mr113181166b.44.1717786593347; Fri, 07 Jun 2024 11:56:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717786593; cv=none; d=google.com; s=arc-20160816; b=zYBabX3uXrO6V/gxn0HPj0+dM3AkQp5BGN+/Nq14WfWBoY/2H8j79sEcLFvHx98vUF dY9HlUjWcGpQsvnip7TyZeu0y2E9sGRhwdaMfmWhIjQtf8/gx9Tgu+ZveIi6AXwdnUNI n8cpKCf9saCXbfNSfbNgZQ7HId+42Fc2TbcTNn6puq1mLFLOIkshcwR2p/I4B8/e9jon XfIXqBrJz20x8vSBjhoJsy0foRropm+EVplIR9ZrKmQUE0JpnAqAMBybQJL0L7kBlo8X nTNDm4lBlUFlQcfSU03/uxT1TEUBVwTi3xhvhdlIJaw+wmY+ZoUGO4a7fvRN8ZZOE0cJ Iy4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=UELaLZoJZmVDJfGWenL/YVA5o3NTExl9k6fJvLQ1FgY=; fh=xLSOOz5Q0Mrmzd+lwBRTYS7D/8TpUWM8TEHgIjpMzow=; b=RtQRPeWQXgC4eBKJhXIfeIuhfO38tI+RyHw8mw0U+AFSrCp9+MrZeXJ5H9H7FefiJo PVezZMmp05wfn7cIZn6DDmgra/2QPU0EF9ly3g4jQx1TyImqtvv0KM6bypN0xA0E5+gl 6u0pU3N5vrlfOt3N/w66OkC6SlgvinWmzQFD8QyX9ZgX2Kt9iN5mto5IwFgDkAORrXm2 PbeiWhQ7aYgIL4Iqad6oK6QSi/UPtgzSWHzD8y6yQ2SxjIS54dDd3wo7WfXKoAwcV3mf 1zr0Xp+UL9JxHr1/WGDTCCkcuxURR57ydnZUk0sh5TNgcZ17Bbp5WqwIUpVcySBQyHmv Utbg==; 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-a6e35262bd3si78117066b.628.2024.06.07.11.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 11:56:33 -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 57FBA8850A; Fri, 7 Jun 2024 20:54:31 +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 3504C88470; Fri, 7 Jun 2024 20:54:30 +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_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_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 46F328851A for ; Fri, 7 Jun 2024 20:54:28 +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 075F71480; Fri, 7 Jun 2024 11:54:52 -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 D15F33F792; Fri, 7 Jun 2024 11:54:24 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Tom Rini , Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Marek Vasut , Mark Kettenis , Fabio Estevam , Sughosh Ganu Subject: [RFC PATCH 17/31] lmb: remove call to efi_lmb_reserve() Date: Sat, 8 Jun 2024 00:22:26 +0530 Message-Id: <20240607185240.1892031-18-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607185240.1892031-1-sughosh.ganu@linaro.org> References: <20240607185240.1892031-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 changes in the EFI memory map are now notified to the LMB module. There is therefore no need to explicitly get the efi memory map and set aside the EFI allocated memory. Signed-off-by: Sughosh Ganu Reviewed-by: Ilias Apalodimas --- lib/lmb.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/lib/lmb.c b/lib/lmb.c index 3059609aea..c9f6ca692e 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -204,38 +204,6 @@ void arch_lmb_reserve_generic(ulong sp, ulong end, ulong align) } } -/** - * 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; -} - /** * lmb_reserve_common() - Reserve memory region occupied by U-Boot image * @fdt_blob: pointer to the FDT blob @@ -255,9 +223,6 @@ 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(); } /**