xref: /openbmc/qemu/qapi/tpm.json (revision a68694cd)
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##
22# @query-tpm-models:
23#
24# Return a list of supported TPM models
25#
26# Returns: a list of TpmModel
27#
28# Since: 1.5
29#
30# Example:
31#
32# -> { "execute": "query-tpm-models" }
33# <- { "return": [ "tpm-tis", "tpm-crb", "tpm-spapr" ] }
34#
35##
36{ 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
37
38##
39# @TpmType:
40#
41# An enumeration of TPM types
42#
43# @passthrough: TPM passthrough type
44# @emulator: Software Emulator TPM type
45#            Since: 2.11
46#
47# Since: 1.5
48##
49{ 'enum': 'TpmType', 'data': [ 'passthrough', 'emulator' ] }
50
51##
52# @query-tpm-types:
53#
54# Return a list of supported TPM types
55#
56# Returns: a list of TpmType
57#
58# Since: 1.5
59#
60# Example:
61#
62# -> { "execute": "query-tpm-types" }
63# <- { "return": [ "passthrough", "emulator" ] }
64#
65##
66{ 'command': 'query-tpm-types', 'returns': ['TpmType'] }
67
68##
69# @TPMPassthroughOptions:
70#
71# Information about the TPM passthrough type
72#
73# @path: string describing the path used for accessing the TPM device
74#
75# @cancel-path: string showing the TPM's sysfs cancel file
76#               for cancellation of TPM commands while they are executing
77#
78# Since: 1.5
79##
80{ 'struct': 'TPMPassthroughOptions',
81  'data': { '*path': 'str',
82            '*cancel-path': 'str' } }
83
84##
85# @TPMEmulatorOptions:
86#
87# Information about the TPM emulator type
88#
89# @chardev: Name of a unix socket chardev
90#
91# Since: 2.11
92##
93{ 'struct': 'TPMEmulatorOptions', 'data': { 'chardev' : 'str' } }
94
95##
96# @TpmTypeOptions:
97#
98# A union referencing different TPM backend types' configuration options
99#
100# @type: - 'passthrough' The configuration options for the TPM passthrough type
101#        - 'emulator' The configuration options for TPM emulator backend type
102#
103# Since: 1.5
104##
105{ 'union': 'TpmTypeOptions',
106   'data': { 'passthrough' : 'TPMPassthroughOptions',
107             'emulator': 'TPMEmulatorOptions' } }
108
109##
110# @TPMInfo:
111#
112# Information about the TPM
113#
114# @id: The Id of the TPM
115#
116# @model: The TPM frontend model
117#
118# @options: The TPM (backend) type configuration options
119#
120# Since: 1.5
121##
122{ 'struct': 'TPMInfo',
123  'data': {'id': 'str',
124           'model': 'TpmModel',
125           'options': 'TpmTypeOptions' } }
126
127##
128# @query-tpm:
129#
130# Return information about the TPM device
131#
132# Returns: @TPMInfo on success
133#
134# Since: 1.5
135#
136# Example:
137#
138# -> { "execute": "query-tpm" }
139# <- { "return":
140#      [
141#        { "model": "tpm-tis",
142#          "options":
143#            { "type": "passthrough",
144#              "data":
145#                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
146#                  "path": "/dev/tpm0"
147#                }
148#            },
149#          "id": "tpm0"
150#        }
151#      ]
152#    }
153#
154##
155{ 'command': 'query-tpm', 'returns': ['TPMInfo'] }
156