From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F3B2C00A5A for ; Thu, 19 Jan 2023 08:38:49 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6FE1885667; Thu, 19 Jan 2023 09:38:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="KQruaL8+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9C74685665; Thu, 19 Jan 2023 09:38:28 +0100 (CET) Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1520085656 for ; Thu, 19 Jan 2023 09:38:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjoerd@collabora.com Received: from beast.luon.net (unknown [IPv6:2a10:3781:2531:0:26cc:6c0f:ebfb:d967]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sjoerd) by madras.collabora.co.uk (Postfix) with ESMTPSA id 9C741660086A; Thu, 19 Jan 2023 08:38:24 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1674117504; bh=Vav7hoU0wRbWOb2frMn8b0VdvSPUCq9w+IXWD6sJWfI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KQruaL8+ssl56VZRZQsdeNyogoQf7jzGgf4pLumFCUC6iTmwww44ghUwalVfH1ASa /jQQC12w3R/N1CgJePkOIns4Z9QnnUEfCuh33W6prVfbGYYFakZsyRdtPTbj+WYfrj dsHdWNoRlWUIF93VF3SPUniXUXweAdPorZNUEJ7SonAXX6O66qHYZttmfA7EwjMONC 6GaWR033GIBka0s604OuTIHhWoshaWDUKxskzQzfT3lX9iqkVyy0vQMWdXkoiTzBBR w2lbIi1+Bk5AfjO/ovmajAjXLR9o4hgNtVK7cPfRPK7JYb5xNx7v6YHytibO8csxED Q8lyXTMUVWWgg== Received: by beast.luon.net (Postfix, from userid 1000) id 82AB361ACB0E; Thu, 19 Jan 2023 09:38:22 +0100 (CET) From: Sjoerd Simons To: u-boot@lists.denx.de Cc: Ashok Reddy Soma , Heinrich Schuchardt , Michal Simek , Patrice Chotard Subject: [PATCH 2/3] lmb: Set correct lmb flags for EFI memory map entries Date: Thu, 19 Jan 2023 09:38:18 +0100 Message-Id: <20230119083820.2656710-3-sjoerd@collabora.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230119083820.2656710-1-sjoerd@collabora.com> References: <20230119083820.2656710-1-sjoerd@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.6 at phobos.denx.de X-Virus-Status: Clean When adding reserved memory areas from the EFI memory map set the NOMAP flag when applicable. When this isn't done adding "no-map" flagged entries from the fdt after receiving the same from the EFI memory map fails due to non-matching flags. Signed-off-by: Sjoerd Simons --- lib/lmb.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/lmb.c b/lib/lmb.c index ec790760db6..f447c639a60 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -175,11 +175,14 @@ static __maybe_unused int efi_lmb_reserve(struct lmb *lmb) return 1; for (i = 0, map = memmap; i < map_size / sizeof(*map); ++map, ++i) { - if (map->type != EFI_CONVENTIONAL_MEMORY) - lmb_reserve(lmb, - map_to_sysmem((void *)(uintptr_t) - map->physical_start), - map->num_pages * EFI_PAGE_SIZE); + if (map->type != EFI_CONVENTIONAL_MEMORY) { + lmb_reserve_flags(lmb, + 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); -- 2.39.0