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