From patchwork Sun Oct 13 10:55:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 835080 Delivered-To: patch@linaro.org Received: by 2002:adf:b352:0:b0:37d:45d0:187 with SMTP id k18csp1536987wrd; Sun, 13 Oct 2024 03:58:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUR2XnIBdyPhJ0qoGIp18R3scAXZOy7GYZSheTHUcTtCcrHHNfLc4pn4t6p3WeuV+OH5cnKjA==@linaro.org X-Google-Smtp-Source: AGHT+IFMoP4iJwrmoILqhJ8x8APJ0X1q7MF/rqVbWBU2DlFJmoetYdfbbR+jlImYGKZlnpsBC5Y1 X-Received: by 2002:a05:6602:340b:b0:835:4cb5:4fa7 with SMTP id ca18e2360f4ac-83793fa4e1fmr634833939f.12.1728817086953; Sun, 13 Oct 2024 03:58:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728817086; cv=none; d=google.com; s=arc-20240605; b=ajLalcGO8oCQqnpAss3rSLrDlRLhaOQjvfLo68cRXKeOkrXCJbj6AjvjyKSbLPNkOU HcPo6TYKG8Fh1urDcnnERsvNIcY6/Ivl+4o+sLMyoZ9R/iNTa+JkpxPFYtXud34hycMJ eMPL6Kp7E945oRln8ul3Co7i04ZZHuOYh0JpUcqA+2zvhpA9Pct/WJPeof5tQeZM9HAZ kbw9DhOdu/rT+Ml39j2CqeV2d0cx0tYgBbpPT52jm7jympdYVSScrmjhYCKj1VnoQJRN YkT/bAjbTYaYBfpP56AhmjeHoFRqeOKiaTz7UfQeDtM3Al8PGkUss2cOrGgxtx/yxfl9 04bQ== 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=/wiNHYzjmcEvWRPlfzKkh71Qp5ObUpNfgBOhTdBjAac=; fh=DqKFq13hCy9hcb48ZltPVvgEKSF1g1c/m42wn0WwlIc=; b=b+IW6+FLJJI5UqS3Y0Z3PmOsi/USu4fDCTy3ugjRhdwqXjoq8tQr+AtX/GupfTMHUh 8Kl3kxdtII0AHQwrw/QR/TEYwLUHW0fwuDuBxyfEbCE1DlMn+jVYOALSaqitCrssv8IW OaDx7vHYjhBtMVpYtOvq0WClPh9Wm5U5yw8nQBMheB96CaGmEZrhUpnrTcZZiABDGQOP le4ZzujEMSFfFacVL/m//IysFXU76/UiCLbjoNovqaqjrmjhFNrHA3iVuOKtWsBdb14Z W2cCnSQDjcqwHohDL8wQe5fxN1gmSCC9KySoeWecM+h0YxB61u0ZhZXqSjkjAzSqez1B 5CvA==; 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 ca18e2360f4ac-8354ba3d318si306462639f.87.2024.10.13.03.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Oct 2024 03:58:06 -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 3F1F088F68; Sun, 13 Oct 2024 12:56:28 +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 8B83688F82; Sun, 13 Oct 2024 12:56:27 +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_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_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 76A7C88F5E for ; Sun, 13 Oct 2024 12:56:25 +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 76EFB1007; Sun, 13 Oct 2024 03:56:54 -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 502F83F71E; Sun, 13 Oct 2024 03:56:22 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Tom Rini , Caleb Connolly , Jonas Karlman , Sughosh Ganu Subject: [PATCH v3 14/15] lmb: remove call to efi_lmb_reserve() Date: Sun, 13 Oct 2024 16:25:21 +0530 Message-Id: <20241013105522.391414-15-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241013105522.391414-1-sughosh.ganu@linaro.org> References: <20241013105522.391414-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 Reviewed-by: Simon Glass --- Changes since V2: None lib/lmb.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/lib/lmb.c b/lib/lmb.c index c08ab2223a..ba9348dd31 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)