From patchwork Mon Nov 30 09:12:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 334693 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp4467631ilb; Mon, 30 Nov 2020 01:13:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJx64eFb12t4lBIWnAcmehGZDe1lwMEehcADIFnTMxDVO2VNsMKixVoc4T6hWGTGAsO3Lyd1 X-Received: by 2002:a17:906:7f10:: with SMTP id d16mr20027561ejr.104.1606727602379; Mon, 30 Nov 2020 01:13:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606727602; cv=none; d=google.com; s=arc-20160816; b=IJDwXZvSrYDF6rwBFfFSwrFw7zY/nweIkk+UbLvlfaK+tAr3726oWGqwzDvRZhbQsa JL3ydUUr4J6ktPHNrfW5uDn8aOXmNlIO+9G5BUj1W4nVAIDfCpd+XhfMZ5XXZB9Hl8xr 6asXwsmGHruhQe92LfOPMGdpvpUumfLmiXqRAnkyhPM+lx+GI2GDtLTXgqYuMHYaZSUt T1nKj2Oq4TIp6BeUIBknz8hyygf3YPYbIoVO271ii2QKOq1CQMPSMJ1QDDPdS9qGbHRX hx1Gw6WFM+KOQL5qF+lsPDZHks33pK+zrXGs+mfI0jHFQeuve2k9KJOwyrUDfIwnfLTL 2xUQ== 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:dkim-signature; bh=pfzS9a249CGCsTB62oWKa+nEqo4kbxAX5xW5fvW6X+k=; b=BBILc4nCX1JRVHUEM2wSS/4wOAo5UmwLJmdu9Zy2aPTU8DeoysVCnl4b9ytqRRANIu uloO31vfW3t2HIHnsX/ctVesRxlXgwsQmNLGZ2ZyMiBlnCNaoZbrfWeC3Lgi6c3UgD7H VJaAGO8l3Zrztd1t0Adc2fmYAN8Z/1mK6b+Kty+hRqhEgx8hBrKstdH9gPORemKpTANh bNwK4yIb8nNYIh4NgnWl7VFOkGKu2zsXIN86IH1u+ARMZSsEpVxIjl66d+1eI5qlT1pY SPenak5tksMINIKAOLrahMRPiDsZ92FB6KHjiri3qLAFFKvapsdlLrB49ZRBgEcE6YF+ UpWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Odf3ownR; 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=pass (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 cq14si12541937edb.207.2020.11.30.01.13.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2020 01:13:22 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=Odf3ownR; 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=pass (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 BE8DA827C8; Mon, 30 Nov 2020 10:13:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="Odf3ownR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AF955827A7; Mon, 30 Nov 2020 10:12:54 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 08FFB8263F for ; Mon, 30 Nov 2020 10:12:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pl1-x642.google.com with SMTP id x4so4408724pln.8 for ; Mon, 30 Nov 2020 01:12:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pfzS9a249CGCsTB62oWKa+nEqo4kbxAX5xW5fvW6X+k=; b=Odf3ownR9qTqxeueO8D6G+kZzpnfO3+PCR2FfN26rf3R9XiuXceea0br5p+c99F6IS 53BHcDbVv2Yb2yNAcJdSVlDR6ifJDctoGwkaYRsXEdJzCx57TXcbkoibcyulQKvv1H82 lZ7myzpmuWjREIsRiK6f4h99Ye7eRVfByq2VEjnpMadqCvmQdq2DOhR3hEWpaVFjDxsT MAAVVFeJKwd//UQ59bcJeGfEZebrojdT8tWqB1dLKUAI4wQiKcvHPsvZZInpQpmf2ECd iYiuZmk0WatxfNDFaUtxlH/WzMprdT+mPXraLW5K8FBsYRoHeZ92dfBuQAJWKAEjxKp4 LSJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pfzS9a249CGCsTB62oWKa+nEqo4kbxAX5xW5fvW6X+k=; b=M3geVYYPzVJHXh/D9b/UwYqw0+1Q5exG1BC5KcNh272d9tTSSqtGz4EcyQlsxOEG8E lO05tAzmFc2mcji2QhhEvsli46oGerSSvZVBuMAfbsbXB4Ua2Q/6kBQKiEhYUAh63zoh rCHHTaVTIIHkC5tFPKj9KB/ELgxffmhW3PjyavyF0AxsyTUt8/LL/DwbSR4WI0Arnsr+ yXHwXk8YW8eYQ8ENjOyE8vvz821Wxv+ObF2KInnPgQQFB+bEupaylIUKNTKM6v+s6zzM 7HF4mQYBvUY6knslwEzJJ+X7KlwCrKdQYieIqJZvahzZb0QmPv0bQG8pMAfyqgwjYBb1 l0lw== X-Gm-Message-State: AOAM531UogzndA/W/gMA5WvwV076oH9Eobr59PCCuXvKI8+ylRcAyPrE aTCidgmTObU2me/gPBN3yS1NVw== X-Received: by 2002:a17:90a:aa0e:: with SMTP id k14mr25652572pjq.153.1606727569667; Mon, 30 Nov 2020 01:12:49 -0800 (PST) Received: from localhost.localdomain (p784a5642.tkyea130.ap.so-net.ne.jp. [120.74.86.66]) by smtp.gmail.com with ESMTPSA id y19sm16015792pfn.147.2020.11.30.01.12.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2020 01:12:49 -0800 (PST) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de Cc: sughosh.ganu@linaro.org, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH v10 03/11] efi_loader: capsule: add memory range capsule definitions Date: Mon, 30 Nov 2020 18:12:10 +0900 Message-Id: <20201130091218.66413-4-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201130091218.66413-1-takahiro.akashi@linaro.org> References: <20201130091218.66413-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Memory range capsule gives us a way to notify that some memory regions should be left untouched across the next reset. See UEFI specification, section 8.5.3. Since how we should handle this kind of capsule is totally up to the system, no implementation will be added in this commit. Signed-off-by: AKASHI Takahiro --- include/efi_api.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.28.0 diff --git a/include/efi_api.h b/include/efi_api.h index c128a0a66ce8..7a2a087c60ed 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -221,6 +221,10 @@ enum efi_reset_type { EFI_GUID(0x39b68c46, 0xf7fb, 0x441b, 0xb6, 0xec, \ 0x16, 0xb0, 0xf6, 0x98, 0x21, 0xf3) +#define EFI_MEMORY_RANGE_CAPSULE_GUID \ + EFI_GUID(0xde9f0ec, 0x88b6, 0x428f, 0x97, 0x7a, \ + 0x25, 0x8f, 0x1d, 0xe, 0x5e, 0x72) + struct efi_capsule_header { efi_guid_t capsule_guid; u32 header_size; @@ -236,6 +240,19 @@ struct efi_capsule_result_variable_header { efi_status_t capsule_status; } __packed; +struct efi_memory_range { + efi_physical_addr_t address; + u64 length; +}; + +struct efi_memory_range_capsule { + struct efi_capsule_header *header; + /* EFI_MEMORY_TYPE: 0x80000000-0xFFFFFFFF */ + enum efi_mem_type os_requested_memory_type; + u64 number_of_memory_ranges; + struct efi_memory_range memory_ranges[]; +} __packed; + #define EFI_RT_SUPPORTED_GET_TIME 0x0001 #define EFI_RT_SUPPORTED_SET_TIME 0x0002 #define EFI_RT_SUPPORTED_GET_WAKEUP_TIME 0x0004