From patchwork Tue Oct 15 15:37:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 835457 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c8f:0:b0:37d:45d0:187 with SMTP id z15csp301519wrs; Tue, 15 Oct 2024 08:39:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWhEELjgYg+EmsFqiS5GMOGb4DRccXEveHPIzjpTRMHAfGgyD3vpKz1eORBHhApyNep7oVtoQ==@linaro.org X-Google-Smtp-Source: AGHT+IGT152oseiMWsMZIriaa4CP21HHDtGsPTBIXhHFLfGJ0iaUkapJHXUjg7oqpzfYles8Lt8P X-Received: by 2002:a05:6602:2dc3:b0:82a:34da:72f7 with SMTP id ca18e2360f4ac-83a64db8b35mr770654939f.16.1729006796628; Tue, 15 Oct 2024 08:39:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729006796; cv=none; d=google.com; s=arc-20240605; b=R5lr8g1h/OCWlUrqyf+NwV4BKIXMiFc8EvKX9sIXz7MDNHHwDI0g63qPhilNoyeWqd zUM7zGhgjYaxm03107yFEHeLO03Jm8VOgS4kQzL/lEoDirT3oahK8NXDR1NaS6f75+TV lqNpRaG5/3Knsf0BbqGGB3QkVFbp/680eVGkQJ5UlyeViCKlsU2P31uQjeO1pmWDw34r En98hdQ3ctdIAt0tbdwOGRcY7MRNPfWJ+dKqcTx9VyUWtRezHBozKRUkmrGB9mjnT0/z galUXQpSAUP2bA+DC8PHsDf5affa/HEjIFwH9ww68BS+97zDsofvxPNvmP2cNDoBvoiS MpPQ== 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=lF33IEPx2uzm+dsebykytYuAyxbtTfpjBOcx8C7BM3s=; fh=MYvlzMqd61VHJORtkCu1tTA+qP9jRMJFkVEqSzDEdy8=; b=OsCze1oL3Y/gmRfY+pBJmeo7++kSr0TqPgcOKfGAKUk1e9fd63d8s6mV/GYT+vrSYb vur8FAzvetvNViGgqFu1IhlpJL0VQ6Zgz5d3r78miL6MR/xU7ZdbAakD+r3L2B15kQfN aWxJLF5otM3O693i0lPLMcu9fI57PpMgBHU1HiTrHgVkyNZveJcB8bvBsIwbqM3fgL1h /0o8mmZaWJCA80qDr1wbQy3P7kn0jpVapfsNiexA+9KZIk2hJr0Z2ysPvfxvi+Oa1rMX O7XMMOdVYOOHVCpCV8mShhuRw4RtUTXMZX1/OSuIccziD6L6wGNhSbDHouCPYmxiWkuA OKpg==; 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-83a8b2b7a4bsi70553439f.89.2024.10.15.08.39.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 08:39:56 -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 738D788753; Tue, 15 Oct 2024 17:38:25 +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 42F3788730; Tue, 15 Oct 2024 17:38:25 +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 3B0D388753 for ; Tue, 15 Oct 2024 17:38:23 +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 4A4C7175A; Tue, 15 Oct 2024 08:38: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 B0E3D3F528; Tue, 15 Oct 2024 08:38:19 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Tom Rini , Caleb Connolly , Jonas Karlman , Mark Kettenis , Sughosh Ganu Subject: [PATCH v4 13/15] lmb: remove call to efi_lmb_reserve() Date: Tue, 15 Oct 2024 21:07:15 +0530 Message-Id: <20241015153717.401371-14-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015153717.401371-1-sughosh.ganu@linaro.org> References: <20241015153717.401371-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 V3: None lib/lmb.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/lib/lmb.c b/lib/lmb.c index ae69201d5b7..f3a1d8ca256 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -204,38 +204,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; @@ -282,9 +250,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)