From patchwork Wed Jun 17 02:55:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1310888 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=q7uWMS8e; 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 49mqW425yKz9sTH for ; Wed, 17 Jun 2020 12:57:52 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 13B3E82020; Wed, 17 Jun 2020 04:56:34 +0200 (CEST) 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="q7uWMS8e"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3BD3681FC1; Wed, 17 Jun 2020 04:56:15 +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=-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-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (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 4DC2981FCD for ; Wed, 17 Jun 2020 04:56:06 +0200 (CEST) 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-x442.google.com with SMTP id z63so430344pfb.1 for ; Tue, 16 Jun 2020 19:56:06 -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=+v77TFaZtFA5W6RkiCTaYVDfMnGc+A2PR8d2zAHFq4s=; b=q7uWMS8e2AKXtuez+CNunpyIV444KgyyYRHExFnydycc3Uvt084LJcurqnqcswbhvt dIdsxuo+8PC5mLqSILJCZxSEVlMWDLWBUKB4jc73zk/L0VHlSzM4vlj6Ccspxp8TCReh xa4GyoPwfBAuA0MX1F1EJ1Y4uTu+jmDv0p3lODSVc5dGSjK0Gu72zXRcW1wPM4o81MbS DVYxDucdEr1AngKtOgOode+THOGvmc983ZsjQXmncD2WI5LNyZVaRCcIvOIQfSBlxAmw fwdhmGLyhLezaZHsn8qMWQUUvP303E9VNfGIUlgUIcf8nRdvSfJc603Ktwq8sxdfeM5S Ppow== 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=+v77TFaZtFA5W6RkiCTaYVDfMnGc+A2PR8d2zAHFq4s=; b=l09/yShyJp4z3mcC/Fgz4jSy9ZwUih3kWIBazi9m04yZD6MOB5qHLq3y5AWg+a+gt3 ysZ2cSztZlCwZjJCzXP8FHasJnXTx7Fe/L3VqQ11LXaVlt7RBuuPOZ5W1HmeuhJ19VPm kQOJkBkQlsMdiWGbQHFfdnXd/l4+FJyLKAcqPgP7eszYsqLp3W8VVtX72xP4WQ6PyD72 N3QbOcW3VHspHXvZsLYVNmFGF5vg5UrZngvYyr2MMf3E38EogUmiugF5PJjZ/OfSZ5EA /UK5dj+up0BkEnD71qThvmZ/e1sxeMMcaexefZleDLs7QoXpWpvmp85eFGJycOx2kLBl n4WA== X-Gm-Message-State: AOAM532DU/Oq2rNCc+36tjU4FDmBSnKdGxYm8yZV04R0ah42nB08Hwkf sy/Wf/17+pODr7ePyC9a8LgFRA== X-Google-Smtp-Source: ABdhPJzEiaw+RWHcwCOjWm+CX7ve2JVLeUsRxxMTOyQ7/H/VhkAo4D5teBOMruDCsCU48+HxOMchtw== X-Received: by 2002:a05:6a00:14d4:: with SMTP id w20mr4873353pfu.279.1592362564340; Tue, 16 Jun 2020 19:56:04 -0700 (PDT) Received: from localhost.localdomain (p6e421564.tkyea130.ap.so-net.ne.jp. [110.66.21.100]) by smtp.gmail.com with ESMTPSA id lt14sm3724918pjb.52.2020.06.16.19.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 19:56:03 -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 v2 09/17] efi_loader: capsule: add memory range capsule definitions Date: Wed, 17 Jun 2020 11:55:07 +0900 Message-Id: <20200617025515.23585-10-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200617025515.23585-1-takahiro.akashi@linaro.org> References: <20200617025515.23585-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 4be01495f096..eeec08efccb1 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