Merge tag 'accel-sh4-ui-20240503' of https://github.com/philmd/qemu into staging
[qemu/armbru.git] / qapi / tpm.json
blob1577b5c259d503be65646fb5d88485c7e9abd115
1 # -*- Mode: Python -*-
2 # vim: filetype=python
5 ##
6 # = TPM (trusted platform module) devices
7 ##
9 ##
10 # @TpmModel:
12 # An enumeration of TPM models
14 # @tpm-tis: TPM TIS model
16 # @tpm-crb: TPM CRB model (since 2.12)
18 # @tpm-spapr: TPM SPAPR model (since 5.0)
20 # Since: 1.5
22 { 'enum': 'TpmModel', 'data': [ 'tpm-tis', 'tpm-crb', 'tpm-spapr' ],
23   'if': 'CONFIG_TPM' }
26 # @query-tpm-models:
28 # Return a list of supported TPM models
30 # Returns: a list of TpmModel
32 # Since: 1.5
34 # Example:
36 #     -> { "execute": "query-tpm-models" }
37 #     <- { "return": [ "tpm-tis", "tpm-crb", "tpm-spapr" ] }
39 { 'command': 'query-tpm-models', 'returns': ['TpmModel'],
40   'if': 'CONFIG_TPM' }
43 # @TpmType:
45 # An enumeration of TPM types
47 # @passthrough: TPM passthrough type
49 # @emulator: Software Emulator TPM type (since 2.11)
51 # Since: 1.5
53 { 'enum': 'TpmType', 'data': [ 'passthrough', 'emulator' ],
54   'if': 'CONFIG_TPM' }
57 # @query-tpm-types:
59 # Return a list of supported TPM types
61 # Returns: a list of TpmType
63 # Since: 1.5
65 # Example:
67 #     -> { "execute": "query-tpm-types" }
68 #     <- { "return": [ "passthrough", "emulator" ] }
70 { 'command': 'query-tpm-types', 'returns': ['TpmType'],
71   'if': 'CONFIG_TPM' }
74 # @TPMPassthroughOptions:
76 # Information about the TPM passthrough type
78 # @path: string describing the path used for accessing the TPM device
80 # @cancel-path: string showing the TPM's sysfs cancel file for
81 #     cancellation of TPM commands while they are executing
83 # Since: 1.5
85 { 'struct': 'TPMPassthroughOptions',
86   'data': { '*path': 'str',
87             '*cancel-path': 'str' },
88   'if': 'CONFIG_TPM' }
91 # @TPMEmulatorOptions:
93 # Information about the TPM emulator type
95 # @chardev: Name of a unix socket chardev
97 # Since: 2.11
99 { 'struct': 'TPMEmulatorOptions', 'data': { 'chardev' : 'str' },
100   'if': 'CONFIG_TPM' }
103 # @TPMPassthroughOptionsWrapper:
105 # @data: Information about the TPM passthrough type
107 # Since: 1.5
109 { 'struct': 'TPMPassthroughOptionsWrapper',
110   'data': { 'data': 'TPMPassthroughOptions' },
111   'if': 'CONFIG_TPM' }
114 # @TPMEmulatorOptionsWrapper:
116 # @data: Information about the TPM emulator type
118 # Since: 2.11
120 { 'struct': 'TPMEmulatorOptionsWrapper',
121   'data': { 'data': 'TPMEmulatorOptions' },
122   'if': 'CONFIG_TPM' }
125 # @TpmTypeOptions:
127 # A union referencing different TPM backend types' configuration
128 # options
130 # @type:
131 #     - 'passthrough' The configuration options for the TPM
132 #       passthrough type
133 #     - 'emulator' The configuration options for TPM emulator backend
134 #       type
136 # Since: 1.5
138 { 'union': 'TpmTypeOptions',
139   'base': { 'type': 'TpmType' },
140   'discriminator': 'type',
141   'data': { 'passthrough' : 'TPMPassthroughOptionsWrapper',
142             'emulator': 'TPMEmulatorOptionsWrapper' },
143   'if': 'CONFIG_TPM' }
146 # @TPMInfo:
148 # Information about the TPM
150 # @id: The Id of the TPM
152 # @model: The TPM frontend model
154 # @options: The TPM (backend) type configuration options
156 # Since: 1.5
158 { 'struct': 'TPMInfo',
159   'data': {'id': 'str',
160            'model': 'TpmModel',
161            'options': 'TpmTypeOptions' },
162   'if': 'CONFIG_TPM' }
165 # @query-tpm:
167 # Return information about the TPM device
169 # Since: 1.5
171 # Example:
173 #     -> { "execute": "query-tpm" }
174 #     <- { "return":
175 #          [
176 #            { "model": "tpm-tis",
177 #              "options":
178 #                { "type": "passthrough",
179 #                  "data":
180 #                    { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
181 #                      "path": "/dev/tpm0"
182 #                    }
183 #                },
184 #              "id": "tpm0"
185 #            }
186 #          ]
187 #        }
189 { 'command': 'query-tpm', 'returns': ['TPMInfo'],
190   'if': 'CONFIG_TPM' }