xref: /openbmc/qemu/qapi/tpm.json (revision 40f23e4e)
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# @tpm-crb: TPM CRB model (since 2.12)
16# @tpm-spapr: TPM SPAPR model (since 5.0)
17#
18# Since: 1.5
19##
20{ 'enum': 'TpmModel', 'data': [ 'tpm-tis', 'tpm-crb', 'tpm-spapr' ],
21  'if': 'defined(CONFIG_TPM)' }
22
23##
24# @query-tpm-models:
25#
26# Return a list of supported TPM models
27#
28# Returns: a list of TpmModel
29#
30# Since: 1.5
31#
32# Example:
33#
34# -> { "execute": "query-tpm-models" }
35# <- { "return": [ "tpm-tis", "tpm-crb", "tpm-spapr" ] }
36#
37##
38{ 'command': 'query-tpm-models', 'returns': ['TpmModel'],
39  'if': 'defined(CONFIG_TPM)' }
40
41##
42# @TpmType:
43#
44# An enumeration of TPM types
45#
46# @passthrough: TPM passthrough type
47# @emulator: Software Emulator TPM type
48#            Since: 2.11
49#
50# Since: 1.5
51##
52{ 'enum': 'TpmType', 'data': [ 'passthrough', 'emulator' ],
53  'if': 'defined(CONFIG_TPM)' }
54
55##
56# @query-tpm-types:
57#
58# Return a list of supported TPM types
59#
60# Returns: a list of TpmType
61#
62# Since: 1.5
63#
64# Example:
65#
66# -> { "execute": "query-tpm-types" }
67# <- { "return": [ "passthrough", "emulator" ] }
68#
69##
70{ 'command': 'query-tpm-types', 'returns': ['TpmType'],
71  'if': 'defined(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
81#               for 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': 'defined(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': 'defined(CONFIG_TPM)' }
101
102##
103# @TpmTypeOptions:
104#
105# A union referencing different TPM backend types' configuration options
106#
107# @type: - 'passthrough' The configuration options for the TPM passthrough type
108#        - 'emulator' The configuration options for TPM emulator backend type
109#
110# Since: 1.5
111##
112{ 'union': 'TpmTypeOptions',
113   'data': { 'passthrough' : 'TPMPassthroughOptions',
114             'emulator': 'TPMEmulatorOptions' },
115  'if': 'defined(CONFIG_TPM)' }
116
117##
118# @TPMInfo:
119#
120# Information about the TPM
121#
122# @id: The Id of the TPM
123#
124# @model: The TPM frontend model
125#
126# @options: The TPM (backend) type configuration options
127#
128# Since: 1.5
129##
130{ 'struct': 'TPMInfo',
131  'data': {'id': 'str',
132           'model': 'TpmModel',
133           'options': 'TpmTypeOptions' },
134  'if': 'defined(CONFIG_TPM)' }
135
136##
137# @query-tpm:
138#
139# Return information about the TPM device
140#
141# Returns: @TPMInfo on success
142#
143# Since: 1.5
144#
145# Example:
146#
147# -> { "execute": "query-tpm" }
148# <- { "return":
149#      [
150#        { "model": "tpm-tis",
151#          "options":
152#            { "type": "passthrough",
153#              "data":
154#                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
155#                  "path": "/dev/tpm0"
156#                }
157#            },
158#          "id": "tpm0"
159#        }
160#      ]
161#    }
162#
163##
164{ 'command': 'query-tpm', 'returns': ['TPMInfo'],
165  'if': 'defined(CONFIG_TPM)' }
166