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