From patchwork Thu Oct 29 04:47:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 319348 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp142166ilc; Wed, 28 Oct 2020 21:51:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcYPGoYjyM3ZyyfGlvxOUiELVCKBl/9xmrwWVqxvoqgjB8guKpJk6Yzrc+WioZjiIqmtV7 X-Received: by 2002:a50:d88c:: with SMTP id p12mr2115751edj.352.1603947076840; Wed, 28 Oct 2020 21:51:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603947076; cv=none; d=google.com; s=arc-20160816; b=ebZephai0k0ctCUfuHRg+8ITC6kk7gg4OZg+5wMFHWZ4nHVNiKlnfKmZpytNfRTslG Br4Raj9rhhc9bqiaNqP9vLv4HKkF2gpsbpD3G+uh9MeQFNSfW9woTyKL9g7sEvKiRqDU XKkDdndiXMJ+1B1fcE7etRKrU41c+MvmYWxODbF0RuQcZ66ZrSWE64BB88FHH+jsnhJ4 hEgiMXBhW60KEzTQdapD1wQY6ITdPu9ndtl3jDUMv3jY4YlnYR2SFo94+Io4mpv0NA5S /iEguhy+IZUYQCHH0YDgIXJQQ8d584+HdM2IOh/j3Hjpgr8Y0TsMME/ShlndZ5NA1V6U oQFw== 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=c3+JIRO3VLvTVLUiVSIZtzXgMfODx36Slbwd42QvFjQRxIjcJH338GeinKBQsj6RlH 3deWCkWwJcmCLUxT7/e0wJnZXWl6E1AsoHNTs+LjojeM+XSNO+QjPQYkaYs/yK1suNdC jo9MCqsO71QLQQ/vDUq7OQvP9ut2wSn2rU+umdvklUd8oteyQowM0brGmuYHKQbsCt41 Tkskl9nZb5e9zStL5HCoy18u0rzKO5Ow9206mSrqdTQWLGeA7Hz1TFgBMLwGBNRqYs7F PREULqOotYKFzJ1JsWhV+1eV0pTvInvVuFXgT44qJuYznR8A5amospLWncVRNq2QSjxA WEqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yCJorSKC; 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 ec11si1066673ejb.540.2020.10.28.21.51.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 21:51:16 -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; dkim=pass header.i=@linaro.org header.s=google header.b=yCJorSKC; 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 7883B82515; Thu, 29 Oct 2020 05:50:12 +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="yCJorSKC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EFCAA8250B; Thu, 29 Oct 2020 05:50:06 +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-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) (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 04298824EC for ; Thu, 29 Oct 2020 05:50:04 +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-pf1-x443.google.com with SMTP id j18so1353257pfa.0 for ; Wed, 28 Oct 2020 21:50:03 -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=pfzS9a249CGCsTB62oWKa+nEqo4kbxAX5xW5fvW6X+k=; b=yCJorSKC8+VMiEePWdQ2cXxHV1zOApg50rjoz0ezlu0Sxvc03xkHW2oW6qpvjSq7fa u0YxL5A7a6W9R+qzQ46R20eE0+oigyhSloP2c7elKHVpDXnphQBOHinMPPJGcNmBupYa YRG677Z8iJetZO5saziLI9KyJnn6Jal0ABy32i9XaSHnU1c2TsxIwuWGSxlg/+D/okwU wY3Inv16X+ZFY8tG0ch79Ah2E5slg/ecuH66KVqN5BiB/fYSxO+Vj55G6SiVu3py12L/ MYo60RtXXFNyU6q6AhJZVxTminrI2PxaxisSS9w3AY1GQ8KdLTBViScT3R2IBct4eM8A G/bg== 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=IJkE3fszWA9HOPA5YG85ZKFkvu7CLKNwCBBLPCVgoevW2lZvgSKZvyW3y3VP4VWubV FFPSf65ctV1GSNSvFCJQmzkdSqaRXmWjagHFtfzCZsNhFxAZxryeusAP603L1k1jT9rE 89SYWnrVykl2Aj9pw00lBPMTYL72bkFy1szs65LAaTZoeHxnUxOp0Fzd/qUwl4Sb4/Kf sHdEJzs1vK2pW9SKl15t42Ph+gBU0b0O2mQ3Y6Fot4Cr0mGsR23xjI8n6BgxGkC5U4wg Ad+4yAoP19dTOKoLHilPA9qK7oiq17bdlBw4EEJr+cOpOoF8AVnPzPduZwnllcQZcP7M 3axQ== X-Gm-Message-State: AOAM530Wbb0WIS8yLBGYi2nqmGQTh35k7/JU8J1n7vcWb76gKcKDm/kQ AlqwFnqsU6ok8Gpzfht/n2YDWw== X-Received: by 2002:a17:90a:66cc:: with SMTP id z12mr2404121pjl.145.1603947002608; Wed, 28 Oct 2020 21:50:02 -0700 (PDT) Received: from localhost.localdomain (p784a66b9.tkyea130.ap.so-net.ne.jp. [120.74.102.185]) by smtp.gmail.com with ESMTPSA id t14sm830689pjy.46.2020.10.28.21.49.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 21:50:02 -0700 (PDT) From: AKASHI Takahiro To: lukma@denx.de, trini@konsulko.com, xypron.glpk@gmx.de, agraf@csgraf.de Cc: sughosh.ganu@linaro.org, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH v7 09/17] efi_loader: capsule: add memory range capsule definitions Date: Thu, 29 Oct 2020 13:47:49 +0900 Message-Id: <20201029044757.183262-10-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201029044757.183262-1-takahiro.akashi@linaro.org> References: <20201029044757.183262-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