xref: /openbmc/qemu/qapi/tpm.json (revision e9206163)
1# -*- Mode: Python -*-
2# vim: filetype=python
3#
4
5##
6# = TPM (trusted platform module) devices
7##
8
9##
10# @TpmModel:
11#
12# An enumeration of TPM models
13#
14# @tpm-tis: TPM TIS model
15#
16# @tpm-crb: TPM CRB model (since 2.12)
17#
18# @tpm-spapr: TPM SPAPR model (since 5.0)
19#
20# Since: 1.5
21##
22{ 'enum': 'TpmModel', 'data': [ 'tpm-tis', 'tpm-crb', 'tpm-spapr' ],
23  'if': 'CONFIG_TPM' }
24
25##
26# @query-tpm-models:
27#
28# Return a list of supported TPM models
29#
30# Returns: a list of TpmModel
31#
32# Since: 1.5
33#
34# Example:
35#
36#     -> { "execute": "query-tpm-models" }
37#     <- { "return": [ "tpm-tis", "tpm-crb", "tpm-spapr" ] }
38##
39{ 'command': 'query-tpm-models', 'returns': ['TpmModel'],
40  'if': 'CONFIG_TPM' }
41
42##
43# @TpmType:
44#
45# An enumeration of TPM types
46#
47# @passthrough: TPM passthrough type
48#
49# @emulator: Software Emulator TPM type (since 2.11)
50#
51# Since: 1.5
52##
53{ 'enum': 'TpmType', 'data': [ 'passthrough', 'emulator' ],
54  'if': 'CONFIG_TPM' }
55
56##
57# @query-tpm-types:
58#
59# Return a list of supported TPM types
60#
61# Returns: a list of TpmType
62#
63# Since: 1.5
64#
65# Example:
66#
67#     -> { "execute": "query-tpm-types" }
68#     <- { "return": [ "passthrough", "emulator" ] }
69##
70{ 'command': 'query-tpm-types', 'returns': ['TpmType'],
71  'if': 'CONFIG_TPM' }
72
73##
74# @TPMPassthroughOptions:
75#
76# Information about the TPM passthrough type
77#
78# @path: string describing the path used for accessing the TPM device
79#
80# @cancel-path: string showing the TPM's sysfs cancel file for
81#     cancellation of TPM commands while they are executing
82#
83# Since: 1.5
84##
85{ 'struct': 'TPMPassthroughOptions',
86  'data': { '*path': 'str',
87            '*cancel-path': 'str' },
88  'if': 'CONFIG_TPM' }
89
90##
91# @TPMEmulatorOptions:
92#
93# Information about the TPM emulator type
94#
95# @chardev: Name of a unix socket chardev
96#
97# Since: 2.11
98##
99{ 'struct': 'TPMEmulatorOptions', 'data': { 'chardev' : 'str' },
100  'if': 'CONFIG_TPM' }
101
102##
103# @TPMPassthroughOptionsWrapper:
104#
105# @data: Information about the TPM passthrough type
106#
107# Since: 1.5
108##
109{ 'struct': 'TPMPassthroughOptionsWrapper',
110  'data': { 'data': 'TPMPassthroughOptions' },
111  'if': 'CONFIG_TPM' }
112
113##
114# @TPMEmulatorOptionsWrapper:
115#
116# @data: Information about the TPM emulator type
117#
118# Since: 2.11
119##
120{ 'struct': 'TPMEmulatorOptionsWrapper',
121  'data': { 'data': 'TPMEmulatorOptions' },
122  'if': 'CONFIG_TPM' }
123
124##
125# @TpmTypeOptions:
126#
127# A union referencing different TPM backend types' configuration
128# options
129#
130# @type:
131#     - 'passthrough' The configuration options for the TPM
132#       passthrough type
133#     - 'emulator' The configuration options for TPM emulator backend
134#       type
135#
136# Since: 1.5
137##
138{ 'union': 'TpmTypeOptions',
139  'base': { 'type': 'TpmType' },
140  'discriminator': 'type',
141  'data': { 'passthrough' : 'TPMPassthroughOptionsWrapper',
142            'emulator': 'TPMEmulatorOptionsWrapper' },
143  'if': 'CONFIG_TPM' }
144
145##
146# @TPMInfo:
147#
148# Information about the TPM
149#
150# @id: The Id of the TPM
151#
152# @model: The TPM frontend model
153#
154# @options: The TPM (backend) type configuration options
155#
156# Since: 1.5
157##
158{ 'struct': 'TPMInfo',
159  'data': {'id': 'str',
160           'model': 'TpmModel',
161           'options': 'TpmTypeOptions' },
162  'if': 'CONFIG_TPM' }
163
164##
165# @query-tpm:
166#
167# Return information about the TPM device
168#
169# Returns: @TPMInfo on success
170#
171# Since: 1.5
172#
173# Example:
174#
175#     -> { "execute": "query-tpm" }
176#     <- { "return":
177#          [
178#            { "model": "tpm-tis",
179#              "options":
180#                { "type": "passthrough",
181#                  "data":
182#                    { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
183#                      "path": "/dev/tpm0"
184#                    }
185#                },
186#              "id": "tpm0"
187#            }
188#          ]
189#        }
190##
191{ 'command': 'query-tpm', 'returns': ['TPMInfo'],
192  'if': 'CONFIG_TPM' }
193