From patchwork Tue Mar 17 02:12:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1255995 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=V4yr2Zaq; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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) by ozlabs.org (Postfix) with ESMTPS id 48hGtb66nFz9sPF for ; Tue, 17 Mar 2020 13:13:43 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 22C0A81927; Tue, 17 Mar 2020 03:13:06 +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="V4yr2Zaq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3D2AB81935; Tue, 17 Mar 2020 03:12:50 +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,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) (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 9C65181924 for ; Tue, 17 Mar 2020 03:12:37 +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-x641.google.com with SMTP id t16so1872056plr.8 for ; Mon, 16 Mar 2020 19:12:37 -0700 (PDT) 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=qoNzBvM3NDmt96W1XNXwBt0JqabQGvi0orZ/pDRRSbs=; b=V4yr2ZaqThuUE5GGnWFfAch97t5dp0vXdRqo5eHy+fz86apLTPDyWBKwBw62o7LkoI Q3hwsqF3kt2gwW2YBZ0TH504kdgp26SQo+tdtyEjNJq6hBRbTSSzMg5/tUD6I4P6ySN3 PFNIB0/lKcFteN2NLPDXFBgy2/N5AvczGUKCQfLkJnsYUefynCZtRltUA6TYke0M6YT1 mkynxoOB7P8JZiYloiQ1okn6kt5YIIfaDvGP7JUjj4j577O7Vb7avi1LWkmgym8onrZD YaFgPEZ6yQRV/OcJ5Bl+WgW4+IyejYuuIGBYg0pDlxEdksu6CcBAoa7HAtz+Lkbe2GQr kjug== 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=qoNzBvM3NDmt96W1XNXwBt0JqabQGvi0orZ/pDRRSbs=; b=MedsIBjRDjenb4i9Q6ZbEW5xwO6U1Ed6B5vnbReE6Ff3YKcs3Nq+xKoVskgyfXO9Ua 63x2gdXFzQpQ4maGFoUDStzUHYuHIfY3qMMwyUBHyKQAG+Q5W4WT0SpFoG02qKBhua0/ jc6XQ//weaohKW3Xyr+KqusiJQi9yMfY4LGGTGkO11sMToUYOMKLAT/IE5RxdZnVejmO 0VN96DRSD6JZD1ZSKSBaNuH0L196q2/HtspiNjiqqxAVi6K7WHcdwaO+XBykLl3ldz3Q bc3/aciH44En4EEMibOro2u+Rfr0U7ny+oUM5Z6rNEOqbnaNeazWwnv+k0pLA1IWSbGM s0IQ== X-Gm-Message-State: ANhLgQ3EC1yzeoghc0KSH3f4bAvexOj7LqR9cxm/DPdHjn3LD3Dda7KM MlcRSx90G8flJSttl2jrPXrADQ== X-Google-Smtp-Source: ADFU+vvFVPaB0lO+x6CoIwgrgirV2ETwpkbn9dRUVL14KuVGSQ70T2VxmSCUg6jPj+IKlo32xfFqWg== X-Received: by 2002:a17:90a:348a:: with SMTP id p10mr2789264pjb.120.1584411156119; Mon, 16 Mar 2020 19:12:36 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id y28sm683226pgc.69.2020.03.16.19.12.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Mar 2020 19:12:35 -0700 (PDT) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de Cc: ilias.apalodimas@linaro.org, sughosh.ganu@linaro.org, u-boot@lists.denx.de Subject: [RFC 07/14] efi_loader: capsule: add memory range capsule definitions Date: Tue, 17 Mar 2020 11:12:40 +0900 Message-Id: <20200317021247.5849-8-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200317021247.5849-1-takahiro.akashi@linaro.org> References: <20200317021247.5849-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 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(+) diff --git a/include/efi_api.h b/include/efi_api.h index ac2b38801c0c..b7bf21cac7ad 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