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