From patchwork Wed Jul 14 13:00:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 476745 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp545997jao; Wed, 14 Jul 2021 06:00:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQBflnnkHlVDPOBifD/8kS6rUg8AEDxvUMJAkSHSIQw7wwc7IILk1qx1ldOu94/rII+Sg1 X-Received: by 2002:a17:906:2450:: with SMTP id a16mr12206790ejb.137.1626267637253; Wed, 14 Jul 2021 06:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626267637; cv=none; d=google.com; s=arc-20160816; b=IS8cU/VFdQKCGPYdp5OkM9cgoOpvOGNvjPjHgEBJaczQ6mzwqIhHvV7z13wF1/Y7Fi fgD9bcTsoAakzZ0LZ6Kjs8z2JcDd7+YXOBNMDXvLthuM1SyivA6Q7XLfAjs0cTiMg4St IEVEGosVZpJP1BO2b+KGgqYVsQkLNufNm05N/1Lsmhs8Ca9mqAN7toEUnaYfq0IpGCNv 3vhrwV6yulrHXJR7uXT4wOc5O0h35E2tx3qzDObfKIao4b9ErEe7WPzuzWwcSRoHSqh9 eejdiyQ0wUVLEmCSCJ246CIcL48EowT1kDWXv0/qMaR7oyG34ViUmGfX/RwpUl9J6uEK S6Bg== 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:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=MuZ+n890G/isu+6lLjUc78dSUOsnwHi6nT3HFfXq3Vo=; b=faCr3SxYECPjJ6Wb9htx6Zy+R9LMQULOF46RWRP+Mk5Nq5Z5g3aBeywwvQbQCZ4wVx m1CKSTN8w1dTg3obsSntFwEtVrV68bQ/nyZsqqK6TzScTsK9u5LrdSBSELZvldaZvbGB r32VsUENza9VUBrd3oAO46IzYeCpNxZvITLJ+4hJ4cPt84Bj1LcajZbBuZwRPNYfHSmP wbBueNFVJmUdPxvxr8Ta2jKfU/gLKR+PbuPfYx8BV0S5K6TwbYjDQ9gowbeNBRazYYkj 4nwKIbEKm4MYSM1R//tRlzd4BxlioWRhsx7jO+bThzvRQpfADfH4seDQEseCc4k4xI9H jJwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hrP4sg7a; 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 g15si2489406edy.571.2021.07.14.06.00.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 06:00:37 -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=hrP4sg7a; 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 D8452820A9; Wed, 14 Jul 2021 14:59:51 +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="hrP4sg7a"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DD8A08203B; Wed, 14 Jul 2021 14:59:42 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) (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 5BF8582054 for ; Wed, 14 Jul 2021 14:59:38 +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=masahisa.kojima@linaro.org Received: by mail-pg1-x534.google.com with SMTP id k20so2312835pgg.7 for ; Wed, 14 Jul 2021 05:59:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=MuZ+n890G/isu+6lLjUc78dSUOsnwHi6nT3HFfXq3Vo=; b=hrP4sg7a05ahJq9QWFBOPGpxcbjj8tEMg0QELwMdQf1fGAf3AQplO51TZiCk5/ZAAm 9lRRmEZrpZJdAQO9l99Fq4MioOvsYYhjrv5tWND2Egw3ap8CFDcCfAAU6Ir/po2sxpFO woZ31RQLOsLgayNrPeu/GrQAGWZy8odV5JPNN6v14vTWg76c/tWCX+VVWkrxpqb8CzUk /wgq039glERzkf10t++jdNVg5+ZkyS5/2Eb6CAcB+10H4+NqqtaQbGnogEInS7noDAAN vP6mO7CIJY+YzIG2mfqLhRDH/FbINgFAJ+1T+f9YDwM5rxntjTe4GeUCI4FLHGCCmmnv f2Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=MuZ+n890G/isu+6lLjUc78dSUOsnwHi6nT3HFfXq3Vo=; b=kaRTN1ge6ffNRY8vvn+COqbh6wRZYEU+ZWcwjvxC9v8NNzostVA7k96D7apGMz8CpC zNXdnZZ2xs0b/qWTrgZ3u1l2f/4LHnjkJUVecSYR+Ou3XCRTi8O/td+iHeOO/n234aYI kV2rF58hAMCg7uwTV+OiVIqdXaKp+mccHN/OgSyoveFzrTF3TVXzmuW9vsRIoLVqAUEx B8DpyCqtFYy2hiOPZwGafaEn9jWZM3QPuGEo8n1kciApxkPQ63JStQOChz/xmCGJ9f/R 0iyWxt3k6me3DA/6fbFQbX9UcSRY/l62sCR4oP4/36lumGwzbNAVgnRes560oK5PzsjM DenQ== X-Gm-Message-State: AOAM532WsON29hujNJWTqHLb29CYlH4UXyFsaoCAhiZPYq/YdyCnG5jH U6IMImEg4C5/lXFdXvEVmqajhQ== X-Received: by 2002:a63:1252:: with SMTP id 18mr8654164pgs.126.1626267576638; Wed, 14 Jul 2021 05:59:36 -0700 (PDT) Received: from localhost.localdomain ([2400:2411:502:a100:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id m21sm2787509pfo.159.2021.07.14.05.59.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 05:59:35 -0700 (PDT) From: Masahisa Kojima To: Heinrich Schuchardt , Alexander Graf , Ilias Apalodimas , Simon Glass , Masahisa Kojima , Dhananjay Phadke , u-boot@lists.denx.de Subject: [PATCH v2 6/6] efi_loader: add comment for efi_tcg2.h Date: Wed, 14 Jul 2021 22:00:06 +0900 Message-Id: <20210714130006.17837-7-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210714130006.17837-1-masahisa.kojima@linaro.org> References: <20210714130006.17837-1-masahisa.kojima@linaro.org> 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.103.2 at phobos.denx.de X-Virus-Status: Clean This commit adds the comment of the TCG Specification efi_tcg2.h file refers, and comment for the structure. Signed-off-by: Masahisa Kojima --- Changes in v2: - newly create commit from v2 include/efi_tcg2.h | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) -- 2.17.1 diff --git a/include/efi_tcg2.h b/include/efi_tcg2.h index 8d7b77c087..25613caa19 100644 --- a/include/efi_tcg2.h +++ b/include/efi_tcg2.h @@ -3,6 +3,13 @@ * Defines data structures and APIs that allow an OS to interact with UEFI * firmware to query information about the device * + * This file refers the following TCG specification. + * - TCG PC Client Platform Firmware Profile Specification + * https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/ + * + * - TCG EFI Protocol Specification + * https://trustedcomputinggroup.org/resource/tcg-efi-protocol-specification/ + * * Copyright (c) 2020, Linaro Limited */ @@ -36,11 +43,23 @@ typedef u32 efi_tcg_event_log_bitmap; typedef u32 efi_tcg_event_log_format; typedef u32 efi_tcg_event_algorithm_bitmap; +/** + * struct tdEFI_TCG2_VERSION + * @major: major version + * @minor: minor version + */ struct efi_tcg2_version { u8 major; u8 minor; }; +/** + * struct tdEFI_TCG2_EVENT_HEADER + * @header_size: size of the event header + * @header_version: header version + * @pcr_index: index of the PCR that is extended + * @event_type: type of the event that is extended + */ struct efi_tcg2_event_header { u32 header_size; u16 header_version; @@ -48,12 +67,27 @@ struct efi_tcg2_event_header { u32 event_type; } __packed; +/** + * struct tdEFI_TCG2_EVENT + * @size: total size of the event including the size component, the header + * and the event data + * @header: event header + * @event: event to add + */ struct efi_tcg2_event { u32 size; struct efi_tcg2_event_header header; u8 event[]; } __packed; +/** + * struct tdUEFI_IMAGE_LOAD_EVENT + * @image_location_in_memory: image address + * @image_length_in_memory: image size + * @image_link_time_address: image link time address + * @length_of_device_path: devive path size + * @device_path: device path + */ struct uefi_image_load_event { efi_physical_addr_t image_location_in_memory; u64 image_length_in_memory; @@ -62,6 +96,23 @@ struct uefi_image_load_event { struct efi_device_path device_path[]; }; +/** + * struct tdEFI_TCG2_BOOT_SERVICE_CAPABILITY + * @size: allocated size of the structure + * @structure_version: version of this structure + * @protocol_version: version of the EFI TCG2 protocol. + * @hash_algorithm_bitmap: supported hash algorithms + * @supported_event_logs: bitmap of supported event log formats + * @tpm_present_flag: false = TPM not present + * @max_command_size: max size (in bytes) of a command + * that can be sent to the TPM + * @max_response_size: max size (in bytes) of a response that + * can be provided by the TPM + * @manufacturer_id: 4-byte Vendor ID + * @number_of_pcr_banks: maximum number of PCR banks + * @active_pcr_banks: bitmap of currently active + * PCR banks (hashing algorithms). + */ struct efi_tcg2_boot_service_capability { u8 size; struct efi_tcg2_version structure_version;